🎨 Improve CSS around Swiper component
This commit is contained in:
10
src/App.vue
10
src/App.vue
@ -41,7 +41,9 @@ const isDataView = computed(() => {
|
|||||||
<div class="center">
|
<div class="center">
|
||||||
<main>
|
<main>
|
||||||
<DateSelector v-show="isDataView" />
|
<DateSelector v-show="isDataView" />
|
||||||
|
<div class="wrapper">
|
||||||
<RouterView />
|
<RouterView />
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<BottomNavbar v-show="$route.name != 'title.login'" />
|
<BottomNavbar v-show="$route.name != 'title.login'" />
|
||||||
</div>
|
</div>
|
||||||
@ -83,5 +85,13 @@ main {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 900px;
|
max-width: 900px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
display: grid;
|
||||||
|
grid-template-rows: auto 1fr;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.wrapper {
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -4,6 +4,7 @@ import { Swiper, SwiperSlide } from "swiper/vue";
|
|||||||
import { Virtual } from "swiper";
|
import { Virtual } from "swiper";
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch } from "vue";
|
||||||
import { getDateSkippingWeekend } from "../util";
|
import { getDateSkippingWeekend } from "../util";
|
||||||
|
import ScrollableContainer from "../components/scrollable-container.vue";
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
element: {
|
element: {
|
||||||
@ -109,9 +110,9 @@ watch(changeDate, (date) => {
|
|||||||
:key="index"
|
:key="index"
|
||||||
:virtualIndex="index"
|
:virtualIndex="index"
|
||||||
>
|
>
|
||||||
<div class="content">
|
<ScrollableContainer>
|
||||||
<component :is="element" :date="date" />
|
<component :is="element" :date="date" />
|
||||||
</div>
|
</ScrollableContainer>
|
||||||
</swiper-slide>
|
</swiper-slide>
|
||||||
</swiper>
|
</swiper>
|
||||||
</template>
|
</template>
|
||||||
@ -122,15 +123,9 @@ watch(changeDate, (date) => {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.swiper {
|
.swiper {
|
||||||
padding: 10px;
|
padding: 5px 10px 0px 10px;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
box-sizing: border-box;
|
||||||
|
|
||||||
.content {
|
|
||||||
height: calc(100% - 150px);
|
|
||||||
overflow-y: auto;
|
|
||||||
padding-bottom: 100px;
|
|
||||||
touch-action: pan-y;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
19
src/components/scrollable-container.vue
Normal file
19
src/components/scrollable-container.vue
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<template>
|
||||||
|
<div class="scroll">
|
||||||
|
<div class="content">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.scroll {
|
||||||
|
overflow-y: auto;
|
||||||
|
touch-action: pan-y;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
padding-bottom: 90px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -4,13 +4,5 @@ import HistoryList from "../components/history-list.vue";
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="history">
|
|
||||||
<DayCarousel :element="HistoryList" />
|
<DayCarousel :element="HistoryList" />
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.history {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
|
import ScrollableContainer from "../components/scrollable-container.vue";
|
||||||
import {
|
import {
|
||||||
classList,
|
classList,
|
||||||
classFilter,
|
classFilter,
|
||||||
@ -13,7 +14,7 @@ const gitHash = GITVERSION;
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="settings">
|
<ScrollableContainer class="settings">
|
||||||
<!-- Filtering -->
|
<!-- Filtering -->
|
||||||
<h2>{{ $t("settings.heading.filtering") }}</h2>
|
<h2>{{ $t("settings.heading.filtering") }}</h2>
|
||||||
<p>{{ $t("settings.text.filtering") }}</p>
|
<p>{{ $t("settings.text.filtering") }}</p>
|
||||||
@ -70,15 +71,12 @@ const gitHash = GITVERSION;
|
|||||||
<p>{{ $t("settings.text.about") }}</p>
|
<p>{{ $t("settings.text.about") }}</p>
|
||||||
<div class="spacer"></div>
|
<div class="spacer"></div>
|
||||||
<p class="gray">{{ $t("settings.version") }}: {{ gitHash }}</p>
|
<p class="gray">{{ $t("settings.version") }}: {{ gitHash }}</p>
|
||||||
</div>
|
</ScrollableContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.settings {
|
.settings {
|
||||||
padding: 15px 10px 80px 10px;
|
padding: 15px 10px 0px 10px;
|
||||||
height: calc(100% - 100px);
|
|
||||||
overflow-y: auto;
|
|
||||||
padding-bottom: 90px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
|
@ -4,13 +4,5 @@ import SubstitutionList from "../components/substitution-list.vue";
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="substitutions">
|
|
||||||
<DayCarousel :element="SubstitutionList" />
|
<DayCarousel :element="SubstitutionList" />
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.substitutions {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
@ -11,13 +11,5 @@ import TimetableList from "../components/timetable-list.vue";
|
|||||||
:options="classList"
|
:options="classList"
|
||||||
v-model="classFilter"
|
v-model="classFilter"
|
||||||
/>
|
/>
|
||||||
<div class="timetable">
|
<DayCarousel v-show="classFilter != 'none'" :element="TimetableList" />
|
||||||
<DayCarousel :element="TimetableList" />
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.timetable {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
Reference in New Issue
Block a user