diff --git a/src/lib/ae_stores.ts b/src/lib/ae_stores.ts index 965acd19..388ac12e 100644 --- a/src/lib/ae_stores.ts +++ b/src/lib/ae_stores.ts @@ -168,10 +168,15 @@ const ae_app_local_data_defaults: key_val = { hide: false, expand: false, hide_access_type: false, + expand_access_type: false, hide_edit_mode: false, + expand_edit_mode: false, hide_user: false, + expand_user: false, hide_theme: false, - hide_cfg: false, + expand_theme: false, + hide_app_cfg: false, + expand_app_cfg: false, }, debug_menu: { hide: false, diff --git a/src/lib/e_app_cfg.svelte b/src/lib/e_app_cfg.svelte index 1f565909..29b47ee6 100644 --- a/src/lib/e_app_cfg.svelte +++ b/src/lib/e_app_cfg.svelte @@ -1,31 +1,47 @@ @@ -25,54 +34,183 @@ if ($ae_loc.app_cfg.theme_mode == 'light') { document.documentElement.classList.add('dark'); } --> - - { - if ($ae_loc.theme_mode == 'light') { - $ae_loc.theme_mode = 'dark'; - } else if ($ae_loc.theme_mode == 'dark') { - $ae_loc.theme_mode = 'light'; - } + + + + + { + // $slct_trigger = 'set_theme_name'; + + let new_theme_name = event.target.value; + // document.documentElement.theme = new_theme_name; + + console.log(`$ae_loc?.theme_name=${$ae_loc?.theme_name}`); + // $slct_trigger = null; + // Update the body attribute named "data-theme" to the current theme name. + // document.body.setAttribute('data-theme', new_theme_name); + // document.body.setAttribute('data-theme', $ae_loc?.theme_name); + + // NEW for Tailwind v4: Update the html attribute named "data-theme" to the current theme name. + document.documentElement.setAttribute('data-theme', new_theme_name); + + // if ($ae_loc.theme_mode == 'light') { + // document.documentElement.classList.remove('dark'); + // document.documentElement.classList.add('light'); + // } else if ($ae_loc.theme_mode == 'dark') { + // document.documentElement.classList.remove('light'); + // document.documentElement.classList.add('dark'); + // } }} - title="Change light and dark mode" + bind:value={$ae_loc.theme_name} + class="select" + class:hidden={!expand} + title="Theme name" > - - {#if $ae_loc.theme_mode == 'light'} - - Light Mode - {:else if $ae_loc.theme_mode == 'dark'} - - Dark Mode - {/if} - - Change Theme - - - + -- None -- + Cerberus + Concord + Crimson + Hamlindigo + Modern + Nouveau + Rocket + Terminus + Vintage + Wintry + + OSIT + LCI + + + + + + {#if expand} + + { + expand = !expand; + }} + title="Hide Theme Options" + > + + + + Hide Theme Options + + + + { + if ($ae_loc.theme_mode == 'light') { + $ae_loc.theme_mode = 'dark'; + } else if ($ae_loc.theme_mode == 'dark') { + $ae_loc.theme_mode = 'light'; + } + + if ($ae_loc.theme_mode == 'light') { + document.documentElement.classList.remove('dark'); + document.documentElement.classList.add('light'); + } else if ($ae_loc.theme_mode == 'dark') { + document.documentElement.classList.remove('light'); + document.documentElement.classList.add('dark'); + } + }} + title="Change light and dark mode" + > + + {#if $ae_loc.theme_mode == 'light'} + + Light Mode + {:else if $ae_loc.theme_mode == 'dark'} + + Dark Mode + {/if} + + Change + + + {:else} + { + if ($ae_loc.theme_mode == 'light') { + $ae_loc.theme_mode = 'dark'; + } else if ($ae_loc.theme_mode == 'dark') { + $ae_loc.theme_mode = 'light'; + } + + if ($ae_loc.theme_mode == 'light') { + document.documentElement.classList.remove('dark'); + document.documentElement.classList.add('light'); + } else if ($ae_loc.theme_mode == 'dark') { + document.documentElement.classList.remove('light'); + document.documentElement.classList.add('dark'); + } + + expand = !expand; + }} + title="Change light and dark mode" + > + {#if $ae_loc.theme_mode == 'light'} + + + + Light Mode + {:else if $ae_loc.theme_mode == 'dark'} + + + + Dark Mode + {/if} + + {/if} + + - - - { - // $slct_trigger = 'set_theme_name'; - let new_theme_name = event.target.value; - // document.documentElement.theme = new_theme_name; - - console.log(`$ae_loc?.theme_name=${$ae_loc?.theme_name}`); - // $slct_trigger = null; - // Update the body attribute named "data-theme" to the current theme name. - // document.body.setAttribute('data-theme', new_theme_name); - // document.body.setAttribute('data-theme', $ae_loc?.theme_name); - - // NEW for Tailwind v4: Update the html attribute named "data-theme" to the current theme name. - document.documentElement.setAttribute('data-theme', new_theme_name); - - // if ($ae_loc.theme_mode == 'light') { - // document.documentElement.classList.remove('dark'); - // document.documentElement.classList.add('light'); - // } else if ($ae_loc.theme_mode == 'dark') { - // document.documentElement.classList.remove('light'); - // document.documentElement.classList.add('dark'); - // } - }} - bind:value={$ae_loc.theme_name} - class="select" - title="Theme name" - > - -- None -- - Cerberus - Concord - Crimson - Hamlindigo - Modern - Nouveau - Rocket - Terminus - Vintage - Wintry - - OSIT - LCI - -