format; linting; aktualizacja do 2023.2.1

This commit is contained in:
2023-10-24 23:28:42 +02:00
parent 57ab6cc02d
commit 1c2a93fbd5
40 changed files with 2019 additions and 1640 deletions
+26 -18
View File
@@ -2,9 +2,10 @@
<section class="stock-section">
<div class="section_modes">
<button
v-for="(id, i) in sectionModes"
:key="id"
class="btn"
ref="sectionButtonRefs"
v-for="(id, i) in sectionModes"
@click="chooseSection(id)"
:data-selected="store.stockSectionMode == id"
>
@@ -15,29 +16,37 @@
<transition name="tab-change" mode="out-in">
<keep-alive>
<component :is="chosenSectionComponent" :key="chosenSectionComponent"></component>
<component
:is="chosenSectionComponent"
:key="chosenSectionComponent"
></component>
</keep-alive>
</transition>
</section>
</template>
<script lang="ts" setup>
import { computed, KeepAlive, onMounted, ref } from 'vue';
import { useStore } from '../../store';
import StockListTab from '../tabs/StockListTab.vue';
import StockGeneratorTab from '../tabs/StockGeneratorTab.vue';
import NumberGeneratorTab from '../tabs/NumberGeneratorTab.vue';
import WikiListTab from '../tabs/WikiListTab.vue';
import { computed, onMounted, ref } from "vue";
import { useStore } from "../../store";
import StockListTab from "../tabs/StockListTab.vue";
import StockGeneratorTab from "../tabs/StockGeneratorTab.vue";
import NumberGeneratorTab from "../tabs/NumberGeneratorTab.vue";
import WikiListTab from "../tabs/WikiListTab.vue";
const sectionButtonRefs = ref([]);
const store = useStore();
type SectionMode = typeof store.stockSectionMode;
const sectionModes: SectionMode[] = ['stock-list', 'wiki-list', 'number-generator', 'stock-generator'];
const sectionModes: SectionMode[] = [
"stock-list",
"wiki-list",
"number-generator",
"stock-generator",
];
onMounted(() => {
window.addEventListener('keydown', (e) => {
window.addEventListener("keydown", (e) => {
if (e.target instanceof HTMLInputElement) return;
if (/[1234]/.test(e.key)) {
@@ -50,16 +59,16 @@ onMounted(() => {
const chosenSectionComponent = computed(() => {
switch (store.stockSectionMode) {
case 'stock-list':
case "stock-list":
return StockListTab;
case 'wiki-list':
case "wiki-list":
return WikiListTab;
case 'stock-generator':
case "stock-generator":
return StockGeneratorTab;
case 'number-generator':
case "number-generator":
return NumberGeneratorTab;
default:
@@ -73,7 +82,7 @@ function chooseSection(sectionId: SectionMode) {
</script>
<style lang="scss">
@import '../../styles/global.scss';
@import "../../styles/global.scss";
// Tab change animation
.tab-change {
@@ -115,14 +124,14 @@ function chooseSection(sectionId: SectionMode) {
left: 50%;
transform: translateX(-50%);
content: '';
content: "";
width: 0;
height: 2px;
transition: all 100ms;
background-color: $accentColor;
}
&[data-selected='true']::after {
&[data-selected="true"]::after {
width: 100%;
}
}
@@ -134,4 +143,3 @@ function chooseSection(sectionId: SectionMode) {
}
}
</style>