@3driseai/3drise-viewer 0.1.40 → 0.1.41

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 (297) hide show
  1. package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
  2. package/dist/animationsV2/ClipsRuntime.js +9 -5
  3. package/dist/animationsV2/clipUtils.d.ts +9 -0
  4. package/dist/animationsV2/clipUtils.d.ts.map +1 -1
  5. package/dist/animationsV2/clipUtils.js +11 -2
  6. package/dist/animationsV2/normalize.d.ts.map +1 -1
  7. package/dist/animationsV2/normalize.js +2 -0
  8. package/dist/animationsV2/types.d.ts +4 -0
  9. package/dist/animationsV2/types.d.ts.map +1 -1
  10. package/dist/api/sceneHandle.d.ts +40 -3
  11. package/dist/api/sceneHandle.d.ts.map +1 -1
  12. package/dist/api/sceneHandle.js +40 -0
  13. package/dist/components/GalleryObject.d.ts +13 -0
  14. package/dist/components/GalleryObject.d.ts.map +1 -0
  15. package/dist/components/GalleryObject.js +46 -0
  16. package/dist/components/ImageObject.d.ts +9 -0
  17. package/dist/components/ImageObject.d.ts.map +1 -0
  18. package/dist/components/ImageObject.js +26 -0
  19. package/dist/components/ObjectNode.d.ts.map +1 -1
  20. package/dist/components/ObjectNode.js +11 -5
  21. package/dist/components/ProjectLoader.d.ts +2 -0
  22. package/dist/components/ProjectLoader.d.ts.map +1 -1
  23. package/dist/components/ProjectLoader.js +2 -2
  24. package/dist/components/SceneBuilder.d.ts +10 -0
  25. package/dist/components/SceneBuilder.d.ts.map +1 -1
  26. package/dist/components/SceneBuilder.js +3 -2
  27. package/dist/components/gallery/BasicCarouselGallery.d.ts +18 -0
  28. package/dist/components/gallery/BasicCarouselGallery.d.ts.map +1 -0
  29. package/dist/components/gallery/BasicCarouselGallery.js +9 -0
  30. package/dist/components/gallery/ContourLinesGallery.d.ts +18 -0
  31. package/dist/components/gallery/ContourLinesGallery.d.ts.map +1 -0
  32. package/dist/components/gallery/ContourLinesGallery.js +9 -0
  33. package/dist/components/gallery/DepthLayersGallery.d.ts +18 -0
  34. package/dist/components/gallery/DepthLayersGallery.d.ts.map +1 -0
  35. package/dist/components/gallery/DepthLayersGallery.js +9 -0
  36. package/dist/components/gallery/EngravingGallery.d.ts +18 -0
  37. package/dist/components/gallery/EngravingGallery.d.ts.map +1 -0
  38. package/dist/components/gallery/EngravingGallery.js +9 -0
  39. package/dist/components/gallery/FlowLinesGallery.d.ts +18 -0
  40. package/dist/components/gallery/FlowLinesGallery.d.ts.map +1 -0
  41. package/dist/components/gallery/FlowLinesGallery.js +9 -0
  42. package/dist/components/gallery/FoldGallery.d.ts +18 -0
  43. package/dist/components/gallery/FoldGallery.d.ts.map +1 -0
  44. package/dist/components/gallery/FoldGallery.js +9 -0
  45. package/dist/components/gallery/GlassPanesGallery.d.ts +18 -0
  46. package/dist/components/gallery/GlassPanesGallery.d.ts.map +1 -0
  47. package/dist/components/gallery/GlassPanesGallery.js +9 -0
  48. package/dist/components/gallery/HaloGallery.d.ts +18 -0
  49. package/dist/components/gallery/HaloGallery.d.ts.map +1 -0
  50. package/dist/components/gallery/HaloGallery.js +9 -0
  51. package/dist/components/gallery/LightThreadsGallery.d.ts +18 -0
  52. package/dist/components/gallery/LightThreadsGallery.d.ts.map +1 -0
  53. package/dist/components/gallery/LightThreadsGallery.js +9 -0
  54. package/dist/components/gallery/LoomGallery.d.ts +18 -0
  55. package/dist/components/gallery/LoomGallery.d.ts.map +1 -0
  56. package/dist/components/gallery/LoomGallery.js +9 -0
  57. package/dist/components/gallery/PaperLanternsGallery.d.ts +18 -0
  58. package/dist/components/gallery/PaperLanternsGallery.d.ts.map +1 -0
  59. package/dist/components/gallery/PaperLanternsGallery.js +9 -0
  60. package/dist/components/gallery/ParticleShiftGallery.d.ts +18 -0
  61. package/dist/components/gallery/ParticleShiftGallery.d.ts.map +1 -0
  62. package/dist/components/gallery/ParticleShiftGallery.js +9 -0
  63. package/dist/components/gallery/PinscreenGallery.d.ts +18 -0
  64. package/dist/components/gallery/PinscreenGallery.d.ts.map +1 -0
  65. package/dist/components/gallery/PinscreenGallery.js +9 -0
  66. package/dist/components/gallery/PopUpGallery.d.ts +18 -0
  67. package/dist/components/gallery/PopUpGallery.d.ts.map +1 -0
  68. package/dist/components/gallery/PopUpGallery.js +9 -0
  69. package/dist/components/gallery/PrismSplitGallery.d.ts +18 -0
  70. package/dist/components/gallery/PrismSplitGallery.d.ts.map +1 -0
  71. package/dist/components/gallery/PrismSplitGallery.js +9 -0
  72. package/dist/components/gallery/RidgelinesGallery.d.ts +18 -0
  73. package/dist/components/gallery/RidgelinesGallery.d.ts.map +1 -0
  74. package/dist/components/gallery/RidgelinesGallery.js +9 -0
  75. package/dist/components/gallery/ShadowBoxGallery.d.ts +18 -0
  76. package/dist/components/gallery/ShadowBoxGallery.d.ts.map +1 -0
  77. package/dist/components/gallery/ShadowBoxGallery.js +9 -0
  78. package/dist/components/gallery/SilkGallery.d.ts +18 -0
  79. package/dist/components/gallery/SilkGallery.d.ts.map +1 -0
  80. package/dist/components/gallery/SilkGallery.js +9 -0
  81. package/dist/components/gallery/SlatsGallery.d.ts +18 -0
  82. package/dist/components/gallery/SlatsGallery.d.ts.map +1 -0
  83. package/dist/components/gallery/SlatsGallery.js +9 -0
  84. package/dist/components/gallery/StrataGallery.d.ts +18 -0
  85. package/dist/components/gallery/StrataGallery.d.ts.map +1 -0
  86. package/dist/components/gallery/StrataGallery.js +9 -0
  87. package/dist/components/gallery/TerracesGallery.d.ts +18 -0
  88. package/dist/components/gallery/TerracesGallery.d.ts.map +1 -0
  89. package/dist/components/gallery/TerracesGallery.js +9 -0
  90. package/dist/components/gallery/WireReliefGallery.d.ts +18 -0
  91. package/dist/components/gallery/WireReliefGallery.d.ts.map +1 -0
  92. package/dist/components/gallery/WireReliefGallery.js +9 -0
  93. package/dist/components/gallery/index.d.ts +46 -0
  94. package/dist/components/gallery/index.d.ts.map +1 -0
  95. package/dist/components/gallery/index.js +22 -0
  96. package/dist/components/gallery/kit/GalleryVariant.d.ts +68 -0
  97. package/dist/components/gallery/kit/GalleryVariant.d.ts.map +1 -0
  98. package/dist/components/gallery/kit/GalleryVariant.js +231 -0
  99. package/dist/components/gallery/kit/feeds.d.ts +7 -0
  100. package/dist/components/gallery/kit/feeds.d.ts.map +1 -0
  101. package/dist/components/gallery/kit/feeds.js +83 -0
  102. package/dist/components/gallery/kit/galleryKit.d.ts +118 -0
  103. package/dist/components/gallery/kit/galleryKit.d.ts.map +1 -0
  104. package/dist/components/gallery/kit/galleryKit.js +298 -0
  105. package/dist/components/gallery/kit/lookBase.d.ts +157 -0
  106. package/dist/components/gallery/kit/lookBase.d.ts.map +1 -0
  107. package/dist/components/gallery/kit/lookBase.js +211 -0
  108. package/dist/components/gallery/kit/pictures.d.ts +14 -0
  109. package/dist/components/gallery/kit/pictures.d.ts.map +1 -0
  110. package/dist/components/gallery/kit/pictures.js +81 -0
  111. package/dist/components/gallery/looks/basicCarousel.d.ts +177 -0
  112. package/dist/components/gallery/looks/basicCarousel.d.ts.map +1 -0
  113. package/dist/components/gallery/looks/basicCarousel.js +315 -0
  114. package/dist/components/gallery/looks/contourLines.d.ts +153 -0
  115. package/dist/components/gallery/looks/contourLines.d.ts.map +1 -0
  116. package/dist/components/gallery/looks/contourLines.js +91 -0
  117. package/dist/components/gallery/looks/depthLayers.d.ts +155 -0
  118. package/dist/components/gallery/looks/depthLayers.d.ts.map +1 -0
  119. package/dist/components/gallery/looks/depthLayers.js +87 -0
  120. package/dist/components/gallery/looks/engraving.d.ts +162 -0
  121. package/dist/components/gallery/looks/engraving.d.ts.map +1 -0
  122. package/dist/components/gallery/looks/engraving.js +96 -0
  123. package/dist/components/gallery/looks/flowLines.d.ts +180 -0
  124. package/dist/components/gallery/looks/flowLines.d.ts.map +1 -0
  125. package/dist/components/gallery/looks/flowLines.js +113 -0
  126. package/dist/components/gallery/looks/fold.d.ts +209 -0
  127. package/dist/components/gallery/looks/fold.d.ts.map +1 -0
  128. package/dist/components/gallery/looks/fold.js +155 -0
  129. package/dist/components/gallery/looks/glassPanes.d.ts +133 -0
  130. package/dist/components/gallery/looks/glassPanes.d.ts.map +1 -0
  131. package/dist/components/gallery/looks/glassPanes.js +208 -0
  132. package/dist/components/gallery/looks/halo.d.ts +100 -0
  133. package/dist/components/gallery/looks/halo.d.ts.map +1 -0
  134. package/dist/components/gallery/looks/halo.js +119 -0
  135. package/dist/components/gallery/looks/lightThreads.d.ts +199 -0
  136. package/dist/components/gallery/looks/lightThreads.d.ts.map +1 -0
  137. package/dist/components/gallery/looks/lightThreads.js +246 -0
  138. package/dist/components/gallery/looks/loom.d.ts +238 -0
  139. package/dist/components/gallery/looks/loom.d.ts.map +1 -0
  140. package/dist/components/gallery/looks/loom.js +256 -0
  141. package/dist/components/gallery/looks/paperLanterns.d.ts +181 -0
  142. package/dist/components/gallery/looks/paperLanterns.d.ts.map +1 -0
  143. package/dist/components/gallery/looks/paperLanterns.js +399 -0
  144. package/dist/components/gallery/looks/particleShift.d.ts +193 -0
  145. package/dist/components/gallery/looks/particleShift.d.ts.map +1 -0
  146. package/dist/components/gallery/looks/particleShift.js +282 -0
  147. package/dist/components/gallery/looks/pinscreen.d.ts +175 -0
  148. package/dist/components/gallery/looks/pinscreen.d.ts.map +1 -0
  149. package/dist/components/gallery/looks/pinscreen.js +96 -0
  150. package/dist/components/gallery/looks/popUp.d.ts +206 -0
  151. package/dist/components/gallery/looks/popUp.d.ts.map +1 -0
  152. package/dist/components/gallery/looks/popUp.js +132 -0
  153. package/dist/components/gallery/looks/prismSplit.d.ts +151 -0
  154. package/dist/components/gallery/looks/prismSplit.d.ts.map +1 -0
  155. package/dist/components/gallery/looks/prismSplit.js +84 -0
  156. package/dist/components/gallery/looks/ridgelines.d.ts +179 -0
  157. package/dist/components/gallery/looks/ridgelines.d.ts.map +1 -0
  158. package/dist/components/gallery/looks/ridgelines.js +111 -0
  159. package/dist/components/gallery/looks/shadowBox.d.ts +152 -0
  160. package/dist/components/gallery/looks/shadowBox.d.ts.map +1 -0
  161. package/dist/components/gallery/looks/shadowBox.js +82 -0
  162. package/dist/components/gallery/looks/silk.d.ts +140 -0
  163. package/dist/components/gallery/looks/silk.d.ts.map +1 -0
  164. package/dist/components/gallery/looks/silk.js +346 -0
  165. package/dist/components/gallery/looks/slats.d.ts +176 -0
  166. package/dist/components/gallery/looks/slats.d.ts.map +1 -0
  167. package/dist/components/gallery/looks/slats.js +93 -0
  168. package/dist/components/gallery/looks/strata.d.ts +172 -0
  169. package/dist/components/gallery/looks/strata.d.ts.map +1 -0
  170. package/dist/components/gallery/looks/strata.js +88 -0
  171. package/dist/components/gallery/looks/terraces.d.ts +168 -0
  172. package/dist/components/gallery/looks/terraces.d.ts.map +1 -0
  173. package/dist/components/gallery/looks/terraces.js +91 -0
  174. package/dist/components/gallery/looks/wireRelief.d.ts +153 -0
  175. package/dist/components/gallery/looks/wireRelief.d.ts.map +1 -0
  176. package/dist/components/gallery/looks/wireRelief.js +128 -0
  177. package/dist/components/image/ContourImage.d.ts +7 -0
  178. package/dist/components/image/ContourImage.d.ts.map +1 -0
  179. package/dist/components/image/ContourImage.js +6 -0
  180. package/dist/components/image/EngravingImage.d.ts +7 -0
  181. package/dist/components/image/EngravingImage.d.ts.map +1 -0
  182. package/dist/components/image/EngravingImage.js +6 -0
  183. package/dist/components/image/FrostImage.d.ts +7 -0
  184. package/dist/components/image/FrostImage.d.ts.map +1 -0
  185. package/dist/components/image/FrostImage.js +6 -0
  186. package/dist/components/image/LenticularImage.d.ts +7 -0
  187. package/dist/components/image/LenticularImage.d.ts.map +1 -0
  188. package/dist/components/image/LenticularImage.js +6 -0
  189. package/dist/components/image/PinscreenImage.d.ts +7 -0
  190. package/dist/components/image/PinscreenImage.d.ts.map +1 -0
  191. package/dist/components/image/PinscreenImage.js +6 -0
  192. package/dist/components/image/PrismImage.d.ts +7 -0
  193. package/dist/components/image/PrismImage.d.ts.map +1 -0
  194. package/dist/components/image/PrismImage.js +6 -0
  195. package/dist/components/image/ProjectorImage.d.ts +7 -0
  196. package/dist/components/image/ProjectorImage.d.ts.map +1 -0
  197. package/dist/components/image/ProjectorImage.js +6 -0
  198. package/dist/components/image/ReliefImage.d.ts +7 -0
  199. package/dist/components/image/ReliefImage.d.ts.map +1 -0
  200. package/dist/components/image/ReliefImage.js +6 -0
  201. package/dist/components/image/RollImage.d.ts +7 -0
  202. package/dist/components/image/RollImage.d.ts.map +1 -0
  203. package/dist/components/image/RollImage.js +6 -0
  204. package/dist/components/image/ShardsImage.d.ts +126 -0
  205. package/dist/components/image/ShardsImage.d.ts.map +1 -0
  206. package/dist/components/image/ShardsImage.js +470 -0
  207. package/dist/components/image/core/contour.d.ts +126 -0
  208. package/dist/components/image/core/contour.d.ts.map +1 -0
  209. package/dist/components/image/core/contour.js +123 -0
  210. package/dist/components/image/core/engraving.d.ts +135 -0
  211. package/dist/components/image/core/engraving.d.ts.map +1 -0
  212. package/dist/components/image/core/engraving.js +163 -0
  213. package/dist/components/image/core/frost.d.ts +126 -0
  214. package/dist/components/image/core/frost.d.ts.map +1 -0
  215. package/dist/components/image/core/frost.js +156 -0
  216. package/dist/components/image/core/imageCore.d.ts +110 -0
  217. package/dist/components/image/core/imageCore.d.ts.map +1 -0
  218. package/dist/components/image/core/imageCore.js +269 -0
  219. package/dist/components/image/core/lenticular.d.ts +129 -0
  220. package/dist/components/image/core/lenticular.d.ts.map +1 -0
  221. package/dist/components/image/core/lenticular.js +132 -0
  222. package/dist/components/image/core/pinscreen.d.ts +126 -0
  223. package/dist/components/image/core/pinscreen.d.ts.map +1 -0
  224. package/dist/components/image/core/pinscreen.js +147 -0
  225. package/dist/components/image/core/prism.d.ts +120 -0
  226. package/dist/components/image/core/prism.d.ts.map +1 -0
  227. package/dist/components/image/core/prism.js +164 -0
  228. package/dist/components/image/core/projector.d.ts +135 -0
  229. package/dist/components/image/core/projector.d.ts.map +1 -0
  230. package/dist/components/image/core/projector.js +225 -0
  231. package/dist/components/image/core/relief.d.ts +111 -0
  232. package/dist/components/image/core/relief.d.ts.map +1 -0
  233. package/dist/components/image/core/relief.js +94 -0
  234. package/dist/components/image/core/roll.d.ts +114 -0
  235. package/dist/components/image/core/roll.d.ts.map +1 -0
  236. package/dist/components/image/core/roll.js +116 -0
  237. package/dist/components/image/imageVariant.d.ts +46 -0
  238. package/dist/components/image/imageVariant.d.ts.map +1 -0
  239. package/dist/components/image/imageVariant.js +128 -0
  240. package/dist/components/image/index.d.ts +22 -0
  241. package/dist/components/image/index.d.ts.map +1 -0
  242. package/dist/components/image/index.js +10 -0
  243. package/dist/components/image/pictureCycle.d.ts +15 -0
  244. package/dist/components/image/pictureCycle.d.ts.map +1 -0
  245. package/dist/components/image/pictureCycle.js +82 -0
  246. package/dist/components/index.d.ts +4 -0
  247. package/dist/components/index.d.ts.map +1 -1
  248. package/dist/components/index.js +4 -0
  249. package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts +9 -7
  250. package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -1
  251. package/dist/components/volumetricClouds/VolumetricCloudsPass.js +39 -27
  252. package/dist/constants.d.ts.map +1 -1
  253. package/dist/constants.js +2 -0
  254. package/dist/galleryRuntime.d.ts +57 -0
  255. package/dist/galleryRuntime.d.ts.map +1 -0
  256. package/dist/galleryRuntime.js +105 -0
  257. package/dist/hooks/useConfigLive.d.ts +1 -1
  258. package/dist/hooks/useConfigLive.d.ts.map +1 -1
  259. package/dist/index.d.ts +4 -1
  260. package/dist/index.d.ts.map +1 -1
  261. package/dist/index.js +4 -0
  262. package/dist/keyPad/KeyPadControls.d.ts +16 -0
  263. package/dist/keyPad/KeyPadControls.d.ts.map +1 -0
  264. package/dist/keyPad/KeyPadControls.js +176 -0
  265. package/dist/keyPad/index.d.ts +16 -0
  266. package/dist/keyPad/index.d.ts.map +1 -0
  267. package/dist/keyPad/index.js +8 -0
  268. package/dist/keyPad/keyBindings.d.ts +43 -0
  269. package/dist/keyPad/keyBindings.d.ts.map +1 -0
  270. package/dist/keyPad/keyBindings.js +92 -0
  271. package/dist/keyPad/keyPadAnimation.d.ts +28 -0
  272. package/dist/keyPad/keyPadAnimation.d.ts.map +1 -0
  273. package/dist/keyPad/keyPadAnimation.js +131 -0
  274. package/dist/keyPad/keyPadMotion.d.ts +68 -0
  275. package/dist/keyPad/keyPadMotion.d.ts.map +1 -0
  276. package/dist/keyPad/keyPadMotion.js +283 -0
  277. package/dist/keyPad/keyPadStore.d.ts +25 -0
  278. package/dist/keyPad/keyPadStore.d.ts.map +1 -0
  279. package/dist/keyPad/keyPadStore.js +63 -0
  280. package/dist/keyPad/types.d.ts +23 -0
  281. package/dist/keyPad/types.d.ts.map +1 -0
  282. package/dist/keyPad/types.js +9 -0
  283. package/dist/operations/catalogue/visibility.d.ts.map +1 -1
  284. package/dist/operations/catalogue/visibility.js +23 -1
  285. package/dist/shaders/clouds/CloudResolveMaterial.d.ts +2 -1
  286. package/dist/shaders/clouds/CloudResolveMaterial.d.ts.map +1 -1
  287. package/dist/shaders/clouds/CloudResolveMaterial.js +37 -12
  288. package/dist/shaders/clouds/CloudVolumeMaterial.d.ts +4 -0
  289. package/dist/shaders/clouds/CloudVolumeMaterial.d.ts.map +1 -1
  290. package/dist/shaders/clouds/CloudVolumeMaterial.js +15 -3
  291. package/dist/triggers/kinds/gallery.d.ts +2 -0
  292. package/dist/triggers/kinds/gallery.d.ts.map +1 -0
  293. package/dist/triggers/kinds/gallery.js +39 -0
  294. package/dist/triggers/kinds/index.d.ts +1 -0
  295. package/dist/triggers/kinds/index.d.ts.map +1 -1
  296. package/dist/triggers/kinds/index.js +1 -0
  297. package/package.json +2 -2
@@ -0,0 +1,246 @@
1
+ // The approved lab module, verbatim but for its import paths and the lab's picture loader (Claude outputs/gallery-lab/
2
+ // threads.mjs). Plain JS-shaped code (the viewer compiles non-strict); typed at its one door, kit/GalleryVariant.tsx. Its own DEFAULTS only fill knobs the
3
+ // core defaults (DEFAULT_GALLERY_OBJECTS.lightThreads) do not carry; its own autoplay is never used.
4
+ // threads — "Light threads": every picture is a curtain of fine vertical threads of light, each thread
5
+ // carrying one column of the image like a string of beads. Curtains hang in a row along the scroll; the
6
+ // one at the front is resolved — its threads pulled into one plane — and lit; the neighbours hang at
7
+ // depth, grey and faint, and the
8
+ // picture only resolves as the curtain comes to the centre. A change re-strings the incoming curtain:
9
+ // light runs down each thread, thread after thread in a sweep, from the faded colours to the full ones; the outgoing one
10
+ // fades. A real point light under the front curtain carries the picture's own average colour.
11
+ import * as THREE from 'three';
12
+ import { fragHead, col, mulberry32, createScroll, focusAt, approach, withLean } from '../kit/galleryKit.js';
13
+ import { createLayout, layoutUniforms, fillLayout, layoutGlsl, LAYOUT_GUI } from '../kit/galleryKit.js';
14
+ export const catalog = { key: 'threads', name: 'Light Threads', camera: { position: [0.3, 0.1, 4.8], target: [0, 0, 0] },
15
+ description: 'Pictures as curtains of fine threads of light, each thread a column of the image; the front curtain resolves and glows, the others hang grey and faint at depth; light runs down the threads on every change. Use for installations, dark lobbies, music and tech showcases.',
16
+ tags: ['gallery', 'threads', 'light', 'curtain', 'installation', 'navigation', 'interactive'] };
17
+ export const DEFAULTS = {
18
+ type: 'threads', enabled: true, lean: 1, imageUrls: [], autoplay: 0, intensity: 1, opacity: 1,
19
+ aspect: 1.5, threads: 160, width: 2.4, // structural
20
+ layout: 'row', spacing: 1.35, depth: 1.2, visible: 2.4, shape: 1, dim: 0.16,
21
+ stiffness: 35, damping: 9, throwing: 0.15,
22
+ restring: 1.4, sweep: 0.6, headGlow: 1.2, beads: 0.12,
23
+ rail: false,
24
+ threadColor: '#8fb8ff', railColor: '#9aa3b5',
25
+ pointerMode: 'reveal', pointerStrength: 1, pointerRadius: 0.5, pointerColor: '#ffd9a6',
26
+ };
27
+ export const STRUCTURAL = ['imageUrls', 'aspect', 'threads', 'width'];
28
+ export const POINTER_MODES = ['reveal'];
29
+ export const GUI = [
30
+ { key: 'lean', min: 0, max: 3, step: 0.01, tip: 'The gallery turns toward the cursor' },
31
+ { key: 'aspect', min: 0.6, max: 2.5, step: 0.01 }, { key: 'threads', min: 40, max: 400, step: 1 }, { key: 'width', min: 1, max: 4, step: 0.01 },
32
+ ...LAYOUT_GUI, { key: 'dim', min: 0, max: 1, step: 0.01 },
33
+ { key: 'stiffness', min: 5, max: 150, step: 1 }, { key: 'damping', min: 2, max: 30, step: 0.1 }, { key: 'throwing', min: 0, max: 0.5, step: 0.01 },
34
+ { key: 'restring', min: 0.3, max: 4, step: 0.05 }, { key: 'sweep', min: 0, max: 1, step: 0.01 }, { key: 'headGlow', min: 0, max: 3, step: 0.01 }, { key: 'beads', min: 0, max: 1, step: 0.01 },
35
+ { key: 'rail' }, { key: 'autoplay', min: 0, max: 20, step: 0.5 },
36
+ { key: 'pointerMode', options: ['none', ...POINTER_MODES] }, { key: 'pointerStrength', min: 0, max: 3, step: 0.01 }, { key: 'pointerRadius', min: 0.2, max: 3, step: 0.01 },
37
+ { key: 'intensity', min: 0, max: 3, step: 0.01 }, { key: 'opacity', min: 0, max: 1, step: 0.01 },
38
+ { key: 'threadColor', color: true }, { key: 'railColor', color: true }, { key: 'pointerColor', color: true },
39
+ ];
40
+ export const PRESETS = [
41
+ { name: 'Installation', description: 'The default.', patch: {} },
42
+ { name: 'Dense', description: 'Many fine threads — almost a picture.', patch: { threads: 320, beads: 0.15 } },
43
+ { name: 'Sparse', description: 'Few threads, a long slow restring, a bright head.', patch: { threads: 70, restring: 2.4, headGlow: 2 } },
44
+ ];
45
+ const MAXI = 32;
46
+ export function createUniforms() {
47
+ return {
48
+ ...layoutUniforms(), uTex: { value: null }, uS: { value: 0 }, uCount: { value: 1 }, uTime: { value: 0 },
49
+ uReveal: { value: new Float32Array(MAXI).fill(0) },
50
+ uSpacing: { value: 1.35 }, uDepth: { value: 1.2 }, uScatter: { value: 0.35 }, uVisible: { value: 2.4 }, uDim: { value: 0.12 },
51
+ uHead: { value: 1.2 }, uBeads: { value: 0.35 }, uSway: { value: 0.4 }, uIntensity: { value: 1 }, uOpacity: { value: 1 },
52
+ uThreadColor: { value: col('#8fb8ff') }, uPointerColor: { value: col('#ffd9a6') },
53
+ uPointer: { value: new THREE.Vector3() }, uPointerActive: { value: 0 }, uPointerMode: { value: 0 }, uPointerStrength: { value: 1 }, uPointerRadius: { value: 0.8 },
54
+ uW: { value: 2.4 }, uH: { value: 1.6 }, uN: { value: 160 },
55
+ };
56
+ }
57
+ export function applyConfig(u, c) {
58
+ const set = (k, v) => { if (v === undefined)
59
+ return; if (u[k].value && u[k].value.isColor) {
60
+ if (v.isColor)
61
+ u[k].value.copy(v);
62
+ else
63
+ u[k].value.set(v);
64
+ }
65
+ else
66
+ u[k].value = v; };
67
+ set('uSpacing', c.spacing);
68
+ set('uDepth', c.depth);
69
+ set('uVisible', c.visible);
70
+ set('uDim', c.dim);
71
+ set('uHead', c.headGlow);
72
+ set('uBeads', c.beads);
73
+ set('uIntensity', c.intensity);
74
+ set('uOpacity', c.opacity);
75
+ set('uThreadColor', c.threadColor);
76
+ set('uPointerColor', c.pointerColor);
77
+ set('uPointerStrength', c.pointerStrength);
78
+ set('uPointerRadius', c.pointerRadius);
79
+ if (c.pointerMode !== undefined)
80
+ u.uPointerMode.value = POINTER_MODES.indexOf(c.pointerMode);
81
+ }
82
+ const vert = /* glsl */ `
83
+ attribute vec4 aInst; // image, thread k, hash, hash2
84
+ uniform float uS, uCount, uTime, uSpacing, uDepth, uScatter, uVisible, uSway, uW, uH, uN;
85
+ uniform float uReveal[${MAXI}];
86
+ uniform vec3 uPointer; uniform float uPointerActive, uPointerMode, uPointerStrength, uPointerRadius;
87
+ varying vec2 vUv; varying float vImg; varying float vK; varying float vFocus; varying float vAlpha; varying float vReveal; varying float vLift; varying float vPw; varying float vH;
88
+ ${layoutGlsl}
89
+ float wrapd(float d, float n){ return n > 1.0 ? mod(d + n * 0.5, n) - n * 0.5 : d; }
90
+ void main(){
91
+ float img = aInst.x, k = aInst.y, h1 = aInst.z, h2 = aInst.w;
92
+ float d = wrapd(img - uS, uCount); float ad = abs(d);
93
+ float focus = 1.0 - smoothstep(0.0, 1.0, ad);
94
+ vFocus = focus;
95
+ // the thread's place in its curtain; neighbours' threads scatter in depth, the front one's pull into a plane
96
+ float tx = (k / uN - 0.5) * uW + (0.5 / uN) * uW;
97
+ float tz = 0.0; // aligned: every curtain's threads in one plane
98
+ // a slow sway, each thread its own phase (threads are hung, not fixed)
99
+ float sw = 0.0; // still: no sway
100
+ int ii = int(img + 0.5);
101
+ float reveal = uReveal[ii];
102
+ vReveal = reveal; vLift = 0.0;
103
+ float yTop = uH * 0.5;
104
+ // position.y is -0.5..0.5 for the quad; the quad spans the full height, the fragment clips to the reveal
105
+ vec3 p = placeAt(img, vec3(tx + sw + position.x, yTop - (0.5 - position.y) * uH, tz));
106
+ // reveal: a soft light around the cursor brings the colour back (fragment)
107
+ vec2 dp = p.xy - uPointer.xy; float dist = length(dp);
108
+ float pw = uPointerActive * uPointerStrength * (1.0 - smoothstep(uPointerRadius * 0.35, uPointerRadius, dist));
109
+ vPw = pw;
110
+ vUv = vec2(k / uN + 0.5 / uN, 1.0 - (0.5 - position.y));
111
+ vImg = img; vK = k; vH = h2;
112
+ vAlpha = fadeAt(img);
113
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(p, 1.0);
114
+ }
115
+ `;
116
+ const frag = /* glsl */ `
117
+ ${fragHead}
118
+ precision highp sampler2DArray;
119
+ uniform sampler2DArray uTex;
120
+ uniform float uDim, uHead, uBeads, uIntensity, uOpacity, uTime, uPointerMode;
121
+ uniform vec3 uThreadColor, uPointerColor;
122
+ varying vec2 vUv; varying float vImg; varying float vK; varying float vFocus; varying float vAlpha; varying float vReveal; varying float vLift; varying float vPw; varying float vH;
123
+ void main(){
124
+ // the thread: a bright core across the quad's width
125
+ float x = abs(gl_PointCoord.x); // unused
126
+ vec3 pic = texture(uTex, vec3(vUv, vImg)).rgb;
127
+ float yFromTop = 1.0 - vUv.y;
128
+ // every curtain is strung: faded, a little desaturated. The active part (above the front) is in full colour;
129
+ // each thread's front runs a touch behind its left neighbour's, so the light sweeps across as it falls.
130
+ float rev = clamp(vReveal * 1.25 - vUv.x * 0.25, 0.0, 1.0);
131
+ float lit = 1.0 - smoothstep(rev - 0.015, rev + 0.015, yFromTop);
132
+ float head = exp(-pow((yFromTop - rev) * 34.0, 2.0)) * step(0.001, rev) * step(rev, 0.999);
133
+ float beads = 1.0 - uBeads * 0.5 * (0.5 + 0.5 * sin(vUv.y * 420.0 + vH * 6.283));
134
+ float lum = dot(pic, vec3(0.299, 0.587, 0.114));
135
+ // inactive: grey and faint. The light (the front, or the cursor's reveal) brings colour and opacity.
136
+ float act = max(lit, vPw * step(-0.5, uPointerMode) * (1.0 - lit));
137
+ vec3 faded = vec3(lum) * uDim;
138
+ vec3 full = pic * 1.25;
139
+ vec3 c = mix(faded, full, act) * beads;
140
+ c += (pic * 2.0 + uThreadColor) * head * uHead;
141
+ float a = vAlpha * uOpacity;
142
+ if (a < 0.003) discard;
143
+ gl_FragColor = vec4(c * uIntensity * a, a);
144
+ #include <tonemapping_fragment>
145
+ #include <colorspace_fragment>
146
+ }
147
+ `;
148
+ export function build(u, c) { return withLean(buildGallery(u, c), c); }
149
+ function buildGallery(u, c) {
150
+ const N = Math.max(8, c.threads | 0), W = c.width, H = W / c.aspect;
151
+ u.uW.value = W;
152
+ u.uH.value = H;
153
+ u.uN.value = N;
154
+ const quad = new THREE.PlaneGeometry(W / N * 0.85, 1); // thin strip, height 1 (scaled by uH in the shader)
155
+ const geo = new THREE.InstancedBufferGeometry();
156
+ geo.index = quad.index;
157
+ geo.attributes.position = quad.attributes.position;
158
+ geo.attributes.uv = quad.attributes.uv;
159
+ const rnd = mulberry32(3);
160
+ const inst = new Float32Array(MAXI * N * 4);
161
+ for (let i = 0; i < MAXI; i++)
162
+ for (let k = 0; k < N; k++)
163
+ inst.set([i, k, rnd(), rnd()], (i * N + k) * 4);
164
+ geo.setAttribute('aInst', new THREE.InstancedBufferAttribute(inst, 4));
165
+ geo.instanceCount = 0;
166
+ geo.boundingSphere = new THREE.Sphere(new THREE.Vector3(), 20);
167
+ const mat = new THREE.ShaderMaterial({ uniforms: u, vertexShader: vert, fragmentShader: frag, glslVersion: THREE.GLSL3, side: THREE.DoubleSide, transparent: true, depthWrite: true, premultipliedAlpha: true }); // threads hide what hangs behind them (layouts overlap)
168
+ const threads = new THREE.Mesh(geo, mat);
169
+ threads.frustumCulled = false;
170
+ threads.raycast = () => { };
171
+ // the rail the threads hang from
172
+ const rail = new THREE.Mesh(new THREE.CylinderGeometry(0.012, 0.012, 1, 10), new THREE.MeshStandardMaterial({ color: c.railColor, roughness: 0.4, metalness: 0.8 }));
173
+ rail.rotation.z = Math.PI / 2;
174
+ const pick = new THREE.Mesh(new THREE.PlaneGeometry(W, H), new THREE.MeshBasicMaterial({ visible: false }));
175
+ pick.userData.pick = 'front';
176
+ const object = new THREE.Group();
177
+ object.add(threads, rail, pick);
178
+ const layout = createLayout(W, H);
179
+ const _inv = new THREE.Matrix4(), _p = new THREE.Vector3();
180
+ const cfg = { ...c };
181
+ const scroll = createScroll(cfg, (dir) => { });
182
+ scroll.st.pitch = W * c.spacing;
183
+ const st = { avg: [], prevIndex: 0, time: 0, pointer: null };
184
+ const reveal = u.uReveal.value;
185
+ const _c = new THREE.Color();
186
+ const controls = Object.assign(scroll.controls, {
187
+ setTexture(tex, count) {
188
+ if (u.uTex.value)
189
+ u.uTex.value.dispose();
190
+ u.uTex.value = tex;
191
+ scroll.st.count = Math.min(count, MAXI);
192
+ u.uCount.value = scroll.st.count;
193
+ geo.instanceCount = scroll.st.count * N;
194
+ // average colour per picture, for the light
195
+ const img = tex.image, W2 = img.width, H2 = img.height, d = img.data;
196
+ st.avg = [];
197
+ for (let i = 0; i < scroll.st.count; i++) {
198
+ let r = 0, g = 0, b = 0, n = 0;
199
+ for (let p = i * W2 * H2 * 4; p < (i + 1) * W2 * H2 * 4; p += 4 * 97) {
200
+ r += d[p];
201
+ g += d[p + 1];
202
+ b += d[p + 2];
203
+ n++;
204
+ }
205
+ st.avg.push(new THREE.Color(r / n / 255, g / n / 255, b / n / 255));
206
+ }
207
+ reveal.fill(0);
208
+ reveal[controls.index] = 1;
209
+ },
210
+ });
211
+ object.userData.gallery = controls;
212
+ return {
213
+ object, controls, pickMesh: pick, materials: [mat, rail.material],
214
+ apply(k) { Object.assign(cfg, k); applyConfig(u, k); scroll.st.pitch = W * cfg.spacing; if (k.railColor)
215
+ rail.material.color.set(k.railColor); rail.visible = cfg.rail !== false; },
216
+ update(dt, pointer) {
217
+ dt = Math.min(dt, 0.05);
218
+ st.time += dt;
219
+ u.uTime.value = st.time;
220
+ scroll.step(dt, pointer);
221
+ u.uS.value = scroll.st.s;
222
+ const n = scroll.st.count;
223
+ fillLayout(layout, u, scroll.st.s, n, cfg);
224
+ // each curtain's light follows its own focus at a constant rate: arriving runs it down, leaving runs it back up
225
+ for (let i = 0; i < n; i++)
226
+ reveal[i] = approach(reveal[i], focusAt(i, scroll.st.s, n) > 0.5 ? 1 : 0, dt, cfg.restring);
227
+ // the rail spans the visible curtains
228
+ const span = (Math.min(n, 2 * cfg.visible + 1)) * W * cfg.spacing;
229
+ rail.scale.set(1, span, 1);
230
+ rail.position.set(0, H / 2 + 0.02, 0);
231
+ // the light under the front curtain, in the picture's own colour
232
+ // the front slot is always at x = 0 (the curtains move, not the slot): the light stays there and blends colours
233
+ pick.position.x = 0;
234
+ // pointer on the z = 0 plane
235
+ if (pointer) {
236
+ threads.parent.updateMatrix();
237
+ _inv.copy(threads.parent.matrix).invert(); /* the cursor arrives in the gallery's own frame; undo the lean */
238
+ _p.set(pointer.x, pointer.y, 0).applyMatrix4(_inv);
239
+ u.uPointer.value.set(_p.x, _p.y, 0);
240
+ }
241
+ u.uPointerActive.value += ((pointer ? 1 : 0) - u.uPointerActive.value) * (1 - Math.exp(-dt * 6));
242
+ },
243
+ dispose() { geo.dispose(); quad.dispose(); mat.dispose(); rail.geometry.dispose(); rail.material.dispose(); pick.geometry.dispose(); if (u.uTex.value)
244
+ u.uTex.value.dispose(); },
245
+ };
246
+ }
@@ -0,0 +1,238 @@
1
+ import * as THREE from 'three';
2
+ export declare const catalog: {
3
+ key: string;
4
+ name: string;
5
+ camera: {
6
+ position: number[];
7
+ target: number[];
8
+ };
9
+ description: string;
10
+ tags: string[];
11
+ };
12
+ export declare const DEFAULTS: {
13
+ type: string;
14
+ enabled: boolean;
15
+ lean: number;
16
+ imageUrls: any[];
17
+ autoplay: number;
18
+ intensity: number;
19
+ opacity: number;
20
+ aspect: number;
21
+ width: number;
22
+ warp: number;
23
+ weft: number;
24
+ layout: string;
25
+ spacing: number;
26
+ depth: number;
27
+ visible: number;
28
+ shape: number;
29
+ dim: number;
30
+ stiffness: number;
31
+ damping: number;
32
+ throwing: number;
33
+ weaveTime: number;
34
+ unravelTime: number;
35
+ wave: number;
36
+ slant: number;
37
+ thread: number;
38
+ shuttle: number;
39
+ weave: number;
40
+ warpGlow: number;
41
+ warpColor: string;
42
+ shuttleColor: string;
43
+ pointerMode: string;
44
+ pointerStrength: number;
45
+ pointerRadius: number;
46
+ pointerColor: string;
47
+ };
48
+ export declare const STRUCTURAL: string[];
49
+ export declare const POINTER_MODES: string[];
50
+ export declare const GUI: ({
51
+ key: string;
52
+ options: string[];
53
+ tip: string;
54
+ min?: undefined;
55
+ max?: undefined;
56
+ step?: undefined;
57
+ } | {
58
+ key: string;
59
+ min: number;
60
+ max: number;
61
+ step: number;
62
+ tip: string;
63
+ options?: undefined;
64
+ } | {
65
+ key: string;
66
+ min: number;
67
+ max: number;
68
+ step: number;
69
+ options?: undefined;
70
+ color?: undefined;
71
+ } | {
72
+ key: string;
73
+ options: string[];
74
+ min?: undefined;
75
+ max?: undefined;
76
+ step?: undefined;
77
+ color?: undefined;
78
+ } | {
79
+ key: string;
80
+ color: boolean;
81
+ min?: undefined;
82
+ max?: undefined;
83
+ step?: undefined;
84
+ options?: undefined;
85
+ })[];
86
+ export declare const PRESETS: ({
87
+ name: string;
88
+ description: string;
89
+ patch: {
90
+ warp?: undefined;
91
+ weft?: undefined;
92
+ weaveTime?: undefined;
93
+ thread?: undefined;
94
+ wave?: undefined;
95
+ warpGlow?: undefined;
96
+ slant?: undefined;
97
+ };
98
+ } | {
99
+ name: string;
100
+ description: string;
101
+ patch: {
102
+ warp: number;
103
+ weft: number;
104
+ weaveTime: number;
105
+ thread: number;
106
+ wave?: undefined;
107
+ warpGlow?: undefined;
108
+ slant?: undefined;
109
+ };
110
+ } | {
111
+ name: string;
112
+ description: string;
113
+ patch: {
114
+ warp: number;
115
+ weft: number;
116
+ weaveTime: number;
117
+ wave: number;
118
+ thread: number;
119
+ warpGlow: number;
120
+ slant?: undefined;
121
+ };
122
+ } | {
123
+ name: string;
124
+ description: string;
125
+ patch: {
126
+ slant: number;
127
+ wave: number;
128
+ warp?: undefined;
129
+ weft?: undefined;
130
+ weaveTime?: undefined;
131
+ thread?: undefined;
132
+ warpGlow?: undefined;
133
+ };
134
+ })[];
135
+ export declare function createUniforms(): {
136
+ uTex: {
137
+ value: any;
138
+ };
139
+ uS: {
140
+ value: number;
141
+ };
142
+ uCount: {
143
+ value: number;
144
+ };
145
+ uTime: {
146
+ value: number;
147
+ };
148
+ uWoven: {
149
+ value: Float32Array<ArrayBuffer>;
150
+ };
151
+ uSpacing: {
152
+ value: number;
153
+ };
154
+ uDepth: {
155
+ value: number;
156
+ };
157
+ uVisible: {
158
+ value: number;
159
+ };
160
+ uDim: {
161
+ value: number;
162
+ };
163
+ uShuttle: {
164
+ value: number;
165
+ };
166
+ uWave: {
167
+ value: number;
168
+ };
169
+ uSlant: {
170
+ value: number;
171
+ };
172
+ uThread: {
173
+ value: number;
174
+ };
175
+ uWeave: {
176
+ value: number;
177
+ };
178
+ uWarpGlow: {
179
+ value: number;
180
+ };
181
+ uSway: {
182
+ value: number;
183
+ };
184
+ uIntensity: {
185
+ value: number;
186
+ };
187
+ uOpacity: {
188
+ value: number;
189
+ };
190
+ uWarpColor: {
191
+ value: THREE.Color;
192
+ };
193
+ uRimColor: {
194
+ value: THREE.Color;
195
+ };
196
+ uShuttleColor: {
197
+ value: THREE.Color;
198
+ };
199
+ uPointerColor: {
200
+ value: THREE.Color;
201
+ };
202
+ uPointer: {
203
+ value: THREE.Vector3;
204
+ };
205
+ uPointerActive: {
206
+ value: number;
207
+ };
208
+ uPointerMode: {
209
+ value: number;
210
+ };
211
+ uPointerStrength: {
212
+ value: number;
213
+ };
214
+ uPointerRadius: {
215
+ value: number;
216
+ };
217
+ uW: {
218
+ value: number;
219
+ };
220
+ uH: {
221
+ value: number;
222
+ };
223
+ uNw: {
224
+ value: number;
225
+ };
226
+ uNf: {
227
+ value: number;
228
+ };
229
+ uKey: {
230
+ value: THREE.Vector3;
231
+ };
232
+ uPlace: {
233
+ value: THREE.Matrix4[];
234
+ };
235
+ };
236
+ export declare function applyConfig(u: any, c: any): void;
237
+ export declare function build(u: any, c: any): any;
238
+ //# sourceMappingURL=loom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loom.d.ts","sourceRoot":"","sources":["../../../../src/components/gallery/looks/loom.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,eAAO,MAAM,OAAO;;;;;;;;;CAEsE,CAAC;AAE3F,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQpB,CAAC;AACF,eAAO,MAAM,UAAU,UAAmD,CAAC;AAC3E,eAAO,MAAM,aAAa,UAAa,CAAC;AACxC,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAWf,CAAC;AACF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKnB,CAAC;AAEF,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU7B;AACD,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,QAM/B;AAgGD,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,OAA6C"}