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:
@@ -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';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user