Migracja projektu na Vite

This commit is contained in:
2022-08-17 23:07:21 +02:00
commit c799b47698
26 changed files with 2222 additions and 0 deletions
+88
View File
@@ -0,0 +1,88 @@
<template>
<PopUpCard v-if="store.alertMessage || store.confirmMessage" />
<router-view></router-view>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import dataMixin from './mixins/dataMixin';
import { useStore } from './store';
import PopUpCard from './components/PopUpCard.vue';
export default defineComponent({
mixins: [dataMixin],
components: { PopUpCard },
setup() {
const store = useStore();
return {
store,
};
},
methods: {
async autoLogin() {
const token = window.localStorage.getItem('auth-token');
if (token) {
this.store.isAuthorized = true;
this.store.token = token;
this.store.user = JSON.parse(window.localStorage.getItem('user')!);
}
},
},
mounted() {
this.autoLogin();
if (window.localStorage.getItem('notifyDiscord') !== null) {
this.store.notifyDiscord = Boolean(Number(window.localStorage.getItem('notifyDiscord')));
}
},
});
</script>
<style lang="scss">
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;600&display=swap');
a {
color: white;
text-decoration: none;
}
a:visited {
color: rgb(124, 164, 218);
}
* {
font-family: 'Inter', sans-serif;
}
body,
html {
padding: 0 0.25em;
margin: 0;
background-color: #1e263f;
color: white;
}
button {
appearance: none;
outline: none;
background-color: #151515;
color: white;
border: 1px solid white;
padding: 0.35rem 0.75rem;
margin: 0.5rem 0;
cursor: pointer;
transition: background-color 100ms;
}
button:hover {
background-color: #505050;
}
button:focus-within {
border: 1px solid gold;
}
</style>