-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
85 lines (84 loc) · 1.73 KB
/
index.html
File metadata and controls
85 lines (84 loc) · 1.73 KB
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>见缝插针小游戏</title>
<style>
* {
padding:0;
margin:0;
}
body, html {
height:100%;
}
body {
background:url(img/12.jpg) no-repeat center center;
}
.container {
width:300px;
margin:50px auto;
}
h2{
font-family:微软雅黑;
color: white;
font-size:35px;
text-align:center;
margin-top:150px;
letter-spacing:7px;
}
h4{
color: white;
font-size:16px;
text-align:center;
margin-top:20px;
}
.play {
margin-top:20px;
text-align:center;
}
.play a {
display:inline-block;
border:3px #666 solid;
border-radius:15px;
padding:45px 25px 12px;
font-size:16px;
background:url(img/play.png) no-repeat center 14px;
color:#505050;
font-weight:bold;
text-decoration:none;
}
button{
margin:19px 116px;
font-size: 16px;
}
</style>
</head>
<body>
<div class="container">
<h2>见缝插针小游戏</h2>
<h4>制作人:刘猛</h4>
<div class="play"> <a href="play.html" id="go">关卡<span id="level">1</span></a> </div>
<button>清除数据</button>
</div>
</body>
<script>
var level = parseInt(window.location.href.split("#")[1]);
if(level){
if(level>=7||level<0){
level = 0;
}
document.getElementById("level").innerHTML = level+1;
// document.getElementById("go").setAttribute("href","play.html#"+level);
localStorage.setItem('level',level);
}
var clear=document.querySelector("button");
clear.onclick=function () {
localStorage.clear();
alert("游戏数据清除完毕,请重新开始游戏!");
}
</script>
</html>