更新 infoPage.vue

This commit is contained in:
Jursin 2024-12-01 14:47:04 +08:00 committed by GitHub
parent f932238465
commit 1feaa54a13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,85 +1,97 @@
<template> <template>
<v-container class="main-container" fill-height> <v-container class="main-area">
<v-row justify="center" align="center"> <v-row>
<v-col cols="12" md="10"> <v-col cols="12" class="d-flex justify-space-between align-center mb-4">
<v-card class="pa-4" outlined> <h1 class="large-title">{{ globalStore.examName }}</h1>
<v-card-title class="text-h3">关于考试看板</v-card-title> <h2 class="medium-title">{{ globalStore.room }}</h2>
<v-card-text> </v-col>
<p class="text-lg"> <v-col cols="12">
欢迎使用考试看板这是一款用于展示考试信息的工具帮助考生更好地了解考试信息与状态 <h3 class="small-title text-left">{{ globalStore.message }}</h3>
</p> </v-col>
<p class="text-lg">本软件旨在为考生提供便捷的考试信息查看体验</p> </v-row>
<p class="text-lg developer">
开发者 <v-row>
<a href="https://github.com/hello8693DSZ" target="_blank" class="developer-name">Hello8963</a> <v-col cols="6">
&nbsp;&nbsp; &nbsp; <Clock></Clock>
<a href="https://github.com/MKStoler4096" target="_blank" class="developer-name">Mkstoler4096</a> <SubjectInfo :exam="currentExam" />
</p> </v-col>
<v-btn
href="https://github.com/ProjectCampus-CH/dsz-exam-showboard-next" <v-col cols="6">
target="_blank" <ExamList :exam="globalStore.examInfos"></ExamList>
color="primary"
class="mt-4 normal-case"
>
GitHub 上查看源代码
</v-btn>
</v-card-text>
</v-card>
</v-col> </v-col>
</v-row> </v-row>
</v-container> </v-container>
</template> </template>
<script setup>
import { ref, computed, onMounted, onUnmounted } from 'vue';
import { useProfileStore } from '@renderer/stores/app';
import { getCurrentTimeSlot, getNextExamTimeSlot } from '@renderer/utils/subjectUtils';
const globalStore = useProfileStore();
const currentExam = ref(null);
let timeout = null;
const updateCurrentExam = () => {
const current = getCurrentTimeSlot(globalStore.examInfos);
currentExam.value = current ? current : getNextExamTimeSlot(globalStore.examInfos);
};
const scheduleNextUpdate = () => {
if (timeout) {
clearTimeout(timeout);
}
const nextExam = getNextExamTimeSlot(globalStore.examInfos);
if (nextExam) {
const nextEndTime = new Date(nextExam.end).getTime();
const now = Date.now();
const delay = nextEndTime - now + 60000;
timeout = setTimeout(() => {
updateCurrentExam();
scheduleNextUpdate();
}, delay);
}
};
onMounted(() => {
updateCurrentExam();
scheduleNextUpdate();
});
onUnmounted(() => {
if (timeout) {
clearTimeout(timeout);
}
});
</script>
<style scoped> <style scoped>
.main-container { .main-area {
padding: 20px; padding-left: 10px;
display: flex; padding-right: 10px;
align-items: center;
} }
.v-card { .large-title {
width: 100%; font-size: 3em;
max-width: 800px;
margin: auto;
transition: transform 0.3s ease-in-out;
} }
.v-card:hover { .medium-title {
transform: scale(1.05); font-size: 3em;
margin-top: 5px;
text-align: right;
} }
/* 调整字体大小 */ .small-title {
.text-h3 { font-size: 1.5em;
font-size: 2.5em !important; margin-top: 3px;
color: gray;
text-align: left;
line-height: 1.2;
} }
.text-lg { .mb-4 {
font-size: 1.2em; margin-bottom: 20px;
}
.v-btn {
height: 48px;
font-size: 1.1em;
}
.normal-case {
text-transform: none !important;
}
/* 开发者名字背景框 */
.developer-name {
background-color: #f0f0f0;
color: black;
padding: 0 6px;
border-radius: 4px;
display: inline-block;
line-height: 1.4em;
font-size: 1.2em;
margin: 0 5px;
text-decoration: none;
}
.developer-name:hover {
text-decoration: underline;
} }
</style> </style>