diff options
author | Gaëtan Caillaut <gcaillaut@protonmail.com> | 2021-03-09 18:12:30 +0100 |
---|---|---|
committer | Gaëtan Caillaut <gcaillaut@protonmail.com> | 2021-03-09 18:32:38 +0100 |
commit | c0044cc7653329044458fb233757b935893cd1a9 (patch) | |
tree | 0a6d66eac2d38193ecf69e81d67601433a84d4c0 /src/components/DarkMode.vue | |
parent | 4a1e8717e90d1b0b516da2cbc1d16ff906d7fbdf (diff) | |
download | homer-c0044cc7653329044458fb233757b935893cd1a9.tar.gz homer-c0044cc7653329044458fb233757b935893cd1a9.tar.zst homer-c0044cc7653329044458fb233757b935893cd1a9.zip |
title attribute that display current theme
Diffstat (limited to 'src/components/DarkMode.vue')
-rw-r--r-- | src/components/DarkMode.vue | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/components/DarkMode.vue b/src/components/DarkMode.vue index 02450d9..4c5ba03 100644 --- a/src/components/DarkMode.vue +++ b/src/components/DarkMode.vue | |||
@@ -4,7 +4,7 @@ | |||
4 | aria-label="Toggle dark mode" | 4 | aria-label="Toggle dark mode" |
5 | class="navbar-item is-inline-block-mobile" | 5 | class="navbar-item is-inline-block-mobile" |
6 | > | 6 | > |
7 | <i :class="`${faClasses[mode]}`" class="fa-fw"></i> | 7 | <i :class="`${faClasses[mode]}`" class="fa-fw" :title="`${titles[mode]}`"></i> |
8 | </a> | 8 | </a> |
9 | </template> | 9 | </template> |
10 | 10 | ||
@@ -15,11 +15,13 @@ export default { | |||
15 | return { | 15 | return { |
16 | isDark: null, | 16 | isDark: null, |
17 | faClasses: null, | 17 | faClasses: null, |
18 | titles: null, | ||
18 | mode: null, | 19 | mode: null, |
19 | }; | 20 | }; |
20 | }, | 21 | }, |
21 | created: function () { | 22 | created: function () { |
22 | this.faClasses = ["fas fa-adjust", "fas fa-circle", "far fa-circle"]; | 23 | this.faClasses = ["fas fa-adjust", "fas fa-circle", "far fa-circle"]; |
24 | this.titles = ["Auto-switch", "Light theme", "Dark theme"] | ||
23 | this.mode = 0; | 25 | this.mode = 0; |
24 | if ("overrideDark" in localStorage) { | 26 | if ("overrideDark" in localStorage) { |
25 | // Light theme is 1 and Dark theme is 2 | 27 | // Light theme is 1 and Dark theme is 2 |