mirror of
https://github.com/kognise/water.css.git
synced 2025-12-07 07:14:57 +01:00
feat: adjust favicon to dark mode
This commit is contained in:
parent
26aecd86db
commit
4673919b7c
5 changed files with 22 additions and 3 deletions
BIN
icons/light-favicon-16x16.png
Executable file
BIN
icons/light-favicon-16x16.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
icons/light-favicon-32x32.png
Executable file
BIN
icons/light-favicon-32x32.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
BIN
icons/light-favicon.ico
Executable file
BIN
icons/light-favicon.ico
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
|
|
@ -202,7 +202,8 @@
|
|||
<h5>Heading 5</h5>
|
||||
<h6>Heading 6</h6>
|
||||
|
||||
<script src='script.js'></script>
|
||||
<script src="https://unpkg.com/favicon-mode-switcher@^1.0.0" defer></script>
|
||||
<script src="script.js" defer></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
20
script.js
20
script.js
|
|
@ -1,4 +1,22 @@
|
|||
(function (ThemeSwitcher) {
|
||||
!(function() {
|
||||
const iconModeSwitcher = window.faviconModeSwitcher && faviconModeSwitcher.default
|
||||
if (!iconModeSwitcher) return
|
||||
iconModeSwitcher([
|
||||
{
|
||||
element: 'link[rel="shortcut icon"]',
|
||||
href: { dark: '/icons/light-favicon.ico' }
|
||||
},
|
||||
{
|
||||
element: 'link[rel="icon"][sizes="16x16"]',
|
||||
href: { dark: '/icons/light-favicon-16x16.png' }
|
||||
},
|
||||
{
|
||||
element: 'link[rel="icon"][sizes="32x32"]',
|
||||
href: { dark: '/icons/light-favicon-32x32.png' }
|
||||
}
|
||||
])
|
||||
})()
|
||||
;(function (ThemeSwitcher) {
|
||||
const themeSwitcher = new ThemeSwitcher('stylesheet');
|
||||
const themeSwitchBtn = document.getElementById('switch');
|
||||
const themes = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue