-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtaichi.html
160 lines (145 loc) · 3.22 KB
/
taichi.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no">
<title>太极图</title>
<script src="https://cdn.staticfile.org/jquery/3.5.1/jquery.min.js"></script>
<!-- <link rel="stylesheet" type="text/css" id="css" href="taichi_begin.css"> -->
<!-- taichi_begin.css / taichi_over.css -->
<style>
:root {
--color1: black;
--color2: white;
--time: 6s;
--border: solid 1px #ccc;
/* rgba(128,128,128,0.25) */
--lightbody: #eee;
/* rgb(248, 249, 250) */
--darkbody: #555;
}
body {
background-color: var(--lightbody);
}
.taiji {
cursor: pointer;
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
margin: auto;
width: 340px;
height: 340px;
border-radius: 50%;
background-color: var(--color2);
border: var(--border);
animation: spin var(--time) linear infinite;
/*动画设置*/
}
.tj_1 {
position: absolute;
top: 0px;
width: 50%;
height: 100%;
}
.tj_big1 {
left: 0px;
border-radius: 100% 0 0 100% / 50% 0 0 50%;
background: var(--color1);
}
.tj_big2 {
right: 0px;
border-radius: 0 100% 100% 0 / 0 50% 50% 0;
background: var(--color2);
}
.tj_2 {
position: absolute;
width: 50%;
height: 50%;
left: 25%;
border-radius: 50%;
}
.tj_s1 {
bottom: 0px;
background: var(--color2);
}
.tj_s2 {
top: 0px;
background: var(--color1);
}
.tj_ss {
position: absolute;
width: 25%;
height: 25%;
left: 37.5%;
border-radius: 50%;
}
.tj_w {
top: 37.5%;
background: var(--color1);
}
.tj_b {
top: 37.5%;
background: var(--color2);
}
/*动画方法*/
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<!-- <div class="taiji" onclick="javascript:document.getElementById('css').href='taichi_over.css'"> -->
<div class="taiji" onclick="redCyan()">
<div class="tj_1 tj_big1"></div>
<div class="tj_1 tj_big2"></div>
<div class="tj_2 tj_s1">
<div class="tj_ss tj_w"></div>
</div>
<div class="tj_2 tj_s2">
<div class="tj_ss tj_b"></div>
</div>
</div>
</body>
<script>
var NightTime = {
darkBackgroundColor: "var(--darkbody)",
lightBackgroundColor: "var(--lightbody)"
}
var currentColor = 0,
repeatClick = 0;
function redCyan() {
if (currentColor == 0) {
var overCSS = document.createElement("style");
overCSS.id = "overCSS";
overCSS.innerHTML =
":root { \
--color1: red; \
--color2: cyan; \
--time: 0.1s; \
--border: dashed 10px green;\
--lightbody: #F0F; \
--darkbody: purple; \
}";
document.body.appendChild(overCSS);
currentColor = 1;
} else {
repeatClick++;
if (repeatClick >= 10) {
var overCSS = document.getElementById("overCSS");
document.body.removeChild(overCSS);
currentColor = 0;
repeatClick = 0;
}
}
}
</script>
<script src="/basis/NightTime.js"></script>
</html>