-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
70 lines (62 loc) · 2.09 KB
/
index.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
<!DOCTYPE html>
<html lang="zh-tw">
<head>
<title>跳!| 臺灣電網實時剩餘容量率資訊民間版 </title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css" />
<link rel="stylesheet" href="./style.css" />
<meta property="og:image" content="./screenshot.png" />
<script src="//www.taipower.com.tw/d006/loadGraph/loadGraph/data/loadpara.txt"></script>
</head>
<body>
<div id="content-wrapper">
<div class="wrapper">
<h1>實時剩餘容量率</h1>
<div id="info">
<h2 class="rate"></h2>
</div>
</div>
</div>
<footer>
本頁之「剩餘容量率」與臺電指的備轉容量率不同,詳情請<a href="https://github.com/bobby1030/taipower-light/issues/1">見此</a><br/>
實時用電量、最大供電能力資訊由臺電網站取得,實際資訊請以臺電官網為準<br/>
Fork me on <a href="https://github.com/bobby1030/taipower-light" target="_blank">GitHub</a>.
</footer>
<iframe id="bg-video" src="
https://www.youtube.com/embed/sbfQ2Pbf2hE
?rel=0
&start=20
&controls=0
&showinfo=0
&autoplay=1
&loop=1
&playlist=sbfQ2Pbf2hE
"></iframe>
<script>
var display = function () {
var currentLoad = parseFloat(loadInfo[0].replace(',', '')) / 10;
var maxCapacity = parseFloat(loadInfo[2].replace(',', '')) / 10;
var avaliableCapacity = maxCapacity - currentLoad;
var rate = avaliableCapacity / maxCapacity * 100;
document.querySelector("h2.rate").innerHTML = rate.toFixed(2) + "%";
}
display()
</script>
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-21983291-9', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>