From bf6bbe78a9d361b96168b05d94e560a381283121 Mon Sep 17 00:00:00 2001 From: GnomeZworc Date: Sun, 7 Jun 2026 12:25:49 +0200 Subject: [PATCH] update icon gestion Signed-off-by: GnomeZworc --- side-nav.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/side-nav.js b/side-nav.js index ac49d79..7ccfadf 100644 --- a/side-nav.js +++ b/side-nav.js @@ -16,19 +16,17 @@ const CHEVRON_ICON = ` ` -const ICONS = { - dashboard: ``, - vpc: ``, - subnet: ``, - vm: ``, -} +const CSS = new URL('./side-nav.css', import.meta.url).href +const MQ = window.matchMedia('(max-width: 768px)') +const NAV_W = 220 // px -const CSS = new URL('./side-nav.css', import.meta.url).href -const MQ = window.matchMedia('(max-width: 768px)') -const NAV_W = 220 // px +const ICON_FALLBACK = `` + +const iconsRes = await fetch('./icons.json') +const ICONS = iconsRes.ok ? await iconsRes.json() : {} function resolveIcon(name) { - return ICONS[name] ?? `` + return ICONS[name] ?? ICON_FALLBACK } class SideNav extends HTMLElement {