Add 'Switch to Dark/Light Mode' to header & footer (Fixes #174) (#177)

* Add 'Switch to Dark/Light Mode' to footer (Fixes #174)

* Cursed mess

* Adds mobile header dark/light mode toggle

I do not like CSS.
Mobile works fine, desktop does not

* Remove unused div & other things I don't remember

* Fixes dark/light mode toggles on desktop

Also simplifies css for footer slightly.
Sometimes a good night's sleep really does do ya good.
https://cdn.discordapp.com/attachments/745980892735864953/835256687803367464/modrinth-2021-04-23_16.50.59.webm

* that was a mistake for the login button but it actually works well
This commit is contained in:
Emma
2021-04-24 22:52:49 -04:00
committed by GitHub
parent a872058704
commit d3449609da
2 changed files with 39 additions and 0 deletions

View File

@@ -4,6 +4,14 @@
Modrinth is open source software. You may view the source code at
<a target="_blank" href="https://github.com/modrinth">our GitHub page</a>.
</span>
<ul>
<li>
<a @click="changeTheme">
<span v-if="$colorMode.value === 'light'">Switch to Dark Mode</span>
<span v-else>Switch to Light Mode</span>
</a>
</li>
</ul>
<ul>
<li>
<nuxt-link to="/legal/terms">Terms</nuxt-link>
@@ -56,6 +64,12 @@ export default {
default: false,
},
},
methods: {
changeTheme() {
this.$colorMode.preference =
this.$colorMode.value === 'dark' ? 'light' : 'dark'
},
},
}
</script>
@@ -93,6 +107,7 @@ footer {
a {
text-decoration: underline;
cursor: pointer;
}
.hideSmall {