-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyles.css
More file actions
126 lines (110 loc) · 2.3 KB
/
Copy pathstyles.css
File metadata and controls
126 lines (110 loc) · 2.3 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
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
.container {
text-align: center;
margin: 20px auto;
max-width: 500px;
padding: 10px;
}
#board {
display: grid;
grid-template-columns: repeat(4, minmax(60px, 100px));
grid-template-rows: repeat(3, minmax(60px, 100px));
gap: 4px;
background: #333;
padding: 4px;
margin: 20px auto;
border-radius: 8px;
width: fit-content;
transition: all 0.2s;
}
.tile {
width: 100%;
height: 100%;
position: relative;
cursor: pointer;
border-radius: 4px;
user-select: none;
transition: transform 0.1s;
background-color: #4a90e2; /* Fallback color */
background-repeat: no-repeat;
border: 2px solid #fff;
box-sizing: border-box;
overflow: hidden;
}
.tile.has-image {
background-image: url('./puzzle.jpg'); /* Ensure the path is correct */
background-size: 400px 300px;
}
.tile:active {
transform: scale(0.95);
}
.tile::after {
content: attr(data-value);
position: absolute;
top: 2px;
left: 2px;
background: rgba(0, 0, 0, 0.3);
color: white;
padding: 1px 4px;
border-radius: 2px;
font-size: 10px;
opacity: 0.8;
}
.empty::after {
display: none;
}
.empty {
background-image: none !important;
background-color: transparent;
border: 2px solid rgba(255, 255, 255, 0.1);
}
.complete-state .empty {
background-image: url('./puzzle.jpg') !important;
background-color: transparent;
border: 2px solid #fff;
opacity: 1;
}
.complete-state .tile::after {
display: none;
}
button {
padding: 10px 20px;
font-size: 1.2em;
margin: 10px;
cursor: pointer;
}
#startGame {
background-color: #2ecc71;
color: white;
border: none;
border-radius: 4px;
padding: 12px 24px;
font-size: 1.2em;
cursor: pointer;
transition: background-color 0.2s;
}
#startGame:hover {
background-color: #27ae60;
}
.timer {
font-size: 1.5em;
margin: 10px;
color: #333;
font-weight: bold;
}
.game-over .timer {
color: #e74c3c;
}
@media (max-width: 480px) {
#board {
grid-template-columns: repeat(4, 1fr);
grid-template-rows: repeat(3, 1fr);
width: 95vw;
height: 71.25vw;
max-width: 350px;
max-height: 300px;
}
.tile::after {
font-size: 8px;
padding: 1px 3px;
}
}