sera-code 0.1.3 → 0.1.4

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 (332) hide show
  1. package/README.md +9 -1
  2. package/bin/sera.mjs +31 -0
  3. package/dist/bundle/chunks/{chunk-OXMPCU7P.js → chunk-DFRGGJWV.js} +1 -1
  4. package/dist/bundle/chunks/{chunk-KO3Z5BTR.js → chunk-EMXTNOOJ.js} +5 -5
  5. package/dist/bundle/chunks/{chunk-KXU77PUU.js → chunk-ET2ARYK4.js} +1 -1
  6. package/dist/bundle/chunks/{chunk-ZNCN2NGY.js → chunk-G5BGS7HZ.js} +2 -2
  7. package/dist/bundle/chunks/{chunk-HODJBMOY.js → chunk-GSGPISRE.js} +3 -4
  8. package/dist/bundle/chunks/{chunk-46WGNYIE.js → chunk-NMUS7OCP.js} +1 -1
  9. package/dist/bundle/chunks/{chunk-HQBQWHLD.js → chunk-RCQXVPCE.js} +1 -1
  10. package/dist/bundle/chunks/{cli-MML2DU4A.js → cli-NOCFT7AL.js} +1 -1
  11. package/dist/bundle/chunks/{execute-HXDNZ26B.js → execute-S2O3RL6V.js} +1 -1
  12. package/dist/bundle/chunks/github-copilot.js +1 -1
  13. package/dist/bundle/chunks/{runtime-JAH75CB5.js → runtime-BRT7AUXY.js} +1 -1
  14. package/dist/bundle/chunks/{virtual-modules-OE2CSJ4W.js → virtual-modules-QR2XYBMY.js} +1 -1
  15. package/dist/bundle/cli-runtime.js +1 -1
  16. package/dist/bundle/index.js +1 -1
  17. package/dist/bundle/rpc-entry.js +1 -1
  18. package/lib/postinstall.js +16 -0
  19. package/lib/update.js +85 -0
  20. package/lib/win-setup.js +96 -0
  21. package/package.json +4 -1
  22. package/sera-core/skills/ambalaj-tasarim/NOTICE +1 -0
  23. package/sera-core/skills/ambalaj-tasarim/SKILL.md +34 -0
  24. package/sera-core/skills/ambalaj-tasarim/dieline.mjs +17 -0
  25. package/sera-core/skills/ambalaj-tasarim/sera-pack.js +535 -0
  26. package/sera-core/skills/animasyonlu-site/NOTICE +1 -0
  27. package/sera-core/skills/animasyonlu-site/SKILL.md +26 -0
  28. package/sera-core/skills/animasyonlu-site/sera-motion.js +310 -0
  29. package/sera-core/skills/animate/LICENSE +21 -0
  30. package/sera-core/skills/animate/NOTICE +2 -0
  31. package/sera-core/skills/animate/RECIPES.md +324 -0
  32. package/sera-core/skills/animate/SKILL.md +209 -0
  33. package/sera-core/skills/astryx-ui/SKILL.md +37 -0
  34. package/sera-core/skills/awwwards/LICENSE +21 -0
  35. package/sera-core/skills/awwwards/NOTICE +5 -0
  36. package/sera-core/skills/awwwards/SKILL.md +357 -0
  37. package/sera-core/skills/awwwards/references/anatomy.md +103 -0
  38. package/sera-core/skills/awwwards/references/art-direction.md +114 -0
  39. package/sera-core/skills/awwwards/references/astro.md +235 -0
  40. package/sera-core/skills/awwwards/references/concepts.md +110 -0
  41. package/sera-core/skills/awwwards/references/content.md +88 -0
  42. package/sera-core/skills/awwwards/references/engine.md +751 -0
  43. package/sera-core/skills/awwwards/references/layout.md +81 -0
  44. package/sera-core/skills/awwwards/references/motion.md +463 -0
  45. package/sera-core/skills/awwwards/references/nextjs.md +386 -0
  46. package/sera-core/skills/awwwards/references/patterns.md +123 -0
  47. package/sera-core/skills/awwwards/references/quality-bar.md +151 -0
  48. package/sera-core/skills/awwwards/references/quality.md +91 -0
  49. package/sera-core/skills/awwwards/references/ship.md +36 -0
  50. package/sera-core/skills/awwwards/references/typography.md +135 -0
  51. package/sera-core/skills/awwwards/references/webgl.md +430 -0
  52. package/sera-core/skills/awwwards/scripts/audit.mjs +243 -0
  53. package/sera-core/skills/awwwards/scripts/browser.mjs +54 -0
  54. package/sera-core/skills/awwwards/scripts/font.mjs +87 -0
  55. package/sera-core/skills/awwwards/scripts/og.mjs +20 -0
  56. package/sera-core/skills/awwwards/scripts/photos.mjs +65 -0
  57. package/sera-core/skills/awwwards/scripts/serve.mjs +48 -0
  58. package/sera-core/skills/awwwards/scripts/shoot.mjs +675 -0
  59. package/sera-core/skills/beceri-yaz/SKILL.md +39 -0
  60. package/sera-core/skills/brag-slim/LICENSE +21 -0
  61. package/sera-core/skills/brag-slim/NOTICE +2 -0
  62. package/sera-core/skills/brag-slim/SKILL.md +108 -0
  63. package/sera-core/skills/brainstorming/LICENSE +21 -0
  64. package/sera-core/skills/brainstorming/NOTICE +5 -0
  65. package/sera-core/skills/brainstorming/SKILL.md +298 -0
  66. package/sera-core/skills/brainstorming/builder-check-prompt.md +23 -0
  67. package/sera-core/skills/copywriting/LICENSE +21 -0
  68. package/sera-core/skills/copywriting/NOTICE +5 -0
  69. package/sera-core/skills/copywriting/SKILL.md +343 -0
  70. package/sera-core/skills/copywriting/references/ai-tells.md +309 -0
  71. package/sera-core/skills/copywriting/references/copy-frameworks.md +432 -0
  72. package/sera-core/skills/copywriting/references/natural-transitions.md +256 -0
  73. package/sera-core/skills/cro/LICENSE +21 -0
  74. package/sera-core/skills/cro/NOTICE +5 -0
  75. package/sera-core/skills/cro/SKILL.md +198 -0
  76. package/sera-core/skills/cro/references/experiments.md +248 -0
  77. package/sera-core/skills/cro/references/form.md +422 -0
  78. package/sera-core/skills/derin-arastirma/referanslar/arastirma-yontem.md +11 -0
  79. package/sera-core/skills/emil-design-eng/LICENSE +21 -0
  80. package/sera-core/skills/emil-design-eng/NOTICE +2 -0
  81. package/sera-core/skills/emil-design-eng/SKILL.md +684 -0
  82. package/sera-core/skills/frontend-design/LICENSE.txt +177 -0
  83. package/sera-core/skills/frontend-design/NOTICE +2 -0
  84. package/sera-core/skills/frontend-design/SKILL.md +71 -0
  85. package/sera-core/skills/gorsel-denetim/SKILL.md +30 -0
  86. package/sera-core/skills/hallmark/LICENSE +21 -0
  87. package/sera-core/skills/hallmark/NOTICE +5 -0
  88. package/sera-core/skills/hallmark/SKILL.md +154 -0
  89. package/sera-core/skills/hallmark/references/anatomy.md +71 -0
  90. package/sera-core/skills/hallmark/references/brand-truth.md +40 -0
  91. package/sera-core/skills/hallmark/references/comp.md +104 -0
  92. package/sera-core/skills/hallmark/references/craft.md +116 -0
  93. package/sera-core/skills/hallmark/references/dark-mode.md +49 -0
  94. package/sera-core/skills/hallmark/references/data-viz.md +48 -0
  95. package/sera-core/skills/hallmark/references/design-md.md +53 -0
  96. package/sera-core/skills/hallmark/references/direction.md +52 -0
  97. package/sera-core/skills/hallmark/references/export-formats.md +80 -0
  98. package/sera-core/skills/hallmark/references/flow.md +131 -0
  99. package/sera-core/skills/hallmark/references/fonts.md +58 -0
  100. package/sera-core/skills/hallmark/references/gates.md +243 -0
  101. package/sera-core/skills/hallmark/references/genres/atmospheric.md +24 -0
  102. package/sera-core/skills/hallmark/references/genres/editorial.md +24 -0
  103. package/sera-core/skills/hallmark/references/genres/modern-minimal.md +24 -0
  104. package/sera-core/skills/hallmark/references/genres/playful.md +24 -0
  105. package/sera-core/skills/hallmark/references/imagery.md +99 -0
  106. package/sera-core/skills/hallmark/references/interaction-and-states.md +89 -0
  107. package/sera-core/skills/hallmark/references/layout.md +104 -0
  108. package/sera-core/skills/hallmark/references/macrostructures/01-bento-grid.md +21 -0
  109. package/sera-core/skills/hallmark/references/macrostructures/02-long-document.md +35 -0
  110. package/sera-core/skills/hallmark/references/macrostructures/03-marquee-hero.md +21 -0
  111. package/sera-core/skills/hallmark/references/macrostructures/04-stat-led.md +21 -0
  112. package/sera-core/skills/hallmark/references/macrostructures/05-workbench.md +21 -0
  113. package/sera-core/skills/hallmark/references/macrostructures/06-conversational-faq.md +28 -0
  114. package/sera-core/skills/hallmark/references/macrostructures/07-manifesto.md +28 -0
  115. package/sera-core/skills/hallmark/references/macrostructures/08-photographic.md +21 -0
  116. package/sera-core/skills/hallmark/references/macrostructures/09-quote-led.md +21 -0
  117. package/sera-core/skills/hallmark/references/macrostructures/10-specimen.md +21 -0
  118. package/sera-core/skills/hallmark/references/macrostructures/11-catalogue.md +21 -0
  119. package/sera-core/skills/hallmark/references/macrostructures/12-letter.md +21 -0
  120. package/sera-core/skills/hallmark/references/macrostructures/13-index-first.md +21 -0
  121. package/sera-core/skills/hallmark/references/macrostructures/14-narrative-workflow.md +21 -0
  122. package/sera-core/skills/hallmark/references/macrostructures/15-split-studio.md +21 -0
  123. package/sera-core/skills/hallmark/references/macrostructures/16-feature-stack.md +23 -0
  124. package/sera-core/skills/hallmark/references/macrostructures/17-type-specimen.md +19 -0
  125. package/sera-core/skills/hallmark/references/macrostructures/18-portfolio-grid.md +21 -0
  126. package/sera-core/skills/hallmark/references/macrostructures/19-map-diagram.md +21 -0
  127. package/sera-core/skills/hallmark/references/macrostructures/20-ecosystem-index.md +19 -0
  128. package/sera-core/skills/hallmark/references/macrostructures/21-component-playground.md +21 -0
  129. package/sera-core/skills/hallmark/references/macrostructures.md +119 -0
  130. package/sera-core/skills/hallmark/references/microinteractions.md +80 -0
  131. package/sera-core/skills/hallmark/references/patterns.md +202 -0
  132. package/sera-core/skills/hallmark/references/redesign.md +88 -0
  133. package/sera-core/skills/hallmark/references/responsive.md +46 -0
  134. package/sera-core/skills/hallmark/references/review-finish.md +19 -0
  135. package/sera-core/skills/hallmark/references/review-hero.md +20 -0
  136. package/sera-core/skills/hallmark/references/scroll-choreography.md +110 -0
  137. package/sera-core/skills/hallmark/references/texture.md +90 -0
  138. package/sera-core/skills/hallmark/references/themes/README.md +58 -0
  139. package/sera-core/skills/hallmark/references/themes/almanac.md +103 -0
  140. package/sera-core/skills/hallmark/references/themes/arcade.md +102 -0
  141. package/sera-core/skills/hallmark/references/themes/atelier.md +98 -0
  142. package/sera-core/skills/hallmark/references/themes/bloom.md +102 -0
  143. package/sera-core/skills/hallmark/references/themes/blueprint.md +103 -0
  144. package/sera-core/skills/hallmark/references/themes/broadside.md +108 -0
  145. package/sera-core/skills/hallmark/references/themes/brutal.md +95 -0
  146. package/sera-core/skills/hallmark/references/themes/carnival.md +104 -0
  147. package/sera-core/skills/hallmark/references/themes/cobalt.md +101 -0
  148. package/sera-core/skills/hallmark/references/themes/console.md +99 -0
  149. package/sera-core/skills/hallmark/references/themes/coral.md +102 -0
  150. package/sera-core/skills/hallmark/references/themes/darkroom.md +99 -0
  151. package/sera-core/skills/hallmark/references/themes/dose.md +98 -0
  152. package/sera-core/skills/hallmark/references/themes/dusk.md +105 -0
  153. package/sera-core/skills/hallmark/references/themes/editorial.md +97 -0
  154. package/sera-core/skills/hallmark/references/themes/formwork.md +107 -0
  155. package/sera-core/skills/hallmark/references/themes/furrow.md +98 -0
  156. package/sera-core/skills/hallmark/references/themes/garden.md +97 -0
  157. package/sera-core/skills/hallmark/references/themes/grid.md +101 -0
  158. package/sera-core/skills/hallmark/references/themes/halftone.md +106 -0
  159. package/sera-core/skills/hallmark/references/themes/hedgerow.md +104 -0
  160. package/sera-core/skills/hallmark/references/themes/hum.md +99 -0
  161. package/sera-core/skills/hallmark/references/themes/ink.md +106 -0
  162. package/sera-core/skills/hallmark/references/themes/kiln.md +108 -0
  163. package/sera-core/skills/hallmark/references/themes/loom.md +106 -0
  164. package/sera-core/skills/hallmark/references/themes/lumen.md +103 -0
  165. package/sera-core/skills/hallmark/references/themes/manifesto.md +101 -0
  166. package/sera-core/skills/hallmark/references/themes/midnight.md +97 -0
  167. package/sera-core/skills/hallmark/references/themes/newsprint.md +102 -0
  168. package/sera-core/skills/hallmark/references/themes/overprint.md +101 -0
  169. package/sera-core/skills/hallmark/references/themes/pasteup.md +100 -0
  170. package/sera-core/skills/hallmark/references/themes/piste.md +99 -0
  171. package/sera-core/skills/hallmark/references/themes/refract.md +101 -0
  172. package/sera-core/skills/hallmark/references/themes/ribbon.md +106 -0
  173. package/sera-core/skills/hallmark/references/themes/rim.md +96 -0
  174. package/sera-core/skills/hallmark/references/themes/riso.md +98 -0
  175. package/sera-core/skills/hallmark/references/themes/solstice.md +104 -0
  176. package/sera-core/skills/hallmark/references/themes/specimen.md +100 -0
  177. package/sera-core/skills/hallmark/references/themes/spore.md +104 -0
  178. package/sera-core/skills/hallmark/references/themes/sport.md +101 -0
  179. package/sera-core/skills/hallmark/references/themes/squeeze.md +99 -0
  180. package/sera-core/skills/hallmark/references/themes/sticker.md +106 -0
  181. package/sera-core/skills/hallmark/references/themes/studio.md +99 -0
  182. package/sera-core/skills/hallmark/references/themes/terminal.md +96 -0
  183. package/sera-core/skills/hallmark/references/themes/terrazzo.md +106 -0
  184. package/sera-core/skills/hallmark/references/themes/ultraviolet.md +106 -0
  185. package/sera-core/skills/hallmark/references/themes/vantage.md +99 -0
  186. package/sera-core/skills/hallmark/references/themes/vellum.md +105 -0
  187. package/sera-core/skills/hallmark/references/themes/wayfind.md +105 -0
  188. package/sera-core/skills/hallmark/references/themes/werkstatt.md +105 -0
  189. package/sera-core/skills/hallmark/scripts/capture.mjs +132 -0
  190. package/sera-core/skills/hallmark/scripts/refcheck.mjs +405 -0
  191. package/sera-core/skills/hallmark/scripts/sloplint-render.mjs +1283 -0
  192. package/sera-core/skills/hallmark/scripts/sloplint.mjs +4426 -0
  193. package/sera-core/skills/hallmark/scripts/theme.mjs +660 -0
  194. package/sera-core/skills/kurum-ici-iletisim/SKILL.md +40 -0
  195. package/sera-core/skills/launch/LICENSE +21 -0
  196. package/sera-core/skills/launch/NOTICE +5 -0
  197. package/sera-core/skills/launch/SKILL.md +385 -0
  198. package/sera-core/skills/launch/references/shipped-changes.md +84 -0
  199. package/sera-core/skills/launch/references/site-launch-qa.md +57 -0
  200. package/sera-core/skills/marka-kimligi/SKILL.md +30 -0
  201. package/sera-core/skills/mcp-yaz/SKILL.md +41 -0
  202. package/sera-core/skills/mobil-arayuz/SKILL.md +12 -0
  203. package/sera-core/skills/mvp-scoping/LICENSE +21 -0
  204. package/sera-core/skills/mvp-scoping/NOTICE +5 -0
  205. package/sera-core/skills/mvp-scoping/SKILL.md +95 -0
  206. package/sera-core/skills/ortak-yazarlik/SKILL.md +32 -0
  207. package/sera-core/skills/oyun-turleri/SKILL.md +176 -0
  208. package/sera-core/skills/paralel-sadelestirme/SKILL.md +33 -0
  209. package/sera-core/skills/phaser-core/LICENSE +201 -0
  210. package/sera-core/skills/phaser-core/NOTICE +5 -0
  211. package/sera-core/skills/phaser-core/NOTICE-UPSTREAM +15 -0
  212. package/sera-core/skills/phaser-core/SKILL.md +245 -0
  213. package/sera-core/skills/phaser-core/references/scene-flow.md +177 -0
  214. package/sera-core/skills/pitch-deck/LICENSE +21 -0
  215. package/sera-core/skills/pitch-deck/NOTICE +5 -0
  216. package/sera-core/skills/pitch-deck/SKILL.md +103 -0
  217. package/sera-core/skills/sera-3d-oyun/NOTICE +1 -0
  218. package/sera-core/skills/sera-3d-oyun/SKILL.md +12 -0
  219. package/sera-core/skills/sera-3d-oyun/sera-3d.js +3697 -0
  220. package/sera-core/skills/sera-diyagram/SKILL.md +43 -0
  221. package/sera-core/skills/sera-ofis-dosya/SKILL.md +3 -0
  222. package/sera-core/skills/sera-ofis-dosya/referanslar/ofis-ileri.md +46 -0
  223. package/sera-core/skills/sera-ui-site/NOTICE +1 -0
  224. package/sera-core/skills/sera-ui-site/SKILL.md +10 -0
  225. package/sera-core/skills/sera-ui-site/sera-ui.js +83 -0
  226. package/sera-core/skills/sera-veri-gorsel/SKILL.md +3 -0
  227. package/sera-core/skills/sera-veri-gorsel/referanslar/palet-dogrula.mjs +80 -0
  228. package/sera-core/skills/sistem-tarama/SKILL.md +49 -0
  229. package/sera-core/skills/sistem-tarama/referanslar/komutlar.md +78 -0
  230. package/sera-core/skills/tasarim-stilleri/SKILL.md +113 -0
  231. package/sera-core/skills/teardown/LICENSE +22 -0
  232. package/sera-core/skills/teardown/NOTICE +3 -0
  233. package/sera-core/skills/teardown/SKILL.md +144 -0
  234. package/sera-core/skills/teardown/package-lock.json +545 -0
  235. package/sera-core/skills/teardown/package.json +18 -0
  236. package/sera-core/skills/teardown/paths.mjs +30 -0
  237. package/sera-core/skills/teardown/run_sfx.py +10 -0
  238. package/sera-core/skills/teardown/sfx/__init__.py +10 -0
  239. package/sera-core/skills/teardown/sfx/__main__.py +64 -0
  240. package/sera-core/skills/teardown/sfx/dsp.py +453 -0
  241. package/sera-core/skills/teardown/sfx/loudness.py +72 -0
  242. package/sera-core/skills/teardown/sfx/mix.py +111 -0
  243. package/sera-core/skills/teardown/sfx/samples/SOURCES.md +23 -0
  244. package/sera-core/skills/teardown/sfx/samples/fs-258269-mouth-pop.ogg +0 -0
  245. package/sera-core/skills/teardown/sfx/samples/fs-323432-typing.ogg +0 -0
  246. package/sera-core/skills/teardown/sfx/samples/fs-329533-room-tone-in-an-apartment-livi.ogg +0 -0
  247. package/sera-core/skills/teardown/sfx/samples/fs-329569-roomtone-bedroom-yew.ogg +0 -0
  248. package/sera-core/skills/teardown/sfx/samples/fs-339521-vhs-rewind-forward-and-eject.ogg +0 -0
  249. package/sera-core/skills/teardown/sfx/samples/fs-349504-triangle-open-04.ogg +0 -0
  250. package/sera-core/skills/teardown/sfx/samples/fs-416777-digital-typing-wav.ogg +0 -0
  251. package/sera-core/skills/teardown/sfx/samples/fs-426767-apartment-room-tone-wav.ogg +0 -0
  252. package/sera-core/skills/teardown/sfx/samples/fs-447909-keyboard-typing.ogg +0 -0
  253. package/sera-core/skills/teardown/sfx/samples/fs-447910-plop.ogg +0 -0
  254. package/sera-core/skills/teardown/sfx/samples/fs-79388-keyboard-typing-wav.ogg +0 -0
  255. package/sera-core/skills/teardown/sfx/samples/fs-824189-pop-in-sfx.ogg +0 -0
  256. package/sera-core/skills/teardown/sfx/score_kit.py +206 -0
  257. package/sera-core/skills/teardown/sfx/synth.py +294 -0
  258. package/sera-core/skills/teardown/sheet.mjs +127 -0
  259. package/sera-core/skills/teardown/sims/beats.py +212 -0
  260. package/sera-core/skills/teardown/sims/build.mjs +141 -0
  261. package/sera-core/skills/teardown/sims/capture.mjs +211 -0
  262. package/sera-core/skills/teardown/sims/cessna-film/main.js +4 -0
  263. package/sera-core/skills/teardown/sims/cessna-film/timeline.json +1 -0
  264. package/sera-core/skills/teardown/sims/cessna-live/main.js +5 -0
  265. package/sera-core/skills/teardown/sims/cessna-shared/console.js +288 -0
  266. package/sera-core/skills/teardown/sims/cessna-shared/film.js +254 -0
  267. package/sera-core/skills/teardown/sims/cessna-shared/flight.js +53 -0
  268. package/sera-core/skills/teardown/sims/cessna-shared/gear.js +364 -0
  269. package/sera-core/skills/teardown/sims/cessna-shared/live.js +351 -0
  270. package/sera-core/skills/teardown/sims/cessna-shared/score.py +41 -0
  271. package/sera-core/skills/teardown/sims/cessna-shared/stage.js +248 -0
  272. package/sera-core/skills/teardown/sims/kit/director.js +300 -0
  273. package/sera-core/skills/teardown/sims/kit/hud.js +194 -0
  274. package/sera-core/skills/teardown/sims/kit/runtime.js +168 -0
  275. package/sera-core/skills/teardown/sims/kit/stage3d.js +114 -0
  276. package/sera-core/skills/teardown/sims/kit/style.css +137 -0
  277. package/sera-core/skills/teardown/sims/kit/util.js +79 -0
  278. package/sera-core/skills/teardown/sims/kit/warm.js +66 -0
  279. package/sera-core/skills/teardown/sims/strandbeest-film/main.js +4 -0
  280. package/sera-core/skills/teardown/sims/strandbeest-film/timeline.json +1 -0
  281. package/sera-core/skills/teardown/sims/strandbeest-live/main.js +5 -0
  282. package/sera-core/skills/teardown/sims/strandbeest-shared/beast.js +419 -0
  283. package/sera-core/skills/teardown/sims/strandbeest-shared/console.js +375 -0
  284. package/sera-core/skills/teardown/sims/strandbeest-shared/film.js +352 -0
  285. package/sera-core/skills/teardown/sims/strandbeest-shared/jansen.js +67 -0
  286. package/sera-core/skills/teardown/sims/strandbeest-shared/live.js +420 -0
  287. package/sera-core/skills/teardown/sims/strandbeest-shared/score.py +85 -0
  288. package/sera-core/skills/teardown/sims/strandbeest-shared/stage.js +463 -0
  289. package/sera-core/skills/teardown/sims/v8-film/main.js +4 -0
  290. package/sera-core/skills/teardown/sims/v8-film/timeline.json +1 -0
  291. package/sera-core/skills/teardown/sims/v8-live/main.js +5 -0
  292. package/sera-core/skills/teardown/sims/v8-shared/console.js +339 -0
  293. package/sera-core/skills/teardown/sims/v8-shared/engine.js +624 -0
  294. package/sera-core/skills/teardown/sims/v8-shared/film.js +239 -0
  295. package/sera-core/skills/teardown/sims/v8-shared/kin.js +86 -0
  296. package/sera-core/skills/teardown/sims/v8-shared/live.js +374 -0
  297. package/sera-core/skills/teardown/sims/v8-shared/score.py +60 -0
  298. package/sera-core/skills/teardown/sims/v8-shared/stage.js +173 -0
  299. package/sera-core/skills/teardown/wave.mjs +67 -0
  300. package/sera-core/skills/toplu-degisiklik/SKILL.md +39 -0
  301. package/sera-core/skills/ui-ux-pro-max/LICENSE +21 -0
  302. package/sera-core/skills/ui-ux-pro-max/NOTICE +5 -0
  303. package/sera-core/skills/ui-ux-pro-max/SKILL.md +13 -0
  304. package/sera-core/skills/ui-ux-pro-max/references/pro-rules.md +117 -0
  305. package/sera-core/skills/ui-ux-pro-max/references/quick-reference.md +266 -0
  306. package/sera-core/skills/unslop/LICENSE.md +410 -0
  307. package/sera-core/skills/unslop/SKILL.md +217 -0
  308. package/sera-core/skills/unslop/references/effects.md +113 -0
  309. package/sera-core/skills/unslop/references/refs/unslop-dashboard-after.webp +0 -0
  310. package/sera-core/skills/unslop/references/refs/unslop-hero-after.webp +0 -0
  311. package/sera-core/skills/unslop/references/refs.md +16 -0
  312. package/sera-core/skills/unslop/references/rtl.md +72 -0
  313. package/sera-core/skills/unslop/references/signs.md +125 -0
  314. package/sera-core/skills/unslop/references/tokens.md +137 -0
  315. package/sera-core/skills/unslop/references/visuals.md +84 -0
  316. package/sera-core/skills/unslop/scripts/snapshot.mjs +197 -0
  317. package/sera-core/skills/uretken-sanat/SKILL.md +42 -0
  318. package/sera-core/skills/verification-before-completion/LICENSE +21 -0
  319. package/sera-core/skills/verification-before-completion/NOTICE +5 -0
  320. package/sera-core/skills/verification-before-completion/SKILL.md +120 -0
  321. package/sera-core/skills/web-yayin-listesi/SKILL.md +3 -0
  322. package/sera-core/src/app-master.ts +2 -2
  323. package/sera-core/src/app-verify.ts +33 -0
  324. package/sera-core/src/extension.ts +16 -2
  325. package/sera-core/src/generated/build-rules.ts +81 -17
  326. package/sera-core/src/generated/quality-probe.ts +2 -0
  327. package/sera-core/src/generated/zero-knowledge.ts +36 -9
  328. package/sera-core/src/image-tool.ts +12 -2
  329. package/sera-core/src/link-data-tools.ts +411 -0
  330. package/sera-core/src/skills.ts +54 -18
  331. package/sera-core/src/video-tool.ts +51 -0
  332. package/sera-core/src/zk.ts +7 -3
@@ -0,0 +1,751 @@
1
+ <!-- Generated from tests/nexttest by tests/_gen/build.py; edit there, not here. -->
2
+ # Motion engine (framework-agnostic)
3
+
4
+ The plumbing that award-level sites get wrong, solved once:
5
+ - one clock (GSAP ticker drives Lenis, ScrollTrigger and WebGL)
6
+ - a page lifecycle that reverts every effect on navigation
7
+ - a loader that tracks real progress
8
+ - page transitions that overlap with the page fetch
9
+ - declarative reveals that stay accessible
10
+ - reduced-motion and no-JS paths that keep content visible
11
+
12
+ It is plain TypeScript with no framework imports and no DOM access at import time, so it is
13
+ safe under SSR. A small adapter connects it to the router: `nextjs.md`, `astro.md`, or the
14
+ contract below for any other stack.
15
+
16
+ The engine is not the design. The loader look, the transition, the tokens and every page are
17
+ authored per project. Shipping the defaults is a failure.
18
+
19
+ Dependencies: `npm i gsap lenis` (+ `ogl` for WebGL, see webgl.md).
20
+
21
+ ## Files
22
+
23
+ ```
24
+ src/engine/
25
+ env.ts media queries + the shared easing names
26
+ scroll.ts Lenis on the GSAP ticker; onScroll feed (y, velocity, progress)
27
+ reveal.ts data-split / data-reveal / data-parallax / data-intro
28
+ loader.ts first-load progress + exit (setLoaderFormat, setLoaderExit)
29
+ interactions.ts data-magnetic, cursor follower (data-cursor)
30
+ transition.ts curtain leave/enter (setTransition)
31
+ index.ts lifecycle core: boot, leave, cleanup, enter, onPage
32
+ gl/ optional WebGL module (webgl.md)
33
+ next.tsx | astro.ts the adapter for your router
34
+ tokens.css design tokens (names below are the contract; values are yours)
35
+ engine.css foundation + engine CSS
36
+ ```
37
+
38
+ ## Adapter contract (wire these four hooks in any framework)
39
+
40
+ | When | Call |
41
+ |---|---|
42
+ | First load, after the DOM is ready (client only) | `boot()`: flags, scroll, GL, cursor, page init, loader, intro |
43
+ | A route change starts (internal link click) | `await leave()`: covers the screen with the curtain. Fetch the next page in parallel when the router allows it |
44
+ | Just before the old page's DOM is removed | `cleanup()`: reverts tweens, ScrollTriggers and splits, and removes GL planes |
45
+ | After the new page's DOM is in place | `enter()`: scroll to top, init page, uncover, play the intro. Back/forward: `enter({ transition: false, scrollTop: false })` |
46
+
47
+ SvelteKit: `beforeNavigate` → leave + cleanup, `afterNavigate` → enter. Nuxt: `page:start` /
48
+ `page:finish` hooks. Vite + React Router: intercept link clicks like the Next adapter, then call
49
+ `enter` in a `useEffect` on `location.pathname`.
50
+
51
+ ## Layout contract (markup every page shares)
52
+
53
+ ```html
54
+ <html lang="en"> <!-- inline script in <head> adds .js and .motion before paint -->
55
+ <body>
56
+ <a class="skip-link" href="#main">Skip to content</a>
57
+ <div id="gl" aria-hidden="true"></div> <!-- WebGL canvas host, persists -->
58
+ <div id="curtain" aria-hidden="true"><div class="curtain__panel"></div></div>
59
+ <div id="cursor" aria-hidden="true"><span data-cursor-label></span></div> <!-- optional -->
60
+ <div id="loader" role="status" aria-label="Loading"> <!-- optional -->
61
+ <span data-loader-out>Name</span> <span data-loader-out data-loader-count>000</span>
62
+ <div data-loader-bar></div>
63
+ </div>
64
+ <header>…</header>
65
+ <main id="main" tabindex="-1">…page…</main>
66
+ <footer>…</footer>
67
+ </body>
68
+ ```
69
+ Before first paint, the inline head script must run:
70
+ `document.documentElement.classList.add('js'); if (!matchMedia('(prefers-reduced-motion: reduce)').matches) document.documentElement.classList.add('motion');`
71
+ Hidden-before-reveal styles are gated on `html.motion`, so content stays visible without JS
72
+ and under reduced motion. `#gl`, `#curtain` and `#cursor` must survive navigation (persistent
73
+ layout in Next, `transition:persist` in Astro). The loader is hidden (not removed) when done
74
+ and sets `html.is-loaded`. QA scripts detect any `#loader` element.
75
+
76
+ ## Markup API (data attributes)
77
+
78
+ | Attribute | Effect |
79
+ |---|---|
80
+ | `data-split="lines\|words\|chars"` | Masked text reveal via SplitText (re-splits on resize/font load, stays accessible) |
81
+ | `data-reveal="up\|fade\|clip\|scale"` | Block reveal. `clip` wipes up, `scale` opens from an inset |
82
+ | `data-intro` | Play with the page intro instead of on scroll (use in heroes) |
83
+ | `data-delay="0.2"` | Extra delay in seconds (works with split, reveal, GL) |
84
+ | `data-parallax="0.15"` | Scrubbed drift, fraction of the element height. Put it on an inner element inside an `overflow: clip` frame |
85
+ | `data-magnetic="0.35"` | Element leans toward the pointer |
86
+ | `data-cursor="View"` | Cursor follower grows with this label over the element |
87
+ | `data-gl`, `data-gl="procedural"`, `data-gl-*` | WebGL planes (webgl.md) |
88
+
89
+ Put `data-split` only on text that never re-renders on the client (server-rendered or static).
90
+ SplitText rewrites the DOM inside the element.
91
+
92
+ ## Script API (`import { … } from '@/engine'` or a relative path)
93
+
94
+ ```ts
95
+ onPage(({ intro, path }) => { // every page load, inside a gsap.context; returns an unsubscribe
96
+ const el = document.querySelector('[data-marquee]');
97
+ if (!el) return; // global modules register once: check presence
98
+ intro.add(gsap.from('.hero-meta', { autoAlpha: 0, y: 20 }), 0.4); // extend the page intro
99
+ return () => { /* remove listeners you added to window/document */ };
100
+ });
101
+ // React: usePage(fn) from the adapter does the same for one component (registers on mount).
102
+
103
+ setTransition({ leave: (curtain) => tl, enter: (curtain) => tl }); // replace the default wipe
104
+ setLoaderFormat((p) => `${p}`); // counter text, p: 0 → 100 (a clock, a year…)
105
+ setLoaderExit((root) => gsap.timeline()…); // the loader → hero handoff
106
+ onScroll(({ y, velocity, progress }) => {}); // one-clock scroll feed; returns an unsubscribe
107
+ scrollToTarget('#work'); stopScroll(); startScroll();
108
+ setBackground(fragmentGLSL, uniforms); clearBackground(); hideGL(0.6); // webgl.md
109
+ ease.out | ease.inOut | ease.soft | ease.spring // the shared easing names
110
+ prefersReducedMotion(), isTouch(), isMobile()
111
+ ```
112
+
113
+ Call global setup (`setTransition`, `setLoaderFormat`, `setLoaderExit`, `setBackground`, the
114
+ driver module) once on the client **before** `boot()` runs: in Astro, from a script imported
115
+ right after the adapter; in Next, at module level of a client module imported by the
116
+ component that renders `<Engine />`. These setters touch no DOM, so they are safe in modules
117
+ that also render on the server.
118
+
119
+ ## Lifecycle
120
+
121
+ - **First load:** the head script flags `html.js.motion`, then the loader runs with real
122
+ progress (fonts + critical images, 1.1 s floor, 2.6 s cap), then page init, then the
123
+ `data-intro` timeline plays.
124
+ - **Navigation:** the leave animation runs while the next page loads, then cleanup reverts the
125
+ old page, then the swap, a scroll reset, page init, the enter animation and the intro.
126
+ - **Reduced motion:** native scroll, no GL, no reveals (content visible), short fades for the
127
+ loader and transitions.
128
+
129
+ ## Pitfalls already handled (do not undo)
130
+
131
+ - CSS transforms on GSAP-animated elements stack with GSAP's: the curtain panel has none.
132
+ - Lenis reports progress 1 on pages that cannot scroll: `scroll.ts` normalizes it to 0.
133
+ - SplitText turns lines into blocks: `text-indent` is kept on the first line only.
134
+ - A revealed text stays revealed when SplitText re-splits after a font load or resize.
135
+ - Hidden-before-reveal is gated on `html.motion`, set before the first paint (no flash).
136
+ - The loader is hidden instead of removed, because React owns that node in Next.
137
+
138
+ ## Code
139
+
140
+ Copy each file verbatim, then customize the parts marked as yours (loader look, transition,
141
+ eases). Keep the hooks and names: other references assume them.
142
+
143
+ ### `src/engine/env.ts`
144
+
145
+ ```ts
146
+ export const prefersReducedMotion = () => matchMedia('(prefers-reduced-motion: reduce)').matches;
147
+ export const isTouch = () => matchMedia('(hover: none), (pointer: coarse)').matches;
148
+ export const isMobile = () => matchMedia('(max-width: 767px)').matches;
149
+
150
+ // Shared easing vocabulary. Use these names everywhere; never invent per-component curves.
151
+ export const ease = {
152
+ out: 'expo.out', // default entrance
153
+ inOut: 'expo.inOut', // curtains, page transitions
154
+ soft: 'power3.out', // small UI
155
+ spring: 'back.out(1.6)', // playful pops, use rarely
156
+ } as const;
157
+ ```
158
+
159
+ ### `src/engine/scroll.ts`
160
+
161
+ ```ts
162
+ // Smooth scroll on ONE clock: Lenis is driven by gsap.ticker, ScrollTrigger reads Lenis.
163
+ // Reduced motion → native scroll, no Lenis.
164
+ import Lenis from 'lenis';
165
+ import { gsap } from 'gsap';
166
+ import { ScrollTrigger } from 'gsap/ScrollTrigger';
167
+ import { prefersReducedMotion } from './env';
168
+
169
+ gsap.registerPlugin(ScrollTrigger);
170
+
171
+ let lenis: Lenis | null = null;
172
+ const listeners = new Set<(s: ScrollState) => void>();
173
+
174
+ export type ScrollState = { y: number; velocity: number; progress: number };
175
+ const state: ScrollState = { y: 0, velocity: 0, progress: 0 };
176
+
177
+ export function initScroll() {
178
+ if (lenis || prefersReducedMotion()) {
179
+ // Still publish native scroll position for WebGL sync.
180
+ if (!lenis) addEventListener('scroll', nativeTick, { passive: true });
181
+ return;
182
+ }
183
+ lenis = new Lenis({ lerp: 0.1, wheelMultiplier: 1, touchMultiplier: 1.2, anchors: true });
184
+ lenis.on('scroll', (l: Lenis) => {
185
+ state.y = l.scroll;
186
+ state.velocity = l.velocity;
187
+ state.progress = l.limit > 0 ? l.scroll / l.limit : 0; // Lenis reports 1 on pages that cannot scroll
188
+ ScrollTrigger.update();
189
+ listeners.forEach((fn) => fn(state));
190
+ });
191
+ gsap.ticker.add((time) => lenis?.raf(time * 1000));
192
+ gsap.ticker.lagSmoothing(0);
193
+ }
194
+
195
+ function nativeTick() {
196
+ const max = document.documentElement.scrollHeight - innerHeight;
197
+ state.velocity = scrollY - state.y;
198
+ state.y = scrollY;
199
+ state.progress = max > 0 ? scrollY / max : 0;
200
+ listeners.forEach((fn) => fn(state));
201
+ }
202
+
203
+ export const onScroll = (fn: (s: ScrollState) => void) => {
204
+ listeners.add(fn);
205
+ return () => listeners.delete(fn);
206
+ };
207
+ export const scrollState = () => state;
208
+ export const stopScroll = () => lenis?.stop();
209
+ export const startScroll = () => lenis?.start();
210
+ export function resetScroll() {
211
+ if (lenis) lenis.scrollTo(0, { immediate: true, force: true });
212
+ else scrollTo(0, 0);
213
+ state.y = 0;
214
+ state.velocity = 0;
215
+ }
216
+ export function scrollToTarget(target: string | HTMLElement | number) {
217
+ if (lenis) lenis.scrollTo(target, { duration: 1.4, easing: (t) => 1 - Math.pow(1 - t, 4) });
218
+ else if (typeof target === 'number') scrollTo({ top: target });
219
+ else (typeof target === 'string' ? document.querySelector(target) : target)?.scrollIntoView();
220
+ }
221
+ ```
222
+
223
+ ### `src/engine/reveal.ts`
224
+
225
+ ```ts
226
+ // Declarative motion through data attributes. Authoring happens in markup:
227
+ // data-split="lines|words|chars" masked text reveal (SplitText), on scroll or on intro
228
+ // data-reveal="up|fade|clip|scale" block reveal
229
+ // data-intro play with the page intro instead of on scroll
230
+ // data-delay="0.2" extra delay (seconds)
231
+ // data-parallax="0.15" scrubbed vertical drift (fraction of element height)
232
+ // Every effect is skipped under reduced motion; CSS keeps content visible without JS.
233
+ import { gsap } from 'gsap';
234
+ import { ScrollTrigger } from 'gsap/ScrollTrigger';
235
+ import { SplitText } from 'gsap/SplitText';
236
+ import { ease, prefersReducedMotion } from './env';
237
+
238
+ gsap.registerPlugin(ScrollTrigger, SplitText);
239
+
240
+ const durations = { lines: 1.2, words: 1.1, chars: 0.9 } as const;
241
+ const staggers = { lines: 0.08, words: 0.035, chars: 0.018 } as const;
242
+
243
+ // autoSplit re-splits after font load / resize. A text that already revealed must stay revealed,
244
+ // so the state lives outside onSplit.
245
+ function splitTween(el: HTMLElement, isIntro: boolean) {
246
+ const type = (el.dataset.split || 'lines') as keyof typeof durations;
247
+ const delay = parseFloat(el.dataset.delay || '0');
248
+ const s = { tween: undefined as gsap.core.Tween | undefined, done: false, requested: false };
249
+ SplitText.create(el, {
250
+ type: type === 'lines' ? 'lines' : `lines,${type}`,
251
+ mask: 'lines',
252
+ autoSplit: true,
253
+ linesClass: 'split-line',
254
+ onSplit(self) {
255
+ gsap.set(el, { visibility: 'visible' });
256
+ if (s.done) return;
257
+ const targets = type === 'lines' ? self.lines : type === 'words' ? self.words : self.chars;
258
+ s.tween = gsap.from(targets, {
259
+ yPercent: 110,
260
+ rotate: type === 'chars' ? 0 : 2,
261
+ duration: durations[type],
262
+ stagger: staggers[type],
263
+ ease: ease.out,
264
+ delay,
265
+ paused: isIntro && !s.requested,
266
+ onComplete: () => { s.done = true; },
267
+ scrollTrigger: isIntro ? undefined : { trigger: el, start: 'top 88%', once: true },
268
+ });
269
+ return s.tween;
270
+ },
271
+ });
272
+ return () => { s.requested = true; s.tween?.play(); };
273
+ }
274
+
275
+ function blockTween(el: HTMLElement, paused: boolean) {
276
+ const kind = el.dataset.reveal || 'up';
277
+ const delay = parseFloat(el.dataset.delay || '0');
278
+ const from: gsap.TweenVars =
279
+ kind === 'fade' ? { autoAlpha: 0 }
280
+ : kind === 'clip' ? { clipPath: 'inset(100% 0% 0% 0%)', autoAlpha: 1 }
281
+ : kind === 'scale' ? { scale: 1.15, clipPath: 'inset(12% 12% 12% 12%)', autoAlpha: 1 }
282
+ : { y: 48, autoAlpha: 0 };
283
+ const to: gsap.TweenVars = kind === 'clip' || kind === 'scale' ? { clipPath: 'inset(0% 0% 0% 0%)', scale: 1 } : {};
284
+ gsap.set(el, { visibility: 'visible' });
285
+ return gsap.fromTo(el, from, {
286
+ ...to,
287
+ y: 0,
288
+ autoAlpha: 1,
289
+ duration: kind === 'fade' ? 1 : 1.3,
290
+ ease: ease.out,
291
+ delay,
292
+ paused,
293
+ scrollTrigger: paused ? undefined : { trigger: el, start: 'top 90%', once: true },
294
+ });
295
+ }
296
+
297
+ /** Wire every reveal inside `root`. Returns the intro timeline (paused) for the page entrance. */
298
+ export function initReveals(root: ParentNode = document) {
299
+ const intro = gsap.timeline({ paused: true });
300
+ if (prefersReducedMotion()) return intro;
301
+
302
+ root.querySelectorAll<HTMLElement>('[data-split]').forEach((el) => {
303
+ const isIntro = el.hasAttribute('data-intro');
304
+ const play = splitTween(el, isIntro);
305
+ if (isIntro) intro.add(play, 0);
306
+ });
307
+ root.querySelectorAll<HTMLElement>('[data-reveal]').forEach((el) => {
308
+ const isIntro = el.hasAttribute('data-intro');
309
+ const t = blockTween(el, isIntro);
310
+ if (isIntro) intro.add(() => t.play(), 0);
311
+ });
312
+ root.querySelectorAll<HTMLElement>('[data-parallax]').forEach((el) => {
313
+ const amount = parseFloat(el.dataset.parallax || '0.15');
314
+ gsap.fromTo(el, { yPercent: -amount * 100 }, {
315
+ yPercent: amount * 100,
316
+ ease: 'none',
317
+ scrollTrigger: { trigger: el.parentElement || el, start: 'top bottom', end: 'bottom top', scrub: true },
318
+ });
319
+ });
320
+ return intro;
321
+ }
322
+ ```
323
+
324
+ ### `src/engine/loader.ts`
325
+
326
+ ```ts
327
+ // First-load sequence. Progress follows REAL work (fonts + critical images), eased by GSAP,
328
+ // with a floor so it reads as intentional and a ceiling so it never becomes a usability problem.
329
+ // Markup (#loader) lives in the layout; its look is authored per project.
330
+ import { gsap } from 'gsap';
331
+ import { ease, prefersReducedMotion } from './env';
332
+
333
+ let format = (p: number) => String(Math.round(p)).padStart(3, '0');
334
+ /** Customize the counter text, e.g. a clock, a year, a frame count. p goes 0 → 100. */
335
+ export const setLoaderFormat = (fn: (p: number) => string) => { format = fn; };
336
+ let exit: ((root: HTMLElement) => gsap.core.Timeline) | null = null;
337
+ /** Replace the exit choreography (the loader → hero handoff). Return a timeline. */
338
+ export const setLoaderExit = (fn: (root: HTMLElement) => gsap.core.Timeline) => { exit = fn; };
339
+
340
+ const MIN = 1.1; // seconds: long enough to read as a designed moment
341
+ const MAX = 2.6; // seconds: a longer loader is a usability problem
342
+
343
+ function criticalAssets(): Promise<unknown>[] {
344
+ const imgs = [...document.querySelectorAll<HTMLImageElement>('img[data-critical], [data-intro] img, [data-gl-instant] img')];
345
+ return [document.fonts.ready, ...imgs.map((i) => (i.complete ? Promise.resolve() : i.decode().catch(() => {})))];
346
+ }
347
+
348
+ export async function runLoader(): Promise<void> {
349
+ const root = document.getElementById('loader');
350
+ if (!root) return;
351
+ if (prefersReducedMotion()) {
352
+ await Promise.race([Promise.all(criticalAssets()), wait(MAX)]);
353
+ await gsap.to(root, { autoAlpha: 0, duration: 0.3 });
354
+ return finish(root);
355
+ }
356
+ const count = root.querySelector<HTMLElement>('[data-loader-count]');
357
+ const bar = root.querySelector<HTMLElement>('[data-loader-bar]');
358
+ const tasks = criticalAssets();
359
+ let done = 0;
360
+ const shown = { v: 0 };
361
+ const target = { v: 0 };
362
+ tasks.forEach((t) => t.then(() => { done++; target.v = (done / tasks.length) * 100; }));
363
+ const start = performance.now();
364
+
365
+ await new Promise<void>((resolve) => {
366
+ const tick = () => {
367
+ const elapsed = (performance.now() - start) / 1000;
368
+ const timeCap = Math.min(100, (elapsed / MIN) * 100); // never faster than MIN
369
+ const goal = elapsed > MAX ? 100 : Math.min(target.v, timeCap);
370
+ shown.v += (goal - shown.v) * 0.12;
371
+ if (goal === 100 && shown.v > 99.5) shown.v = 100;
372
+ if (count) count.textContent = format(shown.v);
373
+ if (bar) bar.style.transform = `scaleX(${shown.v / 100})`;
374
+ if (shown.v === 100) { gsap.ticker.remove(tick); resolve(); }
375
+ };
376
+ gsap.ticker.add(tick);
377
+ });
378
+
379
+ // Exit. Author per project with setLoaderExit(): it is the first handoff every visitor sees.
380
+ if (exit) { await exit(root); return finish(root); }
381
+ await gsap.timeline()
382
+ .to(root.querySelectorAll('[data-loader-out]'), { yPercent: -110, duration: 0.7, ease: ease.inOut, stagger: 0.05 })
383
+ .to(root, { clipPath: 'inset(0% 0% 100% 0%)', duration: 1, ease: ease.inOut }, '-=0.35');
384
+ finish(root);
385
+ }
386
+
387
+ // Hide rather than remove: in React apps the loader node belongs to React.
388
+ function finish(root: HTMLElement) {
389
+ root.hidden = true;
390
+ document.documentElement.classList.add('is-loaded');
391
+ }
392
+
393
+ const wait = (s: number) => new Promise((r) => setTimeout(r, s * 1000));
394
+ ```
395
+
396
+ ### `src/engine/interactions.ts`
397
+
398
+ ```ts
399
+ // Pointer craft. Fine pointers only; never hides the native cursor (accessibility, usability).
400
+ // data-magnetic="0.35" element leans toward the pointer
401
+ // data-cursor="View" follower grows and shows a label over this element
402
+ import { gsap } from 'gsap';
403
+ import { isTouch, prefersReducedMotion } from './env';
404
+
405
+ export function initMagnetic(root: ParentNode = document) {
406
+ if (isTouch() || prefersReducedMotion()) return;
407
+ root.querySelectorAll<HTMLElement>('[data-magnetic]').forEach((el) => {
408
+ const strength = parseFloat(el.dataset.magnetic || '0.35');
409
+ const x = gsap.quickTo(el, 'x', { duration: 0.6, ease: 'power3.out' });
410
+ const y = gsap.quickTo(el, 'y', { duration: 0.6, ease: 'power3.out' });
411
+ const move = (e: PointerEvent) => {
412
+ const r = el.getBoundingClientRect();
413
+ x((e.clientX - (r.left + r.width / 2)) * strength);
414
+ y((e.clientY - (r.top + r.height / 2)) * strength);
415
+ };
416
+ const leave = () => { x(0); y(0); };
417
+ el.addEventListener('pointermove', move);
418
+ el.addEventListener('pointerleave', leave);
419
+ });
420
+ }
421
+
422
+ let follower: HTMLElement | null = null;
423
+ export function initCursor() {
424
+ if (follower || isTouch() || prefersReducedMotion()) return;
425
+ follower = document.getElementById('cursor');
426
+ if (!follower) return;
427
+ const label = follower.querySelector<HTMLElement>('[data-cursor-label]');
428
+ const x = gsap.quickTo(follower, 'x', { duration: 0.45, ease: 'power3.out' });
429
+ const y = gsap.quickTo(follower, 'y', { duration: 0.45, ease: 'power3.out' });
430
+ addEventListener('pointermove', (e) => {
431
+ x(e.clientX); y(e.clientY);
432
+ const target = (e.target as HTMLElement).closest<HTMLElement>('[data-cursor]');
433
+ const text = target?.dataset.cursor || '';
434
+ follower!.classList.toggle('is-active', !!text);
435
+ if (label && label.textContent !== text) label.textContent = text;
436
+ }, { passive: true });
437
+ document.addEventListener('pointerleave', () => follower!.classList.remove('is-active'));
438
+ follower.classList.add('is-ready');
439
+ }
440
+ ```
441
+
442
+ ### `src/engine/transition.ts`
443
+
444
+ ```ts
445
+ // Page transitions. Adapters run leave() while the next page loads, so a transition adds
446
+ // little or no latency. Override the look with setTransition().
447
+ import { gsap } from 'gsap';
448
+ import { ease, prefersReducedMotion } from './env';
449
+
450
+ export type Transition = {
451
+ leave: (curtain: HTMLElement) => Promise<unknown> | gsap.core.Animation;
452
+ enter: (curtain: HTMLElement) => Promise<unknown> | gsap.core.Animation;
453
+ };
454
+
455
+ // Default: a solid panel wipes up over the page, then lifts off the new one.
456
+ let current: Transition = {
457
+ leave: (c) => gsap.timeline()
458
+ .set(c, { autoAlpha: 1 })
459
+ .fromTo(c.querySelector('.curtain__panel'), { yPercent: 100 }, { yPercent: 0, duration: 0.8, ease: ease.inOut }),
460
+ enter: (c) => gsap.timeline()
461
+ .to(c.querySelector('.curtain__panel'), { yPercent: -100, duration: 0.9, ease: ease.inOut })
462
+ .set(c, { autoAlpha: 0 }),
463
+ };
464
+
465
+ const reduced: Transition = {
466
+ leave: (c) => gsap.timeline().set(c, { autoAlpha: 1 }).fromTo(c, { opacity: 0 }, { opacity: 1, duration: 0.2 }),
467
+ enter: (c) => gsap.to(c, { autoAlpha: 0, duration: 0.2 }),
468
+ };
469
+
470
+ export const setTransition = (t: Transition) => { current = t; };
471
+ const pick = () => (prefersReducedMotion() ? reduced : current);
472
+ const curtain = () => document.getElementById('curtain') as HTMLElement;
473
+
474
+ export const playLeave = () => Promise.resolve(pick().leave(curtain()));
475
+ export const playEnter = () => Promise.resolve(pick().enter(curtain()));
476
+ ```
477
+
478
+ ### `src/engine/index.ts`
479
+
480
+ ```ts
481
+ // Engine core: framework-agnostic page lifecycle. No DOM access at import time (SSR-safe).
482
+ // A framework adapter calls:
483
+ // boot(setup) once, on first load: setup → loader → page init → intro
484
+ // leave() → cleanup() before the route swaps (leave can run in parallel with the fetch)
485
+ // enter() after the new page is in the DOM: init → enter animation → intro
486
+ // Project code hooks in with onPage(fn): fn runs on every page load inside a gsap.context, so the
487
+ // tweens and ScrollTriggers it creates are reverted automatically. Return a cleanup for the rest.
488
+ // No WebGL? Delete the five lines marked `// GL`.
489
+ import { gsap } from 'gsap';
490
+ import { ScrollTrigger } from 'gsap/ScrollTrigger';
491
+ import { initScroll, resetScroll, startScroll, stopScroll } from './scroll';
492
+ import { initReveals } from './reveal';
493
+ import { initGL, mountGL, unmountGL } from './gl'; // GL
494
+ import { initCursor, initMagnetic } from './interactions';
495
+ import { runLoader } from './loader';
496
+ import { playEnter, playLeave } from './transition';
497
+ import { prefersReducedMotion } from './env';
498
+
499
+ export { onScroll, scrollState, scrollToTarget, stopScroll, startScroll } from './scroll';
500
+ export { setTransition } from './transition';
501
+ export { setLoaderFormat, setLoaderExit } from './loader';
502
+ export { hideGL, setBackground, clearBackground, glSupported } from './gl'; // GL
503
+ export { ease, isTouch, isMobile, prefersReducedMotion } from './env';
504
+
505
+ export type PageFn = (page: { intro: gsap.core.Timeline; path: string }) => void | (() => void);
506
+ const pageFns = new Set<PageFn>();
507
+ const cleanups: (() => void)[] = [];
508
+ let ctx: gsap.Context | null = null;
509
+ let intro: gsap.core.Timeline | null = null;
510
+ let ready = false;
511
+ let booted = false;
512
+
513
+ /** Run fn on every page load (and now, if a page is ready). Returns an unsubscribe. */
514
+ export function onPage(fn: PageFn) {
515
+ pageFns.add(fn);
516
+ if (ready) runPageFn(fn);
517
+ return () => { pageFns.delete(fn); };
518
+ }
519
+
520
+ function runPageFn(fn: PageFn) {
521
+ ctx?.add(() => {
522
+ const c = fn({ intro: intro!, path: location.pathname });
523
+ if (typeof c === 'function') cleanups.push(c);
524
+ });
525
+ }
526
+
527
+ // Flags on <html>. Re-applied on every page because some routers swap root attributes.
528
+ export function syncFlags() {
529
+ const h = document.documentElement.classList;
530
+ h.add('js', 'is-booted');
531
+ h.toggle('motion', !prefersReducedMotion());
532
+ if (document.querySelector('.gl-canvas')) h.add('gl-on');
533
+ }
534
+
535
+ function initPage() {
536
+ syncFlags();
537
+ document.getElementById('cursor')?.classList.remove('is-active'); // stale label from the previous page
538
+ ctx = gsap.context(() => {
539
+ intro = initReveals(document);
540
+ initMagnetic(document);
541
+ });
542
+ mountGL(document); // GL
543
+ ready = true;
544
+ pageFns.forEach(runPageFn);
545
+ requestAnimationFrame(() => ScrollTrigger.refresh());
546
+ }
547
+
548
+ /** First load. `setup` runs once on the client after scroll/GL init and before the first page:
549
+ * register setTransition, setLoaderFormat, setLoaderExit, setBackground and driver modules there. */
550
+ export async function boot(setup?: () => void) {
551
+ if (booted) return;
552
+ booted = true;
553
+ syncFlags();
554
+ initScroll();
555
+ initGL(); // GL
556
+ initCursor();
557
+ setup?.();
558
+ stopScroll();
559
+ initPage();
560
+ await runLoader();
561
+ startScroll();
562
+ intro?.play();
563
+ }
564
+
565
+ /** Play the leave animation (resolve when the screen is covered). */
566
+ export async function leave() {
567
+ stopScroll();
568
+ await playLeave();
569
+ }
570
+
571
+ /** Tear down the current page: reverts every tween, ScrollTrigger and split; removes GL planes. */
572
+ export function cleanup() {
573
+ if (!ready) return;
574
+ ready = false;
575
+ cleanups.splice(0).forEach((c) => c());
576
+ ctx?.revert();
577
+ ctx = null;
578
+ unmountGL(); // GL
579
+ }
580
+
581
+ /** Init the new page. `transition: false` for back/forward, where no leave ran. */
582
+ export async function enter({ transition = true, scrollTop = true } = {}) {
583
+ if (!booted) return;
584
+ cleanup(); // no-op if the adapter already cleaned up
585
+ if (scrollTop) resetScroll();
586
+ initPage();
587
+ if (transition) await playEnter();
588
+ startScroll();
589
+ intro?.play();
590
+ }
591
+ ```
592
+
593
+ ## CSS
594
+
595
+ ### Tokens (`tokens.css`)
596
+
597
+ ```css
598
+ /* DESIGN TOKENS: rewrite every value per project from the art-direction plan. The NAMES are the
599
+ contract the engine CSS uses; the neutral values only exist so the engine renders. */
600
+
601
+
602
+ :root {
603
+ /* Color: name by role, not by hue. */
604
+ --c-bg: #f2f2f2;
605
+ --c-fg: #101010;
606
+ --c-muted: #6b6b6b;
607
+ --c-line: rgb(16 16 16 / 0.14);
608
+ --c-accent: #101010;
609
+ --c-curtain: var(--c-fg);
610
+
611
+ /* Type families */
612
+ --f-display: 'Display', system-ui, sans-serif; /* Next: var(--font-display) from next/font */
613
+ --f-body: system-ui, sans-serif;
614
+
615
+ /* Fluid type scale (min @ 375px → max @ 1440px) */
616
+ --t-mega: clamp(4rem, 1.2rem + 14vw, 16rem);
617
+ --t-xl: clamp(2.5rem, 1.4rem + 4.8vw, 6rem);
618
+ --t-l: clamp(1.75rem, 1.3rem + 1.9vw, 3rem);
619
+ --t-m: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem);
620
+ --t-body: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
621
+ --t-s: 0.875rem;
622
+ --t-xs: 0.75rem;
623
+
624
+ /* Space: one fluid unit, multiplied. Vary section rhythm deliberately. */
625
+ --u: clamp(0.5rem, 0.35rem + 0.6vw, 1rem);
626
+ --gutter: clamp(1rem, 0.6rem + 1.6vw, 2.5rem);
627
+ --cols: 12;
628
+
629
+ /* Shape: one radius rule for the whole site. */
630
+ --radius: 0px;
631
+
632
+ /* Layers */
633
+ --z-gl: 0;
634
+ --z-content: 1;
635
+ --z-header: 50;
636
+ --z-cursor: 80;
637
+ --z-curtain: 90;
638
+ --z-loader: 100;
639
+ }
640
+ ```
641
+
642
+ ### Engine foundation (`engine.css`)
643
+
644
+ ```css
645
+ /* ENGINE + FOUNDATION. The project look lives in tokens and component styles; edit this file
646
+ only to change engine behavior. */
647
+
648
+ *, *::before, *::after { box-sizing: border-box; }
649
+ * { margin: 0; }
650
+ html {
651
+ -webkit-text-size-adjust: none;
652
+ text-size-adjust: none;
653
+ background: var(--c-bg);
654
+ color: var(--c-fg);
655
+ }
656
+ body {
657
+ min-height: 100dvh;
658
+ font-family: var(--f-body);
659
+ font-size: var(--t-body);
660
+ line-height: 1.5;
661
+ -webkit-font-smoothing: antialiased;
662
+ -moz-osx-font-smoothing: grayscale;
663
+ text-rendering: optimizeLegibility;
664
+ font-kerning: normal;
665
+ overflow-x: clip;
666
+ }
667
+ img, picture, video, canvas, svg { display: block; max-width: 100%; }
668
+ img { height: auto; }
669
+ input, button, textarea, select { font: inherit; color: inherit; }
670
+ button { background: none; border: 0; cursor: pointer; }
671
+ a { color: inherit; text-decoration: none; }
672
+ h1, h2, h3, h4 { font-weight: inherit; font-size: inherit; text-wrap: balance; }
673
+ p { text-wrap: pretty; }
674
+ ::selection { background: var(--c-fg); color: var(--c-bg); }
675
+
676
+ /* Accessibility */
677
+ :focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; border-radius: 2px; }
678
+ #main:focus { outline: none; }
679
+ .skip-link {
680
+ position: fixed; left: var(--gutter); top: var(--gutter); z-index: calc(var(--z-loader) + 1);
681
+ padding: 0.6em 1em; background: var(--c-fg); color: var(--c-bg);
682
+ transform: translateY(-200%);
683
+ }
684
+ .skip-link:focus-visible { transform: none; }
685
+ .sr-only {
686
+ position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
687
+ overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
688
+ }
689
+
690
+ /* Lenis */
691
+ html.lenis, html.lenis body { height: auto; }
692
+ .lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
693
+ .lenis [data-lenis-prevent] { overscroll-behavior: contain; }
694
+ .lenis.lenis-smooth iframe { pointer-events: none; }
695
+
696
+ /* Stacking: canvas under content so text can sit over GL images */
697
+ #gl { position: fixed; inset: 0; z-index: var(--z-gl); pointer-events: none; }
698
+ .gl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
699
+ #main, [data-layer='content'] { position: relative; z-index: var(--z-content); }
700
+ /* GL replaces the pixels of [data-gl] media; the <img> stays for SEO, a11y and fallback. */
701
+ .gl-on [data-gl] img, .gl-on [data-gl] .gl-fallback { opacity: 0; }
702
+ /* The canvas sits UNDER the content: any background on a GL element would hide its plane. */
703
+ .gl-on [data-gl] { background: none !important; }
704
+ [data-gl='procedural'] .gl-fallback {
705
+ position: absolute; inset: 0;
706
+ background: radial-gradient(120% 90% at 30% 20%, var(--c-muted), var(--c-fg));
707
+ }
708
+ [data-gl] { position: relative; }
709
+
710
+ /* Hidden-until-revealed (only when motion is allowed and JS runs) */
711
+ .motion [data-split], .motion [data-reveal] { visibility: hidden; }
712
+ .split-line { padding-bottom: 0.08em; margin-bottom: -0.08em; } /* descender room inside masks */
713
+ /* SplitText turns each line into a block: keep text-indent on the first line only. */
714
+ [data-split] > * , [data-split] > * > * { text-indent: 0; }
715
+ [data-split] > :first-child, [data-split] > :first-child > :first-child { text-indent: inherit; }
716
+
717
+ /* Curtain (page transitions) */
718
+ #curtain { position: fixed; inset: 0; z-index: var(--z-curtain); pointer-events: none; visibility: hidden; overflow: hidden; }
719
+ /* No CSS transform here: GSAP owns it (CSS translate + yPercent would stack). #curtain visibility hides it. */
720
+ .curtain__panel { position: absolute; inset: 0; background: var(--c-curtain); }
721
+
722
+ /* Cursor follower: decorative, never replaces the native cursor */
723
+ #cursor {
724
+ position: fixed; left: 0; top: 0; z-index: var(--z-cursor); pointer-events: none;
725
+ display: grid; place-items: center; width: 0; height: 0; opacity: 0;
726
+ }
727
+ #cursor.is-ready { opacity: 1; }
728
+ #cursor span {
729
+ display: grid; place-items: center; min-width: 5.5rem; aspect-ratio: 1; border-radius: 50%;
730
+ background: var(--c-fg); color: var(--c-bg); font-size: var(--t-xs); letter-spacing: 0.02em;
731
+ transform: translate(-50%, -50%) scale(0); transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
732
+ }
733
+ #cursor.is-active span { transform: translate(-50%, -50%) scale(1); }
734
+ @media (hover: none), (pointer: coarse) { #cursor { display: none; } }
735
+
736
+ /* Loader skeleton: restyle in the project, keep it covering the first paint */
737
+ #loader {
738
+ position: fixed; inset: 0; z-index: var(--z-loader);
739
+ display: grid; align-content: end; padding: var(--gutter);
740
+ background: var(--c-fg); color: var(--c-bg);
741
+ clip-path: inset(0% 0% 0% 0%);
742
+ }
743
+ .loader__inner { display: flex; justify-content: space-between; align-items: end; overflow: hidden; }
744
+ .loader__count { font-variant-numeric: tabular-nums; }
745
+ .loader__bar { height: 1px; margin-top: calc(var(--u) * 1.5); background: currentColor; transform: scaleX(0); transform-origin: left; }
746
+ html:not(.js) #loader, #loader[hidden] { display: none; }
747
+
748
+ @media (prefers-reduced-motion: reduce) {
749
+ *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
750
+ }
751
+ ```