trama-ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/CATALOG.md +1237 -0
  2. package/LICENSE +21 -0
  3. package/README.md +78 -0
  4. package/THIRD-PARTY.md +4 -0
  5. package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/brown.png +0 -0
  6. package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/brown_inlay.png +0 -0
  7. package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/brown_pressed.png +0 -0
  8. package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/grey.png +0 -0
  9. package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/grey_inlay.png +0 -0
  10. package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/grey_pressed.png +0 -0
  11. package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/tan.png +0 -0
  12. package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/tan_inlay.png +0 -0
  13. package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/tan_pressed.png +0 -0
  14. package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/white.png +0 -0
  15. package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/white_inlay.png +0 -0
  16. package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/white_pressed.png +0 -0
  17. package/assets/pixel/kenney-pixel-ui/9-slice/Colored/blue.png +0 -0
  18. package/assets/pixel/kenney-pixel-ui/9-slice/Colored/blue_pressed.png +0 -0
  19. package/assets/pixel/kenney-pixel-ui/9-slice/Colored/green.png +0 -0
  20. package/assets/pixel/kenney-pixel-ui/9-slice/Colored/green_pressed.png +0 -0
  21. package/assets/pixel/kenney-pixel-ui/9-slice/Colored/grey.png +0 -0
  22. package/assets/pixel/kenney-pixel-ui/9-slice/Colored/grey_pressed.png +0 -0
  23. package/assets/pixel/kenney-pixel-ui/9-slice/Colored/red.png +0 -0
  24. package/assets/pixel/kenney-pixel-ui/9-slice/Colored/red_pressed.png +0 -0
  25. package/assets/pixel/kenney-pixel-ui/9-slice/Colored/yellow.png +0 -0
  26. package/assets/pixel/kenney-pixel-ui/9-slice/Colored/yellow_pressed.png +0 -0
  27. package/assets/pixel/kenney-pixel-ui/9-slice/Outline/blue.png +0 -0
  28. package/assets/pixel/kenney-pixel-ui/9-slice/Outline/blue_pressed.png +0 -0
  29. package/assets/pixel/kenney-pixel-ui/9-slice/Outline/green.png +0 -0
  30. package/assets/pixel/kenney-pixel-ui/9-slice/Outline/green_pressed.png +0 -0
  31. package/assets/pixel/kenney-pixel-ui/9-slice/Outline/red.png +0 -0
  32. package/assets/pixel/kenney-pixel-ui/9-slice/Outline/red_pressed.png +0 -0
  33. package/assets/pixel/kenney-pixel-ui/9-slice/Outline/yellow.png +0 -0
  34. package/assets/pixel/kenney-pixel-ui/9-slice/Outline/yellow_pressed.png +0 -0
  35. package/assets/pixel/kenney-pixel-ui/9-slice/list.png +0 -0
  36. package/assets/pixel/kenney-pixel-ui/9-slice/space.png +0 -0
  37. package/assets/pixel/kenney-pixel-ui/9-slice/space_inlay.png +0 -0
  38. package/assets/pixel/kenney-pixel-ui/License.txt +23 -0
  39. package/assets/pixel/kenney-pixel-ui/spritesheet/sheet.png +0 -0
  40. package/bin/trama-ui.mjs +27 -0
  41. package/dist/components/ui/Accordion.d.ts +12 -0
  42. package/dist/components/ui/Accordion.js +12 -0
  43. package/dist/components/ui/Alert.d.ts +15 -0
  44. package/dist/components/ui/Alert.js +15 -0
  45. package/dist/components/ui/ArticlesSection.d.ts +30 -0
  46. package/dist/components/ui/ArticlesSection.js +18 -0
  47. package/dist/components/ui/AsciiBackground.d.ts +58 -0
  48. package/dist/components/ui/AsciiBackground.js +173 -0
  49. package/dist/components/ui/AsciiCard.d.ts +78 -0
  50. package/dist/components/ui/AsciiCard.js +253 -0
  51. package/dist/components/ui/AsciiChart.d.ts +18 -0
  52. package/dist/components/ui/AsciiChart.js +47 -0
  53. package/dist/components/ui/Badge.d.ts +15 -0
  54. package/dist/components/ui/Badge.js +8 -0
  55. package/dist/components/ui/BitmapText.d.ts +25 -0
  56. package/dist/components/ui/BitmapText.js +21 -0
  57. package/dist/components/ui/BlogCard.d.ts +33 -0
  58. package/dist/components/ui/BlogCard.js +13 -0
  59. package/dist/components/ui/Breadcrumbs.d.ts +9 -0
  60. package/dist/components/ui/Breadcrumbs.js +7 -0
  61. package/dist/components/ui/Button.d.ts +74 -0
  62. package/dist/components/ui/Button.js +48 -0
  63. package/dist/components/ui/CTASection.d.ts +13 -0
  64. package/dist/components/ui/CTASection.js +7 -0
  65. package/dist/components/ui/Carousel.d.ts +30 -0
  66. package/dist/components/ui/Carousel.js +80 -0
  67. package/dist/components/ui/CheckboxGroup.d.ts +11 -0
  68. package/dist/components/ui/CheckboxGroup.js +20 -0
  69. package/dist/components/ui/CodeBlock.d.ts +11 -0
  70. package/dist/components/ui/CodeBlock.js +20 -0
  71. package/dist/components/ui/ContactForm.d.ts +25 -0
  72. package/dist/components/ui/ContactForm.js +26 -0
  73. package/dist/components/ui/CrtOverlay.d.ts +10 -0
  74. package/dist/components/ui/CrtOverlay.js +5 -0
  75. package/dist/components/ui/Divider.d.ts +12 -0
  76. package/dist/components/ui/Divider.js +7 -0
  77. package/dist/components/ui/Drawer.d.ts +16 -0
  78. package/dist/components/ui/Drawer.js +25 -0
  79. package/dist/components/ui/Dropdown.d.ts +10 -0
  80. package/dist/components/ui/Dropdown.js +21 -0
  81. package/dist/components/ui/FAQSection.d.ts +14 -0
  82. package/dist/components/ui/FAQSection.js +7 -0
  83. package/dist/components/ui/FeatureGrid.d.ts +18 -0
  84. package/dist/components/ui/FeatureGrid.js +14 -0
  85. package/dist/components/ui/Footer.d.ts +14 -0
  86. package/dist/components/ui/Footer.js +16 -0
  87. package/dist/components/ui/GlyphCursor.d.ts +22 -0
  88. package/dist/components/ui/GlyphCursor.js +50 -0
  89. package/dist/components/ui/GridBackground.d.ts +15 -0
  90. package/dist/components/ui/GridBackground.js +6 -0
  91. package/dist/components/ui/Hero.d.ts +21 -0
  92. package/dist/components/ui/Hero.js +12 -0
  93. package/dist/components/ui/HoverFX.d.ts +29 -0
  94. package/dist/components/ui/HoverFX.js +75 -0
  95. package/dist/components/ui/Icon.d.ts +33 -0
  96. package/dist/components/ui/Icon.js +29 -0
  97. package/dist/components/ui/ImageGallery.d.ts +31 -0
  98. package/dist/components/ui/ImageGallery.js +79 -0
  99. package/dist/components/ui/LogoCloud.d.ts +12 -0
  100. package/dist/components/ui/LogoCloud.js +9 -0
  101. package/dist/components/ui/MagneticButton.d.ts +12 -0
  102. package/dist/components/ui/MagneticButton.js +49 -0
  103. package/dist/components/ui/Marquee.d.ts +29 -0
  104. package/dist/components/ui/Marquee.js +15 -0
  105. package/dist/components/ui/Modal.d.ts +40 -0
  106. package/dist/components/ui/Modal.js +51 -0
  107. package/dist/components/ui/NavBar.d.ts +14 -0
  108. package/dist/components/ui/NavBar.js +12 -0
  109. package/dist/components/ui/NeonSign.d.ts +14 -0
  110. package/dist/components/ui/NeonSign.js +7 -0
  111. package/dist/components/ui/OtpInput.d.ts +9 -0
  112. package/dist/components/ui/OtpInput.js +27 -0
  113. package/dist/components/ui/Pagination.d.ts +10 -0
  114. package/dist/components/ui/Pagination.js +24 -0
  115. package/dist/components/ui/Panel.d.ts +21 -0
  116. package/dist/components/ui/Panel.js +8 -0
  117. package/dist/components/ui/PixelFrame.d.ts +61 -0
  118. package/dist/components/ui/PixelFrame.js +29 -0
  119. package/dist/components/ui/Presence.d.ts +51 -0
  120. package/dist/components/ui/Presence.js +343 -0
  121. package/dist/components/ui/PricingCard.d.ts +30 -0
  122. package/dist/components/ui/PricingCard.js +21 -0
  123. package/dist/components/ui/PricingSection.d.ts +35 -0
  124. package/dist/components/ui/PricingSection.js +21 -0
  125. package/dist/components/ui/Progress.d.ts +17 -0
  126. package/dist/components/ui/Progress.js +9 -0
  127. package/dist/components/ui/RadioGroup.d.ts +10 -0
  128. package/dist/components/ui/RadioGroup.js +11 -0
  129. package/dist/components/ui/RangeSlider.d.ts +14 -0
  130. package/dist/components/ui/RangeSlider.js +11 -0
  131. package/dist/components/ui/Reveal.d.ts +48 -0
  132. package/dist/components/ui/Reveal.js +181 -0
  133. package/dist/components/ui/SceneFlash.d.ts +14 -0
  134. package/dist/components/ui/SceneFlash.js +51 -0
  135. package/dist/components/ui/ScrambleText.d.ts +31 -0
  136. package/dist/components/ui/ScrambleText.js +51 -0
  137. package/dist/components/ui/ScrollArea.d.ts +15 -0
  138. package/dist/components/ui/ScrollArea.js +18 -0
  139. package/dist/components/ui/SectionHeader.d.ts +12 -0
  140. package/dist/components/ui/SectionHeader.js +6 -0
  141. package/dist/components/ui/Select.d.ts +17 -0
  142. package/dist/components/ui/Select.js +31 -0
  143. package/dist/components/ui/Skeleton.d.ts +12 -0
  144. package/dist/components/ui/Skeleton.js +18 -0
  145. package/dist/components/ui/Spinner.d.ts +15 -0
  146. package/dist/components/ui/Spinner.js +24 -0
  147. package/dist/components/ui/Spotlight.d.ts +16 -0
  148. package/dist/components/ui/Spotlight.js +16 -0
  149. package/dist/components/ui/Sprite.d.ts +27 -0
  150. package/dist/components/ui/Sprite.js +19 -0
  151. package/dist/components/ui/StatCounter.d.ts +24 -0
  152. package/dist/components/ui/StatCounter.js +70 -0
  153. package/dist/components/ui/StatsSection.d.ts +14 -0
  154. package/dist/components/ui/StatsSection.js +13 -0
  155. package/dist/components/ui/Stepper.d.ts +10 -0
  156. package/dist/components/ui/Stepper.js +7 -0
  157. package/dist/components/ui/Table.d.ts +10 -0
  158. package/dist/components/ui/Table.js +8 -0
  159. package/dist/components/ui/Tabs.d.ts +12 -0
  160. package/dist/components/ui/Tabs.js +18 -0
  161. package/dist/components/ui/TeamSection.d.ts +18 -0
  162. package/dist/components/ui/TeamSection.js +19 -0
  163. package/dist/components/ui/TerminalTyper.d.ts +20 -0
  164. package/dist/components/ui/TerminalTyper.js +45 -0
  165. package/dist/components/ui/Testimonial.d.ts +19 -0
  166. package/dist/components/ui/Testimonial.js +9 -0
  167. package/dist/components/ui/TestimonialSection.d.ts +20 -0
  168. package/dist/components/ui/TestimonialSection.js +15 -0
  169. package/dist/components/ui/TextField.d.ts +26 -0
  170. package/dist/components/ui/TextField.js +13 -0
  171. package/dist/components/ui/TextmodeBackground.d.ts +52 -0
  172. package/dist/components/ui/TextmodeBackground.js +83 -0
  173. package/dist/components/ui/Timeline.d.ts +13 -0
  174. package/dist/components/ui/Timeline.js +8 -0
  175. package/dist/components/ui/Toast.d.ts +30 -0
  176. package/dist/components/ui/Toast.js +47 -0
  177. package/dist/components/ui/Toggle.d.ts +13 -0
  178. package/dist/components/ui/Toggle.js +10 -0
  179. package/dist/components/ui/Tooltip.d.ts +20 -0
  180. package/dist/components/ui/Tooltip.js +20 -0
  181. package/dist/components/ui/Typewriter.d.ts +20 -0
  182. package/dist/components/ui/Typewriter.js +46 -0
  183. package/dist/components/ui/VideoPlayer.d.ts +81 -0
  184. package/dist/components/ui/VideoPlayer.js +379 -0
  185. package/dist/components/ui/fill.d.ts +32 -0
  186. package/dist/components/ui/fill.js +27 -0
  187. package/dist/components/ui/intent.d.ts +20 -0
  188. package/dist/components/ui/intent.js +23 -0
  189. package/dist/components/ui/styles/kit.css +31 -0
  190. package/dist/components/ui/styles/ui-carousel.css +113 -0
  191. package/dist/components/ui/styles/ui-kit.css +1135 -0
  192. package/dist/components/ui/styles/ui-video.css +75 -0
  193. package/dist/components/ui/swiperCss.d.ts +15 -0
  194. package/dist/components/ui/swiperCss.js +15 -0
  195. package/dist/components/ui/variants.d.ts +12 -0
  196. package/dist/components/ui/variants.js +10 -0
  197. package/dist/index.d.ts +77 -0
  198. package/dist/index.js +77 -0
  199. package/dist/lib/asciify/painters.d.ts +25 -0
  200. package/dist/lib/asciify/painters.js +604 -0
  201. package/dist/lib/asciify/pointer.d.ts +12 -0
  202. package/dist/lib/asciify/pointer.js +54 -0
  203. package/dist/lib/asciify/shape-painters.d.ts +44 -0
  204. package/dist/lib/asciify/shape-painters.js +335 -0
  205. package/dist/lib/asciify/theme-painters.d.ts +8 -0
  206. package/dist/lib/asciify/theme-painters.js +437 -0
  207. package/dist/lib/cells.d.ts +46 -0
  208. package/dist/lib/cells.js +114 -0
  209. package/dist/lib/scroll/store.d.ts +21 -0
  210. package/dist/lib/scroll/store.js +25 -0
  211. package/dist/lib/sketches/aurora.d.ts +3 -0
  212. package/dist/lib/sketches/aurora.js +42 -0
  213. package/dist/lib/sketches/fire.d.ts +3 -0
  214. package/dist/lib/sketches/fire.js +80 -0
  215. package/dist/lib/sketches/flow.d.ts +3 -0
  216. package/dist/lib/sketches/flow.js +70 -0
  217. package/dist/lib/sketches/life.d.ts +3 -0
  218. package/dist/lib/sketches/life.js +107 -0
  219. package/dist/lib/sketches/matrix.d.ts +3 -0
  220. package/dist/lib/sketches/matrix.js +64 -0
  221. package/dist/lib/sketches/ocean.d.ts +3 -0
  222. package/dist/lib/sketches/ocean.js +56 -0
  223. package/dist/lib/sketches/plasma.d.ts +3 -0
  224. package/dist/lib/sketches/plasma.js +29 -0
  225. package/dist/lib/sketches/registry.d.ts +6 -0
  226. package/dist/lib/sketches/registry.js +60 -0
  227. package/dist/lib/sketches/ripples.d.ts +3 -0
  228. package/dist/lib/sketches/ripples.js +84 -0
  229. package/dist/lib/sketches/scroll-assemble.d.ts +8 -0
  230. package/dist/lib/sketches/scroll-assemble.js +90 -0
  231. package/dist/lib/sketches/scroll-parallax.d.ts +6 -0
  232. package/dist/lib/sketches/scroll-parallax.js +76 -0
  233. package/dist/lib/sketches/scroll-rain.d.ts +6 -0
  234. package/dist/lib/sketches/scroll-rain.js +82 -0
  235. package/dist/lib/sketches/scroll-stats.d.ts +7 -0
  236. package/dist/lib/sketches/scroll-stats.js +81 -0
  237. package/dist/lib/sketches/scroll-terminal.d.ts +6 -0
  238. package/dist/lib/sketches/scroll-terminal.js +87 -0
  239. package/dist/lib/sketches/scroll-zoom.d.ts +7 -0
  240. package/dist/lib/sketches/scroll-zoom.js +49 -0
  241. package/dist/lib/sketches/starfield.d.ts +3 -0
  242. package/dist/lib/sketches/starfield.js +54 -0
  243. package/dist/lib/sketches/text-3d.d.ts +6 -0
  244. package/dist/lib/sketches/text-3d.js +62 -0
  245. package/dist/lib/sketches/text-combo-figlet.d.ts +6 -0
  246. package/dist/lib/sketches/text-combo-figlet.js +91 -0
  247. package/dist/lib/sketches/text-glitch.d.ts +3 -0
  248. package/dist/lib/sketches/text-glitch.js +57 -0
  249. package/dist/lib/sketches/text-marquee.d.ts +3 -0
  250. package/dist/lib/sketches/text-marquee.js +35 -0
  251. package/dist/lib/sketches/text-particles.d.ts +9 -0
  252. package/dist/lib/sketches/text-particles.js +91 -0
  253. package/dist/lib/sketches/text-rain.d.ts +3 -0
  254. package/dist/lib/sketches/text-rain.js +73 -0
  255. package/dist/lib/sketches/text-scramble.d.ts +6 -0
  256. package/dist/lib/sketches/text-scramble.js +49 -0
  257. package/dist/lib/sketches/text-wave.d.ts +3 -0
  258. package/dist/lib/sketches/text-wave.js +43 -0
  259. package/dist/lib/sketches/theme-orbit.d.ts +6 -0
  260. package/dist/lib/sketches/theme-orbit.js +119 -0
  261. package/dist/lib/sketches/theme-pulse.d.ts +7 -0
  262. package/dist/lib/sketches/theme-pulse.js +84 -0
  263. package/dist/lib/sketches/tunnel.d.ts +3 -0
  264. package/dist/lib/sketches/tunnel.js +28 -0
  265. package/dist/lib/text/banner.d.ts +5 -0
  266. package/dist/lib/text/banner.js +35 -0
  267. package/dist/lib/text/mask.d.ts +40 -0
  268. package/dist/lib/text/mask.js +143 -0
  269. package/dist/lib/text/store.d.ts +23 -0
  270. package/dist/lib/text/store.js +86 -0
  271. package/dist/lib/ui/card-fields.d.ts +52 -0
  272. package/dist/lib/ui/card-fields.js +193 -0
  273. package/dist/lib/ui/fonts.d.ts +56 -0
  274. package/dist/lib/ui/fonts.js +94 -0
  275. package/dist/lib/ui/fx.d.ts +42 -0
  276. package/dist/lib/ui/fx.js +162 -0
  277. package/dist/lib/ui/icons.d.ts +437 -0
  278. package/dist/lib/ui/icons.js +314 -0
  279. package/dist/lib/ui/placeholder.d.ts +11 -0
  280. package/dist/lib/ui/placeholder.js +65 -0
  281. package/dist/lib/ui/tokens.d.ts +49 -0
  282. package/dist/lib/ui/tokens.js +129 -0
  283. package/dist/lib/ui/useTokens.d.ts +10 -0
  284. package/dist/lib/ui/useTokens.js +32 -0
  285. package/package.json +80 -0
@@ -0,0 +1,193 @@
1
+ /**
2
+ * Campos de caracteres procedurales para el fondo de `AsciiCard`: ligeros (un canvas 2D con ~1.000 celdas, sin
3
+ * motor externo) para poder tener varias tarjetas animadas en la misma página. Cada campo es una función
4
+ * `(u, v, t, seed) → 0..1` que se traduce a un carácter de una rampa y a una opacidad; unos pocos (laberinto,
5
+ * rejilla, binario) eligen el carácter directamente.
6
+ */
7
+ export const CARD_FIELDS = [
8
+ "plasma",
9
+ "waves",
10
+ "rings",
11
+ "noise",
12
+ "rain",
13
+ "stars",
14
+ "dither",
15
+ "topo",
16
+ "maze",
17
+ "grid",
18
+ "halftone",
19
+ "vortex",
20
+ "tunnel",
21
+ "binary",
22
+ "scan",
23
+ ];
24
+ /** Rampas de claro a denso. `glyph` usa el carácter de la tarjeta con distinta opacidad. */
25
+ export const CARD_CHARSETS = {
26
+ detailed: " .:-=+*#%@",
27
+ standard: " .:-=+*#",
28
+ blocks: " ░▒▓█",
29
+ braille: " ⠁⠃⠇⡇⡏⡟⡿⣿",
30
+ dots: " .·•●",
31
+ lines: " -=≡",
32
+ binary: " 01",
33
+ glyph: "",
34
+ };
35
+ const fract = (x) => x - Math.floor(x);
36
+ const hash = (x, y, s = 0) => fract(Math.sin(x * 127.1 + y * 311.7 + s * 74.7) * 43758.5453);
37
+ const smooth = (k) => k * k * (3 - 2 * k);
38
+ function vnoise(x, y, s) {
39
+ const xi = Math.floor(x), yi = Math.floor(y);
40
+ const xf = smooth(x - xi), yf = smooth(y - yi);
41
+ const a = hash(xi, yi, s), b = hash(xi + 1, yi, s), c = hash(xi, yi + 1, s), d = hash(xi + 1, yi + 1, s);
42
+ return a + (b - a) * xf + (c - a) * yf + (a - b - c + d) * xf * yf;
43
+ }
44
+ const fbm = (x, y, s) => vnoise(x, y, s) * 0.55 + vnoise(x * 2.1, y * 2.1, s + 3) * 0.3 + vnoise(x * 4.3, y * 4.3, s + 7) * 0.15;
45
+ const BAYER = [0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5].map((n) => (n + 0.5) / 16);
46
+ /** Valor 0..1 del campo en (u, v) normalizados, con columna/fila de celda para los que trabajan por celda. */
47
+ function sample(field, u, v, t, s, col, row, aspect) {
48
+ const x = u * aspect;
49
+ switch (field) {
50
+ case "plasma": {
51
+ const d = Math.hypot(x - aspect / 2, v - 0.5);
52
+ return 0.5 + 0.125 * (Math.sin(x * 6 + t + s) + Math.sin(v * 5 - t * 0.7) + Math.sin((x + v) * 4 + t * 0.5) + Math.sin(d * 9 - t));
53
+ }
54
+ case "waves":
55
+ return 0.5 + 0.5 * Math.sin(v * 16 + Math.sin(x * 3.5 + t * 0.8 + s) * 1.8 - t * 1.2);
56
+ case "rings": {
57
+ const cx = 0.15 + hash(s, 1) * 0.7 * aspect, cy = 0.15 + hash(s, 2) * 0.7;
58
+ return 0.5 + 0.5 * Math.sin(Math.hypot(x - cx, v - cy) * 30 - t * 2.2);
59
+ }
60
+ case "noise":
61
+ return fbm(x * 3 + t * 0.15, v * 3 - t * 0.1, s);
62
+ case "rain": {
63
+ const speed = 0.25 + hash(col, 3, s) * 0.6;
64
+ const head = fract(hash(col, 5, s) + t * speed * 0.35);
65
+ const dist = fract(head - v);
66
+ return dist < 0.35 ? Math.pow(1 - dist / 0.35, 2) : 0;
67
+ }
68
+ case "stars": {
69
+ const h = hash(col, row, s);
70
+ return h > 0.9 ? 0.35 + 0.65 * (0.5 + 0.5 * Math.sin(t * (1 + h * 4) + h * 40)) : 0;
71
+ }
72
+ case "dither": {
73
+ const g = 0.5 + 0.35 * Math.sin(x * 2.2 + v * 1.4 + t * 0.4 + s) + 0.15 * Math.sin(v * 5 - t * 0.3);
74
+ return g > BAYER[(row % 4) * 4 + (col % 4)] ? 1 : 0.08;
75
+ }
76
+ case "topo": {
77
+ // curvas de nivel: el ruido a baja frecuencia, cortado en 6 cotas; la línea es la franja cercana a cada cota
78
+ const n = vnoise(x * 1.3 + s, v * 1.3 + t * 0.04, s) * 0.7 + vnoise(x * 2.6, v * 2.6, s + 5) * 0.3;
79
+ const f = fract(n * 6);
80
+ const line = Math.min(f, 1 - f);
81
+ return line < 0.14 ? 1 - line / 0.14 : 0.04;
82
+ }
83
+ case "halftone": {
84
+ const d = Math.hypot(x - aspect * (0.5 + 0.3 * Math.sin(t * 0.3 + s)), v - 0.5);
85
+ return Math.max(0, 1 - d * 1.4);
86
+ }
87
+ case "vortex": {
88
+ const dx = x - aspect / 2, dy = v - 0.5;
89
+ const a = Math.atan2(dy, dx), d = Math.hypot(dx, dy);
90
+ return 0.5 + 0.5 * Math.sin(a * 3 + d * 18 - t * 1.6 + s);
91
+ }
92
+ case "tunnel": {
93
+ const dx = x - aspect / 2, dy = v - 0.5;
94
+ const a = Math.atan2(dy, dx) / Math.PI, d = 0.3 / (Math.hypot(dx, dy) + 0.05);
95
+ const c = (Math.floor(a * 6 + t * 0.2) + Math.floor(d * 3 + t)) & 1;
96
+ return c ? Math.min(1, 0.25 + Math.hypot(dx, dy) * 1.6) : 0.05;
97
+ }
98
+ case "scan": {
99
+ // líneas de barrido alternas y una banda brillante que baja por la tarjeta
100
+ const band = fract(v - t * 0.22 + s * 0.1);
101
+ const glow = band > 0.78 ? Math.pow((band - 0.78) / 0.22, 1.5) : 0;
102
+ return Math.max(row % 2 ? 0.3 : 0.1, glow);
103
+ }
104
+ case "binary":
105
+ case "maze":
106
+ case "grid":
107
+ return fbm(x * 2 + t * 0.1, v * 2, s);
108
+ }
109
+ }
110
+ /** Carácter para los campos que no usan rampa. */
111
+ function directChar(field, col, row, t, s, value) {
112
+ if (field === "maze")
113
+ return hash(col, row, s) > 0.5 ? "╱" : "╲";
114
+ if (field === "grid") {
115
+ const gx = col % 6 === 0, gy = row % 4 === 0;
116
+ return gx && gy ? "┼" : gx ? "│" : gy ? "─" : value > 0.62 ? "·" : " ";
117
+ }
118
+ if (field === "binary")
119
+ return hash(col, row + Math.floor(t * (0.5 + hash(col, 9, s) * 2)), s) > 0.5 ? "1" : "0";
120
+ return null;
121
+ }
122
+ /** Color CSS → [r, g, b] usando el propio canvas para normalizar (acepta hex, rgb(), nombres…). */
123
+ function rgbOf(ctx, color) {
124
+ ctx.fillStyle = "#000";
125
+ ctx.fillStyle = color;
126
+ const n = String(ctx.fillStyle);
127
+ if (n.startsWith("#"))
128
+ return [parseInt(n.slice(1, 3), 16), parseInt(n.slice(3, 5), 16), parseInt(n.slice(5, 7), 16)];
129
+ const m = n.match(/[\d.]+/g) ?? ["0", "0", "0"];
130
+ return [Number(m[0]), Number(m[1]), Number(m[2])];
131
+ }
132
+ const mix = (a, b, k) => `rgb(${Math.round(a[0] + (b[0] - a[0]) * k)},${Math.round(a[1] + (b[1] - a[1]) * k)},${Math.round(a[2] + (b[2] - a[2]) * k)})`;
133
+ /**
134
+ * Pinta el campo en el canvas. `pointer` (0..1 del tamaño de la tarjeta) y `intensity` (0..1) controlan la reacción
135
+ * al puntero; `t` en segundos.
136
+ */
137
+ export function drawCardField(ctx, w, h, t, o, pointer) {
138
+ ctx.clearRect(0, 0, w, h);
139
+ const ch = Math.max(6, o.size);
140
+ const cw = ch * 0.62;
141
+ const cols = Math.ceil(w / cw);
142
+ const rows = Math.ceil(h / ch);
143
+ const aspect = w / Math.max(1, h);
144
+ const ramp = o.charset === "glyph" ? ` ${(o.glyph || "#")[0]}` : CARD_CHARSETS[o.charset];
145
+ const hv = pointer.intensity;
146
+ // degradado --acc → --acc2 en 8 pasos precalculados (un fillStyle por celda sería caro de parsear)
147
+ const A = rgbOf(ctx, o.colors.acc), B = rgbOf(ctx, o.colors.acc2);
148
+ const steps = Array.from({ length: 8 }, (_, i) => mix(A, B, i / 7));
149
+ ctx.font = `${ch}px ui-monospace, Consolas, monospace`;
150
+ ctx.textBaseline = "top";
151
+ for (let r = 0; r < rows; r++) {
152
+ for (let c = 0; c < cols; c++) {
153
+ let u = (c + 0.5) / cols;
154
+ let v = (r + 0.5) / rows;
155
+ // distancia al puntero en unidades de altura
156
+ const dx = (u - pointer.x) * aspect, dy = v - pointer.y;
157
+ const d = Math.hypot(dx, dy);
158
+ const near = hv > 0 ? Math.max(0, 1 - d / 0.35) * hv : 0;
159
+ if (o.hover === "repel" && near > 0) {
160
+ u += (dx / (d + 1e-3)) * near * 0.08 / aspect;
161
+ v += (dy / (d + 1e-3)) * near * 0.08;
162
+ }
163
+ let val = sample(o.field, u, v, t, o.seed, c, r, aspect);
164
+ if (o.hover === "ripple" && hv > 0)
165
+ val = Math.min(1, val + Math.max(0, Math.sin(d * 40 - t * 8)) * Math.max(0, 1 - d / 0.6) * hv * 0.8);
166
+ if (o.hover === "glow")
167
+ val = Math.min(1, val + near * 0.8);
168
+ if (o.hover === "reveal")
169
+ val *= Math.min(1, 0.08 + near * 1.4);
170
+ if (val <= 0.02)
171
+ continue;
172
+ const direct = directChar(o.field, c, r, t, o.seed, val);
173
+ const char = direct ?? ramp[Math.min(ramp.length - 1, Math.max(1, Math.round(val * (ramp.length - 1))))];
174
+ if (!char || char === " ")
175
+ continue;
176
+ const color = near > 0.25 && o.hover !== "none" && o.hover !== "reveal"
177
+ ? o.colors.acc
178
+ : o.color === "accent"
179
+ ? o.colors.acc
180
+ : o.color === "gradient"
181
+ ? steps[Math.min(7, Math.max(0, Math.round(((u + v) / 2) * 7)))]
182
+ : o.color === "value"
183
+ ? val > 0.6 ? o.colors.acc : o.colors.mut
184
+ : o.colors.mut;
185
+ ctx.fillStyle = color;
186
+ ctx.globalAlpha = o.opacity * (direct ? 0.35 + 0.65 * val : 0.3 + 0.7 * val);
187
+ ctx.fillText(char, c * cw, r * ch);
188
+ }
189
+ }
190
+ ctx.globalAlpha = 1;
191
+ }
192
+ /** Campos que cambian con el tiempo (los demás solo se repintan al mover el puntero o al cambiar de tema). */
193
+ export const ANIMATED_FIELDS = new Set(["plasma", "waves", "rings", "noise", "rain", "stars", "dither", "topo", "halftone", "vortex", "tunnel", "binary", "scan"]);
@@ -0,0 +1,56 @@
1
+ export declare const inter: import("next/dist/compiled/@next/font").NextFontWithVariable;
2
+ export declare const manrope: import("next/dist/compiled/@next/font").NextFontWithVariable;
3
+ export declare const spaceGrotesk: import("next/dist/compiled/@next/font").NextFontWithVariable;
4
+ export declare const syne: import("next/dist/compiled/@next/font").NextFontWithVariable;
5
+ export declare const fraunces: import("next/dist/compiled/@next/font").NextFontWithVariable;
6
+ export declare const instrumentSerif: import("next/dist/compiled/@next/font").NextFontWithVariable;
7
+ export declare const jetbrainsMono: import("next/dist/compiled/@next/font").NextFontWithVariable;
8
+ export declare const spaceMono: import("next/dist/compiled/@next/font").NextFontWithVariable;
9
+ export declare const pressStart2P: import("next/dist/compiled/@next/font").NextFontWithVariable;
10
+ export declare const vt323: import("next/dist/compiled/@next/font").NextFontWithVariable;
11
+ export declare const geistPixel: import("next/dist/compiled/@next/font").NextFontWithVariable;
12
+ export declare const jersey25: import("next/dist/compiled/@next/font").NextFontWithVariable;
13
+ export declare const pixelifySans: import("next/dist/compiled/@next/font").NextFontWithVariable;
14
+ export declare const dotGothic16: import("next/dist/compiled/@next/font").NextFontWithVariable;
15
+ export declare const silkscreen: import("next/dist/compiled/@next/font").NextFontWithVariable;
16
+ export declare const bitcountSingle: import("next/dist/compiled/@next/font").NextFontWithVariable;
17
+ export declare const jersey10: import("next/dist/compiled/@next/font").NextFontWithVariable;
18
+ export declare const doto: import("next/dist/compiled/@next/font").NextFontWithVariable;
19
+ export declare const tiny5: import("next/dist/compiled/@next/font").NextFontWithVariable;
20
+ export declare const bitcountPropSingle: import("next/dist/compiled/@next/font").NextFontWithVariable;
21
+ export declare const handjet: import("next/dist/compiled/@next/font").NextFontWithVariable;
22
+ export declare const bitcountGridDouble: import("next/dist/compiled/@next/font").NextFontWithVariable;
23
+ export declare const jacquard12: import("next/dist/compiled/@next/font").NextFontWithVariable;
24
+ export declare const jersey20: import("next/dist/compiled/@next/font").NextFontWithVariable;
25
+ export declare const jersey15: import("next/dist/compiled/@next/font").NextFontWithVariable;
26
+ export declare const jacquardaBastarda9: import("next/dist/compiled/@next/font").NextFontWithVariable;
27
+ export declare const micro5: import("next/dist/compiled/@next/font").NextFontWithVariable;
28
+ export declare const bitcountInk: import("next/dist/compiled/@next/font").NextFontWithVariable;
29
+ export declare const bitcountPropSingleInk: import("next/dist/compiled/@next/font").NextFontWithVariable;
30
+ export declare const bitcountGridDoubleInk: import("next/dist/compiled/@next/font").NextFontWithVariable;
31
+ export declare const bitcountPropDoubleInk: import("next/dist/compiled/@next/font").NextFontWithVariable;
32
+ export declare const bitcountGridSingleInk: import("next/dist/compiled/@next/font").NextFontWithVariable;
33
+ export declare const bitcountSingleInk: import("next/dist/compiled/@next/font").NextFontWithVariable;
34
+ export declare const jacquard24: import("next/dist/compiled/@next/font").NextFontWithVariable;
35
+ export declare const bitcountGridSingle: import("next/dist/compiled/@next/font").NextFontWithVariable;
36
+ export declare const coralPixels: import("next/dist/compiled/@next/font").NextFontWithVariable;
37
+ export declare const bytesized: import("next/dist/compiled/@next/font").NextFontWithVariable;
38
+ export declare const bitcount: import("next/dist/compiled/@next/font").NextFontWithVariable;
39
+ export declare const jacquard12Charted: import("next/dist/compiled/@next/font").NextFontWithVariable;
40
+ export declare const bitcountPropDouble: import("next/dist/compiled/@next/font").NextFontWithVariable;
41
+ export declare const jacquard24Charted: import("next/dist/compiled/@next/font").NextFontWithVariable;
42
+ export declare const jersey15Charted: import("next/dist/compiled/@next/font").NextFontWithVariable;
43
+ export declare const micro5Charted: import("next/dist/compiled/@next/font").NextFontWithVariable;
44
+ export declare const jersey10Charted: import("next/dist/compiled/@next/font").NextFontWithVariable;
45
+ export declare const jersey25Charted: import("next/dist/compiled/@next/font").NextFontWithVariable;
46
+ export declare const jacquardaBastarda9Charted: import("next/dist/compiled/@next/font").NextFontWithVariable;
47
+ export declare const jersey20Charted: import("next/dist/compiled/@next/font").NextFontWithVariable;
48
+ export declare const sixtyfour: import("next/dist/compiled/@next/font").NextFontWithVariable;
49
+ export declare const sixtyfourConvergence: import("next/dist/compiled/@next/font").NextFontWithVariable;
50
+ export declare const workbench: import("next/dist/compiled/@next/font").NextFontWithVariable;
51
+ export declare const rubikPixels: import("next/dist/compiled/@next/font").NextFontWithVariable;
52
+ export declare const rubikIso: import("next/dist/compiled/@next/font").NextFontWithVariable;
53
+ export declare const mozillaHeadline: import("next/dist/compiled/@next/font").NextFontWithVariable;
54
+ export declare const rubikBrokenFax: import("next/dist/compiled/@next/font").NextFontWithVariable;
55
+ /** Todas las variables juntas, para aplicar una sola vez en `<html>` (ver `app/layout.tsx`). */
56
+ export declare const fontVariables: string;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Catálogo tipográfico del kit.
3
+ *
4
+ * Fuentes de Google cargadas con `next/font/google`: se descargan en build y se
5
+ * autoalojan en este dominio (sin `<link>` a fonts.googleapis.com, sin petición
6
+ * de red en runtime, sin CLS gracias a `display: "swap"` + métricas de fallback
7
+ * automáticas). Cada una expone una variable CSS (`--font-*`) que `FONT_PRESETS`
8
+ * (`lib/ui/tokens.ts`) y los temas de landing (`lib/themes/themes.ts`) referencian
9
+ * con un *stack* de sistema como último fallback, así nunca se depende 100% de
10
+ * que la variable exista.
11
+ *
12
+ * Para añadir una fuente propia (de marca, con licencia local, no en Google
13
+ * Fonts): usa `next/font/local` en este mismo archivo, exporta su variable igual
14
+ * que las de abajo y regístrala en `FONT_PRESETS`. Ver guía §11.
15
+ */
16
+ import { Fraunces, Inter, Instrument_Serif, JetBrains_Mono, Manrope, Space_Grotesk, Space_Mono, Syne } from "next/font/google";
17
+ export const inter = Inter({ subsets: ["latin"], variable: "--font-inter", display: "swap" });
18
+ export const manrope = Manrope({ subsets: ["latin"], variable: "--font-manrope", display: "swap" });
19
+ export const spaceGrotesk = Space_Grotesk({ subsets: ["latin"], variable: "--font-space-grotesk", display: "swap" });
20
+ export const syne = Syne({ subsets: ["latin"], variable: "--font-syne", display: "swap" });
21
+ export const fraunces = Fraunces({ subsets: ["latin"], variable: "--font-fraunces", display: "swap" });
22
+ export const instrumentSerif = Instrument_Serif({ subsets: ["latin"], weight: ["400"], variable: "--font-instrument-serif", display: "swap" });
23
+ export const jetbrainsMono = JetBrains_Mono({ subsets: ["latin"], variable: "--font-jetbrains-mono", display: "swap" });
24
+ export const spaceMono = Space_Mono({ subsets: ["latin"], weight: ["400", "700"], variable: "--font-space-mono", display: "swap" });
25
+ /**
26
+ * Fuentes "Pixel" — las 46 familias que Google Fonts agrupa bajo Appearance › Theme › Pixel
27
+ * (fonts.google.com/?categoryFilters=Appearance:%2FTheme%2FPixel), todas registradas también
28
+ * en `FONT_PRESETS` bajo la etiqueta "Pixel — …". `preload: false` a propósito: son 46 fuentes
29
+ * decorativas para elegir una a una desde el selector de `/componentes`, no texto de cada
30
+ * página — con precarga activa (el valor por defecto) cada carga de CUALQUIER página del sitio
31
+ * encadenaría 46 `<link rel="preload">` aunque esa página no use ninguna. Sin precarga, el
32
+ * `@font-face` sigue disponible para aplicarla al instante en cuanto se elige.
33
+ */
34
+ import { Bitcount, Bitcount_Grid_Double, Bitcount_Grid_Double_Ink, Bitcount_Grid_Single, Bitcount_Grid_Single_Ink, Bitcount_Ink, Bitcount_Prop_Double, Bitcount_Prop_Double_Ink, Bitcount_Prop_Single, Bitcount_Prop_Single_Ink, Bitcount_Single, Bitcount_Single_Ink, Bytesized, Coral_Pixels, DotGothic16, Doto, Geist_Pixel, Handjet, Jacquard_12, Jacquard_12_Charted, Jacquard_24, Jacquard_24_Charted, Jacquarda_Bastarda_9, Jacquarda_Bastarda_9_Charted, Jersey_10, Jersey_10_Charted, Jersey_15, Jersey_15_Charted, Jersey_20, Jersey_20_Charted, Jersey_25, Jersey_25_Charted, Micro_5, Micro_5_Charted, Mozilla_Headline, Pixelify_Sans, Press_Start_2P, Rubik_Broken_Fax, Rubik_Iso, Rubik_Pixels, Silkscreen, Sixtyfour, Sixtyfour_Convergence, Tiny5, VT323, Workbench, } from "next/font/google";
35
+ export const pressStart2P = Press_Start_2P({ weight: "400", subsets: ["latin"], variable: "--font-press-start-2p", display: "swap", preload: false });
36
+ export const vt323 = VT323({ weight: "400", subsets: ["latin"], variable: "--font-vt323", display: "swap", preload: false });
37
+ export const geistPixel = Geist_Pixel({ subsets: ["latin"], variable: "--font-geist-pixel", display: "swap", preload: false });
38
+ export const jersey25 = Jersey_25({ weight: "400", subsets: ["latin"], variable: "--font-jersey-25", display: "swap", preload: false });
39
+ export const pixelifySans = Pixelify_Sans({ subsets: ["latin"], variable: "--font-pixelify-sans", display: "swap", preload: false });
40
+ export const dotGothic16 = DotGothic16({ weight: "400", subsets: ["latin"], variable: "--font-dotgothic16", display: "swap", preload: false });
41
+ export const silkscreen = Silkscreen({ weight: "400", subsets: ["latin"], variable: "--font-silkscreen", display: "swap", preload: false });
42
+ export const bitcountSingle = Bitcount_Single({ subsets: ["latin"], variable: "--font-bitcount-single", display: "swap", preload: false });
43
+ export const jersey10 = Jersey_10({ weight: "400", subsets: ["latin"], variable: "--font-jersey-10", display: "swap", preload: false });
44
+ export const doto = Doto({ subsets: ["latin"], variable: "--font-doto", display: "swap", preload: false });
45
+ export const tiny5 = Tiny5({ weight: "400", subsets: ["latin"], variable: "--font-tiny5", display: "swap", preload: false });
46
+ export const bitcountPropSingle = Bitcount_Prop_Single({ subsets: ["latin"], variable: "--font-bitcount-prop-single", display: "swap", preload: false });
47
+ export const handjet = Handjet({ subsets: ["latin"], variable: "--font-handjet", display: "swap", preload: false });
48
+ export const bitcountGridDouble = Bitcount_Grid_Double({ subsets: ["latin"], variable: "--font-bitcount-grid-double", display: "swap", preload: false });
49
+ export const jacquard12 = Jacquard_12({ weight: "400", subsets: ["latin"], variable: "--font-jacquard-12", display: "swap", preload: false });
50
+ export const jersey20 = Jersey_20({ weight: "400", subsets: ["latin"], variable: "--font-jersey-20", display: "swap", preload: false });
51
+ export const jersey15 = Jersey_15({ weight: "400", subsets: ["latin"], variable: "--font-jersey-15", display: "swap", preload: false });
52
+ export const jacquardaBastarda9 = Jacquarda_Bastarda_9({ weight: "400", subsets: ["latin"], variable: "--font-jacquarda-bastarda-9", display: "swap", preload: false });
53
+ export const micro5 = Micro_5({ weight: "400", subsets: ["latin"], variable: "--font-micro-5", display: "swap", preload: false });
54
+ export const bitcountInk = Bitcount_Ink({ subsets: ["latin"], variable: "--font-bitcount-ink", display: "swap", preload: false });
55
+ export const bitcountPropSingleInk = Bitcount_Prop_Single_Ink({ subsets: ["latin"], variable: "--font-bitcount-prop-single-ink", display: "swap", preload: false });
56
+ export const bitcountGridDoubleInk = Bitcount_Grid_Double_Ink({ subsets: ["latin"], variable: "--font-bitcount-grid-double-ink", display: "swap", preload: false });
57
+ export const bitcountPropDoubleInk = Bitcount_Prop_Double_Ink({ subsets: ["latin"], variable: "--font-bitcount-prop-double-ink", display: "swap", preload: false });
58
+ export const bitcountGridSingleInk = Bitcount_Grid_Single_Ink({ subsets: ["latin"], variable: "--font-bitcount-grid-single-ink", display: "swap", preload: false });
59
+ export const bitcountSingleInk = Bitcount_Single_Ink({ subsets: ["latin"], variable: "--font-bitcount-single-ink", display: "swap", preload: false });
60
+ export const jacquard24 = Jacquard_24({ weight: "400", subsets: ["latin"], variable: "--font-jacquard-24", display: "swap", preload: false });
61
+ export const bitcountGridSingle = Bitcount_Grid_Single({ subsets: ["latin"], variable: "--font-bitcount-grid-single", display: "swap", preload: false });
62
+ export const coralPixels = Coral_Pixels({ weight: "400", subsets: ["latin"], variable: "--font-coral-pixels", display: "swap", preload: false });
63
+ export const bytesized = Bytesized({ weight: "400", subsets: ["latin"], variable: "--font-bytesized", display: "swap", preload: false });
64
+ export const bitcount = Bitcount({ subsets: ["latin"], variable: "--font-bitcount", display: "swap", preload: false });
65
+ export const jacquard12Charted = Jacquard_12_Charted({ weight: "400", subsets: ["latin"], variable: "--font-jacquard-12-charted", display: "swap", preload: false });
66
+ export const bitcountPropDouble = Bitcount_Prop_Double({ subsets: ["latin"], variable: "--font-bitcount-prop-double", display: "swap", preload: false });
67
+ export const jacquard24Charted = Jacquard_24_Charted({ weight: "400", subsets: ["latin"], variable: "--font-jacquard-24-charted", display: "swap", preload: false });
68
+ export const jersey15Charted = Jersey_15_Charted({ weight: "400", subsets: ["latin"], variable: "--font-jersey-15-charted", display: "swap", preload: false });
69
+ export const micro5Charted = Micro_5_Charted({ weight: "400", subsets: ["latin"], variable: "--font-micro-5-charted", display: "swap", preload: false });
70
+ export const jersey10Charted = Jersey_10_Charted({ weight: "400", subsets: ["latin"], variable: "--font-jersey-10-charted", display: "swap", preload: false });
71
+ export const jersey25Charted = Jersey_25_Charted({ weight: "400", subsets: ["latin"], variable: "--font-jersey-25-charted", display: "swap", preload: false });
72
+ export const jacquardaBastarda9Charted = Jacquarda_Bastarda_9_Charted({ weight: "400", subsets: ["latin"], variable: "--font-jacquarda-bastarda-9-charted", display: "swap", preload: false });
73
+ export const jersey20Charted = Jersey_20_Charted({ weight: "400", subsets: ["latin"], variable: "--font-jersey-20-charted", display: "swap", preload: false });
74
+ export const sixtyfour = Sixtyfour({ subsets: ["latin"], variable: "--font-sixtyfour", display: "swap", preload: false });
75
+ export const sixtyfourConvergence = Sixtyfour_Convergence({ subsets: ["latin"], variable: "--font-sixtyfour-convergence", display: "swap", preload: false });
76
+ export const workbench = Workbench({ subsets: ["latin"], variable: "--font-workbench", display: "swap", preload: false });
77
+ export const rubikPixels = Rubik_Pixels({ weight: "400", subsets: ["latin"], variable: "--font-rubik-pixels", display: "swap", preload: false });
78
+ export const rubikIso = Rubik_Iso({ weight: "400", subsets: ["latin"], variable: "--font-rubik-iso", display: "swap", preload: false });
79
+ export const mozillaHeadline = Mozilla_Headline({ subsets: ["latin"], variable: "--font-mozilla-headline", display: "swap", preload: false });
80
+ export const rubikBrokenFax = Rubik_Broken_Fax({ weight: "400", subsets: ["latin"], variable: "--font-rubik-broken-fax", display: "swap", preload: false });
81
+ /** Todas las variables juntas, para aplicar una sola vez en `<html>` (ver `app/layout.tsx`). */
82
+ export const fontVariables = [
83
+ inter, manrope, spaceGrotesk, syne, fraunces, instrumentSerif, jetbrainsMono, spaceMono,
84
+ pressStart2P, vt323, geistPixel, jersey25, pixelifySans, dotGothic16,
85
+ silkscreen, bitcountSingle, jersey10, doto, tiny5, bitcountPropSingle,
86
+ handjet, bitcountGridDouble, jacquard12, jersey20, jersey15, jacquardaBastarda9,
87
+ micro5, bitcountInk, bitcountPropSingleInk, bitcountGridDoubleInk, bitcountPropDoubleInk, bitcountGridSingleInk,
88
+ bitcountSingleInk, jacquard24, bitcountGridSingle, coralPixels, bytesized, bitcount,
89
+ jacquard12Charted, bitcountPropDouble, jacquard24Charted, jersey15Charted, micro5Charted, jersey10Charted,
90
+ jersey25Charted, jacquardaBastarda9Charted, jersey20Charted, sixtyfour, sixtyfourConvergence, workbench,
91
+ rubikPixels, rubikIso, mozillaHeadline, rubikBrokenFax,
92
+ ]
93
+ .map((f) => f.variable)
94
+ .join(" ");
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Motor de dibujo de los efectos de aparición/desaparición en canvas. Son funciones puras de
3
+ * (progreso, opciones): el componente decide cuándo llamarlas y en qué sentido animar el progreso.
4
+ */
5
+ export declare const CHARSETS: {
6
+ readonly symbols: "!<>-_\\/[]{}=+*^?#";
7
+ readonly binary: "01";
8
+ readonly hex: "0123456789ABCDEF";
9
+ readonly code: "{}[]()<>;:=+-*/\\|&%$#@~^";
10
+ readonly blocks: "░▒▓█";
11
+ readonly dots: ".:;·+*";
12
+ };
13
+ export type CharsetId = keyof typeof CHARSETS;
14
+ export declare const hash: (n: number) => number;
15
+ export declare const clamp01: (v: number) => number;
16
+ export type AsciiPattern = "random" | "sweep" | "rain" | "radial" | "rows";
17
+ export type CoverOptions = {
18
+ pattern: AsciiPattern;
19
+ cell: number;
20
+ chars: string;
21
+ bg: string;
22
+ c1: string;
23
+ c2: string;
24
+ time: number;
25
+ seed: number;
26
+ /** deja un rastro tenue tras el borde de descubrimiento */
27
+ edge: boolean;
28
+ };
29
+ /** Capa de celdas opacas con glifos. `k` = 0 cubre todo; `k` = 1 lo descubre por completo. */
30
+ export declare function drawAsciiCover(ctx: CanvasRenderingContext2D, w: number, h: number, k: number, o: CoverOptions): void;
31
+ /** Ruido de televisión. `amount` 0..1 = opacidad de la capa; se dibuja a baja resolución y se amplía. */
32
+ export declare function drawStatic(ctx: CanvasRenderingContext2D, w: number, h: number, amount: number, tint: string): void;
33
+ /** Barras de "documento censurado" que se retiran (o vuelven) fila a fila. `k` = 0 cubre todo. */
34
+ export declare function drawRedact(ctx: CanvasRenderingContext2D, w: number, h: number, k: number, o: {
35
+ rowH: number;
36
+ color: string;
37
+ textColor: string;
38
+ seed: number;
39
+ label: string;
40
+ }): void;
41
+ /** Bloques y desgarros de corrupción para el glitch profundo. `amp` 0..1; `step` cambia el patrón. */
42
+ export declare function drawCorruption(ctx: CanvasRenderingContext2D, w: number, h: number, amp: number, step: number, c1: string, c2: string): void;
@@ -0,0 +1,162 @@
1
+ /**
2
+ * Motor de dibujo de los efectos de aparición/desaparición en canvas. Son funciones puras de
3
+ * (progreso, opciones): el componente decide cuándo llamarlas y en qué sentido animar el progreso.
4
+ */
5
+ export const CHARSETS = {
6
+ symbols: "!<>-_\\/[]{}=+*^?#",
7
+ binary: "01",
8
+ hex: "0123456789ABCDEF",
9
+ code: "{}[]()<>;:=+-*/\\|&%$#@~^",
10
+ blocks: "░▒▓█",
11
+ dots: ".:;·+*",
12
+ };
13
+ export const hash = (n) => {
14
+ const x = Math.sin(n * 127.1 + 311.7) * 43758.5453;
15
+ return x - Math.floor(x);
16
+ };
17
+ export const clamp01 = (v) => (v < 0 ? 0 : v > 1 ? 1 : v);
18
+ /** Umbral de cobertura 0..1 de una celda según el patrón: la celda se descubre cuando k lo supera. */
19
+ function threshold(p, cx, cy, cols, rows, seed) {
20
+ const j = hash(seed + cx * 31 + cy * 17);
21
+ switch (p) {
22
+ case "sweep":
23
+ return (cx / Math.max(1, cols - 1)) * 0.8 + j * 0.2;
24
+ case "rows":
25
+ return (cy / Math.max(1, rows - 1)) * 0.8 + j * 0.2;
26
+ case "radial": {
27
+ const dx = (cx - cols / 2) / (cols / 2);
28
+ const dy = (cy - rows / 2) / (rows / 2);
29
+ return clamp01(Math.hypot(dx, dy) / 1.42) * 0.8 + j * 0.2;
30
+ }
31
+ case "rain": {
32
+ // cada columna arranca en un momento distinto y se descubre de arriba abajo
33
+ const delay = hash(seed + cx * 7.7) * 0.5;
34
+ return delay + (cy / Math.max(1, rows - 1)) * 0.45 + j * 0.05;
35
+ }
36
+ default:
37
+ return j;
38
+ }
39
+ }
40
+ /** Capa de celdas opacas con glifos. `k` = 0 cubre todo; `k` = 1 lo descubre por completo. */
41
+ export function drawAsciiCover(ctx, w, h, k, o) {
42
+ ctx.clearRect(0, 0, w, h);
43
+ if (k >= 1)
44
+ return;
45
+ const cell = o.cell;
46
+ const cols = Math.ceil(w / cell);
47
+ const rows = Math.ceil(h / cell);
48
+ ctx.font = `${Math.max(8, cell - 3)}px monospace`;
49
+ ctx.textBaseline = "top";
50
+ const chars = o.chars || "#";
51
+ for (let cy = 0; cy < rows; cy++) {
52
+ for (let cx = 0; cx < cols; cx++) {
53
+ const thr = threshold(o.pattern, cx, cy, cols, rows, o.seed) * 0.88 + 0.06;
54
+ const x = cx * cell;
55
+ const y = cy * cell;
56
+ if (k < thr) {
57
+ ctx.globalAlpha = 1;
58
+ ctx.fillStyle = o.bg;
59
+ ctx.fillRect(x, y, cell, cell);
60
+ const lead = thr - k < 0.07;
61
+ ctx.fillStyle = lead ? o.c2 : o.c1;
62
+ ctx.globalAlpha = lead ? 1 : 0.35 + 0.65 * hash(o.seed + cx * 3 + cy * 5 + Math.floor(o.time * 6));
63
+ ctx.fillText(chars[Math.floor(hash(cx * 13 + cy * 7 + Math.floor(o.time * 14)) * chars.length)] ?? "#", x + 2, y + 1);
64
+ }
65
+ else if (o.edge && k - thr < 0.06) {
66
+ ctx.globalAlpha = 0.5 * (1 - (k - thr) / 0.06);
67
+ ctx.fillStyle = o.c2;
68
+ ctx.fillText(chars[Math.floor(hash(cx * 5 + cy * 11) * chars.length)] ?? "#", x + 2, y + 1);
69
+ }
70
+ }
71
+ }
72
+ ctx.globalAlpha = 1;
73
+ }
74
+ let noiseCv = null;
75
+ /** Ruido de televisión. `amount` 0..1 = opacidad de la capa; se dibuja a baja resolución y se amplía. */
76
+ export function drawStatic(ctx, w, h, amount, tint) {
77
+ ctx.clearRect(0, 0, w, h);
78
+ if (amount <= 0.01)
79
+ return;
80
+ const nw = Math.max(8, Math.ceil(w / 3));
81
+ const nh = Math.max(8, Math.ceil(h / 3));
82
+ noiseCv ??= document.createElement("canvas");
83
+ noiseCv.width = nw;
84
+ noiseCv.height = nh;
85
+ const nctx = noiseCv.getContext("2d");
86
+ const img = nctx.createImageData(nw, nh);
87
+ for (let i = 0; i < img.data.length; i += 4) {
88
+ const v = Math.random() * 255;
89
+ img.data[i] = v;
90
+ img.data[i + 1] = v;
91
+ img.data[i + 2] = v;
92
+ img.data[i + 3] = 255;
93
+ }
94
+ nctx.putImageData(img, 0, 0);
95
+ ctx.imageSmoothingEnabled = false;
96
+ ctx.globalAlpha = clamp01(amount);
97
+ ctx.drawImage(noiseCv, 0, 0, w, h);
98
+ ctx.globalCompositeOperation = "multiply";
99
+ ctx.fillStyle = tint;
100
+ ctx.fillRect(0, 0, w, h);
101
+ ctx.globalCompositeOperation = "source-over";
102
+ ctx.globalAlpha = 1;
103
+ }
104
+ /** Barras de "documento censurado" que se retiran (o vuelven) fila a fila. `k` = 0 cubre todo. */
105
+ export function drawRedact(ctx, w, h, k, o) {
106
+ ctx.clearRect(0, 0, w, h);
107
+ if (k >= 1)
108
+ return;
109
+ const rows = Math.ceil(h / o.rowH);
110
+ ctx.font = `700 ${Math.max(9, o.rowH * 0.5)}px monospace`;
111
+ ctx.textBaseline = "middle";
112
+ for (let r = 0; r < rows; r++) {
113
+ const t = (r / rows) * 0.6 + hash(o.seed + r) * 0.35;
114
+ const p = clamp01((k - t) / 0.25);
115
+ const bw = w * (1 - p);
116
+ if (bw < 1)
117
+ continue;
118
+ const y = r * o.rowH;
119
+ ctx.fillStyle = o.color;
120
+ ctx.fillRect(w - bw, y + 1, bw, o.rowH - 2);
121
+ if (bw > 90 && o.label) {
122
+ ctx.fillStyle = o.textColor;
123
+ ctx.globalAlpha = 0.85;
124
+ ctx.fillText(o.label, w - bw + 8, y + o.rowH / 2);
125
+ ctx.globalAlpha = 1;
126
+ }
127
+ }
128
+ }
129
+ /** Bloques y desgarros de corrupción para el glitch profundo. `amp` 0..1; `step` cambia el patrón. */
130
+ export function drawCorruption(ctx, w, h, amp, step, c1, c2) {
131
+ ctx.clearRect(0, 0, w, h);
132
+ if (amp < 0.03)
133
+ return;
134
+ const n = Math.floor(amp * 12) + 1;
135
+ ctx.font = "10px monospace";
136
+ ctx.textBaseline = "top";
137
+ for (let i = 0; i < n; i++) {
138
+ const s = step * 31 + i * 7;
139
+ const x = hash(s) * w;
140
+ const y = hash(s + 1) * h;
141
+ const bw = w * (0.05 + hash(s + 2) * 0.5);
142
+ const bh = 3 + hash(s + 3) * 22;
143
+ ctx.globalAlpha = 0.18 + amp * 0.35;
144
+ ctx.fillStyle = hash(s + 4) > 0.5 ? c1 : c2;
145
+ ctx.fillRect(x - bw / 2, y, bw, bh);
146
+ if (hash(s + 5) > 0.55) {
147
+ ctx.globalAlpha = Math.min(1, amp + 0.2);
148
+ ctx.fillStyle = hash(s + 6) > 0.5 ? c1 : c2;
149
+ let line = "";
150
+ for (let k = 0; k < 14; k++)
151
+ line += CHARSETS.hex[Math.floor(hash(s + 10 + k) * 16)];
152
+ ctx.fillText(line, x - bw / 2 + 2, y + 2);
153
+ }
154
+ // desgarro fino
155
+ if (hash(s + 8) > 0.6) {
156
+ ctx.globalAlpha = 0.5 * amp;
157
+ ctx.fillStyle = "#fff";
158
+ ctx.fillRect(0, hash(s + 9) * h, w, 1);
159
+ }
160
+ }
161
+ ctx.globalAlpha = 1;
162
+ }