diff options
| author | Volpeon <git@volpeon.ink> | 2021-05-15 21:00:40 +0200 |
|---|---|---|
| committer | Volpeon <git@volpeon.ink> | 2021-05-15 21:00:40 +0200 |
| commit | 380fccc62982d7070acb61886c6adf357e8e4c5c (patch) | |
| tree | 728504d6c4c32f397eb10192a596ca0a45f4b9c1 | |
| parent | Fix overlapping box-shadows in card grid, load theme from localStorage (diff) | |
| download | volpeon.ink-380fccc62982d7070acb61886c6adf357e8e4c5c.tar.gz volpeon.ink-380fccc62982d7070acb61886c6adf357e8e4c5c.tar.bz2 volpeon.ink-380fccc62982d7070acb61886c6adf357e8e4c5c.zip | |
Separate script file
| -rw-r--r-- | content/script.js | 5 | ||||
| -rw-r--r-- | templates/base.html | 9 |
2 files changed, 7 insertions, 7 deletions
diff --git a/content/script.js b/content/script.js new file mode 100644 index 0000000..649da9e --- /dev/null +++ b/content/script.js | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | const lightTheme = localStorage.getItem("light"); | ||
| 2 | |||
| 3 | if (lightTheme === "true") { | ||
| 4 | document.documentElement.classList.add("t-light"); | ||
| 5 | } | ||
diff --git a/templates/base.html b/templates/base.html index 3a1502b..6006211 100644 --- a/templates/base.html +++ b/templates/base.html | |||
| @@ -28,16 +28,11 @@ | |||
| 28 | <link rel="preload" href="/GaretVariable.woff2" as="font" type="font/woff2" crossorigin="anonymous" /> | 28 | <link rel="preload" href="/GaretVariable.woff2" as="font" type="font/woff2" crossorigin="anonymous" /> |
| 29 | <link rel="preload" href="/iosevka-term-ss09-regular.woff2" as="font" type="font/woff2" crossorigin="anonymous" /> | 29 | <link rel="preload" href="/iosevka-term-ss09-regular.woff2" as="font" type="font/woff2" crossorigin="anonymous" /> |
| 30 | <link rel="preload" href="/iosevka-term-ss09-bold.woff2" as="font" type="font/woff2" crossorigin="anonymous" /> | 30 | <link rel="preload" href="/iosevka-term-ss09-bold.woff2" as="font" type="font/woff2" crossorigin="anonymous" /> |
| 31 | <link rel="preload" href="/script.js" as="script" /> | ||
| 31 | 32 | ||
| 32 | <link rel="stylesheet" href="/style.css" /> | 33 | <link rel="stylesheet" href="/style.css" /> |
| 33 | 34 | ||
| 34 | <script> | 35 | <script src="/script.js"></script> |
| 35 | const lightTheme = localStorage.getItem("light"); | ||
| 36 | |||
| 37 | if (lightTheme === "true") { | ||
| 38 | document.documentElement.classList.add("t-light"); | ||
| 39 | } | ||
| 40 | </script> | ||
| 41 | </head> | 36 | </head> |
| 42 | 37 | ||
| 43 | <body> | 38 | <body> |
