sera-code 0.1.2 → 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 (333) hide show
  1. package/README.md +9 -1
  2. package/bin/sera.mjs +31 -0
  3. package/dist/bundle/chunks/{chunk-LOMPDCMP.js → chunk-DFRGGJWV.js} +1 -1
  4. package/dist/bundle/chunks/{chunk-AZC5WTED.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-Z2V3PTLI.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/auto-memory.ts +249 -0
  325. package/sera-core/src/extension.ts +69 -3
  326. package/sera-core/src/generated/build-rules.ts +81 -17
  327. package/sera-core/src/generated/quality-probe.ts +2 -0
  328. package/sera-core/src/generated/zero-knowledge.ts +36 -9
  329. package/sera-core/src/image-tool.ts +124 -7
  330. package/sera-core/src/link-data-tools.ts +411 -0
  331. package/sera-core/src/skills.ts +54 -18
  332. package/sera-core/src/video-tool.ts +51 -0
  333. package/sera-core/src/zk.ts +7 -3
@@ -0,0 +1,463 @@
1
+ // The beest's stage: a warm studio over pale sand. PBR with VSM shadows and GTAO (the sand kept out of the AO pass),
2
+ // an unlit sand floor whose ripples fade into the backdrop, shadows laid over it. frame(theta, t, cam) poses the
3
+ // beast from the crank angle and draws one frame; the view size is whatever the caller's canvas box is.
4
+ import * as THREE from 'three';
5
+ import {EffectComposer} from 'three/addons/postprocessing/EffectComposer.js';
6
+ import {GTAOPass} from 'three/addons/postprocessing/GTAOPass.js';
7
+ import {OutputPass} from 'three/addons/postprocessing/OutputPass.js';
8
+ import {Pass} from 'three/addons/postprocessing/Pass.js';
9
+ import {RenderPass} from 'three/addons/postprocessing/RenderPass.js';
10
+ import {ShaderPass} from 'three/addons/postprocessing/ShaderPass.js';
11
+ import {bodyAt, buildBeast, PAD, S} from './beast.js';
12
+ import {FOOT_MIN} from './jansen.js';
13
+
14
+ const V3 = THREE.Vector3;
15
+ export const PALETTES = {
16
+ sand: {
17
+ bg: '#eee7dc',
18
+ sand: '#ebe2d3',
19
+ tube: '#f4f1eb',
20
+ joint: '#d1322a',
21
+ steel: '#646870',
22
+ foot: '#8c8780',
23
+ sail: '#fbf9f5',
24
+ shadow: ['#5b4936', 0.34],
25
+ env: {bg: '#e4ddd2', ground: '#d6ccbb', k: 0.8},
26
+ hemi: ['#fbf7f1', '#dacdb8', 0.62],
27
+ },
28
+ // tan dune under a pale sky: the white frame stands off a darker ground
29
+ dune: {
30
+ bg: '#e9e2d6',
31
+ sand: '#d2bc98',
32
+ tube: '#f7f4ef',
33
+ joint: '#d1322a',
34
+ steel: '#4e525a',
35
+ foot: '#6f6a64',
36
+ sail: '#fbf9f5',
37
+ shadow: ['#4a3220', 0.42],
38
+ env: {bg: '#dde2e4', ground: '#c9b391', k: 0.85},
39
+ hemi: ['#f4f7fa', '#c7ae86', 0.6],
40
+ hero: '#2a2622',
41
+ trace: '#e2672a',
42
+ print: '#6a4f30',
43
+ grain: '#86683f',
44
+ },
45
+ // a cool slate studio: the most contrast the light console can take
46
+ slate: {
47
+ bg: '#cfd5da',
48
+ sand: '#bcc1c3',
49
+ tube: '#f8f7f4',
50
+ joint: '#d8352b',
51
+ steel: '#3f444b',
52
+ foot: '#5d6166',
53
+ sail: '#fbfbf9',
54
+ shadow: ['#1d2731', 0.4],
55
+ env: {bg: '#cfd5da', ground: '#aeb4b8', k: 0.85},
56
+ hemi: ['#f2f5f8', '#a9afb3', 0.62],
57
+ },
58
+ };
59
+ const INK_FRAG = /* glsl */ `
60
+ uniform sampler2D tDiffuse; uniform sampler2D tDepth; uniform sampler2D tNormal;
61
+ uniform float uNear; uniform float uFar; uniform vec2 uPx; uniform vec3 uInk; uniform float uStrength;
62
+ varying vec2 vUv;
63
+ float lz(vec2 uv){ float d = texture2D(tDepth, uv).x; return uNear * uFar / (uFar - d * (uFar - uNear)); }
64
+ vec3 nn(vec2 uv){ return normalize(texture2D(tNormal, uv).xyz * 2.0 - 1.0); }
65
+ void main(){
66
+ vec4 c = texture2D(tDiffuse, vUv);
67
+ float z0 = lz(vUv);
68
+ float zl = lz(vUv - vec2(uPx.x, 0.0)), zr = lz(vUv + vec2(uPx.x, 0.0));
69
+ float zd = lz(vUv - vec2(0.0, uPx.y)), zu = lz(vUv + vec2(0.0, uPx.y));
70
+ float lap = (abs(zl + zr - 2.0 * z0) + abs(zu + zd - 2.0 * z0)) / max(z0, 1e-3);
71
+ float eD = smoothstep(0.004, 0.016, lap);
72
+ vec3 n0 = nn(vUv);
73
+ float eN = max(max(1.0 - dot(n0, nn(vUv - vec2(uPx.x, 0.0))), 1.0 - dot(n0, nn(vUv + vec2(uPx.x, 0.0)))),
74
+ max(1.0 - dot(n0, nn(vUv - vec2(0.0, uPx.y))), 1.0 - dot(n0, nn(vUv + vec2(0.0, uPx.y)))));
75
+ float e = max(eD, smoothstep(0.3, 0.6, eN));
76
+ c.rgb = mix(c.rgb, uInk, e * uStrength);
77
+ gl_FragColor = c;
78
+ }`;
79
+
80
+ const SAND_VERT = /* glsl */ `varying vec3 vW; void main(){ vec4 w = modelMatrix * vec4(position, 1.0); vW = w.xyz; gl_Position = projectionMatrix * viewMatrix * w; }`;
81
+ const SAND_FRAG = /* glsl */ `uniform vec3 uSand; uniform vec3 uBg; uniform vec3 uC; varying vec3 vW;
82
+ float h(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }
83
+ float n(vec2 p){ vec2 i = floor(p); vec2 f = fract(p); f = f * f * (3.0 - 2.0 * f);
84
+ return mix(mix(h(i), h(i + vec2(1, 0)), f.x), mix(h(i + vec2(0, 1)), h(i + vec2(1, 1)), f.x), f.y); }
85
+ void main(){
86
+ vec2 p = vW.xz;
87
+ // wind ripples: long crests bent by a slow noise, light on the windward face
88
+ float bend = n(p * 0.35) * 2.6 + n(p * 1.1) * 0.6;
89
+ float ph = (p.y * 2.9 + p.x * 0.55 + bend) * 6.2831;
90
+ float rip = sin(ph) * 0.5 + 0.5;
91
+ rip = pow(rip, 3.0) - 0.25 * sin(ph + 1.2);
92
+ float grain = n(p * 70.0) * 0.6 + n(p * 190.0) * 0.4;
93
+ float pat = n(p * 0.22);
94
+ vec3 col = uSand * (0.985 + 0.055 * rip - 0.05 * grain + 0.04 * (pat - 0.5));
95
+ // fine fade near the camera's look point keeps the texture under the beast, the horizon melts into the backdrop
96
+ float d = length(p - uC.xz);
97
+ float fade = smoothstep(5.0, 17.0, d);
98
+ gl_FragColor = vec4(mix(col, uBg, fade), 1.0);
99
+ }`;
100
+
101
+ // footprints: pressed ovals that appear at touchdown and fade over ~20 s; one instance per planted step
102
+ const PRINT_VERT = /* glsl */ `attribute vec4 aP; uniform float uT; varying vec2 vUv; varying float vA;
103
+ void main(){
104
+ vec2 c = position.xy;
105
+ float ca = cos(aP.w), sa = sin(aP.w);
106
+ vec2 q = vec2(c.x * 0.085, c.y * 0.105);
107
+ vec2 r = vec2(q.x * ca - q.y * sa, q.x * sa + q.y * ca);
108
+ vUv = c;
109
+ float age = uT - aP.z;
110
+ vA = step(0.0, age) * smoothstep(0.0, 0.15, age) * (1.0 - smoothstep(14.0, 24.0, age));
111
+ gl_Position = projectionMatrix * viewMatrix * vec4(aP.x + r.x, 0.0012, aP.y + r.y, 1.0);
112
+ }`;
113
+ const PRINT_FRAG = /* glsl */ `uniform vec3 uCol; varying vec2 vUv; varying float vA;
114
+ void main(){
115
+ float d = length(vUv * 2.0);
116
+ // a pressed hollow with a raised, lit rim pushed out around it
117
+ float hollow = 1.0 - smoothstep(0.6, 1.0, d);
118
+ float rim = smoothstep(0.75, 0.95, d) * (1.0 - smoothstep(1.0, 1.25, d));
119
+ float a = (hollow * 0.5 + rim * 0.16) * vA;
120
+ if (a < 0.003) discard;
121
+ gl_FragColor = vec4(mix(uCol, vec3(1.0), rim * 0.7), a);
122
+ }`;
123
+ // blown sand: grains streaming low over the dune with the wind, wrapped in a box around the camera's look point
124
+ const GRAIN_VERT = /* glsl */ `attribute vec3 aSeed; uniform float uT; uniform float uFlow; uniform vec3 uC; uniform vec2 uDir; uniform float uPr; uniform float uAmt;
125
+ varying float vA;
126
+ void main(){
127
+ vec3 box = vec3(12.0, 1.0, 9.0);
128
+ vec2 p = aSeed.xz * box.xz + uDir * uFlow * (0.65 + 0.7 * aSeed.y);
129
+ vec2 rel = mod(p - uC.xz + box.xz * 0.5, box.xz);
130
+ vec2 edge = min(rel, box.xz - rel);
131
+ vec3 w = vec3(rel.x + uC.x - box.x * 0.5, 0.012 + aSeed.y * aSeed.y * aSeed.y * 0.55 + 0.03 * sin(uT * 2.3 + aSeed.x * 40.0), rel.y + uC.z - box.z * 0.5);
132
+ vec4 mv = viewMatrix * vec4(w, 1.0);
133
+ gl_Position = projectionMatrix * mv;
134
+ gl_PointSize = uPr * (2.2 + 3.2 * aSeed.z) * clamp(7.0 / -mv.z, 0.5, 2.5);
135
+ vA = uAmt * (0.25 + 0.6 * aSeed.z) * smoothstep(0.0, 1.5, min(edge.x, edge.y));
136
+ }`;
137
+ const GRAIN_FRAG = /* glsl */ `uniform vec3 uCol; varying float vA;
138
+ void main(){ vec2 c = gl_PointCoord - 0.5; float a = (1.0 - smoothstep(0.15, 0.5, length(c))) * vA; if (a < 0.01) discard; gl_FragColor = vec4(uCol, a); }`;
139
+
140
+ export function createBeestStage({canvas, palette = 'sand', ink = 0}) {
141
+ const P = PALETTES[palette] || PALETTES.sand;
142
+ const renderer = new THREE.WebGLRenderer({canvas, antialias: false, preserveDrawingBuffer: true, powerPreference: 'high-performance'});
143
+ renderer.toneMapping = THREE.NeutralToneMapping;
144
+ renderer.toneMappingExposure = 1.0;
145
+ renderer.outputColorSpace = THREE.SRGBColorSpace;
146
+ renderer.shadowMap.enabled = true;
147
+ renderer.shadowMap.type = THREE.VSMShadowMap;
148
+ const scene = new THREE.Scene();
149
+ scene.background = new THREE.Color(P.bg);
150
+ if (P.sky) {
151
+ // a screen-space sky: the top colour down to the horizon, the horizon colour below it
152
+ const c = document.createElement('canvas');
153
+ c.width = 4;
154
+ c.height = 512;
155
+ const g = c.getContext('2d');
156
+ const gr = g.createLinearGradient(0, 0, 0, 512);
157
+ gr.addColorStop(0, P.sky[0]);
158
+ gr.addColorStop(0.55, P.sky[1]);
159
+ gr.addColorStop(1, P.sky[1]);
160
+ g.fillStyle = gr;
161
+ g.fillRect(0, 0, 4, 512);
162
+ const tex = new THREE.CanvasTexture(c);
163
+ tex.colorSpace = THREE.SRGBColorSpace;
164
+ scene.background = tex;
165
+ }
166
+ scene.fog = new THREE.Fog(P.bg, 9, 24);
167
+ const camera = new THREE.PerspectiveCamera(22, 16 / 9, 0.05, 200);
168
+ const rt = new THREE.WebGLRenderTarget(4, 4, {type: THREE.HalfFloatType, samples: 8});
169
+ const composer = new EffectComposer(renderer, rt);
170
+ composer.addPass(new RenderPass(scene, camera));
171
+ const gtao = new GTAOPass(scene, camera, 4, 4);
172
+ gtao.output = GTAOPass.OUTPUT.Default;
173
+ gtao.blendIntensity = 0.85;
174
+ gtao.updateGtaoMaterial({radius: 0.12, distanceExponent: 1.4, thickness: 1.0, scale: 1.0, samples: 16, distanceFallOff: 1.0, screenSpaceRadius: false});
175
+ gtao.updatePdMaterial({lumaPhi: 10, depthPhi: 2, normalPhi: 3, radius: 6, rings: 2, samples: 16});
176
+ class Toggle extends Pass {
177
+ constructor(fn) {
178
+ super();
179
+ this.needsSwap = false;
180
+ this.fn = fn;
181
+ }
182
+ render() {
183
+ this.fn();
184
+ }
185
+ }
186
+ // what the AO pass (and the ink drawn from it) must not see: the ground, the sheets, the overlays, and the ghosted
187
+ // frame while a leg is isolated
188
+ let isoNow = 0;
189
+ const groundAO = (v) => () => {
190
+ floor.visible = v;
191
+ shade.visible = v;
192
+ prints.visible = v;
193
+ grains.visible = v;
194
+ for (const s of beast.sails) s.visible = v;
195
+ for (const m of beast.traces) m.visible = v && m.userData.on;
196
+ if (isoNow > 0.5) for (const m of beast.main) m.visible = v;
197
+ };
198
+ composer.addPass(new Toggle(groundAO(false)));
199
+ // ink only (a weak GPU): GTAO renders just its normal and depth buffer for the outline, skips the AO and the
200
+ // denoise, and leaves the picture where it is
201
+ let aoOn = true;
202
+ const gtaoRender = gtao.render.bind(gtao);
203
+ gtao.render = (renderer, writeBuffer, readBuffer, ...rest) => {
204
+ if (aoOn) return gtaoRender(renderer, writeBuffer, readBuffer, ...rest);
205
+ gtao._overrideVisibility();
206
+ gtao._renderOverride(renderer, gtao.normalMaterial, gtao.normalRenderTarget, 0x7777ff, 1.0);
207
+ gtao._restoreVisibility();
208
+ };
209
+ composer.addPass(gtao);
210
+ composer.addPass(new Toggle(groundAO(true)));
211
+ // ink: depth creases and normal breaks from the AO pass's g-buffer, which holds the beast alone
212
+ const inkPass = new ShaderPass(
213
+ new THREE.ShaderMaterial({
214
+ uniforms: {
215
+ tDiffuse: {value: null},
216
+ tDepth: {value: gtao.depthTexture},
217
+ tNormal: {value: gtao.normalTexture},
218
+ uNear: {value: camera.near},
219
+ uFar: {value: camera.far},
220
+ uPx: {value: new THREE.Vector2(1 / 1920, 1 / 1080)},
221
+ uInk: {value: new THREE.Color().setRGB(0.07, 0.06, 0.055, THREE.LinearSRGBColorSpace)},
222
+ uStrength: {value: ink},
223
+ },
224
+ vertexShader: /* glsl */ `varying vec2 vUv; void main(){ vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }`,
225
+ fragmentShader: INK_FRAG,
226
+ }),
227
+ );
228
+ inkPass.enabled = ink > 0;
229
+ composer.addPass(inkPass);
230
+ composer.addPass(new OutputPass());
231
+
232
+ // studio environment: warm soft boxes over a sand-coloured ground, prefiltered
233
+ {
234
+ const env = new THREE.Scene();
235
+ env.background = new THREE.Color(P.env.bg);
236
+ const box = (w, h, pos, k, tint = [1, 0.985, 0.95]) => {
237
+ const m = new THREE.Mesh(new THREE.PlaneGeometry(w, h), new THREE.MeshBasicMaterial({color: new THREE.Color(...tint).multiplyScalar(k), side: THREE.DoubleSide}));
238
+ m.position.copy(pos);
239
+ m.lookAt(0, 0, 0);
240
+ env.add(m);
241
+ };
242
+ box(16, 7, new V3(-12, 11, 9), 3.0);
243
+ box(10, 10, new V3(11, 14, -7), 2.2);
244
+ box(20, 3, new V3(2, 5, 17), 1.7);
245
+ const g = new THREE.Mesh(new THREE.CircleGeometry(40, 32), new THREE.MeshBasicMaterial({color: P.env.ground, side: THREE.DoubleSide}));
246
+ g.rotation.x = -Math.PI / 2;
247
+ g.position.y = -1.5;
248
+ env.add(g);
249
+ const pm = new THREE.PMREMGenerator(renderer);
250
+ scene.environment = pm.fromScene(env, 0.03).texture;
251
+ scene.environmentIntensity = P.env.k;
252
+ pm.dispose();
253
+ }
254
+ const SUN_DIR = new V3(-0.55, 0.66, 0.52).normalize();
255
+ const sun = new THREE.DirectionalLight('#fff7ec', 2.4);
256
+ sun.castShadow = true;
257
+ const EXT = 3.0;
258
+ Object.assign(sun.shadow.camera, {left: -EXT, right: EXT, top: EXT, bottom: -EXT, near: 0.5, far: 24});
259
+ sun.shadow.mapSize.set(4096, 4096);
260
+ sun.shadow.radius = 7;
261
+ sun.shadow.blurSamples = 20;
262
+ sun.shadow.bias = -0.0003;
263
+ sun.shadow.normalBias = 0.003;
264
+ scene.add(sun, sun.target);
265
+ scene.add(new THREE.HemisphereLight(...P.hemi));
266
+
267
+ // sand
268
+ const sandMat = new THREE.ShaderMaterial({
269
+ vertexShader: SAND_VERT,
270
+ fragmentShader: SAND_FRAG,
271
+ uniforms: {uSand: {value: new THREE.Color(P.sand)}, uBg: {value: new THREE.Color(P.bg)}, uC: {value: new V3()}},
272
+ toneMapped: false,
273
+ });
274
+ const floor = new THREE.Mesh(new THREE.PlaneGeometry(400, 400), sandMat);
275
+ floor.rotation.x = -Math.PI / 2;
276
+ scene.add(floor);
277
+ const shade = new THREE.Mesh(new THREE.PlaneGeometry(400, 400), new THREE.ShadowMaterial({color: P.shadow[0], opacity: P.shadow[1], fog: false, polygonOffset: true, polygonOffsetFactor: -4, polygonOffsetUnits: -8}));
278
+ shade.rotation.x = -Math.PI / 2;
279
+ shade.position.y = 0.0004;
280
+ shade.receiveShadow = true;
281
+ scene.add(shade);
282
+
283
+ const beast = buildBeast(P);
284
+ scene.add(beast.group);
285
+
286
+ // footprints, set by the caller as [x, z, born, angle] per step
287
+ const printGeo = new THREE.InstancedBufferGeometry();
288
+ {
289
+ const base = new THREE.PlaneGeometry(1, 1);
290
+ printGeo.index = base.index;
291
+ printGeo.setAttribute('position', base.attributes.position);
292
+ printGeo.setAttribute('aP', new THREE.InstancedBufferAttribute(new Float32Array(4), 4));
293
+ printGeo.instanceCount = 0;
294
+ }
295
+ const printMat = new THREE.ShaderMaterial({
296
+ vertexShader: PRINT_VERT,
297
+ fragmentShader: PRINT_FRAG,
298
+ uniforms: {uT: {value: 0}, uCol: {value: new THREE.Color(P.print || '#7a5c3a')}},
299
+ transparent: true,
300
+ depthWrite: false,
301
+ // the quad is laid on the ground by a mirrored mapping, so its winding flips
302
+ side: THREE.DoubleSide,
303
+ polygonOffset: true,
304
+ polygonOffsetFactor: -4,
305
+ polygonOffsetUnits: -8,
306
+ });
307
+ const prints = new THREE.Mesh(printGeo, printMat);
308
+ prints.frustumCulled = false;
309
+ prints.renderOrder = 1;
310
+ scene.add(prints);
311
+ const setPrints = (list) => {
312
+ const a = new Float32Array(Math.max(4, list.length * 4));
313
+ list.forEach((p, i) => a.set(p, i * 4));
314
+ printGeo.setAttribute('aP', new THREE.InstancedBufferAttribute(a, 4));
315
+ printGeo.instanceCount = list.length;
316
+ };
317
+ // the live page lays prints as the feet land: a ring of cap slots, unborn slots far in the future
318
+ let ring = null;
319
+ const usePrintRing = (cap) => {
320
+ const a = new Float32Array(cap * 4);
321
+ for (let i = 0; i < cap; i++) a[i * 4 + 2] = 1e9;
322
+ const attr = new THREE.InstancedBufferAttribute(a, 4);
323
+ attr.setUsage(THREE.DynamicDrawUsage);
324
+ printGeo.setAttribute('aP', attr);
325
+ printGeo.instanceCount = cap;
326
+ ring = {attr, cap, i: 0};
327
+ };
328
+ const addPrint = (x, z, born, angle) => {
329
+ ring.attr.array.set([x, z, born, angle], ring.i * 4);
330
+ ring.i = (ring.i + 1) % ring.cap;
331
+ ring.attr.needsUpdate = true;
332
+ };
333
+
334
+ // blown sand
335
+ const NG = 9000;
336
+ const grainGeo = new THREE.BufferGeometry();
337
+ {
338
+ const seed = new Float32Array(NG * 3);
339
+ let r = 91;
340
+ const rnd = () => (r = (r * 16807) % 2147483647) / 2147483647;
341
+ for (let i = 0; i < NG * 3; i++) seed[i] = rnd();
342
+ grainGeo.setAttribute('aSeed', new THREE.BufferAttribute(seed, 3));
343
+ grainGeo.setAttribute('position', new THREE.BufferAttribute(new Float32Array(NG * 3), 3));
344
+ }
345
+ const grainMat = new THREE.ShaderMaterial({
346
+ vertexShader: GRAIN_VERT,
347
+ fragmentShader: GRAIN_FRAG,
348
+ uniforms: {uT: {value: 0}, uFlow: {value: 0}, uC: {value: new V3()}, uDir: {value: new THREE.Vector2(-0.86, 0.5)}, uPr: {value: 1}, uAmt: {value: 0}, uCol: {value: new THREE.Color(P.grain || '#8f7350')}},
349
+ transparent: true,
350
+ depthWrite: false,
351
+ });
352
+ const grains = new THREE.Points(grainGeo, grainMat);
353
+ grains.frustumCulled = false;
354
+ grains.renderOrder = 4;
355
+ scene.add(grains);
356
+
357
+ const size = {w: 1600, h: 900};
358
+ const resize = (w, h, pr) => {
359
+ size.w = w;
360
+ size.h = h;
361
+ grainMat.uniforms.uPr.value = pr;
362
+ renderer.setPixelRatio(pr);
363
+ renderer.setSize(w, h, false);
364
+ composer.setPixelRatio(pr);
365
+ composer.setSize(w, h);
366
+ inkPass.material.uniforms.uPx.value.set(1 / (w * pr), 1 / (h * pr));
367
+ camera.aspect = w / h;
368
+ camera.updateProjectionMatrix();
369
+ };
370
+
371
+ const tmp = new V3();
372
+ const right = new V3().crossVectors(new V3(0, 1, 0), SUN_DIR).normalize();
373
+ const upL = new V3().crossVectors(SUN_DIR, right);
374
+ let texel = (2 * EXT) / sun.shadow.mapSize.x;
375
+
376
+ /** The body's world position for crank angle theta: x along the walk, y of the axle. */
377
+ const bodyPos = (theta) => {
378
+ const b = bodyAt(theta);
379
+ return {x: b.x * S, y: -(FOOT_MIN + b.low - PAD * 1.25) * S};
380
+ };
381
+
382
+ // ops: wind (m/s), flow (metres of wind run so far), iso, hero, trace, heroTrace; cam.sx / cam.sy shift the picture
383
+ // on screen (CSS px) so the subject sits in the space the console leaves free
384
+ const frame = (theta, t, cam, ops = {}) => {
385
+ const b = bodyPos(theta);
386
+ beast.group.position.set(b.x, b.y, 0);
387
+ const wind = ops.wind ?? 6;
388
+ isoNow = ops.iso ?? 0;
389
+ beast.update(theta, t, 0.45 + 0.6 * Math.min(1.2, wind / 10), ops);
390
+ for (const m of beast.traces) m.userData.on = m.visible;
391
+ printMat.uniforms.uT.value = t;
392
+ grainMat.uniforms.uT.value = t;
393
+ grainMat.uniforms.uFlow.value = ops.flow ?? 0;
394
+ grainMat.uniforms.uAmt.value = 0.25 + 0.75 * Math.min(1, Math.max(0, (wind - 5) / 7));
395
+
396
+ const {tx, ty, tz, az, el, d} = cam;
397
+ camera.position.set(tx + d * Math.cos(el) * Math.cos(az), ty + d * Math.sin(el), tz - d * Math.cos(el) * Math.sin(az));
398
+ camera.lookAt(tx, ty, tz);
399
+ camera.setViewOffset(size.w, size.h, -(cam.sx ?? 0), -(cam.sy ?? 0), size.w, size.h);
400
+ camera.updateMatrixWorld();
401
+ grainMat.uniforms.uC.value.set(tx, 0, tz);
402
+ sandMat.uniforms.uC.value.set(tx, 0, tz);
403
+ // the sand and its shadow catcher follow the camera in whole metres; the ripples are drawn in world space
404
+ floor.position.x = shade.position.x = Math.round(tx);
405
+ floor.position.z = shade.position.z = Math.round(tz);
406
+ // the shadow box follows the beast, snapped to texels so it never shimmers
407
+ tmp.set(b.x, 0.6, 0);
408
+ const rr = Math.round(tmp.dot(right) / texel) * texel;
409
+ const uu = Math.round(tmp.dot(upL) / texel) * texel;
410
+ sun.target.position.copy(right).multiplyScalar(rr).addScaledVector(upL, uu).addScaledVector(SUN_DIR, tmp.dot(SUN_DIR));
411
+ sun.position.copy(sun.target.position).addScaledVector(SUN_DIR, 10);
412
+ sun.target.updateMatrixWorld();
413
+ composer.render();
414
+ return b;
415
+ };
416
+ // a world point to CSS px on the canvas, null behind the camera
417
+ const pv = new V3();
418
+ const project = (x, y, z) => {
419
+ pv.set(x, y, z).project(camera);
420
+ if (pv.z > 1) return null;
421
+ return [(pv.x * 0.5 + 0.5) * size.w, (-pv.y * 0.5 + 0.5) * size.h];
422
+ };
423
+ // a point of the beast given in Jansen units of its own frame (u, v, z) to world
424
+ const beastWorld = (u, v, z) => [beast.group.position.x + u * S, beast.group.position.y + v * S, z * S];
425
+ // the live page's quality knobs: MSAA samples, the shadow map and its blur, the AO samples, how many grains blow
426
+ const setQuality = ({samples, shadow, blur, radius, ao, pcf, grains: ng}) => {
427
+ if (samples !== undefined) {
428
+ for (const t of [composer.renderTarget1, composer.renderTarget2]) {
429
+ t.samples = samples;
430
+ t.dispose();
431
+ }
432
+ }
433
+ if (shadow !== undefined) {
434
+ sun.shadow.mapSize.set(shadow, shadow);
435
+ sun.shadow.map?.dispose();
436
+ sun.shadow.map = null;
437
+ texel = (2 * EXT) / shadow;
438
+ }
439
+ if (blur !== undefined) sun.shadow.blurSamples = blur;
440
+ if (radius !== undefined) sun.shadow.radius = radius;
441
+ if (ao !== undefined) {
442
+ aoOn = ao > 0;
443
+ gtao.needsSwap = aoOn;
444
+ if (aoOn) {
445
+ gtao.updateGtaoMaterial({samples: ao});
446
+ gtao.updatePdMaterial({samples: Math.max(4, ao)});
447
+ }
448
+ }
449
+ if (pcf !== undefined) {
450
+ const type = pcf ? THREE.PCFSoftShadowMap : THREE.VSMShadowMap;
451
+ if (renderer.shadowMap.type !== type) {
452
+ renderer.shadowMap.type = type;
453
+ sun.shadow.map?.dispose();
454
+ sun.shadow.map = null;
455
+ scene.traverse((o) => {
456
+ if (o.material) for (const m of [].concat(o.material)) m.needsUpdate = true;
457
+ });
458
+ }
459
+ }
460
+ if (ng !== undefined) grainGeo.setDrawRange(0, ng);
461
+ };
462
+ return {renderer, scene, camera, beast, composer, gtao, inkPass, sun, resize, frame, bodyPos, size, project, beastWorld, setPrints, usePrintRing, addPrint, setQuality};
463
+ }
@@ -0,0 +1,4 @@
1
+ // V8 · Four-Stroke explorer film. Shared code in ../v8-shared.
2
+ import {run} from '../v8-shared/film.js';
3
+
4
+ run();
@@ -0,0 +1 @@
1
+ {"duration":26}
@@ -0,0 +1,5 @@
1
+ import {runLive} from '../v8-shared/live.js';
2
+
3
+ // V8 · Four-Stroke as an interactive page for the site: views, cutaway, overlays, firing order, speed, orbit, and an
4
+ // auto tour when left alone.
5
+ runLive();