-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.vue
81 lines (76 loc) · 1.5 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<script>
//import test from "../src/components/say"
import {
enable as enableDarkMode,
disable as disableDarkMode,
auto as followSystemColorScheme,
exportGeneratedCSS as collectCSS,
} from 'darkreader';
export default {
name: "App",
data(){
return {
darkt:null
}
},
methods:{
dark(){
enableDarkMode({
brightness: 100,
contrast: 90,
sepia: 10
});
},
closedark(){
disableDarkMode();
}
},
computed:{
black(){
return this.$root.blackmode
}
},
watch:{
black(val){
console.log('watch blackmode : '+val)
if(val){
this.dark()
}else{
this.closedark()
}
localStorage.warmagame_black=val
}
},
beforeCreate(){
this.$root.blackmode=eval(localStorage.warmagame_black)
console.log(this.$root.blackmode)
},
mounted(){
if(this.$root.blackmode){
this.dark()
}else{
this.closedark()
}
}
};
</script>
<style>
#app {
position:fixed;
left: 0px;
top:0px;
height: 100%;
width: 100%;
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
"Microsoft YaHei", "微软雅黑", Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
overflow: auto;
}
</style>