-
Notifications
You must be signed in to change notification settings - Fork 0
/
styles.css
168 lines (148 loc) · 2.92 KB
/
styles.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
@keyframes highlight-tile {
/*0% {background-color: #ccc}*/
/*50% {background-color: red}*/
/*100% {background-color: #ccc}*/
0% {transform: scale(1)}
50% {transform: scale(1.4)}
100% {transform: scale(1)}
}
:root {
--tile-size: 47px;
--tile-space: 5px;
--board-width: 14;
--board-height: 10;
}
* {
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
/*display: flex;*/
/*flex-direction: column;*/
/*justify-content: stretch;*/
/*align-items: center;*/
height: 100vh;
background-color: #f0f0f0;
box-sizing: border-box;
}
.game-container {
width: 100%;
height: calc(100vh - 33px);
text-align: center;
display: flex;
flex-direction: column;
justify-items: stretch;
}
h1 {
font-size: 24px;
}
.play-area {
position: relative;
padding: 20px;
flex: 1 1 auto;
background-color: skyblue;
height: 50%;
}
.overlay {
position: absolute;
top: 0;
width: 100%;
height: 100%;
text-align: center;
padding-top: 80px;
background-color: rgb(133 206 239 / 66%);
color: #d85e01;
font-size: 72px;
font-weight: bold;
text-shadow: #d85e01a8 2px 2px 16px;
}
.game-board {
position: relative;
padding: 5px;
transform-origin: top left;
}
.tile {
width: 48px;
height: 48px;
background-color: #ccc;
background-image: url('sprites.png');
border-radius: 5px;
cursor: pointer;
position: absolute;
transform-origin: 50% 50%;
animation-fill-mode: forwards;
opacity: 1;
transition-property: opacity;
transition-duration: 0.3s;
}
.tile.selected {
background-color: red;
}
.tile.moving {
z-index: 1;
}
.tile.empty {
opacity: 0;
cursor: default;
}
.tile.highlight {
animation: highlight-tile 1s infinite;
}
.actions {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.button {
margin-top: 20px;
padding: 10px 20px;
font-size: 16px;
color: #fff;
background-color: #007bff;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
.button.disabled {
opacity: 0.6;
}
#restartButton {
background-color: #007bff;
}
#restartButton:hover {
background-color: #0056b3;
}
#timer-bar {
position: absolute;
top: 0;
left: 0;
width: 100%; /* 计时条占据整个游戏面板宽度 */
height: 10px; /* 计时条高度 */
background-color: green; /* 初始时计时条颜色 */
transition: width 1s linear; /* 过渡效果,宽度每秒逐渐变化 */
}
.level-label {
position: absolute;
top: 26px;
right: 10px;
font-size: 12px;
color: #da9967;
}
#level {
color: #d85e01;
font-size: 18px
}
#next-level {
display: block;
margin: auto;
}
.footer {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
transition: bottom 0.3s linear;
}