-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1index.html.1
232 lines (214 loc) · 4.36 KB
/
1index.html.1
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<!-- style样式代码 -->
<style>
html {
height: 100%;
width: 100%;
}
body {
height: 100%;
width: 100%;
}
div {
background-repeat: no-repeat;
background-size: 100% 100%;
height: 100%;
width: 100%;
}
#page1 {
background-image: url(img/halloween1.jpg);
/* background-repeat: no-repeat; */
/* background-size: 100% 100%; */
/* height: 100%; */
/* width: 100%; */
-display: none;
}
#title {
position: fixed;
left: 380px;
top: 170px;
animation: titlemove 3s infinite;
}
@keyframes titlemove{
from{
opacity: 0;
}
to{
opacity: 1;
}
}
#box {
position: fixed;
left: 330px;
bottom: 525px;
animation: boxmove 1s infinite;
}
@keyframes boxmove{
0%{
left:330px;
}
40%{
left:360px;
}
100%{
left: 340px;
}
}
#page2 {
background-image: url(img/halloween2.jpg);
/* background-repeat: no-repeat; */
/* background-size: 100% 100%; */
/* height: 100%; */
/* width: 100%; */
display: none;
}
#pump {
position: fixed;
left: 295px;
top: 170px;
}
#start {
position: fixed;
left: 380px;
bottom: 435px;
}
#page3 {
background-image: url(img/halloweenMain3.jpg);
display: none
}
#charm01 {
position: fixed;
left: 50px;
top: 100px;
animation: charm01 4s infinite;
}
@keyframes charm01{
0%{
left: 50px;
top: 100px;
opacity: 1;
}
25%{
left:220px ;
top: 120px;
opacity: 0.4;
}
50%{
left:60px ;
top: 240px;
opacity: 0.8;
}
}
#charm02 {
position: fixed;
left: 250px;
top: 400px;
}
#charm03 {
position: fixed;
left: 50px;
top: 650px;
}
#charm04 {
position: fixed;
left: 500px;
top: 50px;
animation: charm04 4s infinite;
}
@keyframes charm04{
10%{
left: 720px;
top: 180px;
}
15%{
left: 600px;
top: 300px;
}
35%{
left: 600px;
top: 300px;
}
60%{
left: 650px;
top: 200px;
}
}
#charm05 {
position: fixed;
left: 400px;
top: 900px;
}
#charm06 {
position: fixed;
left: 300px;
top: 800px;
}
#charm07 {
position: fixed;
right: 50px;
bottom: 300px;
}
</style>
<script>
function suiji(){
var num =Math.floor(Math.random()*7+1);
//alert(num);
//url(img/halloweenMain3.jpg)
var pic = "url(img/charm"+num+".jpg)";
//alert(pic);
var p4 = document.getElementById("page4");
p4.style.backgroundImage = pic;
}
/* function boxdianji(){
var page1 = document.getElementById("page1");
page1.style.display = "none";
var page2 =document.getElementById("page2");
page2.style.display = "block";
}
function start(){
var page2 = document.getElementById("page2");
page2.style.display = "none";
var page3 = document.getElementById("page3");
page3.style.display = "block";
} */
function next(shuzi){
var page1 = document.getElementById("page1");
var page2 = document.getElementById("page2");
var page3 = document.getElementById("page3");
var page4 = document.getElementById("page4");
page1.style.display = "none";
page2.style.display = "none";
page3.style.display = "none";
page4.style.display = "none";
var aaa ="page"+shuzi;
var showpg = document.getElementById(aaa);
showpg.style.display = "block";
}
</script>
</head>
<body>
<div id="page1">
<img id="title" src="img/title.png">
<img id="box" src="img/box.png" onclick="next(2)"/>
</div>
<div id="page2">
<img id="pump" src="img/pumpkin.png">
<img id="start" src="img/startGame.jpg" onclick="next(3)">
</div>
<div id="page3">
<img id="charm01" src="img/1.png" onclick="suiji(),next(4)"/>
<img id="charm02" src="img/2.png" onclick="suiji(),next(4)"/>
<img id="charm03" src="img/3.png" onclick="suiji(),next(4)"/>
<img id="charm04" src="img/4.png" onclick="suiji(),next(4)"/>
<img id="charm05" src="img/5.png" onclick="suiji(),next(4)"/>
<img id="charm06" src="img/6.png" onclick="suiji(),next(4)"/>
<img id="charm07" src="img/7.png" onclick="suiji(),next(4)"/>
</div>
<div id="page4">
</div>
</body>
</html>