aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/DarkMode.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/DarkMode.vue')
-rw-r--r--src/components/DarkMode.vue4
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