-
Notifications
You must be signed in to change notification settings - Fork 0
/
BMS.html
608 lines (580 loc) · 21.6 KB
/
BMS.html
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/css/mdui.min.css" />
<link rel="stylesheet" href="./mdui.css" />
</head>
<body class="mdui-appbar-with-toolbar mdui-appbar-with-tab mdui-theme-accent-blue">
<div id="app">
<!-- mdui appbar+tabbar -->
<div class="mdui-appbar mdui-appbar-fixed mdui-color-white mdui-appbar-inset">
<div class="mdui-toolbar">
<a href="javascript:;" class="mdui-btn mdui-btn-icon" mdui-menu="{target: '#left-drawer'}">
<i class="mdui-icon material-icons">menu</i>
</a>
<a href="javascript:;" class="mdui-typo-headline mdui-hidden-xs">BJWeather</a>
<a href="javascript:;" class="mdui-typo-title">北京气象台</a>
<div class="mdui-toolbar-spacer"></div>
<a href="javascript:;" class="mdui-btn mdui-btn-icon mdui-hidden-xs"
mdui-dialog="{target: '#warningDialog'}" v-if="this.warningList.length != 0">
<i class="mdui-icon material-icons">error_outline</i>
</a>
<div class="mdui-chip" :style="{flexShrink:0}">
<span class="mdui-chip-title" :class="{needUpdate:refreshTime.needUpdate}"
id="refreshDisplay">{{refreshTime.display}}</span>
</div>
<a href="javascript:;" class="mdui-btn mdui-btn-icon">
<i class="mdui-icon material-icons" onclick="location.reload()">refresh</i>
</a>
<a href="javascript:;" class="mdui-btn mdui-btn-icon" mdui-menu="{target: '#exmenu'}">
<i class="mdui-icon material-icons">more_vert</i>
</a>
<ul class="mdui-menu" id="exmenu">
<li class="mdui-menu-item mdui-hidden-sm-up" mdui-dialog="{target: '#warningDialog'}"
v-if="this.warningList.length != 0">
<a href="javascript:;" class="mdui-ripple">
<i class="mdui-menu-item-icon mdui-icon material-icons">error_outline</i>
预警信号
</a>
</li>
<li class="mdui-divider"></li>
<li class="mdui-menu-item" mdui-dialog="{target: '#settingsDialog'}">
<a href="javascript:;" class="mdui-ripple">
<i class=" mdui-menu-item-icon mdui-icon material-icons">settings</i>
设置
</a>
</li>
<li class="mdui-menu-item" mdui-dialog="{target: '#aboutDialog'}">
<a href="javascript:;" class="mdui-ripple">
<i class=" mdui-menu-item-icon mdui-icon material-icons">info_outline</i>
关于
</a>
</li>
</ul>
<ul class="mdui-menu" id="left-drawer">
<li class="mdui-menu-item mdui-ripple mdui-list-item-active">
<a class="mdui-menu-item-content" href="./BMS.html">
<i class="mdui-menu-item-icon mdui-icon material-icons">move_to_inbox</i>
北京气象台
</a>
</li>
<li class="mdui-menu-item mdui-ripple">
<a class="mdui-menu-item-content" href="./NMC.html">
<i class="mdui-menu-item-icon mdui-icon material-icons">move_to_inbox</i>
中央气象台
</a>
</li>
<li class="mdui-menu-item mdui-ripple">
<a class="mdui-menu-item-content" href="./CMA.html">
<i class="mdui-menu-item-icon mdui-icon material-icons">move_to_inbox</i>
中国气象局
</a>
</li>
<li class="mdui-menu-item mdui-ripple">
<a class="mdui-menu-item-content" href="./CMDC.html">
<i class="mdui-menu-item-icon mdui-icon material-icons">move_to_inbox</i>
国家气象信息中心
</a>
</li>
<li class="mdui-menu-item mdui-ripple">
<a class="mdui-menu-item-content" href="./BM.html">
<i class="mdui-menu-item-icon mdui-icon material-icons">move_to_inbox</i>
北京气象
</a>
</li>
<li class="mdui-menu-item mdui-ripple">
<a class="mdui-menu-item-content" href="./weatherol.html">
<i class="mdui-menu-item-icon mdui-icon material-icons">move_to_inbox</i>
北京气象在线
</a>
</li>
<li class="mdui-divider"></li>
<li class="mdui-menu-item mdui-ripple">
<a class="mdui-menu-item-content" href="./12379.html">
<i class="mdui-menu-item-icon mdui-icon material-icons">move_to_inbox</i>
国家预警信息发布中心
</a>
</li>
</ul>
</div>
<div class="mdui-tab mdui-tab-centered" mdui-tab>
<a href="#tab1" class="mdui-ripple">
<label>当前</label>
</a>
<a href="#tab2" class="mdui-ripple">
<label>预报</label>
</a>
<a href="#tab3" class="mdui-ripple">
<label>媒体</label>
</a>
</div>
</div>
<div class="mdui-progress" v-if="isLoading">
<div class="mdui-progress-indeterminate"></div>
</div>
<!-- currrent -->
<div id="tab1" class="mdui-p-a-2">
<div class="mdui-container">
<select class="mdui-select" id="ddd" v-model="distrect" @change="getDistrectInfo()">
<option :value=item.name v-for="(item,index) in distrectData.value">{{item.name}}</option>
</select>
<h2>当前天气(发布时间{{current.datetime}}):</h2>
<ul>
<li v-show="this.current.weather">天气:{{current.weather}}</li>
<li v-show="current.isRainning">降水量:{{current.jiangshuiliang}}mm</li>
<li>气温:{{current.temperature}}℃</li>
<li>风速:{{current.windspeed}}m/s</li>
<li>风向:{{current.winddirection}}</li>
<li>气压:{{current.airpressure}}hPa</li>
<li>相对湿度:{{current.humidity}}%</li>
</ul>
</div>
</div>
<!-- 预报 -->
<div id="tab2" class="mdui-p-a-2">
<div class="mdui-container">
<h2>3小时预报(发布时间{{threeHours.datetime}}):</h2>
<div class="mdui-table-fluid tExtra">
<table class="mdui-table mdui-table-hoverable">
<thead>
<tr>
<th>时间</th>
<th>天气</th>
<th>气温</th>
<th>风力</th>
<th>风向</th>
</tr>
</thead>
<tbody>
<tr v-for="(item,index) in threeHours.value" :key="item.hour">
<td>{{index}}</td>
<td>{{item.wp}}</td>
<td>{{item.t}}℃</td>
<td>{{item.wspeed}}</td>
<td>{{item.wdir}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="mdui-container">
<h2>36小时预报(发布时间{{thirtysixHoursDateTime}}):</h2>
<div class="mdui-table-fluid tExtra">
<table class="mdui-table mdui-table-hoverable">
<thead>
<tr>
<th>时间</th>
<th>天气</th>
<th>气温</th>
<th>风力</th>
<th>风向</th>
<th>相对湿度</th>
</tr>
</thead>
<tbody>
<tr v-for="(item,index) in thirtysixHours" :key="item.lv">
<td>{{item.date}}</td>
<td>{{item.weather}}</td>
<td>{{item.plain_temp}}</td>
<td>{{item.windspeed}}</td>
<td>{{item.wind}}</td>
<td>{{item.other}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="mdui-container">
<h2>7天预报:</h2>
<div class="mdui-table-fluid tExtra">
<table class="mdui-table mdui-table-hoverable">
<thead>
<tr>
<th>日期</th>
<th>时段</th>
<th>天气</th>
<th>气温</th>
<th>风力</th>
<th>风向</th>
</tr>
</thead>
<tbody>
<tr v-for="(item,index) in sevenDaysData" :key="index">
<td>{{item.time}}</td>
<td>{{item.Nighttime}}</td>
<td>{{item.condition}}</td>
<td>{{item.temperature}}℃</td>
<td>{{item.windscale}}</td>
<td>{{item.winddirection}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- radar+云图 -->
<div id="tab3" class="mdui-p-a-2">
<div class="mdui-container">
<div class=" mdui-grid-list mdui-row-md-2 mdui-row-xs-1">
<div class="mdui-col">
<div class="mdui-card">
<div class="mdui-card-media">
<img class="mdui-img-fluid" :src="cloudData.fileName" />
<div class="mdui-card-media-covered">
<div class="mdui-card-primary">
<div class="mdui-card-primary-title">云图</div>
<div class="mdui-card-primary-subtitle">发布时间{{cloudData.datatime}}</div>
</div>
</div>
</div>
</div>
</div>
<div class="mdui-col">
<div class="mdui-card">
<div class="mdui-card-media">
<img class="mdui-img-fluid" :src="radar.img" />
<div class="mdui-card-media-covered">
<div class="mdui-card-primary">
<div class="mdui-card-primary-title">{{radar.title}}</div>
<div class="mdui-card-primary-subtitle">发布时间{{radar.datetime}}</div>
</div>
</div>
</div>
<div class="mdui-card-actions">
<button class="mdui-btn mdui-color-theme-accent mdui-ripple mdui-btn-icon"
@click="radarAutoPlay()">
<i class="mdui-icon material-icons" v-show="!this.isAutoPlay">play_arrow</i>
<i class="mdui-icon material-icons" v-show="this.isAutoPlay">pause</i>
</button>
<button class="mdui-btn mdui-color-theme-accent mdui-ripple mdui-btn-icon"
v-show="radarSelecter!=1" @click="radarSelecter--,reloadRadar()">
<i class="mdui-icon material-icons">arrow_back</i>
</button>
<button class="mdui-btn mdui-color-theme-accent mdui-ripple mdui-btn-icon"
v-show="radarSelecter!=500" @click="radarSelecter++,reloadRadar()">
<i class="mdui-icon material-icons">arrow_forward</i>
</button>
<label class="mdui-slider mdui-slider-discrete">
<input type="range" step="1" min="1" max="500" v-model="radarSelecter"
@change="reloadRadar()" />
</label>
</div>
</div>
</div>
</div>
<div>
<select class="mdui-select" id="ddd2" v-model="videoId" @change="getVideo()">
<option :value=item.videoid v-for="(item,index) in videoData" :key="item.videoid">
{{item.videoname}}</option>
</select>
<video :src="video.src" controls class="mdui-video-fluid"></video>
</div>
</div>
</div>
<!-- 预警 -->
<div class="mdui-dialog" id="warningDialog">
<div class="mdui-dialog-content">
<div class="mdui-dialog-title">预警信号</div>
<ul>
<li v-for="(item, index) in warningData" :key="item.id">
<div class="mdui-chip">
<span class="mdui-chip-icon" :style="{backgroundColor:item.signdegree}">
<i class="mdui-icon material-icons">error_outline</i>
</span>
<span class="mdui-chip-title">{{item.mainbody.signclass}}{{item.mainbody.signrank}}预警</span>
</div>
<br>{{item.mainbody.pubtime}}<br>{{item.mainbody.pubbody}}
</li>
</ul>
</div>
<div class="mdui-dialog-actions">
<button class="mdui-btn mdui-ripple" mdui-dialog-confirm>ok</button>
</div>
</div>
<!-- 设置 -->
<div class="mdui-dialog" id="settingsDialog">
<div class="mdui-dialog-content">
<div class="mdui-dialog-title">设置</div>
自动深色模式
<label class="mdui-switch mdui-float-right">
<input type="checkbox" v-model="isAutoDark" onclick="app.autoDark()" />
<i class="mdui-switch-icon"></i>
</label>
</div>
<div class="mdui-dialog-actions">
<button class="mdui-btn mdui-ripple" mdui-dialog-confirm>ok</button>
</div>
</div>
<div class="mdui-dialog" id="aboutDialog">
<div class="mdui-dialog-content">
<div class="mdui-dialog-title">关于</div>
</div>
<div class="mdui-dialog-actions">
<button class="mdui-btn mdui-ripple" mdui-dialog-confirm>ok</button>
</div>
</div>
</div>
<script src="https://unpkg.com/[email protected]/dist/js/mdui.min.js"></script>
</body>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/quasar.umd.js"></script> -->
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
const app = new Vue({
el: "#app",
data: {
current: {},
radar: {},
threeHours: {},
thirtysixHours: {},
distrectData: {},
distrect: "市中心",
forecastData: {},
thirtysixHoursDateTime: "",
refreshTime: {
display: "刚刚刷新",
min: 0,
secound: 0,
needUpdate: false,
startTime: 0,
},
radarSelecter: 500,
radarData: {},
radarInterval: "",
warningList: [],
warningData: [],
isAutoPlay: false,
sevenDaysData: [],
isLoading: true,
isAutoDark: false,
cloudData: {},
video: {},
videoId: "",
videoData: {},
},
async created() {
if (localStorage.isAutoDark == "true") {
this.isAutoDark = true;
document.body.classList.add("mdui-theme-layout-auto");
document.querySelector(".mdui-appbar").classList.add("autoDarkAppBar");
}
const forecastRes = await axios.get("http://101.200.145.109:8087/weather/scene/data.do?callback=&id=11");
console.log("天气预报:", forecastRes);
this.forecastData = forecastRes.data.substr(1, forecastRes.data.length - 2);
this.forecastData = JSON.parse(this.forecastData);
//当前天气
const distrectRes = await axios.get("http://101.200.145.109:8087/weather/scene/data.do?callback=&id=8");
this.distrectData = distrectRes.data.substr(1, distrectRes.data.length - 2);
this.distrectData = JSON.parse(this.distrectData);
this.$nextTick(function () {
console.log('v-for渲染已经完成')
var inst = new mdui.Select('#ddd');
inst.handleUpdate();
})
this.getDistrectInfo();
console.log(this.distrectData);
//3小时
this.threeHours = JSON.parse(this.forecastData.ThreeHours);
console.log(this.threeHours);
//36小时
let temp = JSON.parse(this.forecastData.thirtysix);
this.thirtysixHoursDateTime = temp.datetime;
for (item in temp.value) {
this.thirtysixHours[temp.value[item].lv] = temp.value[item];
}
console.log(this.thirtysixHours);
//7d
const sevenDaysRes = await axios.get("http://101.200.145.109:8087/weather/scene/data.do?callback=&id=10");
this.sevenDaysData = JSON.parse(sevenDaysRes.data.substr(1, sevenDaysRes.data.length - 2));
for (item in this.sevenDaysData) {
if (this.sevenDaysData[item].Nighttime == "夜晚") {
this.sevenDaysData[item].time = "";
}
}
console.log("7d:", this.sevenDaysData);
//雷达图
const radarRes = await axios.get("http://101.200.145.109:8087/weather/scene/data.do?callback=&id=12");
console.log("雷达图:", radarRes);
this.radarData = radarRes.data.substr(1, radarRes.data.length - 2);
this.radarData = JSON.parse(this.radarData);
this.radar = {
img: "http://101.200.145.109:8087/qxj/" + this.radarData[500 - this.radarSelecter].fileName,
title: this.radarData[0].title,
datetime: this.radarData[0].datetime
};
//云图
const cloudRes = await axios.get("http://101.200.145.109:8087/weather/scene/data.do?callback=&id=5");
this.cloudData = JSON.parse(cloudRes.data.substr(1, cloudRes.data.length - 2));
this.cloudData.fileName = "http://101.200.145.109:8087/qxj/" + this.cloudData.fileName;
//每日视频
const videoRes = await axios.get("http://101.200.145.109:8087/weather/scenetwo/swqx.do?callback=&pageNo=1");
let videoTemp = JSON.parse(videoRes.data.substr(1, videoRes.data.length - 2)).value;
console.log("videoTemp", videoTemp);
this.videoData = videoTemp;
this.videoId = this.videoData[0].videoid;
this.$nextTick(function () {
console.log('v-for渲染已经完成')
var inst = new mdui.Select('#ddd2');
inst.handleUpdate();
})
this.getVideo();
// this.video.src = "http://101.200.145.109:8087/qxj/" + videoTemp[0].videopath;
//预警信号
const warningListRes = await axios.get("http://101.200.145.109:8087/weather/scene/warningPage.do?callback=&pageNo=1&doc=北京市");
let warningListTemp = JSON.parse(warningListRes.data.substr(1, warningListRes.data.length - 2)).value;
let isWarningExpired = [];
warningListTemp = warningListTemp.reverse();
console.log("处理过", warningListTemp);
for (item in warningListTemp) {
if (warningListTemp[item].title.substr(3, 2) == "解除") {
isWarningExpired[warningListTemp[item].title.substr(5, 2)] = true;
} else {
isWarningExpired[warningListTemp[item].title.substr(5, 2)] = false;
}
}
warningListTemp = warningListTemp.reverse();
for (item in warningListTemp) {
if (isWarningExpired[warningListTemp[item].title.substr(5, 2)] == false) {
isWarningExpired[warningListTemp[item].title.substr(5, 2)] = 3;
this.warningList.push(warningListTemp[item]);
}
}
if (this.warningList.length != 0) {
let temp = [];
for (item in this.warningList) {
const warningRes = await axios.get("http://101.200.145.109:8087/weather/scene/warningbyid.do?callback=&doc=" + this.warningList[item].id);
let warningTemp = JSON.parse(warningRes.data.substr(1, warningRes.data.length - 2));
// let warningMainbodyTemp = JSON.parse(warningTemp.mainbody);
// warningMainbodyTemp.title = warningMainbodyTemp.title.substr(5, warningMainbodyTemp.title.length - 1);
warningTemp.mainbody = JSON.parse(warningTemp.mainbody);
// console.log('////' + warningTemp.title.substr(5, 2) + '//' + isWarningExpired[warningTemp.title.substr(5, 2)])
if (temp[warningTemp.mainbody.signclass] != true) {
temp[warningTemp.mainbody.signclass] = true;
if (warningTemp.mainbody.signrank == "蓝色") {
warningTemp.signdegree = "#2196F3";
} else if (warningTemp.mainbody.signrank == "黄色") {
warningTemp.signdegree = "#fdd835";
} else if (warningTemp.mainbody.signrank == "橙色") {
warningTemp.signdegree = "#FF9800";
} else if (warningTemp.mainbody.signrank == "红色") {
warningTemp.signdegree = "#F44336";
}
this.warningData.push(warningTemp);
console.log(warningTemp);
}
}
}
this.startTime = new Date().getTime();
document.addEventListener("visibilitychange", function () {
console.log(document.visibilityState, performance.now());
if (document.visibilityState == "visible") {
app.refreshTimeChange();
}
});
setInterval(() => {
this.refreshTimeChange();
}, 10000);
this.$nextTick(function () {
this.isLoading = false;
})
},
methods: {
getDistrectInfo() {
//api有间歇缺数据问题,需catch error
let currentRes = this.distrectData.value[this.distrect];
if (currentRes == null) {
console.error("分区域数据部分缺失", currentRes)
return;
}
this.current = {
datetime: this.distrectData.datetime,
temperature: currentRes.wendu,
windspeed: currentRes.fengl,
winddirection: currentRes.fengx,
airpressure: currentRes.qiya,
humidity: currentRes.shidu,
jiangshuiliang: currentRes.jiangshuiliang,
}
if (currentRes.jiangshuiliang != "0.0") {
this.current.isRainning = true;
}
if (currentRes.name == "市中心") {
this.current.weather = JSON.parse(this.forecastData.Scene).value.name;
}
},
getVideo() {
console.log("qqqqq", this.videoData.find((el) => el.videoid == this.videoId));
this.video.src = "http://101.200.145.109:8087/qxj/" + this.videoData.find((el) => el.videoid == this.videoId).videopath
},
//播放存在卡顿,可能和网络请求有关? ---暂时通过增大间隔时间解决,这不是一个好方法
//需优化
radarAutoPlay() {
if (this.isAutoPlay == false) {
this.isAutoPlay = true;
if (this.radarSelecter == 500) {
this.radarSelecter = 0;
}
this.radarInterval = setInterval(() => {
// console.log("start auto change");
if (this.radarSelecter == 500) {
this.isAutoPlay = false;
clearInterval(this.radarInterval);
return;
}
this.radarSelecter++;
mdui.updateSliders();
//@change不能监听更改?采用手动刷新
this.reloadRadar();
}, 500);
} else {
this.isAutoPlay = false;
clearInterval(this.radarInterval);
}
},
reloadRadar() {
mdui.updateSliders();
this.radar = {
img: 'http://101.200.145.109:8087/qxj/' + this.radarData[500 - this.radarSelecter].fileName,
title: this.radarData[500 - this.radarSelecter].title,
datetime: this.radarData[500 - this.radarSelecter].datetime,
}
},
refreshTimeChange() {
let timeTemp = (new Date().getTime() - this.startTime) / 1000;
//console.log("11", timeTemp);
if (timeTemp > 10) {
app.refreshTime.display = "T+";
if (timeTemp / 60 > 30) {
app.refreshTime.display = "已过时"
app.refreshTime.needUpdate = true;
} else {
if (Math.floor(timeTemp / 60) > 0) {
app.refreshTime.display += Math.floor(timeTemp / 60) + "m";
}
app.refreshTime.display += Math.floor(timeTemp % 60) + "s";
}
}
},
autoDark() {
// setTimeout(() => {
// this.$nextTick(function () {
if (!this.isAutoDark) {
document.body.classList.add("mdui-theme-layout-auto");
document.querySelector(".mdui-appbar").classList.add("autoDarkAppBar");
localStorage.isAutoDark = true;
} else {
console.log(111);
document.body.classList.remove("mdui-theme-layout-auto");
document.querySelector(".mdui-appbar").classList.remove("autoDarkAppBar");
localStorage.isAutoDark = false;
}
// })
// }, 1000);
},
},
});
</script>
</html>