-
Notifications
You must be signed in to change notification settings - Fork 34
/
index.html
269 lines (239 loc) · 8.15 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
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>PACKABUNCHAS</title>
<link rel="icon"
href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🚀</text></svg>">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<style>
.c {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
background-color: #FFEA7E;
touch-action: none;
}
.c canvas {
object-fit: contain;
max-height: 100%;
max-width: 100%;
touch-action: none;
}
.content {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
background: linear-gradient(to bottom right, #FFEA7E, #FFA500);
/* Default background gradient */
overflow: hidden;
position: relative;
}
.content canvas {
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
/* Adjusting to full available height */
touch-action: none;
}
body,
html {
margin: 0;
padding: 0;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* Gradient selector styles */
.gradient-selector-container {
position: absolute;
top: 10px;
right: 10px;
background-color: rgba(201, 179, 39, 0.8);
border: 5px solid black;
padding: 10px;
border-radius: 30px;
display: none;
flex-direction: column;
color: whitesmoke;
font-size: 400;
box-sizing: border-box;
}
.gradient-selector-container label,
.gradient-selector-container select,
.gradient-selector-container input {
margin: 5px 0;
font-weight:800;
}
.color_input {
width: 30%;
display: flex;
flex-direction: column ;
height: 30px;
border-radius: 6px;
background-color: #5d4d54;
color: #5d4d54;
font-size: 12px;
font-family: Arial, sans-serif;
box-shadow: 2px 2px 5px 0 rgba(0, 0, 0, 0.1);
transition: box-shadow 0.3s, background-color 0.3s;
}
.gradient-selector-container select{
border-radius: 5px;
font-weight: 200;
background-color: #fce7b0;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.gradient-selector-container select:hover{
transition: 0.5s ease-in-out;
background-color: #FFEA7E;
transform: scale(1.1);
}
.gradient-selector-container select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
padding: 0.5em;
/* Add padding for the text */
padding-left: 0.5em;
/* Add a border for the placeholder */
border: 4px solid #5d4d54;
border-radius: 6px;
font-weight:520;
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: 15px;
border-radius: 10px;
color: #5d4d54;
background-color: #dfdccfe2;
}
select:hover{
background-color: whitesmoke;
}
.controls-container {
position: absolute;
top: 10px;
right: 10px;
display: flex;
align-items: center;
background-color:rgb(126, 198, 181);
padding: 10px;
border-radius: 8px;
}
.instructions {
cursor: pointer;
font-size: 24px;
color: black;
margin-right: 10px;
}
.gradient-button {
padding: 10px;
background-color: transparent;
border: none;
cursor: pointer;
font-size: 24px;
color: whitesmoke;
}
.gradient-button:focus {
outline: none;
}
.apply_btn{
background-color: #ff9b54;
border-radius: 5px;
transition: transform 0.5s ease-in-out;
}
.apply_btn:hover{
background-color: #FFEA7E;
transform: scale(1.075);
}
#color1 ,#color2{
width: auto;
text-align: center;
border-radius: 5px;
transition: transform 0.5s ease-in-out;
}
#color1:hover{
transform: scale(1.075);
}
#color2:hover{
transform: scale(1.075);
}
#v{
border-radius: 0px 0px 25px 25px;
}
.gradient-selector-container button {
font-family: Verdana, Geneva, Tahoma, sans-serif;
}
.gradbtn{
font-family: Verdana, Geneva, Tahoma, sans-serif;
border-radius: 10px;
width: 200px;
height: 35px;
}
.instructions-box {
position: absolute;
top: 50px;
right: 10px;
background-color: rgba(0, 0, 0, 0.8);
color: white;
padding: 20px;
border-radius: 8px;
display: none;
max-width: 300px;
z-index: 10;
</style>
</head>
<body>
<div class="content">
<canvas id="v" width="1080" height="1920"></canvas>
<canvas id="v" width="1080" height="1920"></canvas>
<div class="controls-container">
<div class="instructions"><i class="fa-regular fa-lightbulb"></i></div>
<button class="gradient-button" onclick="toggleGradientSelector()">🎨</button>
</div>
<div class="gradient-selector-container" id="gradientSelectorContainer">
<div>
<button onclick="exitGradient()" style="background-color: transparent; border: none; height: 10%; width: 12%; position: absolute; top:1%; right: 7%; color: white; font-size: 40px; text-align: center;">
x
</button>
</div>
<label for="color1" class="color">Color 1:</label>
<input type="color" id="color1" name="color1" value="#FFEA7E" class="color_input">
<label for="color2" class="color">Color 2:</label>
<input type="color" id="color2" name="color2" value="#FFA500" class="color_input">
<label for="direction" class="direction">Direction:</label>
<select id="direction" class="custom-select" name="direction">
<option disabled selected value="select direction">Select direction</option>
<option value="to bottom right">To Bottom Right</option>
<option value="to bottom left">To Bottom Left</option>
<option value="to top right">To Top Right</option>
<option value="to top left">To Top Left</option>
<option value="to bottom">To Bottom</option>
<option value="to top">To Top</option>
<option value="to left">To Left</option>
<option value="to right">To Right</option>
</select>
<button onclick="applyGradient()" class="gradbtn">Apply Gradient</button>
</div>
<div class="instructions-box" id="instructionsBox">
<h2>Game Instructions</h2>
<p>Welcome to the game! Here are the instructions:</p>
<ul>
<li>Drag the puzzle pieces.</li>
<li>You can change thier direction by double clicking on it.</li>
<li>Adjust the puzzle pieces to completely occupy the given space.</li>
<li>Have fun!</li>
</ul>
</div>
<script src="game.js"></script>
</body>
</html>