-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
222 lines (217 loc) · 14.2 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
<!doctype html>
<html class="h-100" lang="de" data-bs-theme="light">
<head>
<!-- Meta -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="manifest" href="manifest.json">
<!-- Website Title-->
<title>Puzzle.it</title>
<link rel="icon" type=”image/svg+xml” href="./images/Octicons-puzzle.svg">
<link rel="mask-icon" href="mask-icon.svg" color="#ffffff">
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Recursive&display=swap" rel="stylesheet">
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" />
<!-- Bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<!-- Stylesheets -->
<link rel="stylesheet" href="./css/style.css">
</head>
<body class="h-100">
<div id="content">
<!-- Content -->
<section class="container" id="hero">
<div class="px-4 py-4 my-5 text-center">
<h1 class="display-5 fw-bold text-body-emphasis title">Puzzle.it</h1>
<div class="col-lg-6 mx-auto">
<p class="lead mb-4">
Create your own digital puzzle with ease. Just <span class="fw-semibold">upload</span> your
image or video
and <span class="fw-semibold">start puzzling!</span>
</p>
</div>
<div class="d-grid col-lg-6 mx-auto my-auto">
<div class="row justify-content-center gap-2">
<label
class="custom-file-upload col btn btn-primary btn-lg d-flex align-items-center justify-content-center"
for="file-upload">Upload Image / Video<span
class="material-symbols-outlined ps-2">upload</span></label>
<input id="file-upload" class="d-none" type="file" accept="image/png, image/jpeg, video/*" />
<div class="btn btn-primary btn-lg col align-items-center justify-content-center" type="button"
id="webcam-btn"><a>Start</a> Webcam-Puzzle
<span class="material-symbols-outlined ps-2">
videocam
</span>
</div>
</div>
<div class="row justify-content-center py-2">
<div class="col-10 ps-0">
<div class="input-group h-100">
<button class="btn btn-outline-primary disabled" type="button"
id="generate-btn">Generate</button>
<select class="form-select" id="tileOptions">
<option selected value="25">🧩 Beginner (25 Tiles)</option>
<option value="49">🌊 Easy (50 Tiles)</option>
<option value="100">⛰ Medium (100 Tiles)</option>
<option value="196">🏋️♀️ Hard (200 Tiles)</option>
<option value="484">🔥 Extreme (500 Tiles)</option>
<option value="1024">💀 Impossible (1000 Tiles)</option>
</select>
</div>
</div>
<a class="btn btn-secondary col-2 d-flex align-items-center justify-content-center"
href="#settings-tab" data-bs-toggle="collapse" role="button" aria-expanded="false"
aria-controls="settings-tab"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
fill="currentColor" class="bi bi-gear" viewBox="0 0 16 16">
<path
d="M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492M5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0" />
<path
d="M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.433.902-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.893 3.434-.902 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.893-1.64-.902-3.433-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094A1.873 1.873 0 0 0 3.06 4.377l-.16-.292c-.415-.764.42-1.6 1.185-1.184l.292.159a1.873 1.873 0 0 0 2.692-1.115z" />
</svg></a>
</div>
<div class="collapse" id="settings-tab">
<div class="row pt-2"> <!-- Switch classes to this if you want the box to be small -->
<div class="card card-body d-flex justify-content-start gap-2">
<div class="form-check form-switch d-flex flex-wrap justify-content-start">
<input class="form-check-input" type="checkbox" role="switch"
id="display-timer-switch" checked>
<label class="form-check-label ps-1" for="display-timer-switch">Display
Timer</label>
</div>
<div class="form-check form-switch d-flex flex-wrap justify-content-start">
<input class="form-check-input" type="checkbox" role="switch"
id="generate-border-switch" checked>
<label class="form-check-label ps-1" for="generate-border-switch">Draw
Border</label>
</div>
<div
class="form-check form-switch d-flex justify-content-start text-start align-items-center">
<input class="form-check-input" type="checkbox" role="switch"
id="custom-color-switch">
<label class="form-check-label ps-1" for="display-timer-switch">Use custom color for
border
</label>
<label for="custom-color-input" class="form-label d-inline-block ps-2"></label>
<input type="color" class="form-control form-control-color d-inline-block"
id="custom-color-input" value="#0D6EFD" title="Choose your border color">
</div>
<div class="form-check form-switch d-flex justify-content-start text-start">
<input class="form-check-input" type="checkbox" role="switch"
id="median-color-switch">
<label class="form-check-label ps-1" for="median-color-switch">Use median color for
border (only for images)</label>
</div>
<div class="form-floating">
<select class="form-select" id="fps-select"
aria-label="Select FPS of rendered video">
<option value="200">5 FPS</option>
<option value="100">10 FPS</option>
<option selected value="50">20 FPS</option>
<option value="33">30 FPS</option>
<option value="22">45 FPS</option>
<option value="17">60 FPS</option>
</select>
<label for="fps-select">Framerate of puzzle pieces</label>
</div>
<div class="form-floating">
<select class="form-select" id="webcam-select"
aria-label="Floating label select example">
</select>
<label for="webcam-select">Camera</label>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="bg-body-secondary" id="features">
<div class="container">
<div class="row g-4 py-5 row-cols-1 row-cols-lg-3">
<div class="col d-flex align-items-start">
<div
class="material-symbols-outlined icon-square text-body-emphasis bg-body-secondary d-inline-flex align-items-center justify-content-center fs-4 flex-shrink-0 me-3">
settings_photo_camera
</div>
<div>
<h3 class="fs-2 text-body-emphasis">Custom Image or Video</h3>
<p>Use any image, video or even your webcam to create a puzzle! All the data is stored on
your PC and will never reach the internet!</p>
</div>
</div>
<div class="col d-flex align-items-start">
<div
class="material-symbols-outlined icon-square text-body-emphasis bg-body-secondary d-inline-flex align-items-center justify-content-center fs-4 flex-shrink-0 me-3">
joystick
</div>
<div>
<h3 class="fs-2 text-body-emphasis">Custom Difficulty Level</h3>
<p>Customize the Difficulty for your puzzle experience, but keep in mind puzzling on the web
is hard!</p>
</div>
</div>
<div class="col d-flex align-items-start">
<div
class="material-symbols-outlined icon-square text-body-emphasis bg-body-secondary d-inline-flex align-items-center justify-content-center fs-4 flex-shrink-0 me-3">
celebration
</div>
<div>
<h3 class="fs-2 text-body-emphasis">Unlimited Fun!</h3>
<p>Nothing is in your way of puzzling as many pictures or videos as you want! Just enjoy
yourself!</p>
</div>
</div>
</div>
</div>
</section>
<section id="puzzle">
<div class="container text-center">
<img src="" id="puzzle-image" class="img-fluid p-5 pb-4 d-none" alt="puzzle-preview">
</div>
<div class="container text-center py-4 d-none">
<div id="video-stream" alt="video-stream-preview"></div>
</div>
<div class="text-center pb-4 justify-content-center d-flex d-none ">
<h1 class="timer" id="timer">00:00</h1>
</div>
<div id="puzzle-container" class="container text-center">
</div>
</section>
</div>
<div class="modal fade" id="success-modal" tabindex="-1" aria-labelledby="success-modal-label" aria-hidden="true">
<div class="modal-dialog modal-sm modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="exampleModalLabel">Good job!</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Content end -->
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<!-- Scripts from Bootstrap -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"></script>
<!-- Footer Script -->
<script src="./scripts/footer.js"></script>
<!-- Navbar Script -->
<script src="./scripts/navbar.js"></script>
<!-- ColorThief for Border -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/color-thief/2.3.0/color-thief.umd.js"></script>
<!-- Puzzle JavaScript -->
<script type="text/javascript" src="./scripts/puzzle.js"></script>
</body>
</html>