switch logo

This commit is contained in:
Kay0u 2022-09-05 17:35:45 +02:00 committed by axolotle
parent 90806206f5
commit c508c1e414
3 changed files with 9 additions and 3 deletions

View file

@ -7,7 +7,12 @@
:to="{ name: 'home' }" :disabled="waiting" :to="{ name: 'home' }" :disabled="waiting"
exact exact-active-class="active" exact exact-active-class="active"
> >
<img alt="Yunohost logo" src="./assets/logo.png"> <span v-if="theme == true">
<img alt="Yunohost logo" src="./assets/logo_light.png" width="40">
</span>
<span v-else>
<img alt="Yunohost logo" src="./assets/logo_dark.png" width="40">
</span>
</b-navbar-brand> </b-navbar-brand>
<b-navbar-nav class="ml-auto"> <b-navbar-nav class="ml-auto">
@ -93,7 +98,8 @@ export default {
'routerKey', 'routerKey',
'transitions', 'transitions',
'transitionName', 'transitionName',
'waiting' 'waiting',
'theme'
]) ])
}, },
@ -154,7 +160,7 @@ export default {
this.$store.commit('SET_SPINNER', 'spookycat') this.$store.commit('SET_SPINNER', 'spookycat')
} }
document.documentElement.setAttribute('data-theme', localStorage.getItem('theme') === "true" ? 'darkMode' : '') // updates the data-theme attribute document.documentElement.setAttribute('data-theme', localStorage.getItem('theme')) // updates the data-theme attribute
} }
} }
</script> </script>

View file

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB