Merge branch 'SettingsView'

This commit is contained in:
Jérémy CHOMAZ 2024-03-17 15:49:14 +01:00
commit 56bf47b91a
3 changed files with 73 additions and 62 deletions

View File

@ -21,7 +21,7 @@
function toggleTheme() { function toggleTheme() {
darkTheme.value = !darkTheme.value darkTheme.value = !darkTheme.value
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark' theme.global.name.value = theme.global.current.value.dark ? 'CustomThemeLight' : 'CustomThemeDark'
} }
</script> </script>

View File

@ -11,30 +11,40 @@ import 'vuetify/styles'
// Composables // Composables
import { createVuetify } from 'vuetify' import { createVuetify } from 'vuetify'
const CustomThemeDark = {
dark: true,
colors: {
background: '#121212',
primary: '#e91e1e',
secondary: '#F44336',
accent: '#FFC107',
error: '#FF5722',
warning: '#FFC107',
info: '#607D8B',
success: '#4CAF50'
}
}
const CustomThemeLight = {
dark: false,
colors: {
background: '#ffffff',
primary: '#e91e1e',
secondary: '#F44336',
accent: '#FFC107',
error: '#FF5722',
warning: '#FFC107',
info: '#607D8B',
success: '#4CAF50'
}
}
// https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides // https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides
export default createVuetify({ export default createVuetify({
theme: { theme: {
defaultTheme: 'CustomThemeDark',
themes: { themes: {
light: { CustomThemeDark,
background: '#212121', CustomThemeLight,
primary: '#cc0000',
controls: '#cc0000',
soundboard: '#9A2779',
secondary: '#b0bec5',
feedback: '#2E7D32',
accent: '#8c9eff',
error: '#b71c1c',
},
dark: {
background: '#121212',
primary: '#2979FF',
controls: '#AB47B',
secondary: '#90a4ae',
feedback: '#2E7D32',
accent: '#8c9eff',
error: '#b71c1c',
}, },
}, },
defaultTheme: 'dark',
}
}) })

View File

@ -1,19 +1,20 @@
<template> <template>
<v-container class="ml-5">
<h1 class="title mb-4">Paramètres</h1> <h1 class="title mb-4 ml-5 mt-5">Paramètres</h1>
<h2 class="title ml-10 mb-5">Son</h2> <hr/>
<h2 class="title ml-10 mb-5 mt-5">Son</h2>
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<v-checkbox label="Activer le son intégré" v-model="EmbeddedSound" class="ml-10"/> <v-switch label="Activer le son intégré" v-model="EmbeddedSound" class="ml-10" color="primary"/>
<div style="width: 250px; margin-left: 16px;"> <div style="width: 250px; margin-left: 16px;">
<v-slider class="ml-15" :disabled="EmbeddedSound === false" v-model="EmbeddedSoundVolume"/> <v-slider class="ml-15" :disabled="EmbeddedSound === false" v-model="EmbeddedSoundVolume" color="primary"/>
</div> </div>
</div> </div>
<v-checkbox label="Activer le son MQTT" v-model="MQTTSound" class="ml-10"/> <v-switch label="Activer le son MQTT" v-model="MQTTSound" class="ml-10" color="primary"/>
</v-container>
</template> </template>
<script setup> <script setup>
import { ref, onMounted, watch } from 'vue'; import { ref, onMounted, watch } from 'vue';
const EmbeddedSound = ref(false); // Définition d'une référence pour la case à cocher. Initialement décochée. const EmbeddedSound = ref(false); // Définition d'une référence pour la case à cocher. Initialement décochée.
@ -47,4 +48,4 @@
localStorage.setItem('MQTTSound', MQTTSoundNewValue); // Mettre à jour l'état de la case à cocher dans le LocalStorage chaque fois qu'il change. localStorage.setItem('MQTTSound', MQTTSoundNewValue); // Mettre à jour l'état de la case à cocher dans le LocalStorage chaque fois qu'il change.
} }
}); });
</script> </script>