fix(mood): reduce font sizes to fit emoji and conditions in 1x1 widget

Problem: Mood widget at 1x1 was cutting off subtext, only showing emoji
and main text (e.g., "🧘 Focused") but hiding conditions below.

Changes:
- Reduced emoji from 1.2rem → 1rem at 1x1 size
- Reduced conditions text from 0.55rem → 0.45rem
- Tightened spacing (gap: 0.1rem, padding: 0.25rem)
- Set line-height: 1 to minimize vertical space usage
- Allow up to 3 lines of conditions text with -webkit-line-clamp
- Added responsive scaling: larger sizes (2x2+) use bigger fonts

Now fits emoji, main text, and subtext comfortably in 1x1 grid cell.
This commit is contained in:
Lucas 'Paperboy' Rose-Winters
2025-10-24 11:52:35 +11:00
parent eb4ac57dae
commit 0d179d22fc
2 changed files with 37 additions and 10 deletions
@@ -98,15 +98,20 @@ export function registerUserMoodWidget(registry, dependencies) {
* @param {number} newH - New height
*/
onResize(container, newW, newH) {
// Responsive adjustments if needed
const mood = container.querySelector('.rpg-mood');
if (!mood) return;
const emoji = container.querySelector('.rpg-mood-emoji');
const conditions = container.querySelector('.rpg-mood-conditions');
if (!mood || !emoji || !conditions) return;
// Adjust layout for narrow widgets
if (newW < 2) {
mood.style.flexDirection = 'column';
// Scale based on widget size
if (newW >= 2 && newH >= 2) {
// Larger widget: bigger text
emoji.style.fontSize = '2rem';
conditions.style.fontSize = '0.75rem';
} else {
mood.style.flexDirection = 'row';
// Compact 1x1: tight spacing
emoji.style.fontSize = '1rem';
conditions.style.fontSize = '0.45rem';
}
}
});
+26 -4
View File
@@ -1358,14 +1358,36 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
height: 1.2vh; /* vh for layout element */
}
/* Mood - rem for text */
/* Mood widget - responsive sizing for dashboard */
.rpg-widget .rpg-mood {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 0.1rem;
height: 100%;
width: 100%;
padding: 0.25rem;
}
.rpg-widget .rpg-mood-emoji {
font-size: 1.5rem;
font-size: 1rem;
flex-shrink: 0;
cursor: text;
line-height: 1;
}
.rpg-widget .rpg-mood-conditions {
font-size: 0.75rem;
line-height: 1.3;
font-size: 0.45rem;
line-height: 1;
text-align: center;
word-break: break-word;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
max-width: 100%;
}
/* Progress bars - rem for spacing */