mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-07-22 12:36:08 +00:00
feat: add toast
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
--header-border-color: lightgray;
|
--header-border-color: lightgray;
|
||||||
--header-text-color: black;
|
--header-text-color: black;
|
||||||
--menu-background-color: white;
|
--menu-background-color: white;
|
||||||
|
--background-color: white;
|
||||||
--menu-border-color: lightgray;
|
--menu-border-color: lightgray;
|
||||||
--menu-selected-background-color: rgba(208, 250, 255, 0.659);
|
--menu-selected-background-color: rgba(208, 250, 255, 0.659);
|
||||||
--menu-text-color: black;
|
--menu-text-color: black;
|
||||||
@@ -22,6 +23,7 @@
|
|||||||
--header-border-color: #555;
|
--header-border-color: #555;
|
||||||
--header-text-color: white;
|
--header-text-color: white;
|
||||||
--menu-background-color: #333;
|
--menu-background-color: #333;
|
||||||
|
--background-color: #121212;
|
||||||
--menu-border-color: #555;
|
--menu-border-color: #555;
|
||||||
--menu-selected-background-color: rgba(255, 255, 255, 0.1);
|
--menu-selected-background-color: rgba(255, 255, 255, 0.1);
|
||||||
--menu-text-color: white;
|
--menu-text-color: white;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
|
import { toast } from '../main'
|
||||||
|
|
||||||
export const ThemeMode = {
|
export const ThemeMode = {
|
||||||
SYSTEM: 'system',
|
SYSTEM: 'system',
|
||||||
@@ -40,6 +41,13 @@ export function cycleTheme() {
|
|||||||
const modes = [ThemeMode.SYSTEM, ThemeMode.LIGHT, ThemeMode.DARK]
|
const modes = [ThemeMode.SYSTEM, ThemeMode.LIGHT, ThemeMode.DARK]
|
||||||
const index = modes.indexOf(themeState.mode)
|
const index = modes.indexOf(themeState.mode)
|
||||||
const next = modes[(index + 1) % modes.length]
|
const next = modes[(index + 1) % modes.length]
|
||||||
|
if (next === ThemeMode.SYSTEM) {
|
||||||
|
toast.success('💻 已经切换到系统主题')
|
||||||
|
} else if (next === ThemeMode.LIGHT) {
|
||||||
|
toast.success('🌞 已经切换到明亮主题')
|
||||||
|
} else {
|
||||||
|
toast.success('🌙 已经切换到暗色主题')
|
||||||
|
}
|
||||||
setTheme(next)
|
setTheme(next)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ export default {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.home-page {
|
.home-page {
|
||||||
|
background-color: var(--background-color);
|
||||||
height: calc(100vh - var(--header-height));
|
height: calc(100vh - var(--header-height));
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -244,6 +244,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
.post-page-container {
|
.post-page-container {
|
||||||
|
background-color: var(--background-color);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
height: calc(100vh - var(--header-height));
|
height: calc(100vh - var(--header-height));
|
||||||
|
|||||||
Reference in New Issue
Block a user