]> zoso.dev Git - nemo-wallet.git/commitdiff
Start building theme switching.
authorChris Duncan <chris@zoso.dev>
Mon, 28 Oct 2024 22:39:24 +0000 (15:39 -0700)
committerChris Duncan <chris@zoso.dev>
Mon, 28 Oct 2024 22:39:24 +0000 (15:39 -0700)
app/pages/nemo-wallet.html

index ab6a3f08bccbc9c5289240abc03f2ec8b8b357df..ac5b420d47fa4f5c858d2b0480a900d940b8aba5 100644 (file)
                        notify.ok(`Session storage cleared`)
                        btn.removeAttribute('disabled')
                }
+               // function toggleTheme () {
+               //      const body = document.querySelector('body')
+               //      const theme = body.style.getPropertyValue('--theme')
+               //      switch (theme) {
+               //              case dark: {
+               //                      body.style = {
+               //                              "--theme": "light",
+               //                              "--theme-primary": "var(--color-light)",
+               //                              "--theme-secondary": "var(--color-blue)",
+               //                              "--theme-highlight": "var(--color-dark)",
+               //                              "--theme-text": "var(--color-black)"
+               //                      break
+               //              }
+               //              case light: {
+               //                      body.style = {
+               //                              "--theme": "light",
+               //                              "--theme-primary": "var(--color-light)",
+               //                              "--theme-secondary": "var(--color-blue)",
+               //                              "--theme-highlight": "var(--color-dark)",
+               //                              "--theme-text": "var(--color-black)"
+               //                      break
+               //              }
+               // }
        </script>
        <style>
                *{border:0;box-sizing:border-box;font:normal normal normal calc(16px + 0.1dvh) 'sans-serif';margin:0;}
                        background: linear-gradient(to right, var(--color-dark), calc((100dvw - 1080px) / 2), var(--color-black) 50%, calc(100dvw - ((100dvw - 1080px) / 2)), var(--color-dark));
                }
                body {
+                       --theme: dark;
+                       --theme-primary: var(--color-dark);
+                       --theme-secondary: var(--color-gray);
+                       --theme-highlight: var(--color-blue);
+                       --theme-text: var(--color-light);
                        align-items: flex-start;
-                       background-color: var(--color-dark);
-                       color: var(--color-light);
+                       background-color: var(--primary);
+                       color: var(--tertiary);
                        display: flex;
                        fill: var(--color-blue);
                        flex-direction: column;
        </style>
 </head>
 
-<body onhashchange="switchPage(event)" style="visibility:hidden;">
+<body onhashchange="switchPage(event)" style="--theme:dark;visibility:hidden;">
        <div id="notifications"></div>
        <header>
                <form>