Skip to content

Commit db1f531

Browse files
committed
u
1 parent 3f70d5a commit db1f531

File tree

2 files changed

+61
-62
lines changed

2 files changed

+61
-62
lines changed

index.html

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
<title>夏天到了 吹点啥鸭</title>
88
<link
99
rel="stylesheet"
10-
type="text/css"
11-
href="https://cdn.jsdelivr.net/gh/HZFE/summer/index.min.css"
10+
href="https://cdn.jsdelivr.net/gh/HZFE/summer@latest/index.min.css"
1211
/>
1312
</head>
1413
<body>
@@ -82,7 +81,9 @@
8281
<span
8382
style="font-size: 28px; color: #d83737; position: relative; top: 4px"
8483
></span
85-
><span style="text-decoration-line: underline" class="jump"
84+
><span
85+
style="text-decoration-line: underline"
86+
onclick="location.href=location.origin+location.pathname+'?time='+new Date().getTime();"
8687
>点我!吹点别的</span
8788
><span
8889
style="font-size: 28px; color: #d83737; position: relative; top: 4px"
@@ -109,7 +110,9 @@
109110
<span
110111
style="font-size: 28px; color: #d83737; position: relative; top: 4px"
111112
></span
112-
><span style="text-decoration-line: underline" class="jump"
113+
><span
114+
style="text-decoration-line: underline"
115+
onclick="location.href=location.origin+location.pathname+'?time='+new Date().getTime();"
113116
>点我!吹点别的</span
114117
><span
115118
style="font-size: 28px; color: #d83737; position: relative; top: 4px"
@@ -132,7 +135,9 @@
132135
<span
133136
style="font-size: 28px; color: #d83737; position: relative; top: 4px"
134137
></span
135-
><span style="text-decoration-line: underline" class="jump"
138+
><span
139+
style="text-decoration-line: underline"
140+
onclick="location.href=location.origin+location.pathname+'?time='+new Date().getTime();"
136141
>点我!吹点别的</span
137142
><span
138143
style="font-size: 28px; color: #d83737; position: relative; top: 4px"
@@ -143,7 +148,7 @@
143148
<div data-v-240e8e56="" class="container-footer">
144149
<p data-v-240e8e56="" class="copyright">
145150
<span data-v-240e8e56="" class="no-select">© 2016 - 2021</span>
146-
ac.hzfe.org - updated at 5163
151+
ac.hzfe.org - updated at 5164
147152
<span data-v-240e8e56="" class="links"
148153
><a
149154
data-v-240e8e56=""

index.js

Lines changed: 50 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -6,68 +6,62 @@ var _hmt = _hmt || [];
66
s.parentNode.insertBefore(hm, s);
77
})();
88
const t = document.querySelector(".text");
9-
document.addEventListener("click", (ev) => {
10-
if (ev.target.className === "jump" || ev.target.className === "rl") {
11-
location.href =
12-
location.origin + location.pathname + "?time=" + new Date().getTime();
13-
}
14-
});
9+
1510
setTimeout(() => {
16-
(() => {
17-
const ac = {
18-
num: 27,
19-
badNum: 35,
20-
};
21-
ac.ok = Math.random() < 0.6;
22-
if (ac.ok) {
23-
ac.isfan = Math.random() > 0.5;
24-
if (ac.isfan) {
25-
const f = document.querySelector(".f");
26-
t.innerText = "吹风扇";
27-
f.className = f.className + " s";
28-
return;
29-
}
30-
const a = document.querySelector(".a");
31-
const v = document.querySelector(".num-val");
11+
var v = Math.random();
12+
const ac = {
13+
num: 27,
14+
badNum: 35,
15+
};
16+
ac.ok = v < 0.66;
17+
ac.isfan = v < 0.33;
18+
if (ac.ok) {
19+
if (ac.isfan) {
20+
const f = document.querySelector(".f");
21+
t.innerText = "吹风扇";
22+
f.className = f.className + " s";
23+
return;
24+
}
25+
const a = document.querySelector(".a");
26+
const v = document.querySelector(".num-val");
3227

33-
t.innerText = "吹空调";
34-
v.innerText = ac.num;
35-
a.className = a.className + " s";
28+
t.innerText = "吹空调";
29+
v.innerText = ac.num;
30+
a.className = a.className + " s";
3631

37-
document.querySelector(".oper").addEventListener("click", function (e) {
38-
if (e.target && e.target.dataset) {
39-
if (e.target.dataset.t === "1") {
40-
v.innerText = ++ac.num > 31 ? (ac.num = 31) : ac.num;
41-
if (ac.num === 31) {
42-
setTimeout(() => {
43-
alert("你怎么不吹空调外机");
44-
}, 100);
45-
}
46-
} else if (e.target.dataset.t === "0") {
47-
v.innerText = --ac.num < 16 ? (ac.num = 16) : ac.num;
32+
document.querySelector(".oper").addEventListener("click", function (e) {
33+
if (e.target && e.target.dataset) {
34+
if (e.target.dataset.t === "1") {
35+
v.innerText = ++ac.num > 31 ? (ac.num = 31) : ac.num;
36+
if (ac.num === 31) {
37+
setTimeout(() => {
38+
alert("你怎么不吹空调外机");
39+
}, 100);
4840
}
41+
} else if (e.target.dataset.t === "0") {
42+
v.innerText = --ac.num < 16 ? (ac.num = 16) : ac.num;
4943
}
50-
});
51-
} else {
52-
const d = document.querySelector(".d");
53-
const b = document.querySelector(".bad-val");
54-
const ba = document.querySelector(".basic");
44+
}
45+
});
46+
} else {
47+
const d = document.querySelector(".d");
48+
const b = document.querySelector(".bad-val");
49+
const ba = document.querySelector(".basic");
5550

56-
// ba.addEventListener("load", function (e) {
57-
const l = document.querySelector(".leaf");
58-
l.style.opacity = 1;
59-
// });
51+
// ba.addEventListener("load", function (e) {
52+
const l = document.querySelector(".leaf");
53+
l.style.opacity = 1;
54+
// });
6055

61-
t.innerText = "吹空调外机";
62-
const val = ac.badNum + Math.floor(Math.random() * 10);
63-
b.innerText = val;
64-
if (val >= 38) {
65-
const c = document.querySelector(".tips");
66-
setTimeout(() => {
67-
c.innerText = "恭喜中暑";
68-
}, 1200);
69-
}
70-
d.className = d.className + " s";
56+
t.innerText = "吹空调外机";
57+
const val = ac.badNum + Math.floor(Math.random() * 10);
58+
b.innerText = val;
59+
if (val >= 38) {
60+
const c = document.querySelector(".tips");
61+
setTimeout(() => {
62+
c.innerText = "恭喜中暑";
63+
}, 1200);
7164
}
72-
})();
65+
d.className = d.className + " s";
66+
}
7367
}, 1600);

0 commit comments

Comments
 (0)