Implement 'palette' section in settings

This commit is contained in:
CakesTwix 2024-09-24 08:24:13 +03:00
parent 5d7741ee3a
commit 78d4b7998a
Signed by: CakesTwix
GPG key ID: 7B11051D5CE19825
2 changed files with 50 additions and 0 deletions

View file

@ -8,6 +8,8 @@
<article class="primary-text">
<RouterLink class="row wave" to="/settings/palette"><i>palette</i> Оформлення</RouterLink>
<hr>
<a class="row wave"><i>person</i> Обліковий запис Tokoka.to</a>
<hr>
<a class="row wave"><i>hub</i> BitTorrent</a>

View file

@ -0,0 +1,48 @@
<template>
<p class="large-text"><i>palette</i> Оформлення</p>
<div class="large-space"></div>
<article class="primary-text">
<a class="row wave"><i>palette</i> Колір<input @change="changeMaterialColor" type="color"></a>
<hr>
<a class="row wave" @click="toggleTheme"><i>light_mode</i> Тема</a>
<hr>
<a class="row wave" @click="goBack"><i>arrow_back</i> Назад</a>
<hr>
</article>
</template>
<script>
export default {
data() {
return {
};
},
created() {
},
methods: {
toggleTheme() {
let mode = ui("mode");
if (mode == "light") {
this.setCookie('my-mode', "dark");
ui("mode", "dark")
} else {
this.setCookie('my-mode', "light");
ui("mode", "light")
}
},
changeMaterialColor(event) {
const inputElement = event.target
ui("theme", inputElement.value);
this.setCookie('my-color', inputElement.value);
},
setCookie(id, value) {
document.cookie = id + '=' + value;
},
goBack() {
this.$router.back();
}
}
}
</script>