Commit 55a3ca73 authored by Mahmoud Aglan's avatar Mahmoud Aglan

feat: full admin theme expansion β€” spacing sliders, RGBA pickers, per-icon uploads

Admin Theme New Sections:
- πŸ“ Spacing & Layout: 9 range sliders for border-radius, content-max,
  header-h, nav-bottom-h, card-padding, section-gap, touch-min
- 🎲 Domino: 5 color pickers for game theming
- 🎯 Backgammon: 8 color pickers for board/checker/felt colors
- 🎨 Icons Grid: per-icon upload (31 icons individually replaceable)

RGBA Picker:
- Color input + alpha slider (0-100%) for rgba-based CSS variables
- Live preview, outputs rgba() string
- Applied to: board highlights, overlays, borders

Per-Icon Override:
- Individual SVG/PNG upload per icon
- Runtime: replaces SVG <use> with <img> element
- Resolution guide: "24Γ—24px SVG مفآل"

Upload Resolution Guides:
- Pieces: 128Γ—128px
- Logo: 200Γ—40px
- Favicon: 32Γ—32px
- Icons: 24Γ—24px
- Sprite: SVG 24px viewBox

All changes live-effective via CSS variable injection + runtime JS.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent d34a923d
...@@ -30,7 +30,21 @@ if (window.__themeAssets) { ...@@ -30,7 +30,21 @@ if (window.__themeAssets) {
el.setAttribute('href', el.getAttribute('href').replace('/public/icons/sprite.svg', a['sprite-svg'])); el.setAttribute('href', el.getAttribute('href').replace('/public/icons/sprite.svg', a['sprite-svg']));
}); });
} }
// Individual icon overrides
Object.keys(a).forEach(k => { Object.keys(a).forEach(k => {
if (k.startsWith('icon-')) {
const iconName = k;
document.querySelectorAll('use[href$="#' + iconName + '"]').forEach(useEl => {
const svg = useEl.closest('svg');
if (svg) {
const img = document.createElement('img');
img.src = a[k];
img.style.cssText = 'width:100%;height:100%;object-fit:contain;';
img.alt = iconName;
svg.replaceWith(img);
}
});
}
if (k.startsWith('piece-')) { if (k.startsWith('piece-')) {
const piece = k.replace('piece-', ''); const piece = k.replace('piece-', '');
document.documentElement.style.setProperty('--piece-' + piece, 'url(' + a[k] + ')'); document.documentElement.style.setProperty('--piece-' + piece, 'url(' + a[k] + ')');
......
This diff is collapsed.
...@@ -68,6 +68,10 @@ ...@@ -68,6 +68,10 @@
--text-section: clamp(12px, 0.5vw + 10px, 14px); --text-section: clamp(12px, 0.5vw + 10px, 14px);
--text-body: clamp(13px, 0.5vw + 11px, 15px); --text-body: clamp(13px, 0.5vw + 11px, 15px);
/* Spacing & Layout (admin-editable) */
--card-padding: 16px;
--section-gap: 16px;
/* Board Theme β€” Chess.com green */ /* Board Theme β€” Chess.com green */
--board-light: #EBECD0; --board-light: #EBECD0;
--board-dark: #779556; --board-dark: #779556;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment