implemented mode change

This commit is contained in:
2024-03-25 23:23:37 +01:00
parent 45a4b58f26
commit 3f88f6b821
71 changed files with 3020 additions and 1006 deletions

View File

@ -1,143 +1,193 @@
<template>
<section :class="[darkMode ? 'section-darkmode' : 'section-lightmode']">
<pre :class="['title', darkMode ? 'title-darkmode' : 'title-lightmode']">Department name</pre>
<div class="data-group">
<div class="data-field" id="id">
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">ID:</pre>
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
</div>
<div class="data-field" id="customer-id">
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Customer ID:</pre>
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
</div>
<div class="data-field" id="head">
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Head:</pre>
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
</div>
<section :class="[darkMode ? 'section-darkmode' : 'section-lightmode']">
<pre :class="['title', darkMode ? 'title-darkmode' : 'title-lightmode']">Department name</pre>
<div class="data-group">
<div class="data-field" id="id">
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">ID:</pre>
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
</div>
<div class="notes">
<pre :class="['area-title', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Notes:</pre>
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']" id="notes">...</pre>
<div class="data-field" id="customer-id">
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Customer ID:</pre>
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
</div>
</section>
<div class="data-field" id="head">
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Head:</pre>
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
</div>
</div>
<div class="notes">
<pre :class="['area-title', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Notes:</pre>
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']" id="notes">...</pre>
</div>
</section>
</template>
<script setup>
import { ref } from 'vue';
const darkMode = ref(true)
<script setup>
import { ref, onMounted, watch } from 'vue';
import { useStore } from 'vuex';
import { computed } from 'vue';
const store = useStore();
const modeChanged = computed(() => store.state.updateDarkMode);
const darkMode = ref('')
const getSession = async () => {
const loggedInUserDarkModeBool = getItem('logged-in-user-darkMode');
if (loggedInUserDarkModeBool == 1) {
darkMode.value = true;
} else {
darkMode.value = false;
}
}
function getItem(item) {
if (process.client) {
return localStorage.getItem(item)
} else {
return undefined
}
}
watch(modeChanged, getSession)
onMounted(async () => {
await getSession();
});
</script>
<script>
export default {
name: "CustomerDepartment",
name: "CustomerDepartment",
};
</script>
</script>
<style scoped>
* {
box-sizing: border-box;
margin: 0;
* {
box-sizing: border-box;
margin: 0;
}
section {
display: flex;
flex-direction: column;
padding: 1.25rem 1.875rem;
border-radius: 0.625rem;
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
align-items: stretch;
justify-content: center;
}
.section-darkmode { background-color: #2c2c2c; }
.section-lightmode { background-color: #ffffff; }
display: flex;
flex-direction: column;
padding: 1.25rem 1.875rem;
border-radius: 0.625rem;
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
align-items: stretch;
justify-content: center;
}
.section-darkmode {
background-color: #2c2c2c;
}
.section-lightmode {
background-color: #ffffff;
}
.title {
padding: 1.25rem 0;
letter-spacing: 0.04rem;
text-decoration-line: underline;
font: italic 400 1rem/1.875rem Overpass, sans-serif;
}
.title-darkmode { color: #ffffff; }
.title-lightmode { color: #000000; }
padding: 1.25rem 0;
letter-spacing: 0.04rem;
text-decoration-line: underline;
font: italic 400 1rem/1.875rem Overpass, sans-serif;
}
.title-darkmode {
color: #ffffff;
}
.title-lightmode {
color: #000000;
}
.data-group {
display: flex;
flex: auto;
width: 100%;
flex-direction: row;
padding: 0.625rem 0;
align-items: center;
justify-content: stretch;
display: flex;
flex: auto;
width: 100%;
flex-direction: row;
padding: 0.625rem 0;
align-items: center;
justify-content: stretch;
}
.data-field {
display: flex;
flex: auto;
width: 30%;
flex-direction: row;
padding: 0.8rem 1.875rem;
align-items: center;
justify-content: flex-start;
gap: 1.25rem;
}
#head { width: 40%; }
.label {
letter-spacing: 0.02rem;
font: 400 0.875rem/1.875rem Overpass, sans-serif;
display: flex;
flex: auto;
width: 30%;
flex-direction: row;
padding: 0.8rem 1.875rem;
align-items: center;
justify-content: flex-start;
gap: 1.25rem;
}
.pre-darkmode { color: #ffffff; }
.pre-lightmode { color: #000000; }
#head {
width: 40%;
}
.label {
letter-spacing: 0.02rem;
font: 400 0.875rem/1.875rem Overpass, sans-serif;
}
.pre-darkmode {
color: #ffffff;
}
.pre-lightmode {
color: #000000;
}
.data {
display: flex;
flex-direction: row;
padding: 0 0.625rem;
border-radius: 0.3125rem;
box-shadow: 0.0625rem 0.0625rem 0.25rem 0rem rgba(0, 0, 0, 0.25) inset;
background-color: #212121;
align-items: center;
justify-content: flex-start;
letter-spacing: 0.02rem;
font: 400 0.75rem/1.875rem Overpass, sans-serif;
}
display: flex;
flex-direction: row;
padding: 0 0.625rem;
border-radius: 0.3125rem;
box-shadow: 0.0625rem 0.0625rem 0.25rem 0rem rgba(0, 0, 0, 0.25) inset;
background-color: #212121;
align-items: center;
justify-content: flex-start;
letter-spacing: 0.02rem;
font: 400 0.75rem/1.875rem Overpass, sans-serif;
}
.data-darkmode {
background-color: #212121;
color: #ffffff;
}
background-color: #212121;
color: #ffffff;
}
.data-lightmode {
background-color: #ebebeb;
color: #000000;
}
background-color: #ebebeb;
color: #000000;
}
.notes {
display: flex;
flex: auto;
flex-direction: column;
padding: 1.25rem 1.875rem 0.625rem;
align-items: flex-start;
justify-content: center;
gap: 0.625rem;
display: flex;
flex: auto;
flex-direction: column;
padding: 1.25rem 1.875rem 0.625rem;
align-items: flex-start;
justify-content: center;
gap: 0.625rem;
}
.area-title {
letter-spacing: 0.03rem;
font: 400 0.875rem/1.875rem Overpass, sans-serif;
letter-spacing: 0.03rem;
font: 400 0.875rem/1.875rem Overpass, sans-serif;
}
#notes { align-self: stretch; }
#notes {
align-self: stretch;
}
</style>