From 2ed71335669d05c6733c0bab5193e403b7a2f6aa Mon Sep 17 00:00:00 2001 From: Lucas 'Paperboy' Rose-Winters Date: Wed, 5 Nov 2025 12:49:55 +1100 Subject: [PATCH] feat: redesign user info widget with avatar background overlay Changed from avatar + text layout to avatar as background with text overlay. Previous approach: Tried horizontal/vertical layouts which caused either horizontal or vertical scrollbars at narrow widths (w:1 h:1). New approach: Avatar fills entire widget as background-image, name + level display as centered overlay with semi-transparent backdrop and blur effect for readability. Uses background-size: contain to show full avatar without cropping. Benefits: - No layout conflicts - works at any widget size - No scrollbars (horizontal or vertical) - Full avatar visible without cropping - Visually interesting design - Simpler code (no layout switching logic) Changes: - userInfoWidget.js: Avatar set as background-image with contain sizing - userInfoWidget.js: Simplified onResize (removed layout switching) - style.css: Container uses background-image with gradient overlay - style.css: Text container has backdrop-filter blur + dark background - style.css: Simplified compact mode (no portrait/layout-specific rules) --- .../dashboard/widgets/userInfoWidget.js | 37 ++-------- style.css | 73 +++++++------------ 2 files changed, 34 insertions(+), 76 deletions(-) diff --git a/src/systems/dashboard/widgets/userInfoWidget.js b/src/systems/dashboard/widgets/userInfoWidget.js index 249c023..d93dbf4 100644 --- a/src/systems/dashboard/widgets/userInfoWidget.js +++ b/src/systems/dashboard/widgets/userInfoWidget.js @@ -82,10 +82,13 @@ export function registerUserInfoWidget(registry, dependencies) { ...config }; - // Build HTML with flexible layout structure + // Build HTML with avatar as background and text overlay + const backgroundStyle = finalConfig.showAvatar ? + `background-image: url('${userPortrait}'); background-size: contain; background-position: center; background-repeat: no-repeat;` : + ''; + const html = ` -
- ${finalConfig.showAvatar ? `${userName}` : ''} +