Nuzwa commited on
Commit
111575a
·
verified ·
1 Parent(s): 2b9b685

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +226 -3
index.html CHANGED
@@ -194,8 +194,39 @@
194
  </div>
195
  </div>
196
 
197
- <div>
198
- <label for="taskFocus">📆 Scene Title / Task Focus</label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  <select id="taskFocus">
200
  <option>Lesson Planning</option>
201
  <option>Quiz Generator</option>
@@ -370,6 +401,56 @@
370
  </div>
371
  </div>
372
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
  <div class="row">
374
  <div>
375
  <label for="colorPalette">🎨 Color Palette</label>
@@ -437,6 +518,116 @@
437
  // --- helpers ---
438
  const $ = (id) => document.getElementById(id);
439
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  function handleTaskFocusChange() {
441
  const selected = $("taskFocus").value;
442
  $("customTaskWrapper").style.display = selected === "custom" ? "block" : "none";
@@ -492,6 +683,29 @@
492
  const camera = cameraSel === "auto" ? resolveAutoCamera(variant) : cameraSel;
493
  const background = backgroundSel === "auto" ? resolveAutoBackground(taskFocus) : backgroundSel;
494
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
495
  const prompt = {
496
  domain,
497
  main_subject: characterOrProduct,
@@ -514,10 +728,14 @@
514
  color_palette: colorPalette,
515
  hook,
516
  finale,
517
- keywords: keywordsRaw.split(',').map(s => s.trim()).filter(Boolean),
518
  negative_prompt: negativePrompt
519
  };
520
 
 
 
 
 
521
  $("output").textContent = JSON.stringify(prompt, null, 2);
522
  }
523
 
@@ -546,6 +764,11 @@
546
  // initialize
547
  $("taskFocus").addEventListener('change', handleTaskFocusChange);
548
  handleTaskFocusChange();
 
 
 
 
 
549
  // generate a starter prompt so output area isn't empty
550
  generatePrompt();
551
  </script>
 
194
  </div>
195
  </div>
196
 
197
+ <!-- Character Look Preset (new) -->
198
+ <div id="lookPresetBlock" style="margin-top:0.5rem;">
199
+ <label style="display:flex; align-items:center; gap:8px; font-weight:600;">
200
+ <input type="checkbox" id="useLookPreset" checked />
201
+ Enable Character Look Preset
202
+ </label>
203
+ <div id="lookPresetFields" class="row" style="margin-top:0.5rem;">
204
+ <div>
205
+ <label for="skinTone">🧑🏽‍ Skin Tone</label>
206
+ <select id="skinTone">
207
+ <option>light wheatish</option>
208
+ <option>wheatish</option>
209
+ <option>medium tan</option>
210
+ <option>warm brown</option>
211
+ <option>deep brown</option>
212
+ </select>
213
+ </div>
214
+ <div id="headCoverWrap">
215
+ <label for="headCover">🧕 Head Covering (if applicable)</label>
216
+ <select id="headCover">
217
+ <option value="auto">Auto</option>
218
+ <option value="none">None</option>
219
+ <option value="dupatta">Dupatta (draped)</option>
220
+ <option value="hijab_wrap">Hijab (wrap)</option>
221
+ <option value="shayla">Shayla</option>
222
+ <option value="niqab">Niqab (eyes visible)</option>
223
+ </select>
224
+ </div>
225
+ </div>
226
+ <div class="note">These presets add culturally-accurate wardrobe, hair, makeup, and accessories to the JSON.</div>
227
+ </div>
228
+
229
+ $0📆 Scene Title / Task Focus</label>
230
  <select id="taskFocus">
231
  <option>Lesson Planning</option>
232
  <option>Quiz Generator</option>
 
401
  </div>
402
  </div>
403
 
404
+ <!-- Voiceover Block (new) -->
405
+ <div id="voiceoverBlock" style="margin-top:0.5rem;">
406
+ <label style="display:flex; align-items:center; gap:8px; font-weight:600;">
407
+ <input type="checkbox" id="useVoiceover" checked />
408
+ Enable Voiceover
409
+ </label>
410
+ <div id="voFields" class="row" style="margin-top:0.5rem;">
411
+ <div>
412
+ <label for="voLanguage">🎙 Language</label>
413
+ <select id="voLanguage">
414
+ <option value="ur-PK-roman">Urdu (Roman Urdu)</option>
415
+ <option value="ur-PK">Urdu (Nastaliq)</option>
416
+ <option value="en-US">English (US)</option>
417
+ <option value="en-GB">English (UK)</option>
418
+ <option value="ar-Gulf">Arabic (Gulf)</option>
419
+ <option value="ar-Levant">Arabic (Levant)</option>
420
+ </select>
421
+ </div>
422
+ <div>
423
+ <label for="voGender">👤 Voice</label>
424
+ <select id="voGender">
425
+ <option value="female">Female</option>
426
+ <option value="male">Male</option>
427
+ <option value="youth">Youth</option>
428
+ </select>
429
+ </div>
430
+ <div>
431
+ <label for="voTone">🎚 Tone</label>
432
+ <select id="voTone">
433
+ <option value="cinematic">Cinematic</option>
434
+ <option value="friendly">Friendly</option>
435
+ <option value="authoritative">Authoritative</option>
436
+ <option value="educational">Educational</option>
437
+ <option value="inspirational">Inspirational</option>
438
+ <option value="playful">Playful</option>
439
+ </select>
440
+ </div>
441
+ <div>
442
+ <label for="voPace">⏱ Pace</label>
443
+ <select id="voPace">
444
+ <option value="slow">Slow</option>
445
+ <option value="medium" selected>Medium</option>
446
+ <option value="fast">Fast</option>
447
+ </select>
448
+ </div>
449
+ </div>
450
+ <label for="voScript" style="margin-top:0.5rem;">📝 Voiceover Script (optional)</label>
451
+ <textarea id="voScript" rows="3" placeholder="Write your VO script here... or leave empty to generate later"></textarea>
452
+ </div>
453
+
454
  <div class="row">
455
  <div>
456
  <label for="colorPalette">🎨 Color Palette</label>
 
518
  // --- helpers ---
519
  const $ = (id) => document.getElementById(id);
520
 
521
+ // --- Character Look Presets (culturally-aware) ---
522
+ const LOOK_PRESETS = {
523
+ "Pakistani Female": {
524
+ ethnicity: "Pakistani",
525
+ age_range: "20s–30s",
526
+ attire: "shalwar kameez with dupatta; modest, contemporary tailoring",
527
+ fabrics: "lawn or cotton blend; subtle embroidery",
528
+ accessories: "jhumka earrings; thin bangles",
529
+ hair: "dark hair, braided or loose soft waves",
530
+ makeup: "natural base, soft kohl eyeliner, nude/rose lipstick",
531
+ head_cover_applicable: true
532
+ },
533
+ "Pakistani Male": {
534
+ ethnicity: "Pakistani",
535
+ age_range: "20s–30s",
536
+ attire: "shalwar kameez (neutral) or kurta; optional waistcoat",
537
+ grooming: "trimmed beard or clean‑shaven",
538
+ accessories: "simple watch",
539
+ head_cover_applicable: false
540
+ },
541
+ "Arab Female": {
542
+ ethnicity: "Arab",
543
+ age_range: "20s–30s",
544
+ attire: "abaya with hijab (neutral/black) or modest dress",
545
+ accessories: "minimal jewelry",
546
+ makeup: "defined eyeliner, matte base",
547
+ hair: "covered if hijab",
548
+ head_cover_applicable: true
549
+ },
550
+ "Arab Male": {
551
+ ethnicity: "Arab",
552
+ age_range: "20s–30s",
553
+ attire: "thobe/kandura (white) or smart casual",
554
+ accessories: "optional ghutra + agal (Gulf)",
555
+ grooming: "trimmed beard",
556
+ head_cover_applicable: false
557
+ },
558
+ "South Asian Coach": {
559
+ ethnicity: "South Asian",
560
+ age_range: "30s–40s",
561
+ attire: "smart casual blazer over shirt/kurta; lanyard/clipboard",
562
+ head_cover_applicable: false
563
+ },
564
+ "Young Creator (Female)": {
565
+ ethnicity: "South Asian",
566
+ age_range: "18–25",
567
+ attire: "streetwear/athleisure; denim jacket; sneakers",
568
+ hair: "loose or ponytail; optional dyed streaks",
569
+ accessories: "minimal rings/necklace",
570
+ head_cover_applicable: false
571
+ },
572
+ "Young Creator (Male)": {
573
+ ethnicity: "South Asian",
574
+ age_range: "18–25",
575
+ attire: "hoodie/overshirt; cap optional",
576
+ hair: "short/messy",
577
+ accessories: "watch/bracelet",
578
+ head_cover_applicable: false
579
+ }
580
+ };
581
+
582
+ const PRODUCT_LIST = ["Smartphone","Perfume","Luxury Car","Skincare Product"];
583
+ const isProduct = (t) => PRODUCT_LIST.includes(t);
584
+
585
+ const isFemaleChar = (t) => /Female/i.test(t);
586
+
587
+ function resolveHeadCoverDefault(type){
588
+ if(type === "Pakistani Female") return "dupatta (draped)";
589
+ if(type === "Arab Female") return "hijab (wrap)";
590
+ return undefined;
591
+ }
592
+
593
+ function buildSubjectLook(type, skinTone, headCover){
594
+ const base = LOOK_PRESETS[type];
595
+ if(!base) return null;
596
+ const out = { ...base, skin_tone: skinTone };
597
+ if(base.head_cover_applicable){
598
+ if(headCover && headCover !== "auto"){
599
+ out.head_cover = headCover === "none" ? "none" : headCover.replace('_',' ');
600
+ } else {
601
+ const def = resolveHeadCoverDefault(type);
602
+ if(def) out.head_cover = def;
603
+ }
604
+ }
605
+ return out;
606
+ }
607
+
608
+ function buildProCamera(aspect, camera){
609
+ return {
610
+ profile: "P.R.O C.A.M.E.R.A",
611
+ P: "Photoreal lighting, accurate materials, cinematic exposure",
612
+ R: "Render at 4K master",
613
+ O: "Optics: 35mm & 85mm primes; shallow depth; creamy bokeh",
614
+ C: "Camera: full‑frame color science; natural skin tones",
615
+ A: `Angles: ${camera} + macro inserts for details`,
616
+ M: "Motion: subtle handheld micro‑jitter at 30fps (if applicable)",
617
+ E: "Environment motivated by background; practicals for depth",
618
+ R2: "Rendering: light filmic grain; no oversharpening"
619
+ };
620
+ }
621
+
622
+ $1
623
+ function updateVoUiVisibility(){
624
+ const enabled = $("useVoiceover")?.checked;
625
+ if($("voFields")) $("voFields").style.display = enabled ? "grid" : "none";
626
+ if($("voScript") && $("voScript").parentElement) $("voScript").parentElement.style.display = enabled ? "block" : "none";
627
+ }
628
+
629
+ }
630
+
631
  function handleTaskFocusChange() {
632
  const selected = $("taskFocus").value;
633
  $("customTaskWrapper").style.display = selected === "custom" ? "block" : "none";
 
683
  const camera = cameraSel === "auto" ? resolveAutoCamera(variant) : cameraSel;
684
  const background = backgroundSel === "auto" ? resolveAutoBackground(taskFocus) : backgroundSel;
685
 
686
+ // subject look (optional)
687
+ const useLook = $("useLookPreset")?.checked;
688
+ const subjectLook = (useLook && !isProduct(characterOrProduct))
689
+ ? buildSubjectLook(characterOrProduct, $("skinTone")?.value, $("headCover")?.value)
690
+ : null;
691
+
692
+ // P.R.O C.A.M.E.R.A auto-add for realistic/professional intents
693
+ const styleStr = (visualStyle || "").toLowerCase();
694
+ const kwStr = (keywordsRaw || "").toLowerCase();
695
+ const shouldPro = /photo|realistic|professional/.test(styleStr) || kwStr.includes("realistic") || kwStr.includes("dslr") || kwStr.includes("pro camera");
696
+ const proCamera = shouldPro ? buildProCamera(aspectRatio, camera) : null;
697
+
698
+ // Voiceover (optional)
699
+ const useVo = $("useVoiceover")?.checked;
700
+ const vo = {
701
+ enabled: !!useVo,
702
+ language: $("voLanguage")?.value,
703
+ voice: $("voGender")?.value,
704
+ tone: $("voTone")?.value,
705
+ pace: $("voPace")?.value,
706
+ script: $("voScript")?.value
707
+ };
708
+
709
  const prompt = {
710
  domain,
711
  main_subject: characterOrProduct,
 
728
  color_palette: colorPalette,
729
  hook,
730
  finale,
731
+ keywords: (keywordsRaw||'').split(',').map(s => s.trim()).filter(Boolean),
732
  negative_prompt: negativePrompt
733
  };
734
 
735
+ if(subjectLook) prompt.subject_look = subjectLook;
736
+ if(proCamera) prompt.pro_camera = proCamera;
737
+ if(useVo) prompt.audio.voiceover = vo;
738
+
739
  $("output").textContent = JSON.stringify(prompt, null, 2);
740
  }
741
 
 
764
  // initialize
765
  $("taskFocus").addEventListener('change', handleTaskFocusChange);
766
  handleTaskFocusChange();
767
+ if($("characterType")){ $("characterType").addEventListener('change', updateLookUiVisibility); }
768
+ if($("useLookPreset")){ $("useLookPreset").addEventListener('change', updateLookUiVisibility); }
769
+ if($("useVoiceover")){ $("useVoiceover").addEventListener('change', updateVoUiVisibility); }
770
+ updateLookUiVisibility();
771
+ updateVoUiVisibility();
772
  // generate a starter prompt so output area isn't empty
773
  generatePrompt();
774
  </script>