diff --git a/src/components/RoadTabs.vue b/src/components/RoadTabs.vue
index ae7fe10f..116366ae 100644
--- a/src/components/RoadTabs.vue
+++ b/src/components/RoadTabs.vue
@@ -4,7 +4,7 @@
v-model="tabRoad"
show-arrows
>
-
+
-
+
close
@@ -76,7 +76,7 @@
/>
-
+
diff --git a/src/components/Semester.vue b/src/components/Semester.vue
index c8c657a1..fadb67cd 100644
--- a/src/components/Semester.vue
+++ b/src/components/Semester.vue
@@ -35,7 +35,7 @@
-
+
{{ semData.message }}
@@ -43,7 +43,6 @@
@@ -30,7 +31,7 @@
-
+
-
+
check_box
@@ -84,6 +85,18 @@
C o u r s e R o a d
+
+
+ mdi-{{ useDark ? 'white-balance-sunny' : 'weather-night' }}
+
+
About
@@ -165,7 +178,7 @@
-
+
Looking for the old courseroad? Visit the old website here and export your roads!
@@ -178,7 +191,7 @@
-
+
This website uses cookies and session storage to store your data and login token, and important features like saving roads will not work without them.
@@ -254,6 +267,19 @@ export default {
};
},
computed: {
+ useDark: {
+ get () {
+ return this.$store.state.useDarkTheme;
+ },
+ set (value) {
+ this.$store.commit('setUseDarkTheme', value);
+ this.$vuetify.theme.primary = value ? this.$vuetify.theme.discordOrange : this.$vuetify.theme.defaultPrimary;
+ this.$vuetify.theme.background = value ? this.$vuetify.theme.backgroundDark : this.$vuetify.theme.backgroundLight;
+ this.$vuetify.theme.background2 = value ? this.$vuetify.theme.backgroundDark : this.$vuetify.theme.background2Light;
+ this.$vuetify.theme.search = value ? this.$vuetify.theme.backgroundDark : this.$vuetify.theme.searchLight;
+ this.$vuetify.theme.crlogo = value ? this.$vuetify.theme.crlogoDark : this.$vuetify.theme.crlogoLight;
+ }
+ },
activeRoad: {
get () {
return this.$store.state.activeRoad;
diff --git a/src/stores/courseData.js b/src/stores/courseData.js
index 71a8cae0..62344a01 100644
--- a/src/stores/courseData.js
+++ b/src/stores/courseData.js
@@ -10,6 +10,7 @@ const DATE_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSS000Z';
const store = new Vuex.Store({
strict: process.env.NODE_ENV !== 'production',
state: {
+ useDarkTheme: true,
currentSemester: 1,
activeRoad: '$defaultroad$',
addingFromCard: false,
@@ -48,6 +49,9 @@ const store = new Vuex.Store({
}
},
mutations: {
+ setUseDarkTheme (state, newValue) {
+ state.useDarkTheme = newValue;
+ },
addClass (state, newClass) {
state.roads[state.activeRoad].contents.selectedSubjects[newClass.semester].push(newClass);
Vue.set(state.roads[state.activeRoad], 'changed', moment().format(DATE_FORMAT));