-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathad-gen.html
More file actions
717 lines (625 loc) · 27.9 KB
/
Copy pathad-gen.html
File metadata and controls
717 lines (625 loc) · 27.9 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
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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Banner Generator | Astrakit</title>
<meta name="description" content="Create beautiful banners and blog headers in the Astrakit design language">
<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=Outfit:wght@400;500;600;700&family=Spline+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="src/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="icon" type="image/png" href="src/images/favicon.png">
<style>
.ad-generator {
padding-top: 60px;
min-height: 100vh;
}
.generator-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2rem;
}
@media (max-width: 768px) {
.generator-container {
grid-template-columns: 1fr;
}
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Outfit', sans-serif;
font-weight: 700;
}
body, p, input, button, textarea, select, label {
font-family: 'Spline Sans', sans-serif;
}
.template-list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
margin-top: 1rem;
}
.template-card {
background-color: var(--card-bg);
padding: 1.2rem;
border-radius: var(--border-radius-sm);
border: 1px solid rgba(255, 255, 255, 0.06);
cursor: pointer;
transition: all 0.3s ease;
position: relative;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.template-card:hover {
transform: translateY(-5px);
border-color: rgba(139, 204, 91, 0.3);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
background-color: rgba(255, 255, 255, 0.08);
}
.template-card.selected {
border-color: var(--main-color);
box-shadow: 0 0 0 2px rgba(139, 204, 91, 0.3);
}
.template-card h4 {
margin: 0 0 0.5rem 0;
color: var(--text-color);
font-size: 1rem;
font-weight: 600;
font-family: 'Outfit', sans-serif;
}
.template-card p {
margin: 0;
font-size: 0.85rem;
color: var(--text-secondary);
font-family: 'Spline Sans', sans-serif;
}
.template-colors {
display: flex;
gap: 0.5rem;
margin-top: 0.8rem;
}
.color-dot {
width: 15px;
height: 15px;
border-radius: 50%;
border: 1px solid rgba(255, 255, 255, 0.1);
}
.preview-container {
margin-top: 1rem;
margin-bottom: 1rem;
position: relative;
overflow: hidden;
border-radius: var(--border-radius-sm);
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: var(--shadow-md);
transition: all 0.3s ease;
background-color: #111;
}
.preview-container:hover {
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
transform: translateY(-2px);
}
#canvas {
max-width: 100%;
height: auto;
display: block;
border-radius: var(--border-radius-sm);
}
.ad-controls, .ad-preview {
background: linear-gradient(to bottom right, rgba(35, 35, 35, 0.6), rgba(25, 25, 25, 0.6));
backdrop-filter: blur(10px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
border: 1px solid rgba(255, 255, 255, 0.08);
padding: 2rem;
border-radius: var(--border-radius-md);
}
.ad-preview {
display: flex;
flex-direction: column;
align-items: center;
}
.form-group {
margin-bottom: 1.5rem;
}
.form-group label {
display: block;
margin-bottom: 0.5rem;
font-weight: 500;
font-family: 'Outfit', sans-serif;
}
.size-inputs {
display: flex;
gap: 1rem;
}
.size-inputs input {
width: 100%;
}
.color-group {
display: flex;
align-items: center;
gap: 1rem;
}
.color-preview {
width: 30px;
height: 30px;
border-radius: 50%;
border: 2px solid rgba(255, 255, 255, 0.2);
}
.presets {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
margin-top: 0.5rem;
}
.preset-size {
padding: 0.4rem 0.8rem;
background-color: rgba(255, 255, 255, 0.1);
border-radius: var(--border-radius-sm);
font-size: 0.85rem;
cursor: pointer;
transition: var(--transition);
}
.preset-size:hover {
background-color: var(--main-color);
color: var(--bg-color);
}
.checkbox-group {
display: flex;
align-items: center;
gap: 0.5rem;
margin: 1rem 0;
}
.checkbox-group input {
width: 18px;
height: 18px;
}
.layout-options {
display: flex;
gap: 1rem;
flex-wrap: wrap;
}
.layout-option {
padding: 0.6rem 1.2rem;
background-color: rgba(255, 255, 255, 0.1);
border-radius: var(--border-radius-sm);
cursor: pointer;
transition: var(--transition);
}
.layout-option.selected {
background-color: var(--main-color);
color: var(--bg-color);
}
.layout-option:hover {
background-color: rgba(255, 255, 255, 0.2);
}
.tabs {
display: flex;
margin-bottom: 1.5rem;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.tab {
padding: 0.8rem 1.5rem;
background: transparent;
border: none;
color: var(--text-secondary);
cursor: pointer;
transition: var(--transition);
font-size: 0.95rem;
position: relative;
font-family: 'Outfit', sans-serif;
font-weight: 500;
}
.tab.active {
color: var(--main-color);
}
.tab.active::after {
content: '';
position: absolute;
bottom: -1px;
left: 0;
width: 100%;
height: 2px;
background-color: var(--main-color);
}
.tab:hover {
color: var(--text-color);
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
input[type="text"],
input[type="number"],
input[type="email"],
textarea {
width: 100%;
padding: 1rem;
background-color: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.06);
border-radius: var(--border-radius-sm);
color: var(--text-color);
transition: var(--transition);
font-family: var(--body-font);
font-size: 1rem;
display: block;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
textarea:focus {
border-color: rgba(139, 204, 91, 0.3);
outline: none;
box-shadow: 0 0 0 3px rgba(139, 204, 91, 0.08);
background-color: rgba(255, 255, 255, 0.05);
}
input[type="color"] {
width: 60px;
height: 30px;
border: none;
border-radius: var(--border-radius-sm);
background: transparent;
cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper {
padding: 0;
}
input[type="color"]::-webkit-color-swatch {
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: var(--border-radius-sm);
}
.result-container {
margin-top: 2rem;
text-align: center;
padding: 2rem;
background: linear-gradient(to bottom right, rgba(35, 35, 35, 0.6), rgba(25, 25, 25, 0.6));
backdrop-filter: blur(10px);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
border-radius: var(--border-radius-md);
border: 1px solid rgba(255, 255, 255, 0.08);
}
.result-image {
max-width: 100%;
height: auto;
margin: 1rem 0;
border-radius: var(--border-radius-sm);
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
transition: all 0.3s ease;
}
.result-image:hover {
transform: scale(1.02);
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}
.blur-circle {
position: fixed;
border-radius: 50%;
filter: blur(80px);
z-index: -1;
opacity: 0.4;
will-change: transform;
}
.circle-1 {
width: 600px;
height: 600px;
background-color: rgba(139, 204, 91, 0.08);
top: -200px;
right: -150px;
animation: float-slow 20s infinite alternate;
}
.circle-2 {
width: 800px;
height: 800px;
background-color: rgba(139, 204, 91, 0.05);
bottom: -300px;
left: -200px;
animation: float-slow 25s infinite alternate-reverse;
}
@keyframes float-slow {
0% {
transform: translate(0, 0);
}
100% {
transform: translate(40px, 40px);
}
}
.btn {
font-family: 'Outfit', sans-serif;
font-weight: 600;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0.9rem 1.8rem;
border-radius: 30px;
text-decoration: none;
transition: all 0.3s ease;
border: none;
cursor: pointer;
font-size: 1rem;
gap: 0.5rem;
}
.btn.primary {
background-color: var(--main-color);
color: var(--bg-color);
box-shadow: 0 4px 15px rgba(139, 204, 91, 0.2);
}
.btn.primary:hover {
box-shadow: 0 6px 20px rgba(139, 204, 91, 0.3);
transform: translateY(-5px);
}
.btn.secondary {
border: 2px solid var(--main-color);
color: var (--main-color);
background-color: transparent;
}
.btn.secondary:hover {
background-color: var(--main-color);
color: var(--bg-color);
transform: translateY(-5px);
}
.highlight {
background: linear-gradient(90deg, #8BCC5B, #6DA549);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.section-intro {
font-family: 'Spline Sans', sans-serif;
line-height: 1.6;
text-align: center;
max-width: 800px;
margin: 0 auto var(--spacing-lg);
font-size: 1.15rem;
color: var(--text-secondary);
}
.subtext {
font-family: 'Spline Sans', sans-serif;
font-size: 0.9rem;
color: var(--text-secondary);
}
.alert {
background-color: rgba(255, 50, 50, 0.2);
padding: 1rem;
border-radius: var(--border-radius-sm);
margin-bottom: 2rem;
}
.alert p {
color: #fff;
margin: 0;
}
h1, h2, h3 {
background: linear-gradient(90deg, #fff, #ccc);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
font-weight: 700;
}
#ad-text,
#ad-text[type="text"],
input#ad-text,
input#ad-text[type="text"] {
display: block !important;
visibility: visible !important;
opacity: 1 !important;
position: static !important;
height: auto !important;
width: 100% !important;
margin: 0 !important;
padding: 1rem !important;
font-family: var(--body-font) !important;
font-size: 1rem !important;
background-color: rgba(255, 255, 255, 0.03) !important;
border: 1px solid rgba(255, 255, 255, 0.06) !important;
border-radius: var(--border-radius-sm) !important;
color: var(--text-color) !important;
transition: var(--transition) !important;
min-height: 2.5rem !important;
z-index: 10 !important;
clip: auto !important;
}
#ad-text:focus,
#ad-text[type="text"]:focus {
border-color: rgba(139, 204, 91, 0.3) !important;
outline: none !important;
box-shadow: 0 0 0 3px rgba(139, 204, 91, 0.08) !important;
background-color: rgba(255, 255, 255, 0.05) !important;
}
label[for="ad-text"] {
display: block !important;
visibility: visible !important;
opacity: 1 !important;
position: static !important;
margin-bottom: 0.5rem !important;
font-weight: 500 !important;
font-family: 'Outfit', sans-serif !important;
z-index: 10 !important;
}
.form-group:has(#ad-text) {
display: block !important;
margin-bottom: 1.5rem !important;
}
</style>
</head>
<body>
<div class="blur-circle circle-1"></div>
<div class="blur-circle circle-2"></div>
<section class="ad-generator">
<div class="container">
<h1>Astrakit <span class="highlight">Banner Generator</span></h1>
<p class="section-intro">Create beautiful banners and blog headers in the Astrakit design language. Add titles, descriptions, customize your design, and export in PNG format.</p>
<div id="alert-container"></div>
<div id="result-container" style="display: none">
<div class="result-container">
<h2>Your Banner is <span class="highlight">Ready!</span></h2>
<div>
<img id="result-image" alt="Generated Banner" class="result-image">
</div>
<p>Your banner has been generated successfully!</p>
<a id="download-btn" download="astrakit-banner.png" class="btn primary">
<i class="fas fa-download"></i> Download Banner
</a>
<button id="create-another-btn" class="btn secondary" style="margin-top: 1rem;">
<i class="fas fa-redo"></i> Create Another
</button>
</div>
</div>
<div id="generator-container" class="generator-container">
<div class="ad-controls">
<h3>Banner <span class="highlight">Settings</span></h3>
<div class="tabs">
<button type="button" class="tab active" data-tab="templates">Templates</button>
<button type="button" class="tab" data-tab="basics">Basic Settings</button>
<button type="button" class="tab" data-tab="design">Design</button>
</div>
<form id="ad-form">
<div class="tab-content active" id="templates-tab">
<div class="form-group">
<label>Choose a Premade Template</label>
<p class="subtext">Select a template to quickly start with a pre-designed banner</p>
<div class="template-list">
<div class="template-card" data-template="modern-dark">
<h4>Modern Dark</h4>
<p>Clean, professional dark theme with green accent</p>
<div class="template-colors">
<div class="color-dot" style="background-color: #121212;"></div>
<div class="color-dot" style="background-color: #ffffff;"></div>
<div class="color-dot" style="background-color: #8BCC5B;"></div>
</div>
</div>
<div class="template-card" data-template="gradient-green">
<h4>Green Gradient</h4>
<p>Bold green gradient with left-aligned content</p>
<div class="template-colors">
<div class="color-dot" style="background-color: #0F2027;"></div>
<div class="color-dot" style="background-color: #ffffff;"></div>
<div class="color-dot" style="background-color: #8BCC5B;"></div>
</div>
</div>
<div class="template-card" data-template="minimal-light">
<h4>Light & Clean</h4>
<p>Minimalist light design with dark text</p>
<div class="template-colors">
<div class="color-dot" style="background-color: #f5f5f5;"></div>
<div class="color-dot" style="background-color: #212121;"></div>
<div class="color-dot" style="background-color: #8BCC5B;"></div>
</div>
</div>
<div class="template-card" data-template="tech-blue">
<h4>Tech Inspired</h4>
<p>Deep blue with teal accent and right alignment</p>
<div class="template-colors">
<div class="color-dot" style="background-color: #0A192F;"></div>
<div class="color-dot" style="background-color: #64FFDA;"></div>
<div class="color-dot" style="background-color: #CCD6F6;"></div>
</div>
</div>
<div class="template-card" data-template="vibrant-green">
<h4>Vibrant Green</h4>
<p>Bold, energetic design with Astrakit green focus</p>
<div class="template-colors">
<div class="color-dot" style="background-color: #1E3A24;"></div>
<div class="color-dot" style="background-color: #8BCC5B;"></div>
<div class="color-dot" style="background-color: #E0F5D7;"></div>
</div>
</div>
<div class="template-card" data-template="astrakit">
<h4>Astrakit Official</h4>
<p>Our official branding colors and style</p>
<div class="template-colors">
<div class="color-dot" style="background-color: #161616;"></div>
<div class="color-dot" style="background-color: #ffffff;"></div>
<div class="color-dot" style="background-color: #8BCC5B;"></div>
</div>
</div>
</div>
</div>
</div>
<div class="tab-content" id="basics-tab">
<div class="form-group">
<label for="width">Banner Size (width × height)</label>
<div class="size-inputs">
<input type="number" id="width" name="width" value="800" min="50" max="2000" required>
<input type="number" id="height" name="height" value="300" min="50" max="1200" required>
</div>
<div class="presets">
<div class="preset-size" data-width="800" data-height="300">800×300 (Blog Header)</div>
<div class="preset-size" data-width="1200" data-height="600">1200×600 (Featured)</div>
<div class="preset-size" data-width="1600" data-height="400">1600×400 (Wide)</div>
<div class="preset-size" data-width="600" data-height="600">600×600 (Square)</div>
<div class="preset-size" data-width="500" data-height="750">500×750 (Story)</div>
</div>
</div>
<div class="form-group">
<label for="banner-title">Banner Title</label>
<input type="text" id="banner-title" name="banner_title" value="Your Awesome Title" required>
</div>
<div class="form-group">
<label for="description">Description / Subtitle</label>
<input type="text" id="description" name="description" value="Add a compelling subtitle or description for your banner" placeholder="Optional description or subtitle">
</div>
<div class="form-group">
<label>Layout Style</label>
<div class="layout-options">
<div class="layout-option selected" data-value="left">Left Aligned</div>
<div class="layout-option" data-value="centered">Centered</div>
<div class="layout-option" data-value="right">Right Aligned</div>
</div>
<input type="hidden" id="layout-type" name="layout_type" value="left">
</div>
<div class="checkbox-group">
<input type="checkbox" id="include-logo" name="include_logo" checked>
<label for="include-logo">Include Astrakit Logo</label>
</div>
</div>
<div class="tab-content" id="design-tab">
<div class="form-group">
<label>Background Color</label>
<div class="color-group">
<div class="color-preview" id="bg-color-preview"></div>
<input type="color" id="bg-color" name="bg_color" value="#161616">
</div>
</div>
<div class="form-group">
<label>Title Color</label>
<div class="color-group">
<div class="color-preview" id="text-color-preview"></div>
<input type="color" id="text-color" name="text_color" value="#ffffff">
</div>
</div>
<div class="form-group">
<label>Description Color</label>
<div class="color-group">
<div class="color-preview" id="description-color-preview"></div>
<input type="color" id="description-color" name="description_color" value="#cccccc">
</div>
</div>
<div class="form-group">
<label>Accent Color (for particles & effects)</label>
<div class="color-group">
<div class="color-preview" id="accent-color-preview"></div>
<input type="color" id="accent-color" name="accent_color" value="#8BCC5B">
</div>
</div>
<div class="checkbox-group">
<input type="checkbox" id="include-particles" name="include_particles" checked>
<label for="include-particles">Include Floating Particles & Blur Effects</label>
</div>
</div>
<button type="submit" class="btn primary" id="generate-btn">
<i class="fas fa-magic"></i> Generate Banner
</button>
</form>
</div>
<div class="ad-preview">
<h3>Live <span class="highlight">Preview</span></h3>
<div class="preview-container" id="preview-container">
<canvas id="canvas"></canvas>
</div>
<p class="subtext">This is a real-time preview. You can download the final banner after generating.</p>
</div>
</div>
</div>
</section>
<script src="src/banner-generator.js"></script>
</body>
</html>