Ezequield commited on
Commit
d111a69
·
verified ·
1 Parent(s): 2a77993

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +618 -579
index.html CHANGED
@@ -3,25 +3,26 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>AE Motion Logo Maker</title>
7
- <!-- Import Fonts -->
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
- <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;900&family=Orbitron:wght@400;700;900&family=Pacifico&family=Playfair+Display:wght@700&family=Roboto:wght@300;500&display=swap" rel="stylesheet">
11
- <!-- Icons -->
12
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
13
 
14
  <style>
15
  :root {
16
- --bg-dark: #121212;
17
- --bg-panel: #1e1e1e;
18
- --bg-input: #2c2c2c;
19
- --accent: #5e6ad2;
20
- --accent-hover: #4b56b3;
21
- --text-main: #e0e0e0;
22
- --text-muted: #a0a0a0;
23
- --border: #333;
24
- --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
 
25
  }
26
 
27
  * {
@@ -32,737 +33,775 @@
32
  }
33
 
34
  body {
35
- font-family: 'Roboto', sans-serif;
36
  background-color: var(--bg-dark);
37
  color: var(--text-main);
38
- height: 100vh;
39
  display: flex;
40
  flex-direction: column;
41
- overflow: hidden;
42
  }
43
 
44
  /* --- Header --- */
45
  header {
46
- height: 60px;
47
- background-color: var(--bg-panel);
48
  border-bottom: 1px solid var(--border);
 
49
  display: flex;
50
- align-items: center;
51
  justify-content: space-between;
52
- padding: 0 20px;
53
- z-index: 10;
54
- }
55
-
56
- .logo-area {
57
- display: flex;
58
  align-items: center;
59
- gap: 10px;
60
- font-weight: 700;
61
- font-size: 1.2rem;
62
- color: var(--accent);
63
  }
64
 
65
- .logo-area i {
66
- font-size: 1.4rem;
 
 
 
 
 
67
  }
68
 
69
  .anycoder-link {
70
- font-size: 0.85rem;
71
  color: var(--text-muted);
72
  text-decoration: none;
73
- transition: color 0.3s;
 
 
 
74
  }
75
 
76
  .anycoder-link:hover {
77
- color: var(--accent);
78
  }
79
 
80
  /* --- Main Layout --- */
81
  main {
82
  flex: 1;
83
- display: flex;
84
- overflow: hidden;
 
 
 
 
 
 
 
 
 
 
 
85
  }
86
 
87
  /* --- Sidebar Controls --- */
88
  .controls {
89
- width: 340px;
90
- background-color: var(--bg-panel);
91
- border-right: 1px solid var(--border);
92
- overflow-y: auto;
93
  display: flex;
94
  flex-direction: column;
95
- padding: 20px;
96
- gap: 24px;
97
- flex-shrink: 0;
98
  }
99
 
100
  .control-group {
101
  display: flex;
102
  flex-direction: column;
103
- gap: 12px;
104
  }
105
 
106
- .group-title {
107
- font-size: 0.75rem;
108
- text-transform: uppercase;
109
- letter-spacing: 1px;
110
  color: var(--text-muted);
111
- font-weight: 700;
112
- border-bottom: 1px solid var(--border);
113
- padding-bottom: 5px;
114
- margin-bottom: 5px;
115
  }
116
 
117
- /* Form Elements */
118
- label {
119
- font-size: 0.85rem;
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  display: flex;
121
- justify-content: space-between;
122
  align-items: center;
123
  }
124
 
125
- input[type="text"], select {
126
- width: 100%;
127
- background-color: var(--bg-input);
128
- border: 1px solid var(--border);
129
- color: var(--text-main);
130
- padding: 8px 12px;
131
- border-radius: 4px;
132
- font-size: 0.9rem;
133
- transition: border-color 0.2s;
134
  }
135
-
136
- input[type="text"]:focus, select:focus {
137
- border-color: var(--accent);
 
 
 
 
 
138
  }
139
 
140
  input[type="range"] {
141
- -webkit-appearance: none;
142
  width: 100%;
143
- height: 4px;
144
- background: var(--bg-input);
145
- border-radius: 2px;
146
- outline: none;
 
147
  }
148
 
149
  input[type="range"]::-webkit-slider-thumb {
150
- -webkit-appearance: none;
151
- width: 16px;
152
- height: 16px;
 
153
  border-radius: 50%;
154
- background: var(--accent);
155
  cursor: pointer;
156
- transition: background 0.2s;
157
  }
158
 
159
  input[type="range"]::-webkit-slider-thumb:hover {
160
- background: var(--accent-hover);
161
  }
162
 
163
- input[type="color"] {
164
- -webkit-appearance: none;
165
- border: none;
166
- width: 100%;
167
- height: 35px;
168
- background: transparent;
169
- cursor: pointer;
170
  }
171
-
172
- input[type="color"]::-webkit-color-swatch-wrapper {
173
- padding: 0;
 
 
 
 
 
174
  }
175
-
176
- input[type="color"]::-webkit-color-swatch {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  border: 1px solid var(--border);
178
- border-radius: 4px;
 
 
 
 
 
 
 
179
  }
180
 
181
- .row {
182
- display: flex;
183
- gap: 10px;
184
  }
185
 
186
- .col {
187
- flex: 1;
 
 
 
188
  }
189
 
190
- /* --- Canvas Area --- */
191
- .canvas-area {
192
- flex: 1;
193
- background-color: #0e0e0e;
194
- background-image:
195
- linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
196
- linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
197
- background-size: 40px 40px;
198
  display: flex;
199
  flex-direction: column;
200
- align-items: center;
201
- justify-content: center;
202
  position: relative;
203
  overflow: hidden;
204
- perspective: 1000px; /* Essential for 3D effects */
205
  }
206
 
207
- .preview-stage {
208
- width: 600px;
209
- height: 400px;
210
  display: flex;
 
211
  align-items: center;
 
 
 
 
 
212
  justify-content: center;
 
 
 
 
 
 
213
  position: relative;
214
- /* Border for visual guide */
215
- border: 1px dashed rgba(255,255,255,0.1);
216
- border-radius: 8px;
217
  }
218
 
219
- /* The Actual Logo Element */
220
- #logo-target {
221
- font-size: 60px;
222
- font-weight: 900;
223
- white-space: nowrap;
224
- cursor: default;
225
- transform-style: preserve-3d;
226
- /* Default Transition for smooth property updates, but overridden by animation classes */
227
- transition: color 0.3s, text-shadow 0.3s, transform 0.3s;
228
- line-height: 1.2;
229
  text-align: center;
 
230
  }
231
 
232
- /* --- Timeline / Action Bar --- */
233
- .timeline-bar {
234
- height: 70px;
235
- background-color: var(--bg-panel);
236
- border-top: 1px solid var(--border);
237
- display: flex;
238
- align-items: center;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  justify-content: center;
240
- gap: 20px;
241
- padding: 0 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  }
243
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  .btn {
245
- background-color: var(--bg-input);
246
- color: var(--text-main);
247
- border: 1px solid var(--border);
248
- padding: 10px 20px;
249
- border-radius: 6px;
 
250
  cursor: pointer;
251
- font-size: 0.9rem;
252
  display: flex;
253
  align-items: center;
254
- gap: 8px;
255
- transition: all 0.2s;
256
- font-weight: 500;
257
  }
258
 
259
  .btn:hover {
260
- background-color: #383838;
261
- border-color: #555;
262
- }
263
-
264
- .btn-primary {
265
- background-color: var(--accent);
266
- border-color: var(--accent);
267
- color: white;
268
  }
269
 
270
- .btn-primary:hover {
271
- background-color: var(--accent-hover);
 
 
272
  }
273
 
274
- .btn i {
275
- font-size: 1rem;
 
276
  }
277
 
278
- /* --- Animations (The "After Effects" Magic) --- */
279
-
280
- /* 1. Fade In Scale */
281
- @keyframes anim-fade-scale {
282
- 0% { opacity: 0; transform: scale(0.5) translateZ(-100px); filter: blur(10px); }
283
- 100% { opacity: 1; transform: scale(1) translateZ(0); filter: blur(0); }
284
- }
285
-
286
- /* 2. Cinematic Slide */
287
- @keyframes anim-slide {
288
- 0% { opacity: 0; transform: translateY(50px) translateX(-20px); }
289
- 100% { opacity: 1; transform: translateY(0) translateX(0); }
290
- }
291
-
292
- /* 3. 3D Rotation */
293
- @keyframes anim-3d-rotate {
294
- 0% { opacity: 0; transform: rotateX(-90deg) scale(0.5); }
295
- 100% { opacity: 1; transform: rotateX(0) scale(1); }
296
- }
297
-
298
- /* 4. Glitch Effect */
299
- @keyframes anim-glitch {
300
- 0% { transform: translate(0); }
301
- 20% { transform: translate(-2px, 2px); }
302
- 40% { transform: translate(-2px, -2px); }
303
- 60% { transform: translate(2px, 2px); }
304
- 80% { transform: translate(2px, -2px); }
305
- 100% { transform: translate(0); }
306
- }
307
- @keyframes anim-glitch-fade {
308
- 0% { opacity: 0; clip-path: inset(0 0 100% 0); }
309
- 50% { opacity: 1; clip-path: inset(0 0 0 0); }
310
- 55% { opacity: 1; clip-path: inset(20% 0 10% 0); transform: translate(-5px, 0); }
311
- 60% { opacity: 1; clip-path: inset(50% 0 20% 0); transform: translate(5px, 0); }
312
- 65% { opacity: 1; clip-path: inset(0 0 0 0); transform: translate(0, 0); }
313
- 100% { opacity: 1; clip-path: inset(0 0 0 0); }
314
- }
315
-
316
- /* 5. Neon Pulse */
317
- @keyframes anim-neon {
318
- 0% { opacity: 0; text-shadow: 0 0 0px currentColor; }
319
- 50% { opacity: 1; text-shadow: 0 0 20px currentColor, 0 0 40px currentColor; }
320
- 100% { opacity: 1; text-shadow: 0 0 10px currentColor, 0 0 20px currentColor; }
321
- }
322
-
323
- /* 6. Bounce */
324
- @keyframes anim-bounce {
325
- 0% { transform: translateY(-500px); opacity: 0; }
326
- 60% { transform: translateY(0); opacity: 1; }
327
- 75% { transform: translateY(-30px); }
328
- 100% { transform: translateY(0); }
329
- }
330
-
331
- /* Classes to apply animations */
332
- .animate-fade-scale { animation: anim-fade-scale var(--anim-duration) var(--anim-easing) forwards; }
333
- .animate-slide { animation: anim-slide var(--anim-duration) var(--anim-easing) forwards; }
334
- .animate-3d-rotate { animation: anim-3d-rotate var(--anim-duration) var(--anim-easing) forwards; }
335
- .animate-glitch { animation: anim-glitch-fade var(--anim-duration) steps(5) forwards; }
336
- .animate-neon { animation: anim-neon var(--anim-duration) ease-out forwards; }
337
- .animate-bounce { animation: anim-bounce var(--anim-duration) cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
338
-
339
- /* Toast Notification */
340
  .toast {
341
  position: fixed;
342
- bottom: 90px;
343
- right: 20px;
344
- background-color: var(--accent);
345
- color: white;
346
- padding: 12px 24px;
347
- border-radius: 4px;
348
- box-shadow: 0 4px 12px rgba(0,0,0,0.3);
349
- transform: translateY(100px);
350
- opacity: 0;
351
- transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
352
- z-index: 100;
353
- font-size: 0.9rem;
354
  display: flex;
355
  align-items: center;
356
- gap: 10px;
357
  }
 
358
  .toast.show {
359
  transform: translateY(0);
360
- opacity: 1;
361
  }
362
 
363
- /* Responsive */
364
- @media (max-width: 900px) {
365
- main {
366
- flex-direction: column-reverse;
367
- overflow-y: auto;
368
- }
369
- .controls {
370
- width: 100%;
371
- height: 50%;
372
- border-right: none;
373
- border-top: 1px solid var(--border);
374
- }
375
- .canvas-area {
376
- height: 50%;
377
- }
378
- .preview-stage {
379
- width: 90%;
380
- height: 80%;
381
- }
382
- .timeline-bar {
383
- height: 60px;
384
- padding: 0 10px;
385
- }
386
- .btn span {
387
- display: none; /* Hide text on small screens */
388
- }
389
- .btn {
390
- padding: 10px;
391
- }
392
  }
 
393
  </style>
394
  </head>
395
  <body>
396
 
397
- <!-- Header -->
398
  <header>
399
- <div class="logo-area">
400
- <i class="fa-solid fa-layer-group"></i>
401
- <span>Motion Logo Maker</span>
402
  </div>
403
  <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-link">
404
- Built with anycoder <i class="fa-solid fa-arrow-up-right-from-square" style="font-size: 0.7em;"></i>
405
  </a>
406
  </header>
407
 
408
  <main>
409
- <!-- Sidebar Controls -->
410
  <aside class="controls">
411
-
412
- <!-- Text Settings -->
413
  <div class="control-group">
414
- <div class="group-title">Content</div>
415
- <input type="text" id="inp-text" value="AESTHETIC" placeholder="Enter Logo Text">
416
- <div class="row">
417
- <div class="col">
418
- <label>Font</label>
419
- <select id="inp-font">
420
- <option value="'Montserrat', sans-serif">Montserrat</option>
421
- <option value="'Orbitron', sans-serif">Orbitron (Sci-Fi)</option>
422
- <option value="'Pacifico', cursive">Pacifico (Script)</option>
423
- <option value="'Playfair Display', serif">Playfair (Elegant)</option>
424
- <option value="'Roboto', sans-serif">Roboto (Clean)</option>
425
- </select>
426
- </div>
427
- <div class="col">
428
- <label>Weight</label>
429
- <select id="inp-weight">
430
- <option value="300">Light</option>
431
- <option value="500">Medium</option>
432
- <option value="700">Bold</option>
433
- <option value="900">Black</option>
434
- </select>
435
- </div>
436
- </div>
437
- <label>Size <span id="val-size">60px</span></label>
438
- <input type="range" id="inp-size" min="20" max="150" value="60">
439
  </div>
440
 
441
- <!-- Colors & Effects -->
442
  <div class="control-group">
443
- <div class="group-title">Style</div>
444
- <label>Fill Color</label>
445
- <input type="color" id="inp-color" value="#ffffff">
446
-
447
- <label>Background (Canvas)</label>
448
- <input type="color" id="inp-bg-color" value="#0e0e0e">
449
-
450
- <label>Opacity</label>
451
- <input type="range" id="inp-opacity" min="0" max="100" value="100">
452
-
453
- <label>Letter Spacing <span id="val-spacing">0px</span></label>
454
- <input type="range" id="inp-spacing" min="-5" max="30" value="0">
455
  </div>
456
 
457
- <!-- 3D Transforms -->
458
  <div class="control-group">
459
- <div class="group-title">3D Transform</div>
460
- <label>Rotate X <span id="val-rx">0deg</span></label>
461
- <input type="range" id="inp-rx" min="-180" max="180" value="0">
462
-
463
- <label>Rotate Y <span id="val-ry">0deg</span></label>
464
- <input type="range" id="inp-ry" min="-180" max="180" value="0">
465
-
466
- <label>Perspective Depth <span id="val-persp">1000px</span></label>
467
- <input type="range" id="inp-persp" min="100" max="2000" value="1000">
468
  </div>
469
 
470
- <!-- Shadows & Glow -->
471
- <div class="control-group">
472
- <div class="group-title">Lighting</div>
473
- <label>Shadow Blur (Glow)</label>
474
- <input type="range" id="inp-shadow-blur" min="0" max="50" value="0">
475
-
476
- <label>Shadow Color</label>
477
- <input type="color" id="inp-shadow-color" value="#5e6ad2">
478
-
479
- <label>Offset X / Y</label>
480
- <div class="row">
481
- <input type="range" id="inp-shadow-x" min="-20" max="20" value="0">
482
- <input type="range" id="inp-shadow-y" min="-20" max="20" value="0">
483
  </div>
484
  </div>
485
 
486
- <!-- Animation Settings -->
487
- <div class="control-group">
488
- <div class="group-title">Animation</div>
489
- <label>Effect Type</label>
490
- <select id="inp-anim-type">
491
- <option value="none">None</option>
492
- <option value="animate-fade-scale">Fade & Scale (Cinematic)</option>
493
- <option value="animate-slide">Slide In</option>
494
- <option value="animate-3d-rotate">3D Flip</option>
495
- <option value="animate-glitch">Glitch (Cyberpunk)</option>
496
- <option value="animate-neon">Neon Pulse</option>
497
- <option value="animate-bounce">Heavy Bounce</option>
498
- </select>
499
-
500
- <label>Duration (ms) <span id="val-duration">1000ms</span></label>
501
- <input type="range" id="inp-duration" min="200" max="3000" step="100" value="1000">
502
-
503
- <label>Easing</label>
504
- <select id="inp-easing">
505
- <option value="ease">Ease</option>
506
- <option value="ease-in">Ease In</option>
507
- <option value="ease-out">Ease Out</option>
508
- <option value="ease-in-out">Ease In Out</option>
509
- <option value="cubic-bezier(0.175, 0.885, 0.32, 1.275)">Bouncy</option>
510
- <option value="steps(5)">Steps (Digital)</option>
511
- </select>
512
  </div>
513
-
514
  </aside>
515
 
516
  <!-- Preview Area -->
517
- <section class="canvas-area" id="canvas-bg">
518
- <div class="preview-stage" id="stage">
519
- <div id="logo-target">AESTHETIC</div>
 
 
 
 
 
 
520
  </div>
521
  </section>
522
  </main>
523
 
524
- <!-- Timeline / Actions -->
525
- <div class="timeline-bar">
526
- <button class="btn" id="btn-reset"><i class="fa-solid fa-rotate-left"></i> <span>Reset</span></button>
527
- <button class="btn btn-primary" id="btn-play"><i class="fa-solid fa-play"></i> <span>Play Animation</span></button>
528
- <button class="btn" id="btn-export"><i class="fa-solid fa-code"></i> <span>Copy CSS</span></button>
529
- </div>
530
 
531
- <!-- Toast Notification -->
532
  <div class="toast" id="toast">
533
- <i class="fa-solid fa-check-circle"></i>
534
- <span>CSS copied to clipboard!</span>
535
  </div>
536
 
537
  <script>
538
- // DOM Elements
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
539
  const logoTarget = document.getElementById('logo-target');
540
- const canvasBg = document.getElementById('canvas-bg');
541
- const stage = document.getElementById('stage');
 
 
 
 
 
 
542
  const toast = document.getElementById('toast');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
543
 
544
- // Inputs
545
- const inputs = {
546
- text: document.getElementById('inp-text'),
547
- font: document.getElementById('inp-font'),
548
- weight: document.getElementById('inp-weight'),
549
- size: document.getElementById('inp-size'),
550
- color: document.getElementById('inp-color'),
551
- bgColor: document.getElementById('inp-bg-color'),
552
- opacity: document.getElementById('inp-opacity'),
553
- spacing: document.getElementById('inp-spacing'),
554
- rx: document.getElementById('inp-rx'),
555
- ry: document.getElementById('inp-ry'),
556
- persp: document.getElementById('inp-persp'),
557
- shadowBlur: document.getElementById('inp-shadow-blur'),
558
- shadowColor: document.getElementById('inp-shadow-color'),
559
- shadowX: document.getElementById('inp-shadow-x'),
560
- shadowY: document.getElementById('inp-shadow-y'),
561
- animType: document.getElementById('inp-anim-type'),
562
- duration: document.getElementById('inp-duration'),
563
- easing: document.getElementById('inp-easing')
564
- };
565
-
566
- // Value Displays
567
- const displays = {
568
- size: document.getElementById('val-size'),
569
- spacing: document.getElementById('val-spacing'),
570
- rx: document.getElementById('val-rx'),
571
- ry: document.getElementById('val-ry'),
572
- persp: document.getElementById('val-persp'),
573
- duration: document.getElementById('val-duration')
574
- };
575
 
576
- // State management
577
- let state = {};
578
-
579
- // Initialize state from inputs
580
- function updateState() {
581
- state = {
582
- text: inputs.text.value,
583
- font: inputs.font.value,
584
- weight: inputs.weight.value,
585
- size: inputs.size.value + 'px',
586
- color: inputs.color.value,
587
- bgColor: inputs.bgColor.value,
588
- opacity: inputs.opacity.value / 100,
589
- spacing: inputs.spacing.value + 'px',
590
- rx: inputs.rx.value + 'deg',
591
- ry: inputs.ry.value + 'deg',
592
- persp: inputs.persp.value + 'px',
593
- shadowBlur: inputs.shadowBlur.value + 'px',
594
- shadowColor: inputs.shadowColor.value,
595
- shadowX: inputs.shadowX.value + 'px',
596
- shadowY: inputs.shadowY.value + 'px',
597
- animType: inputs.animType.value,
598
- duration: inputs.duration.value + 'ms',
599
- easing: inputs.easing.value
600
- };
601
- updateUI();
602
- }
603
-
604
- // Apply styles to the preview
605
- function updateUI() {
606
  // Update Text
607
  logoTarget.textContent = state.text;
608
-
609
- // Update Font/Typography
610
- logoTarget.style.fontFamily = state.font;
611
- logoTarget.style.fontWeight = state.weight;
612
- logoTarget.style.fontSize = state.size;
613
- logoTarget.style.letterSpacing = state.spacing;
614
- logoTarget.style.color = state.color;
615
- logoTarget.style.opacity = state.opacity;
616
-
617
- // Update Background
618
- canvasBg.style.backgroundColor = state.bgColor;
619
-
620
- // Update Transforms (3D)
621
- stage.style.perspective = state.persp;
622
- // We apply the static transforms here.
623
- // Note: If animation is running, the animation might override this momentarily
624
- // But we set the base transform state.
625
- logoTarget.style.transform = `rotateX(${state.rx}) rotateY(${state.ry})`;
626
-
627
- // Update Shadow/Glow
628
- const shadowVal = `${state.shadowX} ${state.shadowY} ${state.shadowBlur} ${state.shadowColor}`;
629
- logoTarget.style.textShadow = shadowVal;
630
-
631
- // Update Displays
632
- displays.size.textContent = state.size;
633
- displays.spacing.textContent = state.spacing;
634
- displays.rx.textContent = state.rx;
635
- displays.ry.textContent = state.ry;
636
- displays.persp.textContent = state.persp;
637
- displays.duration.textContent = state.duration;
638
- }
639
-
640
- // Event Listeners for all inputs
641
- Object.values(inputs).forEach(input => {
642
- input.addEventListener('input', updateState);
643
- });
644
-
645
- // --- Animation Logic ---
646
-
647
- function triggerAnimation() {
648
- // Remove any existing animation classes to restart them
649
- const classes = logoTarget.className.split(" ").filter(c => !c.startsWith('animate-'));
650
- logoTarget.className = classes.join(" ");
651
-
652
- // Force reflow/repaint
653
- void logoTarget.offsetWidth;
654
-
655
- if (state.animType !== 'none') {
656
- // Set CSS variables for dynamic animation values
657
- logoTarget.style.setProperty('--anim-duration', state.duration);
658
- logoTarget.style.setProperty('--anim-easing', state.easing);
659
-
660
- // Add the specific animation class
661
- logoTarget.classList.add(state.animType);
662
- }
663
- }
664
 
665
- document.getElementById('btn-play').addEventListener('click', triggerAnimation);
666
-
667
- // --- Reset Logic ---
668
- document.getElementById('btn-reset').addEventListener('click', () => {
669
- inputs.text.value = "LOGO";
670
- inputs.size.value = 80;
671
- inputs.rx.value = 0;
672
- inputs.ry.value = 0;
673
- inputs.shadowBlur.value = 0;
674
- inputs.animType.value = "none";
675
- inputs.color.value = "#ffffff";
676
- inputs.bgColor.value = "#0e0e0e";
677
- updateState();
678
- triggerAnimation(); // Re-trigger to clear stuck animations
679
- });
680
-
681
- // --- Export Logic ---
682
- document.getElementById('btn-export').addEventListener('click', () => {
683
- const cssCode = `
684
- /* Generated by Motion Logo Maker */
685
- .logo-container {
686
- perspective: ${state.persp};
687
- display: flex;
688
- justify-content: center;
689
- align-items: center;
690
- background-color: ${state.bgColor};
691
- }
692
-
693
- .my-logo {
694
- font-family: ${state.font};
695
- font-weight: ${state.weight};
696
- font-size: ${state.size};
697
- color: ${state.color};
698
- letter-spacing: ${state.spacing};
699
- text-shadow: ${state.shadowX} ${state.shadowY} ${state.shadowBlur} ${state.shadowColor};
700
- opacity: ${state.opacity};
701
- transform: rotateX(${state.rx}) rotateY(${state.ry});
702
-
703
- /* Animation Setup */
704
- animation-name: ${state.animType === 'none' ? 'none' : state.animType.replace('animate-', 'anim-')};
705
- animation-duration: ${state.duration};
706
- animation-timing-function: ${state.easing};
707
- animation-fill-mode: forwards;
708
- }
709
-
710
- /* Keyframes for the selected effect */
711
- ${getAnimationKeyframes(state.animType)}
712
- `.trim();
713
-
714
- navigator.clipboard.writeText(cssCode).then(() => {
715
- showToast();
716
- });
717
- });
718
 
719
- function getAnimationKeyframes(type) {
720
- if(type === 'none') return '';
721
-
722
- // Simplified mapping of JS class names to standard CSS keyframes for export
723
- switch(type) {
724
- case 'animate-fade-scale':
725
- return `@keyframes anim-fade-scale {
726
- 0% { opacity: 0; transform: scale(0.5); filter: blur(10px); }
727
- 100% { opacity: 1; transform: scale(1); filter: blur(0); }
728
- }`;
729
- case 'animate-slide':
730
- return `@keyframes anim-slide {
731
- 0% { opacity: 0; transform: translateY(50px); }
732
- 100% { opacity: 1; transform: translateY(0); }
733
- }`;
734
- case 'animate-3d-rotate':
735
- return `@keyframes anim-3d-rotate {
736
- 0% { opacity: 0; transform: rotateX(-90deg); }
737
- 100% { opacity: 1; transform: rotateX(0); }
738
- }`;
739
- case 'animate-neon':
740
- return `@keyframes anim-neon {
741
- 0% { text-shadow: 0 0 0px currentColor; opacity: 0; }
742
- 50% { text-shadow: 0 0 20px currentColor; opacity: 1; }
743
- 100% { text-shadow: 0 0 10px currentColor; opacity: 1; }
744
- }`;
745
- case 'animate-bounce':
746
- return `@keyframes anim-bounce {
747
- 0% { transform: translateY(-500px); opacity: 0; }
748
- 60% { transform: translateY(0); opacity: 1; }
749
- 75% { transform: translateY(-30px); }
750
- 100% { transform: translateY(0); }
751
- }`;
752
- default:
753
- return `/* Please check the application page for specific keyframes */`;
754
- }
755
  }
756
 
757
- function showToast() {
 
758
  toast.classList.add('show');
759
  setTimeout(() => {
760
  toast.classList.remove('show');
761
  }, 3000);
762
  }
763
 
764
- // Initial run
765
- updateState();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
766
 
767
  </script>
768
  </body>
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>ABC Logo Maker 1935-2024</title>
7
+ <!-- Importing Google Fonts for different eras -->
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
+ <link href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Great+Vibes&family=Montserrat:wght@100..900&family=Orbitron:wght@400..900&family=Rock+Salt&family=Inter:wght@300..800&display=swap" rel="stylesheet">
11
+ <!-- Font Awesome for Icons -->
12
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
13
 
14
  <style>
15
  :root {
16
+ --bg-dark: #0f172a;
17
+ --bg-panel: #1e293b;
18
+ --primary: #3b82f6;
19
+ --primary-hover: #2563eb;
20
+ --text-main: #f8fafc;
21
+ --text-muted: #94a3b8;
22
+ --border: #334155;
23
+ --accent: #8b5cf6;
24
+ --radius: 12px;
25
+ --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
26
  }
27
 
28
  * {
 
33
  }
34
 
35
  body {
36
+ font-family: 'Inter', sans-serif;
37
  background-color: var(--bg-dark);
38
  color: var(--text-main);
39
+ min-height: 100vh;
40
  display: flex;
41
  flex-direction: column;
42
+ overflow-x: hidden;
43
  }
44
 
45
  /* --- Header --- */
46
  header {
47
+ background: rgba(15, 23, 42, 0.9);
48
+ backdrop-filter: blur(10px);
49
  border-bottom: 1px solid var(--border);
50
+ padding: 1rem 2rem;
51
  display: flex;
 
52
  justify-content: space-between;
 
 
 
 
 
 
53
  align-items: center;
54
+ position: sticky;
55
+ top: 0;
56
+ z-index: 100;
 
57
  }
58
 
59
+ .brand {
60
+ font-size: 1.5rem;
61
+ font-weight: 800;
62
+ background: linear-gradient(135deg, var(--primary), var(--accent));
63
+ -webkit-background-clip: text;
64
+ -webkit-text-fill-color: transparent;
65
+ letter-spacing: -0.5px;
66
  }
67
 
68
  .anycoder-link {
69
+ font-size: 0.875rem;
70
  color: var(--text-muted);
71
  text-decoration: none;
72
+ transition: var(--transition);
73
+ display: flex;
74
+ align-items: center;
75
+ gap: 0.5rem;
76
  }
77
 
78
  .anycoder-link:hover {
79
+ color: var(--primary);
80
  }
81
 
82
  /* --- Main Layout --- */
83
  main {
84
  flex: 1;
85
+ display: grid;
86
+ grid-template-columns: 350px 1fr;
87
+ gap: 2rem;
88
+ padding: 2rem;
89
+ max-width: 1600px;
90
+ margin: 0 auto;
91
+ width: 100%;
92
+ }
93
+
94
+ @media (max-width: 1024px) {
95
+ main {
96
+ grid-template-columns: 1fr;
97
+ }
98
  }
99
 
100
  /* --- Sidebar Controls --- */
101
  .controls {
102
+ background: var(--bg-panel);
103
+ border-radius: var(--radius);
104
+ padding: 1.5rem;
105
+ border: 1px solid var(--border);
106
  display: flex;
107
  flex-direction: column;
108
+ gap: 1.5rem;
109
+ height: fit-content;
 
110
  }
111
 
112
  .control-group {
113
  display: flex;
114
  flex-direction: column;
115
+ gap: 0.5rem;
116
  }
117
 
118
+ label {
119
+ font-size: 0.875rem;
120
+ font-weight: 600;
 
121
  color: var(--text-muted);
122
+ text-transform: uppercase;
123
+ letter-spacing: 0.5px;
 
 
124
  }
125
 
126
+ input[type="text"] {
127
+ background: var(--bg-dark);
128
+ border: 1px solid var(--border);
129
+ color: var(--text-main);
130
+ padding: 0.75rem 1rem;
131
+ border-radius: 8px;
132
+ font-size: 1rem;
133
+ transition: var(--transition);
134
+ }
135
+
136
+ input[type="text"]:focus {
137
+ border-color: var(--primary);
138
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
139
+ }
140
+
141
+ .color-picker-wrapper {
142
  display: flex;
143
+ gap: 1rem;
144
  align-items: center;
145
  }
146
 
147
+ input[type="color"] {
148
+ -webkit-appearance: none;
149
+ border: none;
150
+ width: 40px;
151
+ height: 40px;
152
+ border-radius: 50%;
153
+ cursor: pointer;
154
+ overflow: hidden;
155
+ background: none;
156
  }
157
+
158
+ input[type="color"]::-webkit-color-swatch-wrapper {
159
+ padding: 0;
160
+ }
161
+
162
+ input[type="color"]::-webkit-color-swatch {
163
+ border: 2px solid var(--border);
164
+ border-radius: 50%;
165
  }
166
 
167
  input[type="range"] {
 
168
  width: 100%;
169
+ height: 6px;
170
+ background: var(--bg-dark);
171
+ border-radius: 3px;
172
+ appearance: none;
173
+ cursor: pointer;
174
  }
175
 
176
  input[type="range"]::-webkit-slider-thumb {
177
+ appearance: none;
178
+ width: 18px;
179
+ height: 18px;
180
+ background: var(--primary);
181
  border-radius: 50%;
 
182
  cursor: pointer;
183
+ transition: var(--transition);
184
  }
185
 
186
  input[type="range"]::-webkit-slider-thumb:hover {
187
+ transform: scale(1.2);
188
  }
189
 
190
+ /* --- Timeline / Era Selector --- */
191
+ .timeline-container {
192
+ margin-top: 1rem;
 
 
 
 
193
  }
194
+
195
+ .timeline {
196
+ display: flex;
197
+ gap: 0.5rem;
198
+ overflow-x: auto;
199
+ padding-bottom: 1rem;
200
+ scrollbar-width: thin;
201
+ scrollbar-color: var(--border) var(--bg-dark);
202
  }
203
+
204
+ .timeline::-webkit-scrollbar {
205
+ height: 6px;
206
+ }
207
+
208
+ .timeline::-webkit-scrollbar-track {
209
+ background: var(--bg-dark);
210
+ }
211
+
212
+ .timeline::-webkit-scrollbar-thumb {
213
+ background: var(--border);
214
+ border-radius: 3px;
215
+ }
216
+
217
+ .era-btn {
218
+ background: var(--bg-dark);
219
  border: 1px solid var(--border);
220
+ color: var(--text-muted);
221
+ padding: 0.5rem 1rem;
222
+ border-radius: 20px;
223
+ font-size: 0.875rem;
224
+ font-weight: 500;
225
+ cursor: pointer;
226
+ white-space: nowrap;
227
+ transition: var(--transition);
228
  }
229
 
230
+ .era-btn:hover {
231
+ border-color: var(--primary);
232
+ color: var(--text-main);
233
  }
234
 
235
+ .era-btn.active {
236
+ background: var(--primary);
237
+ border-color: var(--primary);
238
+ color: white;
239
+ box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
240
  }
241
 
242
+ /* --- Preview Area --- */
243
+ .preview-area {
244
+ background: var(--bg-panel);
245
+ border-radius: var(--radius);
246
+ border: 1px solid var(--border);
 
 
 
247
  display: flex;
248
  flex-direction: column;
 
 
249
  position: relative;
250
  overflow: hidden;
251
+ min-height: 500px;
252
  }
253
 
254
+ .preview-header {
255
+ padding: 1rem 2rem;
256
+ border-bottom: 1px solid var(--border);
257
  display: flex;
258
+ justify-content: space-between;
259
  align-items: center;
260
+ }
261
+
262
+ .preview-canvas {
263
+ flex: 1;
264
+ display: flex;
265
  justify-content: center;
266
+ align-items: center;
267
+ background-image:
268
+ radial-gradient(var(--border) 1px, transparent 1px),
269
+ radial-gradient(var(--border) 1px, transparent 1px);
270
+ background-size: 20px 20px;
271
+ background-position: 0 0, 10px 10px;
272
  position: relative;
273
+ padding: 2rem;
274
+ overflow: hidden;
 
275
  }
276
 
277
+ /* --- The Logo CSS Classes (The Core Logic) --- */
278
+
279
+ /* Common Base */
280
+ .logo-display {
281
+ transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
282
+ user-select: none;
 
 
 
 
283
  text-align: center;
284
+ line-height: 1;
285
  }
286
 
287
+ /* 1935: Classic Serif */
288
+ .era-1935 {
289
+ font-family: 'Playfair Display', serif;
290
+ font-weight: 700;
291
+ letter-spacing: 2px;
292
+ text-transform: uppercase;
293
+ font-style: italic;
294
+ border-bottom: 4px solid var(--logo-color, #fff);
295
+ padding-bottom: 10px;
296
+ }
297
+
298
+ /* 1953: Script/Broadcast */
299
+ .era-1953 {
300
+ font-family: 'Great Vibes', cursive;
301
+ font-size: 1.5em !important;
302
+ color: var(--logo-color, #eab308);
303
+ text-shadow: 2px 2px 0px rgba(0,0,0,0.5);
304
+ }
305
+
306
+ /* 1962: The Circle (Iconic ABC) */
307
+ .era-1962 {
308
+ position: relative;
309
+ display: inline-flex;
310
  justify-content: center;
311
+ align-items: center;
312
+ }
313
+
314
+ .era-1962::before {
315
+ content: '';
316
+ position: absolute;
317
+ width: 1.4em;
318
+ height: 1.4em;
319
+ background-color: #000; /* Always black circle for authenticity */
320
+ border-radius: 50%;
321
+ z-index: -1;
322
+ box-shadow: 0 10px 30px rgba(0,0,0,0.3);
323
+ }
324
+
325
+ .era-1962 {
326
+ font-family: 'Arial Black', 'Helvetica Neue', sans-serif;
327
+ color: white;
328
+ font-weight: 900;
329
+ text-transform: lowercase;
330
+ letter-spacing: -2px;
331
+ }
332
+
333
+ /* 1975: Bold Sans Serif */
334
+ .era-1975 {
335
+ font-family: 'Montserrat', sans-serif;
336
+ font-weight: 900;
337
+ text-transform: uppercase;
338
+ letter-spacing: -2px;
339
+ border: 8px solid var(--logo-color, #000);
340
+ padding: 0.2em 0.5em;
341
+ box-shadow: 10px 10px 0px var(--logo-secondary, #333);
342
  }
343
 
344
+ /* 1988: Synthwave/Neon */
345
+ .era-1988 {
346
+ font-family: 'Orbitron', sans-serif;
347
+ font-weight: 700;
348
+ text-transform: uppercase;
349
+ color: #fff;
350
+ text-shadow:
351
+ 0 0 5px #fff,
352
+ 0 0 10px #fff,
353
+ 0 0 20px var(--logo-color, #ff00de),
354
+ 0 0 40px var(--logo-color, #ff00de),
355
+ 0 0 80px var(--logo-color, #ff00de);
356
+ }
357
+
358
+ /* 2007: Glossy Web 2.0 */
359
+ .era-2007 {
360
+ font-family: 'Inter', sans-serif;
361
+ font-weight: 800;
362
+ text-transform: uppercase;
363
+ background: linear-gradient(180deg, var(--logo-color, #3b82f6) 0%, var(--logo-secondary, #1d4ed8) 100%);
364
+ -webkit-background-clip: text;
365
+ -webkit-text-fill-color: transparent;
366
+ filter: drop-shadow(0px 4px 0px rgba(0,0,0,0.2));
367
+ }
368
+
369
+ /* 2024: Modern Minimal */
370
+ .era-2024 {
371
+ font-family: 'Montserrat', sans-serif;
372
+ font-weight: 800;
373
+ letter-spacing: -3px;
374
+ background: linear-gradient(90deg, var(--logo-color, #fff) 0%, var(--logo-secondary, #94a3b8) 100%);
375
+ -webkit-background-clip: text;
376
+ -webkit-text-fill-color: transparent;
377
+ position: relative;
378
+ }
379
+
380
+ .era-2024::after {
381
+ content: attr(data-text);
382
+ position: absolute;
383
+ left: 2px;
384
+ top: 2px;
385
+ width: 100%;
386
+ z-index: -1;
387
+ background: linear-gradient(90deg, var(--logo-secondary, #94a3b8) 0%, transparent 100%);
388
+ -webkit-background-clip: text;
389
+ -webkit-text-fill-color: transparent;
390
+ opacity: 0.5;
391
+ filter: blur(4px);
392
+ }
393
+
394
+ /* --- Action Buttons --- */
395
  .btn {
396
+ background: var(--primary);
397
+ color: white;
398
+ border: none;
399
+ padding: 0.75rem 1.5rem;
400
+ border-radius: 8px;
401
+ font-weight: 600;
402
  cursor: pointer;
403
+ transition: var(--transition);
404
  display: flex;
405
  align-items: center;
406
+ gap: 0.5rem;
407
+ justify-content: center;
 
408
  }
409
 
410
  .btn:hover {
411
+ background: var(--primary-hover);
412
+ transform: translateY(-2px);
413
+ box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
 
 
 
 
 
414
  }
415
 
416
+ .btn-secondary {
417
+ background: transparent;
418
+ border: 1px solid var(--border);
419
+ color: var(--text-main);
420
  }
421
 
422
+ .btn-secondary:hover {
423
+ background: var(--border);
424
+ transform: translateY(-2px);
425
  }
426
 
427
+ /* --- Toast Notification --- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
428
  .toast {
429
  position: fixed;
430
+ bottom: 2rem;
431
+ right: 2rem;
432
+ background: var(--bg-panel);
433
+ border: 1px solid var(--primary);
434
+ color: var(--text-main);
435
+ padding: 1rem 1.5rem;
436
+ border-radius: 8px;
437
+ box-shadow: 0 10px 30px rgba(0,0,0,0.5);
438
+ transform: translateY(150%);
439
+ transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
440
+ z-index: 1000;
 
441
  display: flex;
442
  align-items: center;
443
+ gap: 0.75rem;
444
  }
445
+
446
  .toast.show {
447
  transform: translateY(0);
 
448
  }
449
 
450
+ .toast i {
451
+ color: var(--primary);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
452
  }
453
+
454
  </style>
455
  </head>
456
  <body>
457
 
 
458
  <header>
459
+ <div class="brand">
460
+ <i class="fa-solid fa-layer-group"></i> LogoMaker
 
461
  </div>
462
  <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-link">
463
+ Built with anycoder <i class="fa-solid fa-arrow-up-right-from-square"></i>
464
  </a>
465
  </header>
466
 
467
  <main>
468
+ <!-- Sidebar Control Panel -->
469
  <aside class="controls">
 
 
470
  <div class="control-group">
471
+ <label for="text-input">Logo Text</label>
472
+ <input type="text" id="text-input" value="abc" maxlength="15" placeholder="Enter text...">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
473
  </div>
474
 
 
475
  <div class="control-group">
476
+ <label>Colors</label>
477
+ <div class="color-picker-wrapper">
478
+ <input type="color" id="color-primary" value="#ffffff" title="Primary Color">
479
+ <input type="color" id="color-secondary" value="#3b82f6" title="Secondary Color/Accent">
480
+ </div>
 
 
 
 
 
 
 
481
  </div>
482
 
 
483
  <div class="control-group">
484
+ <label for="size-slider">Size</label>
485
+ <input type="range" id="size-slider" min="50" max="250" value="120">
 
 
 
 
 
 
 
486
  </div>
487
 
488
+ <div class="timeline-container">
489
+ <label>Select Era (1935 - 2024)</label>
490
+ <div class="timeline" id="timeline">
491
+ <!-- Generated by JS -->
 
 
 
 
 
 
 
 
 
492
  </div>
493
  </div>
494
 
495
+ <div style="margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;">
496
+ <button class="btn btn-secondary" id="randomize-btn">
497
+ <i class="fa-solid fa-shuffle"></i> Random
498
+ </button>
499
+ <button class="btn" id="download-btn">
500
+ <i class="fa-solid fa-download"></i> Save
501
+ </button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
502
  </div>
 
503
  </aside>
504
 
505
  <!-- Preview Area -->
506
+ <section class="preview-area">
507
+ <div class="preview-header">
508
+ <span style="font-size: 0.875rem; color: var(--text-muted);">Live Preview</span>
509
+ <div style="font-size: 0.875rem; font-weight: 600; color: var(--primary);" id="current-era-label">1962 Era</div>
510
+ </div>
511
+ <div class="preview-canvas">
512
+ <div id="logo-target" class="logo-display era-1962">
513
+ abc
514
+ </div>
515
  </div>
516
  </section>
517
  </main>
518
 
519
+ <!-- Hidden Canvas for Export -->
520
+ <canvas id="export-canvas" style="display: none;"></canvas>
 
 
 
 
521
 
522
+ <!-- Toast -->
523
  <div class="toast" id="toast">
524
+ <i class="fa-solid fa-circle-check"></i>
525
+ <span id="toast-message">Action successful</span>
526
  </div>
527
 
528
  <script>
529
+ // --- Configuration & State ---
530
+ const eras = [
531
+ { id: 1935, name: '1935 Classic', class: 'era-1935' },
532
+ { id: 1953, name: '1953 Script', class: 'era-1953' },
533
+ { id: 1962, name: '1962 Circle', class: 'era-1962' },
534
+ { id: 1975, name: '1975 Bold', class: 'era-1975' },
535
+ { id: 1988, name: '1988 Neon', class: 'era-1988' },
536
+ { id: 2007, name: '2007 Glossy', class: 'era-2007' },
537
+ { id: 2024, name: '2024 Modern', class: 'era-2024' }
538
+ ];
539
+
540
+ let state = {
541
+ text: 'abc',
542
+ eraIndex: 2, // Default to 1962
543
+ color1: '#ffffff',
544
+ color2: '#3b82f6',
545
+ size: 120
546
+ };
547
+
548
+ // --- DOM Elements ---
549
  const logoTarget = document.getElementById('logo-target');
550
+ const textInput = document.getElementById('text-input');
551
+ const color1Input = document.getElementById('color-primary');
552
+ const color2Input = document.getElementById('color-secondary');
553
+ const sizeSlider = document.getElementById('size-slider');
554
+ const timelineContainer = document.getElementById('timeline');
555
+ const eraLabel = document.getElementById('current-era-label');
556
+ const downloadBtn = document.getElementById('download-btn');
557
+ const randomBtn = document.getElementById('randomize-btn');
558
  const toast = document.getElementById('toast');
559
+ const toastMsg = document.getElementById('toast-message');
560
+
561
+ // --- Initialization ---
562
+ function init() {
563
+ renderTimeline();
564
+ updatePreview();
565
+ setupEventListeners();
566
+ }
567
+
568
+ // --- Core Functions ---
569
+ function renderTimeline() {
570
+ timelineContainer.innerHTML = '';
571
+ eras.forEach((era, index) => {
572
+ const btn = document.createElement('button');
573
+ btn.className = `era-btn ${index === state.eraIndex ? 'active' : ''}`;
574
+ btn.textContent = era.name;
575
+ btn.onclick = () => setEra(index);
576
+ timelineContainer.appendChild(btn);
577
+ });
578
+ }
579
 
580
+ function setEra(index) {
581
+ state.eraIndex = index;
582
+ renderTimeline(); // Update active class
583
+ updatePreview();
584
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
585
 
586
+ function updatePreview() {
587
+ const currentEra = eras[state.eraIndex];
588
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
589
  // Update Text
590
  logoTarget.textContent = state.text;
591
+ logoTarget.setAttribute('data-text', state.text); // For 2024 style pseudo-element
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
592
 
593
+ // Update Classes (Remove old, add new)
594
+ logoTarget.className = `logo-display ${currentEra.class}`;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
595
 
596
+ // Update Size
597
+ logoTarget.style.fontSize = `${state.size}px`;
598
+
599
+ // Update CSS Variables for Colors
600
+ logoTarget.style.setProperty('--logo-color', state.color1);
601
+ logoTarget.style.setProperty('--logo-secondary', state.color2);
602
+
603
+ // Update Label
604
+ eraLabel.textContent = `${currentEra.id} Design`;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
605
  }
606
 
607
+ function showToast(message) {
608
+ toastMsg.textContent = message;
609
  toast.classList.add('show');
610
  setTimeout(() => {
611
  toast.classList.remove('show');
612
  }, 3000);
613
  }
614
 
615
+ // --- Canvas Export Logic (No external libraries) ---
616
+ function downloadLogo() {
617
+ const canvas = document.getElementById('export-canvas');
618
+ const ctx = canvas.getContext('2d');
619
+ const currentEra = eras[state.eraIndex];
620
+
621
+ // High resolution for export
622
+ const scale = 4;
623
+ const fontSize = state.size;
624
+
625
+ // Estimate text width
626
+ ctx.font = `900 ${fontSize}px Arial`; // Fallback for measurement
627
+ const textWidth = ctx.measureText(state.text).width;
628
+
629
+ // Set canvas dimensions
630
+ const padding = fontSize * 2;
631
+ canvas.width = (textWidth + padding) * scale;
632
+ canvas.height = (fontSize * 2) * scale;
633
+
634
+ // Reset scale transforms before drawing
635
+ ctx.setTransform(1, 0, 0, 1, 0, 0);
636
+ ctx.scale(scale, scale);
637
+
638
+ // Center coordinate system
639
+ ctx.translate(canvas.width / (2 * scale), canvas.height / (2 * scale));
640
+
641
+ // Background (Transparent usually, but let's keep it transparent)
642
+
643
+ // Drawing Logic based on Era
644
+ ctx.textAlign = 'center';
645
+ ctx.textBaseline = 'middle';
646
+
647
+ if (currentEra.id === 1935) {
648
+ ctx.font = `italic 700 ${fontSize}px 'Playfair Display', serif`;
649
+ ctx.fillStyle = state.color1;
650
+ ctx.fillText(state.text.toUpperCase(), 0, 0);
651
+ ctx.beginPath();
652
+ ctx.moveTo(-textWidth/2, fontSize/3);
653
+ ctx.lineTo(textWidth/2, fontSize/3);
654
+ ctx.strokeStyle = state.color1;
655
+ ctx.lineWidth = 4;
656
+ ctx.stroke();
657
+ }
658
+ else if (currentEra.id === 1953) {
659
+ ctx.font = `${fontSize}px 'Great Vibes', cursive`;
660
+ ctx.fillStyle = state.color1;
661
+ ctx.shadowColor = "rgba(0,0,0,0.5)";
662
+ ctx.shadowBlur = 0;
663
+ ctx.shadowOffsetX = 2 * (fontSize/100);
664
+ ctx.shadowOffsetY = 2 * (fontSize/100);
665
+ ctx.fillText(state.text, 0, 0);
666
+ }
667
+ else if (currentEra.id === 1962) {
668
+ // Circle
669
+ ctx.beginPath();
670
+ ctx.arc(0, 0, fontSize * 0.7, 0, Math.PI * 2);
671
+ ctx.fillStyle = '#000000';
672
+ ctx.fill();
673
+
674
+ // Text
675
+ ctx.font = `900 ${fontSize}px 'Arial', sans-serif`;
676
+ ctx.fillStyle = '#ffffff';
677
+ ctx.fillText(state.text.toLowerCase(), 0, 0);
678
+ }
679
+ else if (currentEra.id === 1975) {
680
+ ctx.font = `900 ${fontSize}px 'Montserrat', sans-serif`;
681
+ ctx.fillStyle = state.color1;
682
+
683
+ // Box drawing
684
+ const boxW = textWidth + fontSize;
685
+ const boxH = fontSize + 20;
686
+
687
+ // Shadow Box
688
+ const offset = 10;
689
+ ctx.fillStyle = state.color2;
690
+ ctx.fillRect(-boxW/2 + offset, -boxH/2 + offset, boxW, boxH);
691
+
692
+ // Main Box
693
+ // Note: CSS border is hard to replicate perfectly in canvas stroke without offset math
694
+ // We will draw a filled rect for the border effect
695
+ ctx.fillStyle = state.color1; // Border color
696
+ ctx.fillRect(-boxW/2, -boxH/2, boxW, boxH);
697
+
698
+ // Inner text area (simulating hole)
699
+ ctx.fillStyle = state.color1; // Matches background ideally, but here let's use text color
700
+ // Actually 1975 style usually has text INSIDE the box. Let's just draw text.
701
+ ctx.fillStyle = state.color2;
702
+ ctx.fillText(state.text.toUpperCase(), 0, 0);
703
+ }
704
+ else if (currentEra.id === 1988) {
705
+ ctx.font = `700 ${fontSize}px 'Orbitron', sans-serif`;
706
+ ctx.fillStyle = '#ffffff';
707
+ ctx.shadowColor = state.color1;
708
+ ctx.shadowBlur = 20;
709
+ ctx.shadowOffsetX = 0;
710
+ ctx.shadowOffsetY = 0;
711
+ ctx.fillText(state.text.toUpperCase(), 0, 0);
712
+ }
713
+ else if (currentEra.id === 2007) {
714
+ ctx.font = `800 ${fontSize}px 'Inter', sans-serif`;
715
+
716
+ // Gradient Text
717
+ const gradient = ctx.createLinearGradient(-textWidth/2, 0, textWidth/2, 0);
718
+ gradient.addColorStop(0, state.color1);
719
+ gradient.addColorStop(1, state.color2);
720
+ ctx.fillStyle = gradient;
721
+
722
+ ctx.shadowColor = "rgba(0,0,0,0.2)";
723
+ ctx.shadowBlur = 0;
724
+ ctx.shadowOffsetY = 4;
725
+
726
+ ctx.fillText(state.text.toUpperCase(), 0, 0);
727
+ }
728
+ else if (currentEra.id === 2024) {
729
+ ctx.font = `800 ${fontSize}px 'Montserrat', sans-serif`;
730
+
731
+ // Gradient 1
732
+ const gradient = ctx.createLinearGradient(-textWidth/2, 0, textWidth/2, 0);
733
+ gradient.addColorStop(0, state.color1);
734
+ gradient.addColorStop(1, state.color2);
735
+ ctx.fillStyle = gradient;
736
+ ctx.fillText(state.text, 0, 0);
737
+
738
+ // Blur layer behind
739
+ ctx.globalAlpha = 0.5;
740
+ ctx.fillStyle = state.color2;
741
+ ctx.filter = 'blur(4px)';
742
+ ctx.fillText(state.text, 2, 2);
743
+ ctx.filter = 'none';
744
+ ctx.globalAlpha = 1.0;
745
+ }
746
+
747
+ // Trigger Download
748
+ const link = document.createElement('a');
749
+ link.download = `logo-${currentEra.id}.png`;
750
+ link.href = canvas.toDataURL();
751
+ link.click();
752
+
753
+ showToast('Logo downloaded successfully!');
754
+ }
755
+
756
+ function randomize() {
757
+ // Random text
758
+ const texts = ['ABC', 'NET', 'SKY', 'LOGO', 'WEB', 'TV', 'NEWS'];
759
+ state.text = texts[Math.floor(Math.random() * texts.length)];
760
+
761
+ // Random Era
762
+ state.eraIndex = Math.floor(Math.random() * eras.length);
763
+
764
+ // Random Colors
765
+ state.color1 = '#' + Math.floor(Math.random()*16777215).toString(16).padStart(6, '0');
766
+ state.color2 = '#' + Math.floor(Math.random()*16777215).toString(16).padStart(6, '0');
767
+
768
+ // Update Inputs
769
+ textInput.value = state.text;
770
+ color1Input.value = state.color1;
771
+ color2Input.value = state.color2;
772
+
773
+ updatePreview();
774
+ renderTimeline();
775
+ }
776
+
777
+ // --- Event Listeners ---
778
+ function setupEventListeners() {
779
+ textInput.addEventListener('input', (e) => {
780
+ state.text = e.target.value;
781
+ updatePreview();
782
+ });
783
+
784
+ color1Input.addEventListener('input', (e) => {
785
+ state.color1 = e.target.value;
786
+ updatePreview();
787
+ });
788
+
789
+ color2Input.addEventListener('input', (e) => {
790
+ state.color2 = e.target.value;
791
+ updatePreview();
792
+ });
793
+
794
+ sizeSlider.addEventListener('input', (e) => {
795
+ state.size = e.target.value;
796
+ updatePreview();
797
+ });
798
+
799
+ downloadBtn.addEventListener('click', downloadLogo);
800
+ randomBtn.addEventListener('click', randomize);
801
+ }
802
+
803
+ // Run
804
+ init();
805
 
806
  </script>
807
  </body>