Skip to content

Commit fce54d1

Browse files
DevonRDsamfreund
andauthored
Dark mode and minor interface tweaks (#2016)
Co-authored-by: Sam Freund <[email protected]>
1 parent 3e19cd4 commit fce54d1

36 files changed

+955
-764
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,4 @@ photon-server/src/main/resources/web/*
147147
node_modules
148148
dist
149149
components.d.ts
150+
photon-server/src/main/resources/web/index.html

photon-client/src/App.vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,30 +87,26 @@ if (!is_demo) {
8787
}
8888
8989
::-webkit-scrollbar-track {
90-
background: #232c37;
90+
background: rgb(var(--v-theme-background));
9191
}
9292
9393
::-webkit-scrollbar-thumb {
94-
background-color: #ffd843;
94+
background-color: rgb(var(--v-theme-accent));
9595
border-radius: 10px;
9696
}
9797
9898
::-webkit-scrollbar-thumb:hover {
99-
background-color: #e4c33c;
99+
background-color: rgb(var(--v-theme-primary));
100100
}
101101
102102
.main-container {
103-
background-color: #232c37;
104103
padding: 0 !important;
105104
}
106105
107106
.v-overlay__scrim {
108-
background-color: #202020;
107+
background-color: #111111;
109108
}
110109
111-
#title {
112-
color: #ffd843;
113-
}
114110
div.v-layout {
115111
overflow: unset !important;
116112
}

photon-client/src/assets/images/loading-transparent.svg

Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 25 additions & 0 deletions
Loading

photon-client/src/assets/styles/variables.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
$default-font: "Prompt", sans-serif !default;
44
$body-font-family: $default-font;
55
$heading-font-family: $default-font;
6-
$body-background: #282c34;
6+
$body-background: rgb(var(--v-theme-background));
77

88
body {
99
background: $body-background;
@@ -21,11 +21,7 @@ html {
2121
> table
2222
> tbody
2323
> tr:hover:not(.v-data-table__expanded__content):not(.v-data-table__empty-wrapper) {
24-
background: #005281 !important;
25-
}
26-
27-
.v-banner {
28-
padding: 4px !important;
24+
background: rgba(0, 0, 0, 0.2);
2925
}
3026

3127
.v-card-title,
@@ -72,3 +68,7 @@ html {
7268
.pa-10px {
7369
padding: 10px !important;
7470
}
71+
72+
.rounded-12 {
73+
border-radius: 12px;
74+
}

photon-client/src/components/app/photon-error-snackbar.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { useStateStore } from "@/stores/StateStore";
66
<v-snackbar
77
v-model="useStateStore().snackbarData.show"
88
location="top"
9+
variant="elevated"
910
:color="useStateStore().snackbarData.color"
1011
:timeout="useStateStore().snackbarData.timeout"
1112
>

photon-client/src/components/app/photon-log-view.vue

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ document.addEventListener("keydown", (e) => {
7474

7575
<template>
7676
<v-dialog v-model="useStateStore().showLogModal" width="1500" dark>
77-
<v-card class="dialog-container pa-5" color="primary" flat>
77+
<v-card class="dialog-container pa-5" color="surface" flat>
7878
<!-- Logs header -->
7979
<v-row class="pb-3">
8080
<v-col cols="4">
8181
<v-card-title class="pa-0">Program Logs</v-card-title>
8282
</v-col>
8383
<v-col class="align-self-center pl-3" style="text-align: right">
8484
<v-btn variant="text" color="white" @click="handleLogExport">
85-
<v-icon start class="menu-icon"> mdi-download </v-icon>
85+
<v-icon start class="menu-icon" size="large"> mdi-download </v-icon>
8686
<span class="menu-label">Download</span>
8787

8888
<!-- Special hidden link that gets 'clicked' when the user exports journalctl logs -->
@@ -95,11 +95,11 @@ document.addEventListener("keydown", (e) => {
9595
/>
9696
</v-btn>
9797
<v-btn variant="text" color="white" @click="handleLogClear">
98-
<v-icon start class="menu-icon"> mdi-trash-can-outline </v-icon>
98+
<v-icon start class="menu-icon" size="large"> mdi-trash-can-outline </v-icon>
9999
<span class="menu-label">Clear Client Logs</span>
100100
</v-btn>
101101
<v-btn variant="text" color="white" @click="() => (useStateStore().showLogModal = false)">
102-
<v-icon start class="menu-icon"> mdi-close </v-icon>
102+
<v-icon start class="menu-icon" size="large"> mdi-close </v-icon>
103103
<span class="menu-label">Close</span>
104104
</v-btn>
105105
</v-col>
@@ -110,26 +110,31 @@ document.addEventListener("keydown", (e) => {
110110
<div class="dialog-data">
111111
<!-- Log view options -->
112112
<v-row no-gutters class="pt-4 pt-md-0" style="display: flex; justify-content: space-between">
113-
<v-col cols="12" md="7" style="display: flex; align-items: center">
113+
<v-col cols="12" md="7" style="display: flex; align-items: center" class="pr-3">
114114
<v-text-field
115115
v-model="searchQuery"
116116
density="compact"
117117
clearable
118118
hide-details="auto"
119119
prepend-icon="mdi-magnify"
120-
color="accent"
120+
color="primary"
121121
label="Search"
122122
variant="underlined"
123123
/>
124124
<input v-model="timeInput" type="time" step="1" class="text-white pl-3" />
125125
<v-btn icon variant="flat" @click="timeInput = undefined">
126-
<v-icon>mdi-close-circle-outline</v-icon>
126+
<v-icon>mdi-close</v-icon>
127127
</v-btn>
128128
</v-col>
129129
<v-col v-for="level in [0, 1, 2, 3]" :key="level" class="pr-3">
130130
<div class="pb-0 pt-0" style="display: flex; align-items: center; flex: min-content">
131131
{{ getLogLevelFromIndex(level)
132-
}}<v-switch v-model="selectedLogLevels[level]" class="pl-2" hide-details color="#ffd843"></v-switch>
132+
}}<v-switch
133+
v-model="selectedLogLevels[level]"
134+
class="pl-2"
135+
hide-details
136+
color="rgb(var(--v-theme-primary))"
137+
></v-switch>
133138
</div>
134139
</v-col>
135140
</v-row>
@@ -170,7 +175,7 @@ document.addEventListener("keydown", (e) => {
170175
/* Dialog data size - options */
171176
height: calc(100% - 56px);
172177
padding: 10px;
173-
background-color: #232c37 !important;
178+
background-color: rgb(var(--v-theme-logsBackground)) !important;
174179
border-radius: 5px;
175180
}
176181

photon-client/src/components/app/photon-sidebar.vue

Lines changed: 61 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { useSettingsStore } from "@/stores/settings/GeneralSettingsStore";
44
import { useStateStore } from "@/stores/StateStore";
55
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore";
66
import { useRoute } from "vue-router";
7-
import { useDisplay } from "vuetify";
7+
import { useDisplay, useTheme } from "vuetify";
8+
import { onBeforeMount } from "vue";
89
910
const compact = computed<boolean>({
1011
get: () => {
@@ -16,17 +17,32 @@ const compact = computed<boolean>({
1617
});
1718
const { mdAndUp } = useDisplay();
1819
20+
const theme = useTheme();
21+
22+
const changeTheme = () => {
23+
const newTheme = theme.global.name.value === "LightTheme" ? "DarkTheme" : "LightTheme";
24+
theme.global.name.value = newTheme;
25+
localStorage.setItem("theme", newTheme);
26+
};
27+
28+
onBeforeMount(() => {
29+
const storedTheme = localStorage.getItem("theme");
30+
if (storedTheme) {
31+
theme.global.name.value = storedTheme;
32+
}
33+
});
34+
1935
const renderCompact = computed<boolean>(() => compact.value || !mdAndUp.value);
2036
</script>
2137

2238
<template>
23-
<v-navigation-drawer permanent :rail="renderCompact" color="primary">
24-
<v-list nav>
39+
<v-navigation-drawer permanent :rail="renderCompact" color="sidebar">
40+
<v-list nav color="primary">
2541
<!-- List item for the heading; note that there are some tricks in setting padding and image width make things look right -->
2642
<v-list-item :class="renderCompact ? 'pr-0 pl-0' : ''" style="display: flex; justify-content: center">
2743
<template #prepend>
2844
<img v-if="!renderCompact" class="logo" src="@/assets/images/logoLarge.svg" alt="large logo" />
29-
<img v-else class="logo" src="@/assets/images/logoSmall.svg" alt="small logo" />
45+
<img v-else class="logo" src="@/assets/images/logoSmallTransparent.svg" alt="small logo" />
3046
</template>
3147
</v-list-item>
3248

@@ -67,20 +83,35 @@ const renderCompact = computed<boolean>(() => compact.value || !mdAndUp.value);
6783
:prepend-icon="`mdi-chevron-${compact || !mdAndUp ? 'right' : 'left'}`"
6884
@click="() => (compact = !compact)"
6985
>
70-
<v-list-item-title>Compact Mode</v-list-item-title>
86+
<v-list-item-title>Compact</v-list-item-title>
7187
</v-list-item>
7288
<v-list-item
73-
:prepend-icon="
74-
useSettingsStore().network.runNTServer
75-
? 'mdi-server'
76-
: useStateStore().ntConnectionStatus.connected
77-
? 'mdi-robot'
78-
: 'mdi-robot-off'
79-
"
89+
link
90+
:prepend-icon="theme.global.name.value === 'LightTheme' ? 'mdi-white-balance-sunny' : 'mdi-weather-night'"
91+
@click="changeTheme"
8092
>
93+
<v-list-item-title>Theme</v-list-item-title>
94+
</v-list-item>
95+
<v-list-item>
96+
<template #prepend>
97+
<v-icon
98+
:icon="
99+
useSettingsStore().network.runNTServer
100+
? 'mdi-server'
101+
: useStateStore().ntConnectionStatus.connected
102+
? 'mdi-robot'
103+
: 'mdi-robot-off'
104+
"
105+
:color="
106+
useSettingsStore().network.runNTServer || useStateStore().ntConnectionStatus.connected
107+
? '#00ff00'
108+
: '#ff0000'
109+
"
110+
/>
111+
</template>
81112
<v-list-item-title v-if="useSettingsStore().network.runNTServer" v-show="!renderCompact" class="text-wrap">
82113
NetworkTables server running for
83-
<span class="text-accent">{{ useStateStore().ntConnectionStatus.clients || 0 }}</span> clients
114+
<span class="text-primary">{{ useStateStore().ntConnectionStatus.clients || 0 }}</span> clients
84115
</v-list-item-title>
85116
<v-list-item-title
86117
v-else-if="useStateStore().ntConnectionStatus.connected && useStateStore().backendConnected"
@@ -89,9 +120,7 @@ const renderCompact = computed<boolean>(() => compact.value || !mdAndUp.value);
89120
style="flex-direction: column; display: flex"
90121
>
91122
NetworkTables Server Connected!
92-
<span class="text-accent">
93-
{{ useStateStore().ntConnectionStatus.address }}
94-
</span>
123+
<span class="text-primary"> {{ useStateStore().ntConnectionStatus.address }} </span>
95124
</v-list-item-title>
96125
<v-list-item-title
97126
v-else
@@ -102,10 +131,15 @@ const renderCompact = computed<boolean>(() => compact.value || !mdAndUp.value);
102131
Not connected to NetworkTables Server!
103132
</v-list-item-title>
104133
</v-list-item>
105-
106-
<v-list-item :prepend-icon="useStateStore().backendConnected ? 'mdi-server-network' : 'mdi-server-network-off'">
134+
<v-list-item>
135+
<template #prepend>
136+
<v-icon
137+
:icon="useStateStore().backendConnected ? 'mdi-server-network' : 'mdi-server-network-off'"
138+
:color="useStateStore().backendConnected ? '#00ff00' : '#ff0000'"
139+
/>
140+
</template>
107141
<v-list-item-title v-show="!renderCompact" class="text-wrap">
108-
{{ useStateStore().backendConnected ? "Backend connected" : "Trying to connect to backend" }}
142+
{{ useStateStore().backendConnected ? "Backend connected" : "Trying to connect to backend..." }}
109143
</v-list-item-title>
110144
</v-list-item>
111145
</v-list>
@@ -114,6 +148,14 @@ const renderCompact = computed<boolean>(() => compact.value || !mdAndUp.value);
114148
</template>
115149

116150
<style scoped>
151+
.v-navigation-drawer {
152+
border: none;
153+
}
154+
155+
.v-navigation-drawer--rail {
156+
border: none;
157+
}
158+
117159
.v-list-item-title {
118160
font-size: 1rem !important;
119161
line-height: 1.2rem !important;

0 commit comments

Comments
 (0)