mirror of
https://github.com/kognise/water.css.git
synced 2025-08-16 01:54:50 +02:00
feat: adjust favicon to dark mode
This commit is contained in:
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>
|
<h5>Heading 5</h5>
|
||||||
<h6>Heading 6</h6>
|
<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>
|
</body>
|
||||||
|
|
||||||
</html>
|
</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 themeSwitcher = new ThemeSwitcher('stylesheet');
|
||||||
const themeSwitchBtn = document.getElementById('switch');
|
const themeSwitchBtn = document.getElementById('switch');
|
||||||
const themes = {
|
const themes = {
|
||||||
|
Reference in New Issue
Block a user