Nuzwa commited on
Commit
a87c2a1
·
verified ·
1 Parent(s): 5627632

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +78 -75
index.html CHANGED
@@ -18,7 +18,9 @@
18
  --border-color: #d1d5db;
19
  --shadow-color: rgba(0, 0, 0, 0.08);
20
  }
 
21
  * { box-sizing: border-box; }
 
22
  body {
23
  font-family: 'Poppins', sans-serif;
24
  background-color: var(--background-color);
@@ -30,6 +32,7 @@
30
  align-items: flex-start;
31
  min-height: 100vh;
32
  }
 
33
  .container {
34
  width: 100%;
35
  max-width: 820px;
@@ -39,61 +42,74 @@
39
  box-shadow: 0 10px 30px var(--shadow-color);
40
  border: 1px solid #e5e7eb;
41
  }
 
42
  @media (max-width: 600px) { .container { padding: 1.25rem; } }
 
43
  h1 {
44
  font-size: 2rem; font-weight: 700; margin: 0 0 .75rem 0; text-align: center;
45
  background: linear-gradient(90deg, var(--primary-color-start), var(--primary-color-end));
46
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
47
  }
 
48
  .subtitle { text-align:center; font-size:.9rem; color:#6b7280; margin-bottom: .75rem; }
 
49
  label { font-weight: 600; display:block; margin-top: 1rem; margin-bottom: .4rem; color: var(--label-color); font-size:.95rem; }
 
50
  select, textarea, input[type="text"] {
51
  width: 100%; padding: .8rem 1rem; border-radius: 10px; border: 1px solid var(--border-color);
52
  font-size: 1rem; font-family: 'Poppins', sans-serif; background: #f9fafb; transition: all .2s ease-in-out;
53
  }
54
- select:focus, textarea:focus, input[type="text"]
 
 
 
 
 
 
 
 
 
 
55
  /* === Unified dropdown styling for all <select> === */
56
  select {
57
- /* سارے براؤزرز میں نیٹو اَرو ہٹا دیں */
58
- -webkit-appearance: none;
59
- -moz-appearance: none;
60
- appearance: none;
61
-
62
- /* اَرو کے لئے اندر اسپیس */
63
- padding-right: 2.25rem; /* تھا: 1rem */
64
-
65
- /* کستم chevron (برینڈ کلر #4F46E5 میں) */
66
- background-image: url('data:image/svg+xml;utf8,\
67
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">\
68
- <path d="M6 8l4 4 4-4" stroke="%234F46E5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
69
- background-repeat: no-repeat;
70
- background-position: right .75rem center; /* کنارے سے ہٹا کر اندر */
71
- background-size: 14px;
72
- }
73
-
74
- /* پرانے Edge/IE کا نیٹو اَرو */
75
- select::-ms-expand { display: none; }
76
-
77
- /* ڈسایبلڈ ڈراپ ڈاؤن بھی ایک جیسا لگے */
78
- select:disabled {
79
- opacity: .6;
80
- cursor: not-allowed;
81
- }
82
- :focus { outline:none; border-color: var(--primary-color-start); box-shadow: 0 0 0 3px rgba(79,70,229,.15); background:#fff; }
83
  .row { display:grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; }
84
  .row > div { width:100%; }
 
 
 
 
 
 
85
  .actions { display:grid; grid-template-columns: 1fr 1fr; gap:.75rem; margin-top:1.25rem; }
 
86
  button {
87
  background-image: linear-gradient(90deg, var(--primary-color-start), var(--primary-color-end)); color:#fff; border:none; padding:.9rem 1.2rem; font-size:1.05rem; font-weight:700; border-radius:10px; cursor:pointer; width:100%;
88
  transition: transform .18s ease, box-shadow .18s ease; box-shadow: 0 4px 15px rgba(0,0,0,.10);
89
  }
90
  button:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(0,0,0,.15); }
91
  button.secondary { background:#111827; }
 
92
  pre { background:#0f172a; color:#e5e7eb; padding:1rem 1.25rem; white-space:pre-wrap; word-break:break-word; border-radius:12px; margin-top:1rem; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size:.92rem; line-height:1.6; border:1px solid #1f2937; }
 
93
  .note { font-size:.8rem; color:#6b7280; margin-top:.25rem; }
94
- .toolbar { display:flex; gap:1rem; align-items:center; justify-content:center; flex-wrap: wrap; margin:.35rem 0 1rem; }
95
- .toolbar .group { display:flex; gap:.5rem; align-items:center; }
96
  .dimmed { opacity:.55; }
 
97
  .toast { position: fixed; right: 16px; bottom: 16px; background: #111827; color: #fff; padding: 10px 12px; border-radius: 10px; opacity: 0; transform: translateY(10px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); transition: opacity .2s ease, transform .2s ease; font-size: .9rem; z-index:1000; }
98
  .toast.show { opacity:1; transform: translateY(0); }
99
  </style>
@@ -103,16 +119,11 @@ select::-ms-expand { display: none; }
103
  <h1>🎬 Veo3 JSON Prompt Generator <span style="font-size: 1rem; font-weight: 400;">(Pro)</span></h1>
104
  <div class="subtitle">Single‑file HTML • Smart Mode • Copy‑ready JSON</div>
105
 
106
- <!-- Smart / Pro toolbar -->
107
  <div class="toolbar">
108
  <div class="group">
109
- <label style="display:flex;gap:.5rem;align-items:center;margin:0">
110
- <input type="checkbox" id="proModeToggle"> Advanced / Pro
111
- </label>
112
- </div>
113
- <div class="group">
114
- <label for="qualityPreset" style="margin:0">🎚 Quality:</label>
115
- <select id="qualityPreset">
116
  <option value="pro" selected>Pro (default)</option>
117
  <option value="draft">Draft / Fast</option>
118
  <option value="cinematic">Cinematic</option>
@@ -468,7 +479,7 @@ select::-ms-expand { display: none; }
468
  <button class="secondary" id="copyBtn" onclick="copyToClipboard()">📋 Copy Prompt</button>
469
  </div>
470
 
471
- <pre id="output">{ /* Your JSON prompt will appear here */ }</pre>
472
  </div>
473
 
474
  <div id="toast" class="toast" role="status" aria-live="polite">Copied!</div>
@@ -481,8 +492,22 @@ select::-ms-expand { display: none; }
481
  const t = $("toast"); if(!t) return; t.textContent = msg; t.classList.add("show"); setTimeout(()=>t.classList.remove("show"), 1200);
482
  }
483
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
484
  function copyToClipboard(){
485
- const text = $("output").textContent || "";
486
  navigator.clipboard.writeText(text).then(()=>showToast("Copied!"));
487
  }
488
 
@@ -519,22 +544,22 @@ select::-ms-expand { display: none; }
519
  camera: ["handheld","rack-focus"],
520
  lighting: "Soft Wrap Key",
521
  bg: "lab",
522
- music: "Educational",
523
- sfx: "Click / Tap"
524
  },
525
  "BTS/documentary": {
526
  camera: ["handheld"],
527
  lighting: "Neutral Daylight",
528
  bg: "warehouse",
529
- music: "Natural Documentary",
530
- sfx: "Ambient Room"
531
  },
532
  meme: {
533
  camera: ["smash-zoom","whip-pan"],
534
  lighting: "High-Key Clean",
535
  bg: "auto",
536
  music: "Trap",
537
- sfx: "Smash-Zoom Gag"
538
  }
539
  };
540
 
@@ -557,7 +582,6 @@ select::-ms-expand { display: none; }
557
  const platEl = el("platform");
558
  const varEl = el("variant");
559
  const domEl = el("domain");
560
- const proToggle = el("proModeToggle");
561
  const qualEl = el("qualityPreset") || { value:"pro" };
562
 
563
  function syncPlatformsFromAspect() {
@@ -565,13 +589,9 @@ select::-ms-expand { display: none; }
565
  const ar = aspectEl.value;
566
  const rec = AR_TO_PLATFORMS[ar] || [];
567
  platEl.dataset.recommended = JSON.stringify(rec);
568
- const pro = proToggle?.checked;
569
- if (!pro) {
570
- platEl.value = rec[0] || "tiktok";
571
- platEl.disabled = true;
572
- platEl.title = `Auto: ${rec.join(", ")}`;
573
- } else {
574
- platEl.disabled = false; platEl.title = "";
575
  }
576
  }
577
 
@@ -603,22 +623,6 @@ select::-ms-expand { display: none; }
603
  setIfAuto(sfxEl, vAuto.sfx || "Whoosh / Riser");
604
  }
605
 
606
- function syncProLocking(){
607
- const pro = proToggle?.checked;
608
- const advancedIds = [
609
- "platform","camera","background","lightingMood","audioTrack","sfx",
610
- "colorPalette","hook","finale","keywords","negativePrompt",
611
- "skinTone","headCover","voLanguage","voGender","voTone","voPace"
612
- ];
613
- advancedIds.forEach(id=>{
614
- const node = el(id);
615
- if (!node) return;
616
- node.disabled = !pro;
617
- node.closest("div")?.classList?.toggle("dimmed", !pro);
618
- });
619
- syncPlatformsFromAspect();
620
- }
621
-
622
  function cleanObj(obj){
623
  const isArr = Array.isArray(obj);
624
  const acc = isArr ? [] : {};
@@ -673,10 +677,9 @@ select::-ms-expand { display: none; }
673
  const sfx = el("sfx")?.value;
674
 
675
  let platforms = [];
676
- if (platEl?.dataset?.recommended && !platEl.disabled){
677
- platforms = [platEl.value];
678
- } else if (platEl?.dataset?.recommended){
679
- platforms = JSON.parse(platEl.dataset.recommended);
680
  }
681
 
682
  const negatives = (el("negativePrompt")?.value || "no logos, no text overlays, no watermark").trim();
@@ -711,7 +714,8 @@ select::-ms-expand { display: none; }
711
  });
712
 
713
  const pretty = JSON.stringify(out, null, 2);
714
- document.getElementById("output").textContent = pretty;
 
715
 
716
  if (typeof _oldGenerate === "function") { try { _oldGenerate(); } catch(e){} }
717
  };
@@ -727,11 +731,10 @@ select::-ms-expand { display: none; }
727
  customTaskWrap.style.display = taskFocus.value === 'custom' ? 'block' : 'none';
728
  });
729
 
730
- proToggle?.addEventListener("change", ()=>{ syncProLocking(); });
731
  document.addEventListener("DOMContentLoaded", ()=>{
732
- syncProLocking();
733
  autoFromVariantAndDomain();
734
  syncPlatformsFromAspect();
 
735
  });
736
  </script>
737
  </body>
 
18
  --border-color: #d1d5db;
19
  --shadow-color: rgba(0, 0, 0, 0.08);
20
  }
21
+
22
  * { box-sizing: border-box; }
23
+
24
  body {
25
  font-family: 'Poppins', sans-serif;
26
  background-color: var(--background-color);
 
32
  align-items: flex-start;
33
  min-height: 100vh;
34
  }
35
+
36
  .container {
37
  width: 100%;
38
  max-width: 820px;
 
42
  box-shadow: 0 10px 30px var(--shadow-color);
43
  border: 1px solid #e5e7eb;
44
  }
45
+
46
  @media (max-width: 600px) { .container { padding: 1.25rem; } }
47
+
48
  h1 {
49
  font-size: 2rem; font-weight: 700; margin: 0 0 .75rem 0; text-align: center;
50
  background: linear-gradient(90deg, var(--primary-color-start), var(--primary-color-end));
51
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
52
  }
53
+
54
  .subtitle { text-align:center; font-size:.9rem; color:#6b7280; margin-bottom: .75rem; }
55
+
56
  label { font-weight: 600; display:block; margin-top: 1rem; margin-bottom: .4rem; color: var(--label-color); font-size:.95rem; }
57
+
58
  select, textarea, input[type="text"] {
59
  width: 100%; padding: .8rem 1rem; border-radius: 10px; border: 1px solid var(--border-color);
60
  font-size: 1rem; font-family: 'Poppins', sans-serif; background: #f9fafb; transition: all .2s ease-in-out;
61
  }
62
+
63
+ /* Focus states for inputs */
64
+ select:focus,
65
+ textarea:focus,
66
+ input[type="text"]:focus {
67
+ outline: none;
68
+ border-color: var(--primary-color-start);
69
+ box-shadow: 0 0 0 3px rgba(79,70,229,.15);
70
+ background: #fff;
71
+ }
72
+
73
  /* === Unified dropdown styling for all <select> === */
74
  select {
75
+ -webkit-appearance: none; /* iOS/Safari */
76
+ -moz-appearance: none;
77
+ appearance: none;
78
+ padding-right: 2.25rem; /* space for chevron */
79
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none"><path d="M6 8l4 4 4-4" stroke="%234F46E5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
80
+ background-repeat: no-repeat;
81
+ background-position: right .75rem center;
82
+ background-size: 14px;
83
+ }
84
+
85
+ /* old Edge/IE arrow */
86
+ select::-ms-expand { display: none; }
87
+
88
+ /* disabled look */
89
+ select:disabled { opacity: .6; cursor: not-allowed; }
90
+
 
 
 
 
 
 
 
 
 
 
91
  .row { display:grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; }
92
  .row > div { width:100%; }
93
+
94
+ /* Toolbar layout */
95
+ .toolbar { display:flex; gap:1rem; align-items:center; justify-content:center; flex-wrap: wrap; margin:.35rem 0 1rem; }
96
+ .toolbar .group { display:flex; gap:.5rem; align-items:center; }
97
+ .toolbar select { width: auto; min-width: 12ch; }
98
+
99
  .actions { display:grid; grid-template-columns: 1fr 1fr; gap:.75rem; margin-top:1.25rem; }
100
+
101
  button {
102
  background-image: linear-gradient(90deg, var(--primary-color-start), var(--primary-color-end)); color:#fff; border:none; padding:.9rem 1.2rem; font-size:1.05rem; font-weight:700; border-radius:10px; cursor:pointer; width:100%;
103
  transition: transform .18s ease, box-shadow .18s ease; box-shadow: 0 4px 15px rgba(0,0,0,.10);
104
  }
105
  button:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(0,0,0,.15); }
106
  button.secondary { background:#111827; }
107
+
108
  pre { background:#0f172a; color:#e5e7eb; padding:1rem 1.25rem; white-space:pre-wrap; word-break:break-word; border-radius:12px; margin-top:1rem; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size:.92rem; line-height:1.6; border:1px solid #1f2937; }
109
+
110
  .note { font-size:.8rem; color:#6b7280; margin-top:.25rem; }
 
 
111
  .dimmed { opacity:.55; }
112
+
113
  .toast { position: fixed; right: 16px; bottom: 16px; background: #111827; color: #fff; padding: 10px 12px; border-radius: 10px; opacity: 0; transform: translateY(10px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); transition: opacity .2s ease, transform .2s ease; font-size: .9rem; z-index:1000; }
114
  .toast.show { opacity:1; transform: translateY(0); }
115
  </style>
 
119
  <h1>🎬 Veo3 JSON Prompt Generator <span style="font-size: 1rem; font-weight: 400;">(Pro)</span></h1>
120
  <div class="subtitle">Single‑file HTML • Smart Mode • Copy‑ready JSON</div>
121
 
122
+ <!-- Toolbar (Quality only) -->
123
  <div class="toolbar">
124
  <div class="group">
125
+ <label for="qualityPreset" style="margin:0">Quality</label>
126
+ <select id="qualityPreset" aria-label="Quality Preset">
 
 
 
 
 
127
  <option value="pro" selected>Pro (default)</option>
128
  <option value="draft">Draft / Fast</option>
129
  <option value="cinematic">Cinematic</option>
 
479
  <button class="secondary" id="copyBtn" onclick="copyToClipboard()">📋 Copy Prompt</button>
480
  </div>
481
 
482
+ <pre id="output" aria-live="polite">{ /* Your JSON prompt will appear here */ }</pre>
483
  </div>
484
 
485
  <div id="toast" class="toast" role="status" aria-live="polite">Copied!</div>
 
492
  const t = $("toast"); if(!t) return; t.textContent = msg; t.classList.add("show"); setTimeout(()=>t.classList.remove("show"), 1200);
493
  }
494
 
495
+ let _lastJSON = "";
496
+ let _typeTimer = null;
497
+
498
+ function typewriter(el, text, speed = 8){
499
+ if (!el) return;
500
+ if (_typeTimer) { clearInterval(_typeTimer); _typeTimer = null; }
501
+ el.textContent = "";
502
+ let i = 0;
503
+ _typeTimer = setInterval(()=>{
504
+ el.textContent += text[i++] || "";
505
+ if (i >= text.length) { clearInterval(_typeTimer); _typeTimer = null; }
506
+ }, speed);
507
+ }
508
+
509
  function copyToClipboard(){
510
+ const text = _lastJSON || $("output").textContent || "";
511
  navigator.clipboard.writeText(text).then(()=>showToast("Copied!"));
512
  }
513
 
 
544
  camera: ["handheld","rack-focus"],
545
  lighting: "Soft Wrap Key",
546
  bg: "lab",
547
+ music: "Cinematic Pulses",
548
+ sfx: "Metallic Clinks"
549
  },
550
  "BTS/documentary": {
551
  camera: ["handheld"],
552
  lighting: "Neutral Daylight",
553
  bg: "warehouse",
554
+ music: "Cinematic Pulses",
555
+ sfx: "Whoosh / Riser"
556
  },
557
  meme: {
558
  camera: ["smash-zoom","whip-pan"],
559
  lighting: "High-Key Clean",
560
  bg: "auto",
561
  music: "Trap",
562
+ sfx: "Whoosh / Riser"
563
  }
564
  };
565
 
 
582
  const platEl = el("platform");
583
  const varEl = el("variant");
584
  const domEl = el("domain");
 
585
  const qualEl = el("qualityPreset") || { value:"pro" };
586
 
587
  function syncPlatformsFromAspect() {
 
589
  const ar = aspectEl.value;
590
  const rec = AR_TO_PLATFORMS[ar] || [];
591
  platEl.dataset.recommended = JSON.stringify(rec);
592
+ // set a sensible default if empty
593
+ if (!platEl.value || !rec.includes(platEl.value)) {
594
+ platEl.value = rec[0] || platEl.value || "tiktok";
 
 
 
 
595
  }
596
  }
597
 
 
623
  setIfAuto(sfxEl, vAuto.sfx || "Whoosh / Riser");
624
  }
625
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
626
  function cleanObj(obj){
627
  const isArr = Array.isArray(obj);
628
  const acc = isArr ? [] : {};
 
677
  const sfx = el("sfx")?.value;
678
 
679
  let platforms = [];
680
+ if (platEl?.dataset?.recommended){
681
+ const rec = JSON.parse(platEl.dataset.recommended);
682
+ platforms = platEl.value ? [platEl.value] : rec;
 
683
  }
684
 
685
  const negatives = (el("negativePrompt")?.value || "no logos, no text overlays, no watermark").trim();
 
714
  });
715
 
716
  const pretty = JSON.stringify(out, null, 2);
717
+ _lastJSON = pretty;
718
+ typewriter(document.getElementById("output"), pretty, 6); // typewriting effect
719
 
720
  if (typeof _oldGenerate === "function") { try { _oldGenerate(); } catch(e){} }
721
  };
 
731
  customTaskWrap.style.display = taskFocus.value === 'custom' ? 'block' : 'none';
732
  });
733
 
 
734
  document.addEventListener("DOMContentLoaded", ()=>{
 
735
  autoFromVariantAndDomain();
736
  syncPlatformsFromAspect();
737
+ generatePrompt(); // prefill output with typing
738
  });
739
  </script>
740
  </body>