-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
127 lines (121 loc) · 3.03 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
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
<!DOCTYPE html>
<html>
<head>
<title>2048 Circle!</title>
<link rel="icon" href="favicon.png" type="image/png">
<link href="https://fonts.googleapis.com/css2?family=Baloo+Bhai+2:wght@400;700&display=swap" rel="stylesheet">
<style type="text/css">
body{
font-family: 'Baloo Bhai 2', sans-serif;
width: 550px;
margin: auto;
background-color: #F7F5F6;
}
td{
background-color: #DDD;
border-radius: 3px;
}
#grid{
border-spacing: 10px;
width: 550px;
height: 550px;
user-select: none;
}
.hidden{
visibility: hidden;
}
.tile{
width: 80px;
padding-top: calc(40px - 0.8em);
padding-bottom: calc(40px - 0.8em);
border-radius: 3px;
color: white;
font-weight: bold;
font-size: 2em;
transition: 0.1s ease-in-out;
text-align: center;
position: absolute;
z-index: 2;
background-color: #DDD;
box-shadow: 1px 1px 3px grey;
}
button{
border-radius: 3px;
background-color: grey;
border: none;
padding: 7px 14px;
color: white;
font-family: 'Baloo Bhai 2', sans-serif;
cursor: pointer;
font-size: 1em;
float: right;
}
</style>
</head>
<body>
<audio id="swipe"><source src="swipe.mp3" type="audio/mp3"></audio>
<audio id="success"><source src="success-bell.wav" type="audio/wav"></audio>
<h1 style="margin-bottom: 0;">2048 Circle!</h1>
By: Kira L<br>
Use the arrow keys to move the tiles. If you are on a device without a keyboard, this game will not work. When two tiles with the same number collide, they will merge into their sum. Try to get the 2048 tile!<br>
<button onclick="newGame()">New Game</button>
<br><br>
<div id="tiles" style="position: absolute; user-select: none;"></div>
<table id="grid">
<tr>
<td class="hidden"></td>
<td class="hidden"></td>
<td></td>
<td></td>
<td class="hidden"></td>
<td class="hidden"></td>
</tr>
<tr>
<td class="hidden"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="hidden"></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td class="hidden"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="hidden"></td>
</tr>
<tr>
<td class="hidden"></td>
<td class="hidden"></td>
<td></td>
<td></td>
<td class="hidden"></td>
<td class="hidden"></td>
</tr>
</table>
<br><br>
This game is a variation of 2048, which can be played at <a href="https://play2048.co/">play2048.co</a>.
If you like this, check out my other projects at <a href="http://kiraprograms.com">kiraprograms.com</a>!
<script type="text/javascript" src="move.js"></script>
<script type="text/javascript" src="script.js"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-167430586-1"></script><script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-167430586-1");</script>
</body>
</html>