mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-04-20 23:46:39 -04:00
wip, split dark theme style by .dark and store light theme to normal
This commit is contained in:
parent
8d60568fd0
commit
f345a8f33a
@ -1,46 +1,16 @@
|
||||
@import "vars.scss";
|
||||
@import "node_modules/bootstrap/scss/bootstrap";
|
||||
|
||||
html,
|
||||
body,
|
||||
input,
|
||||
.modal-content {
|
||||
background: var(--page-background);
|
||||
color: var(--main-font-color);
|
||||
}
|
||||
a,
|
||||
.table,
|
||||
.nav-link {
|
||||
color: var(--main-font-color);
|
||||
}
|
||||
.nav-pills .nav-link.active,
|
||||
.nav-pills .show > .nav-link {
|
||||
color: #0a0a0a;
|
||||
}
|
||||
|
||||
.nav-link:hover,
|
||||
.nav-link:focus {
|
||||
color: #5cdd8b;
|
||||
}
|
||||
|
||||
.form-control,
|
||||
.form-control:focus,
|
||||
.form-select,
|
||||
.form-select:focus {
|
||||
color: var(--main-font-color);
|
||||
background-color: var(--background-4);
|
||||
}
|
||||
|
||||
#app {
|
||||
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
|
||||
segoe ui, Roboto, helvetica neue, Arial, noto sans, sans-serif,
|
||||
apple color emoji, segoe ui emoji, segoe ui symbol, noto color emoji;
|
||||
font-family: ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol,noto color emoji;
|
||||
}
|
||||
|
||||
.shadow-box {
|
||||
overflow: hidden;
|
||||
box-shadow: 0 15px 70px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 15px 70px rgba(0, 0, 0, .1);
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
|
||||
&.big-padding {
|
||||
padding: 20px;
|
||||
}
|
||||
@ -52,13 +22,10 @@ a,
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
color: #0a0a0a;
|
||||
color: white;
|
||||
|
||||
&:hover,
|
||||
&:active,
|
||||
&:focus,
|
||||
&.active {
|
||||
color: #0a0a0a;
|
||||
&:hover, &:active, &:focus, &.active {
|
||||
color: white;
|
||||
background-color: $highlight;
|
||||
border-color: $highlight;
|
||||
}
|
||||
@ -69,8 +36,49 @@ a,
|
||||
backdrop-filter: blur(3px);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
// Dark Theme override here
|
||||
.dark {
|
||||
a:hover {
|
||||
color: #7ce8a4;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
color: #0a0a0a;
|
||||
|
||||
&:hover, &:active, &:focus, &.active {
|
||||
color: #0a0a0a;
|
||||
background-color: $highlight;
|
||||
border-color: $highlight;
|
||||
}
|
||||
}
|
||||
|
||||
html,
|
||||
body,
|
||||
input,
|
||||
.modal-content {
|
||||
background: var(--page-background);
|
||||
color: var(--main-font-color);
|
||||
}
|
||||
a,
|
||||
.table,
|
||||
.nav-link {
|
||||
color: var(--main-font-color);
|
||||
}
|
||||
.nav-pills .nav-link.active,
|
||||
.nav-pills .show > .nav-link {
|
||||
color: #0a0a0a;
|
||||
}
|
||||
|
||||
.nav-link:hover,
|
||||
.nav-link:focus {
|
||||
color: #5cdd8b;
|
||||
}
|
||||
|
||||
.form-control,
|
||||
.form-control:focus,
|
||||
.form-select,
|
||||
.form-select:focus {
|
||||
color: var(--main-font-color);
|
||||
background-color: var(--background-4);
|
||||
}
|
||||
}
|
||||
|
@ -1,24 +1,17 @@
|
||||
$primary: #5cdd8b;
|
||||
$danger: #dc3545;
|
||||
$warning: #dca235;
|
||||
$primary: #5CDD8B;
|
||||
$danger: #DC3545;
|
||||
$warning: #f8a306;
|
||||
$link-color: #111;
|
||||
$border-radius: .25rem;
|
||||
$border-radius: 50rem;
|
||||
|
||||
$highlight: #7ce8a4;
|
||||
$highlight-white: #e7faec;
|
||||
|
||||
:root {
|
||||
color-scheme: light dark;
|
||||
--page-background: #fafafa;
|
||||
--background-secondary: #d0d3d5;
|
||||
--background-4: #d0d3d5;
|
||||
--background-ternary: #8e8e8e;
|
||||
--background-sidebar-active: #e4e4e4;
|
||||
--background-navbar: #FFF;
|
||||
--main-font-color: #212529;
|
||||
}
|
||||
.dark {
|
||||
$primary: #5cdd8b;
|
||||
$danger: #dc3545;
|
||||
$warning: #dca235;
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--page-background: #0a0a0a;
|
||||
--background-secondary: #656565;
|
||||
|
@ -133,7 +133,7 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
@import "../assets/vars.scss";
|
||||
|
||||
.wrap {
|
||||
@ -149,7 +149,11 @@ export default {
|
||||
border-radius: 50rem;
|
||||
|
||||
&.empty {
|
||||
background-color: #d0d3d5;
|
||||
background-color: aliceblue;
|
||||
|
||||
.dark & {
|
||||
background-color: #d0d3d5;
|
||||
}
|
||||
}
|
||||
|
||||
&.down {
|
||||
@ -168,8 +172,10 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.hp-bar-big .beat.empty{
|
||||
background-color: #848484;
|
||||
.dark {
|
||||
.hp-bar-big .beat.empty{
|
||||
background-color: #848484;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -233,17 +233,17 @@
|
||||
<template v-if="notification.type === 'pushy'">
|
||||
<div class="mb-3">
|
||||
<label for="pushy-app-token" class="form-label">API_KEY</label>
|
||||
<input type="text" class="form-control" id="pushy-app-token" required v-model="notification.pushyAPIKey">
|
||||
<input id="pushy-app-token" v-model="notification.pushyAPIKey" type="text" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="pushy-user-key" class="form-label">USER_TOKEN</label>
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" class="form-control" id="pushy-user-key" required v-model="notification.pushyToken">
|
||||
<input id="pushy-user-key" v-model="notification.pushyToken" type="text" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<p style="margin-top: 8px;">
|
||||
More info on: <a href="https://pushy.me/docs/api/send-notifications" target="_blank">https://pushy.me/docs/api/send-notifications</a>
|
||||
More info on: <a href="https://pushy.me/docs/api/send-notifications" target="_blank">https://pushy.me/docs/api/send-notifications</a>
|
||||
</p>
|
||||
</template>
|
||||
|
||||
@ -334,7 +334,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button v-if="id" type="button" class="btn btn-danger" :disabled="processing" @click="deleteConfirm">
|
||||
@ -509,17 +508,19 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.modal-dialog .form-text, .modal-dialog p{
|
||||
color: var(--main-font-color);
|
||||
}
|
||||
.modal-content{
|
||||
border: 1px solid var(--main-font-color);
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
<style lang="scss" scoped>
|
||||
.dark {
|
||||
.modal-dialog .form-text, .modal-dialog p{
|
||||
color: var(--main-font-color);
|
||||
}
|
||||
|
||||
.modal-content{
|
||||
border: 1px solid var(--main-font-color);
|
||||
}
|
||||
|
||||
.btn-close{
|
||||
background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23FFF'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,76 +1,78 @@
|
||||
<template>
|
||||
<div v-if="! $root.socket.connected && ! $root.socket.firstConnect" class="lost-connection">
|
||||
<div class="container-fluid">
|
||||
{{ $root.connectionErrorMsg }}
|
||||
<div :class="$root.theme">
|
||||
<div v-if="! $root.socket.connected && ! $root.socket.firstConnect" class="lost-connection">
|
||||
<div class="container-fluid">
|
||||
{{ $root.connectionErrorMsg }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Desktop header -->
|
||||
<header v-if="! $root.isMobile" class="d-flex flex-wrap justify-content-center py-3 mb-3 border-bottom">
|
||||
<router-link to="/dashboard" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-dark text-decoration-none">
|
||||
<object class="bi me-2 ms-4" width="40" height="40" data="/icon.svg" alt="Logo" />
|
||||
<span class="fs-4 title">Uptime Kuma</span>
|
||||
</router-link>
|
||||
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item">
|
||||
<router-link to="/dashboard" class="nav-link">
|
||||
<font-awesome-icon icon="tachometer-alt" /> Dashboard
|
||||
</router-link>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<router-link to="/settings" class="nav-link">
|
||||
<font-awesome-icon icon="cog" /> Settings
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</header>
|
||||
|
||||
<!-- Mobile header -->
|
||||
<header v-else class="d-flex flex-wrap justify-content-center mt-3 mb-3">
|
||||
<router-link to="/dashboard" class="d-flex align-items-center text-dark text-decoration-none">
|
||||
<object class="bi" width="40" height="40" data="/icon.svg" />
|
||||
<span class="fs-4 title ms-2">Uptime Kuma</span>
|
||||
</router-link>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<!-- Add :key to disable vue router re-use the same component -->
|
||||
<router-view v-if="$root.loggedIn" :key="$route.fullPath" />
|
||||
<Login v-if="! $root.loggedIn && $root.allowLoginDialog" />
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<div class="container-fluid">
|
||||
Uptime Kuma -
|
||||
Version: {{ $root.info.version }} -
|
||||
<a href="https://github.com/louislam/uptime-kuma/releases" target="_blank" rel="noopener">Check Update On GitHub</a>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Mobile Only -->
|
||||
<div v-if="$root.isMobile" style="width: 100%;height: 60px;" />
|
||||
<nav v-if="$root.isMobile" class="bottom-nav">
|
||||
<router-link to="/dashboard" class="nav-link" @click="$root.cancelActiveList">
|
||||
<div><font-awesome-icon icon="tachometer-alt" /></div>
|
||||
Dashboard
|
||||
</router-link>
|
||||
|
||||
<a href="#" :class=" { 'router-link-exact-active' : $root.showListMobile } " @click="$root.showListMobile = ! $root.showListMobile">
|
||||
<div><font-awesome-icon icon="list" /></div>
|
||||
List
|
||||
</a>
|
||||
|
||||
<router-link to="/add" class="nav-link" @click="$root.cancelActiveList">
|
||||
<div><font-awesome-icon icon="plus" /></div>
|
||||
Add
|
||||
</router-link>
|
||||
|
||||
<router-link to="/settings" class="nav-link" @click="$root.cancelActiveList">
|
||||
<div><font-awesome-icon icon="cog" /></div>
|
||||
Settings
|
||||
</router-link>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<!-- Desktop header -->
|
||||
<header v-if="! $root.isMobile" class="d-flex flex-wrap justify-content-center py-3 mb-3 border-bottom">
|
||||
<router-link to="/dashboard" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-decoration-none">
|
||||
<object class="bi me-2 ms-4" width="40" height="40" data="/icon.svg" alt="Logo" />
|
||||
<span class="fs-4 title">Uptime Kuma</span>
|
||||
</router-link>
|
||||
|
||||
<ul class="nav nav-pills">
|
||||
<li class="nav-item">
|
||||
<router-link to="/dashboard" class="nav-link">
|
||||
<font-awesome-icon icon="tachometer-alt" /> Dashboard
|
||||
</router-link>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<router-link to="/settings" class="nav-link">
|
||||
<font-awesome-icon icon="cog" /> Settings
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</header>
|
||||
|
||||
<!-- Mobile header -->
|
||||
<header v-else class="d-flex flex-wrap justify-content-center mt-3 mb-3">
|
||||
<router-link to="/dashboard" class="d-flex align-items-center text-decoration-none">
|
||||
<object class="bi" width="40" height="40" data="/icon.svg" />
|
||||
<span class="fs-4 title ms-2">Uptime Kuma</span>
|
||||
</router-link>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<!-- Add :key to disable vue router re-use the same component -->
|
||||
<router-view v-if="$root.loggedIn" :key="$route.fullPath" />
|
||||
<Login v-if="! $root.loggedIn && $root.allowLoginDialog" />
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<div class="container-fluid">
|
||||
Uptime Kuma -
|
||||
Version: {{ $root.info.version }} -
|
||||
<a href="https://github.com/louislam/uptime-kuma/releases" target="_blank" rel="noopener">Check Update On GitHub</a>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Mobile Only -->
|
||||
<div v-if="$root.isMobile" style="width: 100%;height: 60px;" />
|
||||
<nav v-if="$root.isMobile" class="bottom-nav">
|
||||
<router-link to="/dashboard" class="nav-link" @click="$root.cancelActiveList">
|
||||
<div><font-awesome-icon icon="tachometer-alt" /></div>
|
||||
Dashboard
|
||||
</router-link>
|
||||
|
||||
<a href="#" :class=" { 'router-link-exact-active' : $root.showListMobile } " @click="$root.showListMobile = ! $root.showListMobile">
|
||||
<div><font-awesome-icon icon="list" /></div>
|
||||
List
|
||||
</a>
|
||||
|
||||
<router-link to="/add" class="nav-link" @click="$root.cancelActiveList">
|
||||
<div><font-awesome-icon icon="plus" /></div>
|
||||
Add
|
||||
</router-link>
|
||||
|
||||
<router-link to="/settings" class="nav-link" @click="$root.cancelActiveList">
|
||||
<div><font-awesome-icon icon="cog" /></div>
|
||||
Settings
|
||||
</router-link>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -103,7 +105,7 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
@import "../assets/vars.scss";
|
||||
|
||||
.bottom-nav {
|
||||
@ -113,7 +115,6 @@ export default {
|
||||
height: 60px;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
background-color: var(--background-navbar);
|
||||
box-shadow: 0 15px 47px 0 rgba(0, 0, 0, 0.05), 0 5px 14px 0 rgba(0, 0, 0, 0.05);
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
@ -141,6 +142,12 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.dark {
|
||||
.bottom-nav {
|
||||
background-color: var(--background-navbar);
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import { FontAwesomeIcon } from "./icon.js";
|
||||
import EmptyLayout from "./layouts/EmptyLayout.vue";
|
||||
import Layout from "./layouts/Layout.vue";
|
||||
import socket from "./mixins/socket";
|
||||
import theme from "./mixins/theme";
|
||||
import Dashboard from "./pages/Dashboard.vue";
|
||||
import DashboardHome from "./pages/DashboardHome.vue";
|
||||
import Details from "./pages/Details.vue";
|
||||
@ -76,6 +77,7 @@ const router = createRouter({
|
||||
const app = createApp({
|
||||
mixins: [
|
||||
socket,
|
||||
theme
|
||||
],
|
||||
render: () => h(App),
|
||||
})
|
||||
|
@ -29,7 +29,7 @@ export default {
|
||||
notificationList: [],
|
||||
windowWidth: window.innerWidth,
|
||||
showListMobile: false,
|
||||
connectionErrorMsg: "Cannot connect to the socket server. Reconnecting..."
|
||||
connectionErrorMsg: "Cannot connect to the socket server. Reconnecting...",
|
||||
}
|
||||
},
|
||||
|
||||
|
33
src/mixins/theme.js
Normal file
33
src/mixins/theme.js
Normal file
@ -0,0 +1,33 @@
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
system: (window.matchMedia("(prefers-color-scheme: dark)")) ? "dark" : "light",
|
||||
userTheme: localStorage.theme,
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
// Default Light
|
||||
if (! this.userTheme) {
|
||||
this.userTheme = "light";
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
theme() {
|
||||
if (this.userTheme === "auto") {
|
||||
return this.system;
|
||||
}
|
||||
return this.userTheme;
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
changeTheme(name) {
|
||||
localStorage.theme = name;
|
||||
this.userTheme = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
@import "../assets/vars.scss";
|
||||
|
||||
.container-fluid {
|
||||
@ -119,11 +119,11 @@ export default {
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: var(--background-4);
|
||||
background-color: $highlight-white;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: var(--background-4);
|
||||
background-color: #cdf8f4;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -133,4 +133,18 @@ export default {
|
||||
padding-right: 5px !important;
|
||||
}
|
||||
|
||||
.dark {
|
||||
.list {
|
||||
.item {
|
||||
&:hover {
|
||||
background-color: var(--background-4);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: var(--background-4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -169,11 +169,11 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
@import "../assets/vars";
|
||||
|
||||
.num {
|
||||
font-size: 1rem;
|
||||
font-size: 30px;
|
||||
color: $primary;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
|
@ -20,6 +20,19 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="btn-group" role="group" aria-label="Basic checkbox toggle button group">
|
||||
<input id="btncheck1" type="radio" class="btn-check" name="theme" autocomplete="off">
|
||||
<label class="btn btn-outline-primary" for="btncheck1">Light</label>
|
||||
|
||||
<input id="btncheck2" type="radio" class="btn-check" name="theme" autocomplete="off">
|
||||
<label class="btn btn-outline-primary" for="btncheck2">Dark</label>
|
||||
|
||||
<input id="btncheck3" type="radio" class="btn-check" name="theme" autocomplete="off">
|
||||
<label class="btn btn-outline-primary" for="btncheck3">Auto</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button class="btn btn-primary" type="submit">
|
||||
Save
|
||||
@ -201,12 +214,15 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style lang="scss" scoped>
|
||||
.shadow-box {
|
||||
padding: 20px;
|
||||
}
|
||||
.list-group-item{
|
||||
background-color: var(--background-4);
|
||||
color: var(--main-font-color);
|
||||
|
||||
.dark {
|
||||
.list-group-item {
|
||||
background-color: var(--background-4);
|
||||
color: var(--main-font-color);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Loading…
x
Reference in New Issue
Block a user