create-template-html-css 1.9.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +80 -0
- package/COMPONENTS-GALLERY.html +735 -747
- package/README.md +179 -2
- package/bin/cli.js +15 -3
- package/package.json +1 -1
- package/templates/blackjack/index.html +97 -0
- package/templates/blackjack/script.js +381 -0
- package/templates/blackjack/style.css +452 -0
- package/templates/breakout/index.html +56 -0
- package/templates/breakout/script.js +387 -0
- package/templates/breakout/style.css +239 -0
- package/templates/connect-four/index.html +78 -0
- package/templates/connect-four/script.js +413 -0
- package/templates/connect-four/style.css +426 -0
- package/templates/dice-game/index.html +99 -0
- package/templates/dice-game/script.js +291 -0
- package/templates/dice-game/style.css +403 -0
- package/templates/flappy-bird/index.html +47 -0
- package/templates/flappy-bird/script.js +394 -0
- package/templates/flappy-bird/style.css +243 -0
- package/templates/game-2048/index.html +59 -0
- package/templates/game-2048/script.js +269 -0
- package/templates/game-2048/style.css +281 -0
- package/templates/pong/index.html +90 -0
- package/templates/pong/script.js +364 -0
- package/templates/pong/style.css +371 -0
- package/templates/rock-paper-scissors/index.html +84 -0
- package/templates/rock-paper-scissors/script.js +199 -0
- package/templates/rock-paper-scissors/style.css +295 -0
- package/templates/simon-says/index.html +64 -0
- package/templates/simon-says/script.js +206 -0
- package/templates/simon-says/style.css +250 -0
- package/templates/slot-machine/index.html +112 -0
- package/templates/slot-machine/script.js +238 -0
- package/templates/slot-machine/style.css +464 -0
- package/templates/tetris/index.html +84 -0
- package/templates/tetris/script.js +447 -0
- package/templates/tetris/style.css +286 -0
- package/templates/whack-a-mole/index.html +85 -0
- package/templates/whack-a-mole/script.js +172 -0
- package/{demo-games/snake-game → templates/whack-a-mole}/style.css +114 -97
- package/PUBLISH-GUIDE.md +0 -112
- package/create-template-html-css-1.8.0.tgz +0 -0
- package/demo-games/guess-number/index.html +0 -71
- package/demo-games/guess-number/script.js +0 -216
- package/demo-games/guess-number/style.css +0 -337
- package/demo-games/memory-game/index.html +0 -50
- package/demo-games/memory-game/script.js +0 -216
- package/demo-games/memory-game/style.css +0 -288
- package/demo-games/snake-game/index.html +0 -61
- package/demo-games/snake-game/script.js +0 -360
- package/demo-games/tic-tac-toe/index.html +0 -57
- package/demo-games/tic-tac-toe/script.js +0 -156
- package/demo-games/tic-tac-toe/style.css +0 -244
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
* {
|
|
2
|
+
margin: 0;
|
|
3
|
+
padding: 0;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
body {
|
|
8
|
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
9
|
+
background: linear-gradient(135deg, #0f4c27 0%, #1e3a20 100%);
|
|
10
|
+
min-height: 100vh;
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
align-items: center;
|
|
14
|
+
padding: 20px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.container {
|
|
18
|
+
background: white;
|
|
19
|
+
border-radius: 20px;
|
|
20
|
+
padding: 30px;
|
|
21
|
+
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
|
|
22
|
+
max-width: 900px;
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.header {
|
|
27
|
+
text-align: center;
|
|
28
|
+
margin-bottom: 20px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.header h1 {
|
|
32
|
+
color: #0f4c27;
|
|
33
|
+
font-size: 2.5rem;
|
|
34
|
+
margin-bottom: 5px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.subtitle {
|
|
38
|
+
color: #718096;
|
|
39
|
+
font-size: 1.1rem;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.game-info {
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: space-around;
|
|
45
|
+
gap: 15px;
|
|
46
|
+
margin-bottom: 25px;
|
|
47
|
+
flex-wrap: wrap;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.info-item {
|
|
51
|
+
background: linear-gradient(135deg, #0f4c27 0%, #1e3a20 100%);
|
|
52
|
+
padding: 12px 25px;
|
|
53
|
+
border-radius: 10px;
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
align-items: center;
|
|
57
|
+
min-width: 130px;
|
|
58
|
+
box-shadow: 0 4px 15px rgba(15, 76, 39, 0.4);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.label {
|
|
62
|
+
color: rgba(255, 255, 255, 0.9);
|
|
63
|
+
font-size: 0.85rem;
|
|
64
|
+
font-weight: 600;
|
|
65
|
+
margin-bottom: 5px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.value {
|
|
69
|
+
color: white;
|
|
70
|
+
font-size: 1.8rem;
|
|
71
|
+
font-weight: bold;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.game-area {
|
|
75
|
+
background: linear-gradient(135deg, #0f4c27 0%, #1e3a20 100%);
|
|
76
|
+
border-radius: 15px;
|
|
77
|
+
padding: 25px;
|
|
78
|
+
margin-bottom: 25px;
|
|
79
|
+
box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.3);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.player-section {
|
|
83
|
+
margin-bottom: 25px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.player-section:last-child {
|
|
87
|
+
margin-bottom: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.player-header {
|
|
91
|
+
display: flex;
|
|
92
|
+
justify-content: space-between;
|
|
93
|
+
align-items: center;
|
|
94
|
+
margin-bottom: 15px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.player-header h3 {
|
|
98
|
+
color: white;
|
|
99
|
+
font-size: 1.3rem;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.score-display {
|
|
103
|
+
background: rgba(255, 255, 255, 0.2);
|
|
104
|
+
padding: 8px 20px;
|
|
105
|
+
border-radius: 8px;
|
|
106
|
+
border: 2px solid rgba(255, 255, 255, 0.3);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.score-display span {
|
|
110
|
+
color: white;
|
|
111
|
+
font-size: 1.5rem;
|
|
112
|
+
font-weight: bold;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.hand {
|
|
116
|
+
display: flex;
|
|
117
|
+
gap: 15px;
|
|
118
|
+
flex-wrap: wrap;
|
|
119
|
+
min-height: 140px;
|
|
120
|
+
align-items: center;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.card {
|
|
124
|
+
width: 90px;
|
|
125
|
+
height: 130px;
|
|
126
|
+
background: white;
|
|
127
|
+
border-radius: 8px;
|
|
128
|
+
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-direction: column;
|
|
131
|
+
position: relative;
|
|
132
|
+
transition: all 0.3s ease;
|
|
133
|
+
opacity: 0;
|
|
134
|
+
transform: translateY(-20px) rotate(-5deg);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.card.dealt {
|
|
138
|
+
opacity: 1;
|
|
139
|
+
transform: translateY(0) rotate(0);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.card:hover {
|
|
143
|
+
transform: translateY(-5px);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.card-back {
|
|
147
|
+
background: linear-gradient(135deg, #c41e3a 0%, #8b0000 100%);
|
|
148
|
+
justify-content: center;
|
|
149
|
+
align-items: center;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.card-pattern {
|
|
153
|
+
font-size: 4rem;
|
|
154
|
+
color: rgba(255, 255, 255, 0.3);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.card-front {
|
|
158
|
+
padding: 8px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.card-corner {
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-direction: column;
|
|
164
|
+
align-items: center;
|
|
165
|
+
line-height: 1;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.card-corner.top-left {
|
|
169
|
+
position: absolute;
|
|
170
|
+
top: 8px;
|
|
171
|
+
left: 8px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.card-corner.bottom-right {
|
|
175
|
+
position: absolute;
|
|
176
|
+
bottom: 8px;
|
|
177
|
+
right: 8px;
|
|
178
|
+
transform: rotate(180deg);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.card-value {
|
|
182
|
+
font-size: 1.3rem;
|
|
183
|
+
font-weight: bold;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.card-suit {
|
|
187
|
+
font-size: 1.1rem;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.card-center {
|
|
191
|
+
position: absolute;
|
|
192
|
+
top: 50%;
|
|
193
|
+
left: 50%;
|
|
194
|
+
transform: translate(-50%, -50%);
|
|
195
|
+
font-size: 3rem;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.betting-area {
|
|
199
|
+
text-align: center;
|
|
200
|
+
margin-bottom: 20px;
|
|
201
|
+
padding: 20px;
|
|
202
|
+
background: #f7fafc;
|
|
203
|
+
border-radius: 12px;
|
|
204
|
+
border: 2px solid #e2e8f0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.betting-area h3 {
|
|
208
|
+
color: #2d3748;
|
|
209
|
+
margin-bottom: 15px;
|
|
210
|
+
font-size: 1.2rem;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.bet-buttons {
|
|
214
|
+
display: flex;
|
|
215
|
+
gap: 10px;
|
|
216
|
+
justify-content: center;
|
|
217
|
+
flex-wrap: wrap;
|
|
218
|
+
margin-bottom: 15px;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.bet-btn {
|
|
222
|
+
padding: 12px 25px;
|
|
223
|
+
font-size: 1.1rem;
|
|
224
|
+
font-weight: bold;
|
|
225
|
+
border: 3px solid #0f4c27;
|
|
226
|
+
background: white;
|
|
227
|
+
color: #0f4c27;
|
|
228
|
+
border-radius: 8px;
|
|
229
|
+
cursor: pointer;
|
|
230
|
+
transition: all 0.3s ease;
|
|
231
|
+
min-width: 80px;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.bet-btn:hover {
|
|
235
|
+
background: #0f4c27;
|
|
236
|
+
color: white;
|
|
237
|
+
transform: translateY(-2px);
|
|
238
|
+
box-shadow: 0 4px 15px rgba(15, 76, 39, 0.4);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.bet-btn:active {
|
|
242
|
+
transform: translateY(0);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.action-buttons {
|
|
246
|
+
display: flex;
|
|
247
|
+
gap: 15px;
|
|
248
|
+
justify-content: center;
|
|
249
|
+
margin-bottom: 20px;
|
|
250
|
+
flex-wrap: wrap;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.btn {
|
|
254
|
+
padding: 12px 30px;
|
|
255
|
+
font-size: 1rem;
|
|
256
|
+
font-weight: 600;
|
|
257
|
+
border: none;
|
|
258
|
+
border-radius: 8px;
|
|
259
|
+
cursor: pointer;
|
|
260
|
+
transition: all 0.3s ease;
|
|
261
|
+
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
|
|
262
|
+
min-width: 140px;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.btn:hover:not(:disabled) {
|
|
266
|
+
transform: translateY(-2px);
|
|
267
|
+
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.btn:active:not(:disabled) {
|
|
271
|
+
transform: translateY(0);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.btn:disabled {
|
|
275
|
+
opacity: 0.5;
|
|
276
|
+
cursor: not-allowed;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.btn-primary {
|
|
280
|
+
background: linear-gradient(135deg, #0f4c27 0%, #1e3a20 100%);
|
|
281
|
+
color: white;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.btn-success {
|
|
285
|
+
background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
|
|
286
|
+
color: white;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.btn-warning {
|
|
290
|
+
background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
|
|
291
|
+
color: white;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.btn-info {
|
|
295
|
+
background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
|
|
296
|
+
color: white;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.result-message {
|
|
300
|
+
text-align: center;
|
|
301
|
+
padding: 15px;
|
|
302
|
+
border-radius: 10px;
|
|
303
|
+
font-size: 1.3rem;
|
|
304
|
+
font-weight: bold;
|
|
305
|
+
margin-bottom: 15px;
|
|
306
|
+
display: none;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.result-message.success {
|
|
310
|
+
background: #c6f6d5;
|
|
311
|
+
color: #22543d;
|
|
312
|
+
border: 2px solid #9ae6b4;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.result-message.error {
|
|
316
|
+
background: #fed7d7;
|
|
317
|
+
color: #742a2a;
|
|
318
|
+
border: 2px solid #fc8181;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.result-message.info {
|
|
322
|
+
background: #bee3f8;
|
|
323
|
+
color: #2c5282;
|
|
324
|
+
border: 2px solid #90cdf4;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.instructions {
|
|
328
|
+
background: #f7fafc;
|
|
329
|
+
padding: 20px;
|
|
330
|
+
border-radius: 10px;
|
|
331
|
+
border: 2px solid #e2e8f0;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.instructions h3 {
|
|
335
|
+
color: #2d3748;
|
|
336
|
+
margin-bottom: 12px;
|
|
337
|
+
font-size: 1.1rem;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.instructions ul {
|
|
341
|
+
list-style: none;
|
|
342
|
+
padding-right: 0;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.instructions li {
|
|
346
|
+
color: #4a5568;
|
|
347
|
+
margin-bottom: 8px;
|
|
348
|
+
padding-right: 20px;
|
|
349
|
+
position: relative;
|
|
350
|
+
line-height: 1.6;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.instructions li:before {
|
|
354
|
+
content: "•";
|
|
355
|
+
color: #0f4c27;
|
|
356
|
+
font-weight: bold;
|
|
357
|
+
position: absolute;
|
|
358
|
+
right: 0;
|
|
359
|
+
font-size: 1.2rem;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/* Responsive */
|
|
363
|
+
@media (max-width: 768px) {
|
|
364
|
+
.container {
|
|
365
|
+
padding: 20px;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.header h1 {
|
|
369
|
+
font-size: 2rem;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.game-info {
|
|
373
|
+
gap: 10px;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.info-item {
|
|
377
|
+
min-width: 100px;
|
|
378
|
+
padding: 10px 15px;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.value {
|
|
382
|
+
font-size: 1.5rem;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.game-area {
|
|
386
|
+
padding: 15px;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.card {
|
|
390
|
+
width: 70px;
|
|
391
|
+
height: 100px;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.card-center {
|
|
395
|
+
font-size: 2rem;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.hand {
|
|
399
|
+
gap: 10px;
|
|
400
|
+
min-height: 100px;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.bet-buttons {
|
|
404
|
+
gap: 8px;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.bet-btn {
|
|
408
|
+
padding: 10px 15px;
|
|
409
|
+
min-width: 60px;
|
|
410
|
+
font-size: 1rem;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.btn {
|
|
414
|
+
padding: 10px 20px;
|
|
415
|
+
min-width: 110px;
|
|
416
|
+
font-size: 0.9rem;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
@media (max-width: 480px) {
|
|
421
|
+
.header h1 {
|
|
422
|
+
font-size: 1.5rem;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.game-info {
|
|
426
|
+
flex-direction: column;
|
|
427
|
+
align-items: stretch;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.info-item {
|
|
431
|
+
flex-direction: row;
|
|
432
|
+
justify-content: space-between;
|
|
433
|
+
min-width: unset;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.card {
|
|
437
|
+
width: 60px;
|
|
438
|
+
height: 85px;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.card-value {
|
|
442
|
+
font-size: 1rem;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.card-suit {
|
|
446
|
+
font-size: 0.9rem;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.card-center {
|
|
450
|
+
font-size: 1.5rem;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Breakout</title>
|
|
7
|
+
<link rel="stylesheet" href="style.css">
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div class="container">
|
|
11
|
+
<div class="header">
|
|
12
|
+
<h1>🎮 Breakout</h1>
|
|
13
|
+
<p class="subtitle">Break all the bricks!</p>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div class="game-info">
|
|
17
|
+
<div class="info-item">
|
|
18
|
+
<span class="label">Score:</span>
|
|
19
|
+
<span id="score" class="value">0</span>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="info-item">
|
|
22
|
+
<span class="label">Lives:</span>
|
|
23
|
+
<span id="lives" class="value">3</span>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="info-item">
|
|
26
|
+
<span class="label">Level:</span>
|
|
27
|
+
<span id="level" class="value">1</span>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="info-item">
|
|
30
|
+
<span class="label">High Score:</span>
|
|
31
|
+
<span id="highScore" class="value">0</span>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<canvas id="gameCanvas"></canvas>
|
|
36
|
+
|
|
37
|
+
<div class="controls">
|
|
38
|
+
<button id="startBtn" class="btn btn-primary">Start Game</button>
|
|
39
|
+
<button id="pauseBtn" class="btn btn-secondary" disabled>Pause</button>
|
|
40
|
+
<button id="resetBtn" class="btn btn-danger">Reset</button>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="instructions">
|
|
44
|
+
<h3>⌨️ Game Instructions:</h3>
|
|
45
|
+
<ul>
|
|
46
|
+
<li>Use arrow keys ← → or mouse to move the paddle</li>
|
|
47
|
+
<li>Break all the bricks to advance to the next level</li>
|
|
48
|
+
<li>Don't let the ball fall!</li>
|
|
49
|
+
<li>Different colored bricks give different points</li>
|
|
50
|
+
</ul>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<script src="script.js"></script>
|
|
55
|
+
</body>
|
|
56
|
+
</html>
|