138 lines
2.9 KiB
Vue
138 lines
2.9 KiB
Vue
<template>
|
|
<section :class="['quick-access', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
|
<h2 :class="['heading', darkMode ? 'h2-darkmode' : 'h2-lightmode']">Quick Access</h2>
|
|
<div class="shortcuts">
|
|
<input :class="[darkMode ? 'input-darkmode' : 'input-lightmode']" type="button" id="pins" value="Pins">
|
|
<!--<input type="button" id="maintenance-visits" value="My Maintenance Visits">
|
|
<input type="button" id="production-orders" value="My Production Orders">
|
|
<input type="button" id="solutions" value="My Solutions">
|
|
<input type="button" id="issue-slips" value="My Issue Slips">-->
|
|
</div>
|
|
</section>
|
|
</template>
|
|
|
|
|
|
<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 modeChangedLocalstorage = computed(() => store.state.modeQuickAccess);
|
|
|
|
const darkMode = ref('');
|
|
|
|
const getSession = async () => {
|
|
if (modeChangedLocalstorage.value) {
|
|
store.commit('resetModeQuickAccessChanged');
|
|
}
|
|
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)
|
|
watch(modeChangedLocalstorage, getSession)
|
|
|
|
onMounted(async () => {
|
|
await getSession();
|
|
});
|
|
</script>
|
|
|
|
<script>
|
|
export default {
|
|
name: "QuickAccess",
|
|
};
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
.quick-access {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
justify-content: center;
|
|
align-self: stretch;
|
|
width: 100%;
|
|
padding: 1.875rem 3.125rem 3.125rem;
|
|
gap: 1.25rem;
|
|
border-radius: 0.625rem;
|
|
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
|
|
}
|
|
|
|
.section-darkmode {
|
|
background-color: #2c2c2c;
|
|
}
|
|
|
|
.section-lightmode {
|
|
background-color: #fff;
|
|
}
|
|
|
|
.heading {
|
|
color: #fff;
|
|
letter-spacing: 5%;
|
|
text-decoration-line: underline;
|
|
font: 400 1rem/2rem Overpass, sans-serif;
|
|
}
|
|
|
|
.h2-darkmode {
|
|
color: #fff;
|
|
}
|
|
|
|
.h2-lightmode {
|
|
color: #000;
|
|
}
|
|
|
|
.shortcuts {
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
align-content: center;
|
|
padding: 0.625rem 2.5rem;
|
|
gap: 2.5rem;
|
|
}
|
|
|
|
input {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 15rem;
|
|
height: 4rem;
|
|
border-radius: 0.625rem;
|
|
padding: 0.9375rem 1.25rem;
|
|
border: none;
|
|
text-align: center;
|
|
letter-spacing: 5%;
|
|
font: 400 0.875rem/2rem Overpass, sans-serif;
|
|
}
|
|
|
|
.input-darkmode {
|
|
color: #fff;
|
|
background-color: #343434;
|
|
}
|
|
|
|
.input-lightmode {
|
|
color: #000;
|
|
background-color: #E4E4E4;
|
|
}
|
|
|
|
input#pins {
|
|
border: 0.0625rem dashed #454545;
|
|
color: #8e8e8e;
|
|
font: 400 0.875rem/2rem Overpass, sans-serif;
|
|
background-color: #34343400;
|
|
}
|
|
</style> |