From 1439bfb0561d2a2ac244e07be3855aa6514be631 Mon Sep 17 00:00:00 2001 From: minie4 Date: Sun, 21 Aug 2022 23:10:21 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refactor=20frontend=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/base.css | 6 ++++-- src/components/loading-element.vue | 3 +++ src/components/titlebar-element.vue | 3 ++- src/store.js | 8 ++++---- src/views/HistoryView.vue | 2 +- src/views/SettingsView.vue | 13 +++++++++++++ src/views/SubstitutionView.vue | 6 +----- src/views/TimetableView.vue | 17 +++++++++-------- 8 files changed, 37 insertions(+), 21 deletions(-) diff --git a/src/assets/base.css b/src/assets/base.css index 0a2d512..4afe561 100644 --- a/src/assets/base.css +++ b/src/assets/base.css @@ -2,12 +2,12 @@ --bg-color: #353535; --element-color: #333030; --element-color-hover: #292424; - --element-border-input: #34631f; + --element-border-input: #4e7a3a; --element-border-action: #1f5b63; --text-color: #bdbdbd; --font-family: "sourcesanspro"; --titlebar-color: #212121; - --titlebar-element-active-color: #335723; + --titlebar-element-active-color: #466439; --bottomnav-color: #555555; --bottomnav-icon-color: #c7c7c7; --bottomnav-icon-active-color: #456c47; @@ -18,6 +18,8 @@ --substitution-background-addition: #476331; --substitution-background-deletion: #7d2b2d; --substitution-background-unchanged: #26272a; + --timetable-trust-warning-border: #b71c1c; + --timetable-trust-warning-background: #412727; } @font-face { diff --git a/src/components/loading-element.vue b/src/components/loading-element.vue index fd71e8c..6272b5e 100644 --- a/src/components/loading-element.vue +++ b/src/components/loading-element.vue @@ -26,10 +26,12 @@ defineProps({ transition: all 0.8s; transition-delay: 0.2s; } + .container.active { height: 100px; opacity: 1; } + .loader { width: 48px; height: 48px; @@ -40,6 +42,7 @@ defineProps({ box-sizing: border-box; animation: rotation 1s linear infinite; } + @keyframes rotation { 0% { transform: rotate(0deg); diff --git a/src/components/titlebar-element.vue b/src/components/titlebar-element.vue index f52feae..4613105 100644 --- a/src/components/titlebar-element.vue +++ b/src/components/titlebar-element.vue @@ -58,10 +58,11 @@ a { text-decoration: none; color: inherit; padding: 4px; + border-radius: 5px; + transition: background-color 0.2s; } a.router-link-active { background-color: var(--titlebar-element-active-color); - border-radius: 5px; } diff --git a/src/store.js b/src/store.js index 8b2b6db..9283cbc 100644 --- a/src/store.js +++ b/src/store.js @@ -110,10 +110,10 @@ export async function fetchData() { const checkResponse = await fetch(`${baseUrl}/check`); if (checkResponse.status != 200) router.push("/login"); - fetchClassList(); - fetchTimetable(); - fetchSubstitutions(); - fetchHistory(); + await fetchClassList(); + await fetchTimetable(); + await fetchSubstitutions(); + await fetchHistory(); loading.value = false; } diff --git a/src/views/HistoryView.vue b/src/views/HistoryView.vue index 8bd03d9..24cfb91 100644 --- a/src/views/HistoryView.vue +++ b/src/views/HistoryView.vue @@ -78,7 +78,7 @@ function getColor(type) { border-radius: 11px; margin: 10px 0px; padding: 10px 10px; - grid-template-columns: 40px auto; + grid-template-columns: min-content auto; gap: 5px; } diff --git a/src/views/SettingsView.vue b/src/views/SettingsView.vue index 4305945..00787f3 100644 --- a/src/views/SettingsView.vue +++ b/src/views/SettingsView.vue @@ -13,6 +13,7 @@ const gitHash = GITVERSION;