decklight 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/LICENSE +202 -21
  2. package/README.md +61 -177
  3. package/SPEC.md +20 -8
  4. package/cli/agents.mjs +102 -0
  5. package/cli/bundle.mjs +37 -0
  6. package/cli/decklight.mjs +18 -0
  7. package/cli/dev.mjs +266 -0
  8. package/cli/edit.mjs +230 -17
  9. package/cli/init.mjs +58 -19
  10. package/cli/rec.mjs +7 -0
  11. package/dist/decklight.css +241 -51
  12. package/dist/decklight.js +120 -76
  13. package/dist/decklight.js.map +4 -4
  14. package/package.json +6 -4
  15. package/themes/aliens.css +3 -0
  16. package/themes/apple2.css +3 -0
  17. package/themes/aurora.css +3 -0
  18. package/themes/berry.css +3 -0
  19. package/themes/blade-runner.css +3 -0
  20. package/themes/c64.css +3 -0
  21. package/themes/carbon.css +3 -0
  22. package/themes/citrus.css +3 -0
  23. package/themes/coastal.css +3 -0
  24. package/themes/cosmos.css +3 -0
  25. package/themes/dune.css +3 -0
  26. package/themes/eclipse.css +3 -0
  27. package/themes/ember.css +3 -0
  28. package/themes/fjord.css +3 -0
  29. package/themes/friends.css +3 -0
  30. package/themes/gameboy.css +3 -0
  31. package/themes/genesis.css +3 -0
  32. package/themes/glacier.css +3 -0
  33. package/themes/godfather.css +3 -0
  34. package/themes/graphite.css +3 -0
  35. package/themes/harvest.css +3 -0
  36. package/themes/ibm-modern.css +3 -0
  37. package/themes/ibm-oldschool.css +3 -0
  38. package/themes/ink.css +3 -0
  39. package/themes/latte.css +3 -0
  40. package/themes/linen.css +3 -0
  41. package/themes/meadow.css +3 -0
  42. package/themes/metropolis.css +3 -0
  43. package/themes/miami-vice.css +3 -0
  44. package/themes/midnight.css +3 -0
  45. package/themes/mint.css +3 -0
  46. package/themes/moss.css +3 -0
  47. package/themes/obsidian.css +3 -0
  48. package/themes/orchid.css +3 -0
  49. package/themes/packs.json +2 -1
  50. package/themes/paper.css +3 -0
  51. package/themes/peony.css +3 -0
  52. package/themes/porcelain.css +3 -0
  53. package/themes/pulp-fiction.css +3 -0
  54. package/themes/reveal-beige.css +3 -0
  55. package/themes/reveal-black.css +3 -0
  56. package/themes/reveal-blood.css +3 -0
  57. package/themes/reveal-dracula.css +3 -0
  58. package/themes/reveal-league.css +3 -0
  59. package/themes/reveal-moon.css +3 -0
  60. package/themes/reveal-night.css +3 -0
  61. package/themes/reveal-serif.css +3 -0
  62. package/themes/reveal-simple.css +3 -0
  63. package/themes/reveal-sky.css +3 -0
  64. package/themes/reveal-solarized.css +3 -0
  65. package/themes/reveal-white.css +3 -0
  66. package/themes/sepia.css +3 -0
  67. package/themes/seriph.css +3 -0
  68. package/themes/severance.css +3 -0
  69. package/themes/slate.css +3 -0
  70. package/themes/snes.css +3 -0
  71. package/themes/star-wars.css +3 -0
  72. package/themes/storm.css +3 -0
  73. package/themes/stranger-things.css +3 -0
  74. package/themes/synthwave.css +3 -0
  75. package/themes/terminator.css +3 -0
  76. package/themes/velvet.css +3 -0
  77. package/themes/yamabuki.css +120 -0
  78. package/tools/chrome.mjs +43 -0
  79. package/tools/gemini-tts.mjs +19 -1
  80. package/tools/lipsync-server.mjs +249 -0
  81. package/tools/lipsync.mjs +166 -0
  82. package/tools/publish-site-voices.mjs +3 -0
  83. package/tools/shot.mjs +85 -0
  84. package/tools/tts-engines.mjs +226 -0
  85. package/tools/visemes.mjs +26 -0
  86. package/tools/voiceover-server.mjs +0 -0
  87. package/tools/voiceover.mjs +51 -34
@@ -1,3 +1,6 @@
1
+ /* Copyright 2026 Gilles Philippart
2
+ SPDX-License-Identifier: Apache-2.0 */
3
+
1
4
  /* Decklight — structural stylesheet. Themes supply the tokens (SPEC §5);
2
5
  this file supplies layout, builds, motion, chrome, code, terminal
3
6
  structure, and print. */
@@ -100,6 +103,44 @@
100
103
  /* momentary measurement state: laid out, never painted (same-task add/remove) */
101
104
  .decklight-stage > section.pin-measure { display: flex; visibility: hidden; }
102
105
 
106
+ /* ---------- per-slide layout override (SPEC §8) ----------------------------
107
+ data-layout on a section — cycled live with L/⇧L or authored directly.
108
+ 'pinned' and 'centered' resolve in the engine (pin vs in-flow); 'top' also
109
+ anchors the flow to the top of the slide instead of centering it. The
110
+ split pair turns the section into a wrapping flex row: the header (title +
111
+ subtitle, or the pinned block) spans the full width, content blocks become
112
+ ~half-width sides — first left, rest right; 'split-flip' mirrors. A lone
113
+ list gets .split-columns from the engine and splits across two columns. */
114
+ .decklight-stage > section[data-layout="top"] { justify-content: flex-start; }
115
+
116
+ .decklight-stage > section[data-layout|="split"] {
117
+ flex-direction: row;
118
+ flex-wrap: wrap;
119
+ align-items: center;
120
+ align-content: center;
121
+ column-gap: 4%;
122
+ }
123
+ .decklight-stage > section[data-layout="split-flip"] { flex-direction: row-reverse; }
124
+ .decklight-stage > section[data-layout|="split"] > * {
125
+ flex: 1 1 40%;
126
+ min-width: 0;
127
+ max-width: 48%;
128
+ }
129
+ .decklight-stage > section[data-layout|="split"] > h1,
130
+ .decklight-stage > section[data-layout|="split"] > h2,
131
+ .decklight-stage > section[data-layout|="split"] > .subtitle,
132
+ .decklight-stage > section[data-layout|="split"] > .decklight-hero-logo {
133
+ flex: 0 0 100%;
134
+ max-width: none;
135
+ }
136
+ .decklight-stage > section[data-layout|="split"] > .split-columns {
137
+ flex-basis: 100%;
138
+ max-width: none;
139
+ columns: 2;
140
+ column-gap: 2em;
141
+ }
142
+ .decklight-stage > section[data-layout|="split"] > .split-columns > li { break-inside: avoid; }
143
+
103
144
  /* ---------- subtitle (SPEC §1) ---------------------------------------------
104
145
  The <p> directly after a slide's leading heading. One canonical look
105
146
  everywhere — markdown or HTML authored, pinned or centered. Absolute size
@@ -362,23 +403,77 @@
362
403
  /* a hero slide carries its own mark — the corner chrome yields */
363
404
  .decklight.has-hero-logo > .decklight-logo { display: none; }
364
405
 
365
- /* theme-switch toast */
366
- .decklight-toast {
406
+ /* Messages: top-left, stacked newest-last, readable from the back of a room.
407
+ They fade after a few seconds — the history lives in the message log (I). */
408
+ .decklight-messages {
367
409
  position: absolute;
368
- bottom: 18px;
369
- left: 50%;
370
- transform: translateX(-50%);
371
- background: rgba(0, 0, 0, .65);
410
+ top: 18px;
411
+ left: 18px;
412
+ display: flex;
413
+ flex-direction: column;
414
+ align-items: flex-start;
415
+ gap: 8px;
416
+ max-width: min(60ch, 70%);
417
+ pointer-events: none;
418
+ z-index: 40;
419
+ }
420
+ .decklight-toast {
421
+ background: rgba(0, 0, 0, .78);
372
422
  color: #fff;
373
- font: 14px var(--font-mono, monospace);
374
- padding: 6px 14px;
375
- border-radius: 999px;
423
+ font: 500 20px/1.35 var(--font-mono, monospace);
424
+ padding: 10px 18px;
425
+ border-radius: 10px;
426
+ border-left: 4px solid var(--accent, #7ee787);
427
+ box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
376
428
  opacity: 0;
377
- transition: opacity .25s;
429
+ transform: translateY(-6px);
430
+ transition: opacity .25s, transform .25s;
378
431
  pointer-events: none;
379
- z-index: 40;
380
432
  }
381
- .decklight-toast.show { opacity: 1; }
433
+ .decklight-toast.show { opacity: 1; transform: none; }
434
+
435
+ /* the message log (I) — every message, with the time it arrived */
436
+ .decklight-msglog {
437
+ position: absolute;
438
+ top: 18px;
439
+ left: 18px;
440
+ width: min(70ch, 80%);
441
+ max-height: 70%;
442
+ display: flex;
443
+ flex-direction: column;
444
+ background: rgba(0, 0, 0, .88);
445
+ color: #eee;
446
+ border-radius: 10px;
447
+ box-shadow: 0 8px 32px rgba(0, 0, 0, .45);
448
+ z-index: 60;
449
+ overflow: hidden;
450
+ }
451
+ .decklight-msglog .msg-head {
452
+ font: 600 14px var(--font-mono, monospace);
453
+ padding: 10px 14px;
454
+ background: rgba(255, 255, 255, .07);
455
+ letter-spacing: .04em;
456
+ text-transform: uppercase;
457
+ }
458
+ .decklight-msglog .msg-log {
459
+ overflow-y: auto;
460
+ padding: 8px 14px 12px;
461
+ }
462
+ .decklight-msglog .msg-row {
463
+ display: flex;
464
+ gap: 12px;
465
+ padding: 6px 0;
466
+ font: 16px/1.45 var(--font-mono, monospace);
467
+ border-bottom: 1px solid rgba(255, 255, 255, .06);
468
+ }
469
+ .decklight-msglog .msg-row:last-child { border-bottom: 0; }
470
+ .decklight-msglog .msg-time { color: #8b98a5; flex: 0 0 auto; }
471
+ .decklight-msglog .msg-text { word-break: break-word; }
472
+ .decklight-msglog .msg-empty {
473
+ color: #8b98a5;
474
+ font: 16px var(--font-mono, monospace);
475
+ padding: 8px 0;
476
+ }
382
477
 
383
478
  /* draw style: strokes animate dash-offset; text/fills fade */
384
479
  .decklight .build-step[data-build-style="draw"] { visibility: visible; opacity: 1; }
@@ -545,6 +640,11 @@
545
640
  padding: 2px 10px;
546
641
  }
547
642
  .decklight-arrow:hover { color: var(--accent, #6af); }
643
+ /* progress bar (H) — a hairline along the very bottom edge; its width is the
644
+ position in the deck. Below the captions bar (bottom: 7%, z45), the
645
+ character overlay (z44) and the corner chrome, so it covers nothing.
646
+ Track is a translucent neutral (readable on any canvas, like the clock's
647
+ scrim); the fill is the theme's accent. */
548
648
  .decklight-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 40; background: rgba(128,128,128,.2); }
549
649
  .decklight-progress .bar { height: 100%; width: 0; background: var(--accent, #6af); transition: width 200ms ease; }
550
650
  .decklight-slide-number {
@@ -561,6 +661,27 @@
561
661
  margin-right: 12px;
562
662
  font-family: var(--font-body, system-ui, sans-serif);
563
663
  }
664
+ /* presenter clock (K) — wall time + elapsed talk time, directly BELOW the
665
+ slide number: messages own the top-left, the logo defaults bottom-left,
666
+ the arrows sit bottom-right, so this is the corner slot that covers no
667
+ other chrome. Own scrim, not theme tokens — readable on any canvas. */
668
+ .decklight-clock {
669
+ position: absolute;
670
+ right: 20px;
671
+ top: 42px;
672
+ z-index: 40;
673
+ display: flex;
674
+ gap: 10px;
675
+ padding: 5px 10px;
676
+ border-radius: 8px;
677
+ background: rgba(8, 9, 12, .72);
678
+ color: #fff;
679
+ font-size: 15px;
680
+ font-family: var(--font-mono, monospace);
681
+ pointer-events: none;
682
+ user-select: none;
683
+ }
684
+ .decklight-clock .clk-elapsed { color: var(--accent, #6af); }
564
685
  /* touch chrome — shown only where there's no keyboard (see engine.js) */
565
686
  .decklight-touch-controls { position: absolute; left: 14px; top: 14px; z-index: 41; display: none; gap: 8px; }
566
687
  .decklight-touch-btn {
@@ -577,45 +698,8 @@
577
698
  .decklight-touch-btn:active { background: rgba(70, 70, 74, .6); }
578
699
  @media (pointer: coarse) { .decklight-touch-controls { display: flex; } }
579
700
 
580
- /* module menu (playlist): list overlay, same pattern as the theme picker */
581
- .decklight-module-menu {
582
- position: absolute;
583
- inset: 0;
584
- z-index: 50;
585
- background: rgba(0, 0, 0, .55);
586
- backdrop-filter: blur(3px);
587
- display: flex;
588
- align-items: center;
589
- justify-content: center;
590
- }
591
- .decklight-module-menu .mm-panel {
592
- width: min(460px, 80vw);
593
- max-height: min(560px, 80vh);
594
- display: flex;
595
- flex-direction: column;
596
- background: #16181d;
597
- color: #e8eaee;
598
- border-radius: 14px;
599
- padding: 18px;
600
- box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
601
- font: 15px/1.4 system-ui, sans-serif;
602
- }
603
- .decklight-module-menu .mm-title {
604
- font-weight: 600;
605
- opacity: .7;
606
- padding: 0 12px 10px;
607
- text-transform: uppercase;
608
- font-size: 12px;
609
- letter-spacing: .08em;
610
- }
611
- .decklight-module-menu .mm-list { overflow-y: auto; }
612
- .decklight-module-menu .mm-row {
613
- padding: 8px 12px;
614
- border-radius: 8px;
615
- cursor: pointer;
616
- }
617
- .decklight-module-menu .mm-row.mm-selected { background: rgba(255, 255, 255, .14); }
618
- .decklight-module-menu .mm-row.mm-current::after { content: ' ✓'; opacity: .7; }
701
+ /* a finder row that is another module (a separate file), not a slide here */
702
+ .decklight-finder .tp-row.tp-module { color: #cbb6ff; }
619
703
 
620
704
  /* overview */
621
705
  .decklight-overview-grid {
@@ -680,6 +764,34 @@
680
764
  margin: 0;
681
765
  max-width: none;
682
766
  }
767
+ .decklight-overview-grid .ov-clone[data-layout="top"] { justify-content: flex-start; }
768
+ .decklight-overview-grid .ov-clone[data-layout|="split"] {
769
+ flex-direction: row;
770
+ flex-wrap: wrap;
771
+ align-items: center;
772
+ align-content: center;
773
+ column-gap: 4%;
774
+ }
775
+ .decklight-overview-grid .ov-clone[data-layout="split-flip"] { flex-direction: row-reverse; }
776
+ .decklight-overview-grid .ov-clone[data-layout|="split"] > * {
777
+ flex: 1 1 40%;
778
+ min-width: 0;
779
+ max-width: 48%;
780
+ }
781
+ .decklight-overview-grid .ov-clone[data-layout|="split"] > h1,
782
+ .decklight-overview-grid .ov-clone[data-layout|="split"] > h2,
783
+ .decklight-overview-grid .ov-clone[data-layout|="split"] > .subtitle,
784
+ .decklight-overview-grid .ov-clone[data-layout|="split"] > .decklight-hero-logo {
785
+ flex: 0 0 100%;
786
+ max-width: none;
787
+ }
788
+ .decklight-overview-grid .ov-clone[data-layout|="split"] > .split-columns {
789
+ flex-basis: 100%;
790
+ max-width: none;
791
+ columns: 2;
792
+ column-gap: 2em;
793
+ }
794
+ .decklight-overview-grid .ov-clone[data-layout|="split"] > .split-columns > li { break-inside: avoid; }
683
795
  .decklight-overview-grid .ov-num {
684
796
  position: absolute; left: 8px; top: 6px; z-index: 2;
685
797
  font-size: 12px; color: var(--fg, #eee); background: rgba(0,0,0,.5); border-radius: 4px; padding: 0 7px;
@@ -859,6 +971,81 @@
859
971
  }
860
972
  .decklight-captions.show { display: block; }
861
973
 
974
+ /* animated character (N → Character…) — lip-synced narration companion.
975
+ The controller sets data-viseme on the overlay each frame; one
976
+ [data-mouth] group shows at a time. [data-eyelid]/[data-idle] are the
977
+ default art's blink + sway — custom art gets them for free too. */
978
+ .decklight-character {
979
+ position: absolute;
980
+ width: var(--character-size, 220px);
981
+ height: var(--character-size, 220px);
982
+ z-index: 44; /* under the captions bar */
983
+ pointer-events: none;
984
+ display: none;
985
+ filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35));
986
+ }
987
+ .decklight-character.show { display: block; }
988
+ .decklight-character.pos-br { right: 28px; bottom: 28px; }
989
+ .decklight-character.pos-bl { left: 28px; bottom: 28px; }
990
+ .decklight-character.pos-tr { right: 28px; top: 28px; }
991
+ .decklight-character.pos-tl { left: 28px; top: 28px; }
992
+
993
+ /* solo — the narrator takes the stage. The slide steps aside and the
994
+ character centers, sized to the stage: `inset: 0` pins all four offsets
995
+ (overriding whichever pos-* corner is set) and `margin: auto` does the
996
+ centering. The arrows and the captions stay — you still need to navigate,
997
+ and the captions ARE the narration, not slide content. */
998
+ .decklight.decklight-solo .decklight-stage,
999
+ .decklight.decklight-solo .decklight-progress,
1000
+ .decklight.decklight-solo .decklight-slide-number { visibility: hidden; }
1001
+ /* width/height are set directly, NOT through --character-size: `size` in the
1002
+ config writes that variable inline on the element, and an inline custom
1003
+ property would beat this rule. */
1004
+ .decklight.decklight-solo .decklight-character {
1005
+ inset: 0;
1006
+ margin: auto;
1007
+ width: var(--character-solo-size, min(74vh, 74vw));
1008
+ height: var(--character-solo-size, min(74vh, 74vw));
1009
+ }
1010
+ .decklight-character svg, .decklight-character img { width: 100%; height: 100%; display: block; }
1011
+ .decklight-character.mode-video video {
1012
+ width: 100%;
1013
+ height: 100%;
1014
+ object-fit: cover;
1015
+ border-radius: 50%;
1016
+ background: rgba(8, 9, 12, .6);
1017
+ }
1018
+ .decklight-character [data-mouth] { visibility: hidden; }
1019
+ .decklight-character[data-viseme="A"] [data-mouth="A"],
1020
+ .decklight-character[data-viseme="B"] [data-mouth="B"],
1021
+ .decklight-character[data-viseme="C"] [data-mouth="C"],
1022
+ .decklight-character[data-viseme="D"] [data-mouth="D"],
1023
+ .decklight-character[data-viseme="E"] [data-mouth="E"],
1024
+ .decklight-character[data-viseme="F"] [data-mouth="F"],
1025
+ .decklight-character[data-viseme="G"] [data-mouth="G"],
1026
+ .decklight-character[data-viseme="H"] [data-mouth="H"],
1027
+ .decklight-character[data-viseme="X"] [data-mouth="X"] { visibility: visible; }
1028
+ .decklight-character [data-eyelid] {
1029
+ transform-box: fill-box;
1030
+ transform-origin: 50% 10%;
1031
+ transform: scaleY(0);
1032
+ animation: decklight-blink 4.7s infinite;
1033
+ }
1034
+ @keyframes decklight-blink {
1035
+ 0%, 94.5%, 99.5%, 100% { transform: scaleY(0); }
1036
+ 96%, 98% { transform: scaleY(1); }
1037
+ }
1038
+ .decklight-character [data-idle] {
1039
+ transform-box: fill-box;
1040
+ transform-origin: 50% 85%;
1041
+ animation: decklight-idle 6.4s ease-in-out infinite alternate;
1042
+ }
1043
+ @keyframes decklight-idle {
1044
+ from { transform: rotate(-1.1deg) translateY(0); }
1045
+ to { transform: rotate(1.1deg) translateY(1.5px); }
1046
+ }
1047
+ .decklight.decklight-print .decklight-character { display: none !important; }
1048
+
862
1049
  /* notes editor (E, served by `decklight edit`) */
863
1050
  .decklight-editor .narr-card { width: min(640px, 88vw); }
864
1051
  .decklight-editor .edit-notes {
@@ -914,6 +1101,9 @@
914
1101
  }
915
1102
 
916
1103
 
1104
+ /* Copyright 2026 Gilles Philippart
1105
+ SPDX-License-Identifier: Apache-2.0 */
1106
+
917
1107
  /* Decklight terminal player chrome (SPEC §7.3).
918
1108
  * Shipped from src/terminal/ so the terminal subsystem is self-contained;
919
1109
  * the core build concatenates this into dist/decklight.css.