-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2048.css
176 lines (152 loc) · 2.13 KB
/
2048.css
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
/* 通用样式 */
*{
margin:0;
padding:0;
}
div,p,h1,h2,a,span{
font-family:Arial;
font-weight:bold;
text-decoration:none;
}
/* 头部标题 */
header{
padding-top:16px;
}
h1{
text-align:center;
}
/* 游戏面板 */
#gamePanel{
width:500px;
margin:0 auto;
position:relative;
}
#gridePanel{
width:480px;
height:480px;
background:#BBADA0;
border-radius:10px;
padding:20px 0 0 20px;
position:relative;
}
#gamePanel p{
padding:8px;
}
/* 按钮样式 */
.button{
display:inline-block;
padding:10px;
background-color:#9F8B77;
border-radius:6px;
color:#fff;
cursor:pointer;
}
.grid,.cell{
width:100px;
height:100px;
border-radius:6px;
}
.grid{
background-color:#ccc0b3;
float:left;
margin:0 20px 20px 0;
}
/* 格式化单元格 */
.cell{
color:#776E65;
position:absolute;
text-align:center;
font-size:40px;
line-height:100px;
}
/* 定义行位置 */
#cell00,#cell01,#cell02,#cell03{
top:20px;
}
#cell10,#cell11,#cell12,#cell13{
top:140px;
}
#cell20,#cell21,#cell22,#cell23{
top:260px;
}
#cell30,#cell31,#cell32,#cell33{
top:380px;
}
/* 列定位 */
#cell00,#cell10,#cell20,#cell30{
left:20px;
}
#cell01,#cell11,#cell21,#cell31{
left:140px;
}
#cell02,#cell12,#cell22,#cell32{
left:260px;
}
#cell03,#cell13,#cell23,#cell33{
left:380px;
}
/* 数字的显示效果 */
/* 除了2、4均为白色 */
.num8,.num16,.num32,.num64,.num128,.num256,.num512,.num1024,.num2048,.num4096,.num8192{
color:#fff;
}
.num2{
background:#eee4da;
}
.num4{
background:#ede0c8;
}
.num8{
background:#f2b179;
}
.num16{
background:#f59563;
}
.num32{
background:#f67c5f;
}
.num64{
background:#f65e3b;
}
.num128{
background:#edcf72;
}
.num256{
background:#edcc61;
}
.num512{
background:#9c0;
}
.num1024{
background:#33b5e5;
}
.num2048{
background:#09c;
}
.num4096{
background:#a6c;
}
.num8192{
background:#93c;
}
/* GameOver样式 */
#gameOver{
position:absolute;
width:100%;
height:100%;
top:0;
left:0;
background:rgba(85,85,85,0.5);
}
#gameOver p{
background-color:#fff;
border-radius:10px;
width:300px;
position:absolute;
left:100px;
top:200px;
font-size:30px;
line-height:1.5em;
text-align:center;
padding-bottom:20px;
}