feat: enhance help system with toast notification highlighting and logo documentation

This commit is contained in:
sha
2025-12-28 05:38:55 +02:00
parent 6ced857f0f
commit a27fcfc0f6
3 changed files with 52 additions and 22 deletions
+17 -5
View File
@@ -2,7 +2,7 @@
All notable changes to the Shadoll Animated Placeholder project will be documented in this file. All notable changes to the Shadoll Animated Placeholder project will be documented in this file.
## [2.0.0] - 2025-12-28 ## [1.2.0] - 2025-12-28
### Major New Features ### Major New Features
@@ -63,15 +63,25 @@ All notable changes to the Shadoll Animated Placeholder project will be document
- **Help System Improvements**: - **Help System Improvements**:
- Multiple help toggles: `H`, `?`, `/` keys - Multiple help toggles: `H`, `?`, `/` keys
- `ESC` key closes help window - `ESC` key closes help window
- Toast notifications moved to top - Toast notifications moved to top with higher z-index (1002)
- Toast always appears above help window on mobile
- Help button always at bottom-right corner - Help button always at bottom-right corner
- Removed duplicate/conflicting media query styles - Removed duplicate/conflicting media query styles
- **Toast Notification Highlighting**:
- Changed settings are highlighted in bold in toast messages
- Provides clear visual feedback on what was modified
- Uses HTML formatting for emphasis
- **Footer**: Added copyright notice at bottom center - **Footer**: Added copyright notice at bottom center
- Semi-transparent white text - Semi-transparent white text
- Subtle shadow for visibility - Subtle shadow for visibility
- Responsive sizing - Responsive sizing
- **Logo Documentation**: Added description of logo design
- Logo represents "s" and "d" from "shadoll" word
- Documented in README.md and CLAUDE.md
### Changed ### Changed
- **Default Animation**: Changed from `tilt` to `mixed` - **Default Animation**: Changed from `tilt` to `mixed`
@@ -89,10 +99,12 @@ All notable changes to the Shadoll Animated Placeholder project will be document
### Files Modified ### Files Modified
- [index.html](index.html) - Added palette param, footer, data-key attributes - [index.html](index.html) - Added palette param, footer, data-key attributes
- [css/styles.css](css/styles.css) - 6 palettes, liquid glass styles, mobile fixes - [css/styles.css](css/styles.css) - 6 palettes, liquid glass styles, mobile fixes, toast z-index
- [js/app.js](js/app.js) - Interactive controller, viewBox setup, palette cycling - [js/app.js](js/app.js) - Interactive controller, viewBox setup, palette cycling, toast highlighting
- [README.md](README.md) - Updated features and examples - [README.md](README.md) - Updated features, examples, and logo description
- [TODO.md](TODO.md) - Marked completed tasks - [TODO.md](TODO.md) - Marked completed tasks
- [USAGE.md](USAGE.md) - Updated with all new features and examples
- [CLAUDE.md](CLAUDE.md) - Added logo design documentation and architectural decisions
- [CHANGELOG.md](CHANGELOG.md) - This file - [CHANGELOG.md](CHANGELOG.md) - This file
--- ---
+1 -1
View File
@@ -424,7 +424,7 @@ html, body {
0 2px 8px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.2),
inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3),
inset 0 -1px 0 rgba(0, 0, 0, 0.1); inset 0 -1px 0 rgba(0, 0, 0, 0.1);
z-index: 999; z-index: 1002;
opacity: 0; opacity: 0;
transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
pointer-events: none; pointer-events: none;
+34 -16
View File
@@ -57,9 +57,9 @@
clearTimeout(toastTimeout); clearTimeout(toastTimeout);
} }
// Set toast content // Set toast content (support HTML for highlighting)
elements.toastTitle.textContent = title; elements.toastTitle.textContent = title;
elements.toastMessage.textContent = message; elements.toastMessage.innerHTML = message;
// Show toast // Show toast
elements.toast.classList.add('show'); elements.toast.classList.add('show');
@@ -403,7 +403,7 @@
} }
// ===== Apply All Configurations ===== // ===== Apply All Configurations =====
function applyConfiguration(config, showNotification = false) { function applyConfiguration(config, showNotification = false, changedKey = null) {
console.log('Applying configuration:', config); console.log('Applying configuration:', config);
configureBackground(config); configureBackground(config);
@@ -415,13 +415,6 @@
if (showNotification) { if (showNotification) {
const messages = []; const messages = [];
if (config.bg === 'static') {
messages.push(`Background: Static ${config.gradient}`);
} else {
messages.push(`Background: Animated ${config.gradient}`);
}
// Add palette info
const paletteNames = { const paletteNames = {
'default': 'Default', 'default': 'Default',
'blue-yellow': 'Blue-Yellow', 'blue-yellow': 'Blue-Yellow',
@@ -430,17 +423,30 @@
'fire': 'Fire', 'fire': 'Fire',
'nature': 'Nature' 'nature': 'Nature'
}; };
messages.push(`Palette: ${paletteNames[config.palette] || config.palette}`);
// Background
const bgText = config.bg === 'static' ? `Static ${config.gradient}` : `Animated ${config.gradient}`;
const shouldHighlightBg = changedKey === 'bg' || changedKey === 'gradient';
messages.push(shouldHighlightBg ? `<strong>Background: ${bgText}</strong>` : `Background: ${bgText}`);
// Palette
const paletteText = paletteNames[config.palette] || config.palette;
messages.push(changedKey === 'palette' ? `<strong>Palette: ${paletteText}</strong>` : `Palette: ${paletteText}`);
// Logo
let logoText;
if (config.logo === 'static') { if (config.logo === 'static') {
messages.push('Logo: Static'); logoText = 'Static';
} else if (config.logo === 'animated') { } else if (config.logo === 'animated') {
messages.push(`Logo: Elements (${config.elementAnim})`); logoText = `Elements (${config.elementAnim})`;
} else { } else {
messages.push(`Logo: Full (${config.logoAnim} + ${config.elementAnim})`); logoText = `Full (${config.logoAnim} + ${config.elementAnim})`;
} }
const shouldHighlightLogo = changedKey === 'logo' || changedKey === 'logoAnim' || changedKey === 'elementAnim';
messages.push(shouldHighlightLogo ? `<strong>Logo: ${logoText}</strong>` : `Logo: ${logoText}`);
messages.push(`Speed: ${config.speed}x`); // Speed
messages.push(changedKey === 'speed' ? `<strong>Speed: ${config.speed}x</strong>` : `Speed: ${config.speed}x`);
showToast('Configuration Updated', messages.join(' • ')); showToast('Configuration Updated', messages.join(' • '));
} }
@@ -463,58 +469,70 @@
let currentConfig = getURLParams(); let currentConfig = getURLParams();
document.addEventListener('keydown', (e) => { document.addEventListener('keydown', (e) => {
let changedKey = null;
switch(e.key.toLowerCase()) { switch(e.key.toLowerCase()) {
case 'b': case 'b':
// Toggle background animation // Toggle background animation
currentConfig.bg = currentConfig.bg === 'animated' ? 'static' : 'animated'; currentConfig.bg = currentConfig.bg === 'animated' ? 'static' : 'animated';
changedKey = 'bg';
break; break;
case 'g': case 'g':
// Cycle gradient types // Cycle gradient types
const gradients = ['linear', 'radial', 'conic']; const gradients = ['linear', 'radial', 'conic'];
const currentIndex = gradients.indexOf(currentConfig.gradient); const currentIndex = gradients.indexOf(currentConfig.gradient);
currentConfig.gradient = gradients[(currentIndex + 1) % gradients.length]; currentConfig.gradient = gradients[(currentIndex + 1) % gradients.length];
changedKey = 'gradient';
break; break;
case 'p': case 'p':
// Cycle color palettes // Cycle color palettes
const palettes = ['default', 'blue-yellow', 'dark', 'light', 'fire', 'nature']; const palettes = ['default', 'blue-yellow', 'dark', 'light', 'fire', 'nature'];
const paletteIndex = palettes.indexOf(currentConfig.palette); const paletteIndex = palettes.indexOf(currentConfig.palette);
currentConfig.palette = palettes[(paletteIndex + 1) % palettes.length]; currentConfig.palette = palettes[(paletteIndex + 1) % palettes.length];
changedKey = 'palette';
break; break;
case 'l': case 'l':
// Cycle logo animations // Cycle logo animations
const logoStates = ['static', 'animated', 'full']; const logoStates = ['static', 'animated', 'full'];
const logoIndex = logoStates.indexOf(currentConfig.logo); const logoIndex = logoStates.indexOf(currentConfig.logo);
currentConfig.logo = logoStates[(logoIndex + 1) % logoStates.length]; currentConfig.logo = logoStates[(logoIndex + 1) % logoStates.length];
changedKey = 'logo';
break; break;
case 'a': case 'a':
// Cycle logo body animations // Cycle logo body animations
const logoAnims = ['shake', 'rotate', 'tilt', 'interactive', 'mixed', 'all']; const logoAnims = ['shake', 'rotate', 'tilt', 'interactive', 'mixed', 'all'];
const animIndex = logoAnims.indexOf(currentConfig.logoAnim); const animIndex = logoAnims.indexOf(currentConfig.logoAnim);
currentConfig.logoAnim = logoAnims[(animIndex + 1) % logoAnims.length]; currentConfig.logoAnim = logoAnims[(animIndex + 1) % logoAnims.length];
changedKey = 'logoAnim';
break; break;
case 'e': case 'e':
// Cycle element animations // Cycle element animations
const elemAnims = ['neon', 'color', 'explosion', 'fly', 'all']; const elemAnims = ['neon', 'color', 'explosion', 'fly', 'all'];
const elemIndex = elemAnims.indexOf(currentConfig.elementAnim); const elemIndex = elemAnims.indexOf(currentConfig.elementAnim);
currentConfig.elementAnim = elemAnims[(elemIndex + 1) % elemAnims.length]; currentConfig.elementAnim = elemAnims[(elemIndex + 1) % elemAnims.length];
changedKey = 'elementAnim';
break; break;
case '+': case '+':
case '=': case '=':
// Increase speed // Increase speed
currentConfig.speed = Math.min(5, currentConfig.speed + 0.25); currentConfig.speed = Math.min(5, currentConfig.speed + 0.25);
changedKey = 'speed';
break; break;
case '-': case '-':
case '_': case '_':
// Decrease speed // Decrease speed
currentConfig.speed = Math.max(0.1, currentConfig.speed - 0.25); currentConfig.speed = Math.max(0.1, currentConfig.speed - 0.25);
changedKey = 'speed';
break; break;
case '0': case '0':
// Reset speed to 1x // Reset speed to 1x
currentConfig.speed = 1; currentConfig.speed = 1;
changedKey = 'speed';
break; break;
case 'r': case 'r':
// Reset to defaults // Reset to defaults
currentConfig = { ...DEFAULT_CONFIG }; currentConfig = { ...DEFAULT_CONFIG };
changedKey = 'reset';
break; break;
case 'h': case 'h':
case '?': case '?':
@@ -526,7 +544,7 @@
return; return;
} }
applyConfiguration(currentConfig, true); // Show toast notification applyConfiguration(currentConfig, true, changedKey); // Show toast notification with highlight
updateURL(currentConfig); updateURL(currentConfig);
}); });
} }