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.
- package/CATALOG.md +1237 -0
- package/LICENSE +21 -0
- package/README.md +78 -0
- package/THIRD-PARTY.md +4 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/brown.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/brown_inlay.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/brown_pressed.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/grey.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/grey_inlay.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/grey_pressed.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/tan.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/tan_inlay.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/tan_pressed.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/white.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/white_inlay.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Ancient/white_pressed.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Colored/blue.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Colored/blue_pressed.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Colored/green.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Colored/green_pressed.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Colored/grey.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Colored/grey_pressed.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Colored/red.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Colored/red_pressed.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Colored/yellow.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Colored/yellow_pressed.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Outline/blue.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Outline/blue_pressed.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Outline/green.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Outline/green_pressed.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Outline/red.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Outline/red_pressed.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Outline/yellow.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/Outline/yellow_pressed.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/list.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/space.png +0 -0
- package/assets/pixel/kenney-pixel-ui/9-slice/space_inlay.png +0 -0
- package/assets/pixel/kenney-pixel-ui/License.txt +23 -0
- package/assets/pixel/kenney-pixel-ui/spritesheet/sheet.png +0 -0
- package/bin/trama-ui.mjs +27 -0
- package/dist/components/ui/Accordion.d.ts +12 -0
- package/dist/components/ui/Accordion.js +12 -0
- package/dist/components/ui/Alert.d.ts +15 -0
- package/dist/components/ui/Alert.js +15 -0
- package/dist/components/ui/ArticlesSection.d.ts +30 -0
- package/dist/components/ui/ArticlesSection.js +18 -0
- package/dist/components/ui/AsciiBackground.d.ts +58 -0
- package/dist/components/ui/AsciiBackground.js +173 -0
- package/dist/components/ui/AsciiCard.d.ts +78 -0
- package/dist/components/ui/AsciiCard.js +253 -0
- package/dist/components/ui/AsciiChart.d.ts +18 -0
- package/dist/components/ui/AsciiChart.js +47 -0
- package/dist/components/ui/Badge.d.ts +15 -0
- package/dist/components/ui/Badge.js +8 -0
- package/dist/components/ui/BitmapText.d.ts +25 -0
- package/dist/components/ui/BitmapText.js +21 -0
- package/dist/components/ui/BlogCard.d.ts +33 -0
- package/dist/components/ui/BlogCard.js +13 -0
- package/dist/components/ui/Breadcrumbs.d.ts +9 -0
- package/dist/components/ui/Breadcrumbs.js +7 -0
- package/dist/components/ui/Button.d.ts +74 -0
- package/dist/components/ui/Button.js +48 -0
- package/dist/components/ui/CTASection.d.ts +13 -0
- package/dist/components/ui/CTASection.js +7 -0
- package/dist/components/ui/Carousel.d.ts +30 -0
- package/dist/components/ui/Carousel.js +80 -0
- package/dist/components/ui/CheckboxGroup.d.ts +11 -0
- package/dist/components/ui/CheckboxGroup.js +20 -0
- package/dist/components/ui/CodeBlock.d.ts +11 -0
- package/dist/components/ui/CodeBlock.js +20 -0
- package/dist/components/ui/ContactForm.d.ts +25 -0
- package/dist/components/ui/ContactForm.js +26 -0
- package/dist/components/ui/CrtOverlay.d.ts +10 -0
- package/dist/components/ui/CrtOverlay.js +5 -0
- package/dist/components/ui/Divider.d.ts +12 -0
- package/dist/components/ui/Divider.js +7 -0
- package/dist/components/ui/Drawer.d.ts +16 -0
- package/dist/components/ui/Drawer.js +25 -0
- package/dist/components/ui/Dropdown.d.ts +10 -0
- package/dist/components/ui/Dropdown.js +21 -0
- package/dist/components/ui/FAQSection.d.ts +14 -0
- package/dist/components/ui/FAQSection.js +7 -0
- package/dist/components/ui/FeatureGrid.d.ts +18 -0
- package/dist/components/ui/FeatureGrid.js +14 -0
- package/dist/components/ui/Footer.d.ts +14 -0
- package/dist/components/ui/Footer.js +16 -0
- package/dist/components/ui/GlyphCursor.d.ts +22 -0
- package/dist/components/ui/GlyphCursor.js +50 -0
- package/dist/components/ui/GridBackground.d.ts +15 -0
- package/dist/components/ui/GridBackground.js +6 -0
- package/dist/components/ui/Hero.d.ts +21 -0
- package/dist/components/ui/Hero.js +12 -0
- package/dist/components/ui/HoverFX.d.ts +29 -0
- package/dist/components/ui/HoverFX.js +75 -0
- package/dist/components/ui/Icon.d.ts +33 -0
- package/dist/components/ui/Icon.js +29 -0
- package/dist/components/ui/ImageGallery.d.ts +31 -0
- package/dist/components/ui/ImageGallery.js +79 -0
- package/dist/components/ui/LogoCloud.d.ts +12 -0
- package/dist/components/ui/LogoCloud.js +9 -0
- package/dist/components/ui/MagneticButton.d.ts +12 -0
- package/dist/components/ui/MagneticButton.js +49 -0
- package/dist/components/ui/Marquee.d.ts +29 -0
- package/dist/components/ui/Marquee.js +15 -0
- package/dist/components/ui/Modal.d.ts +40 -0
- package/dist/components/ui/Modal.js +51 -0
- package/dist/components/ui/NavBar.d.ts +14 -0
- package/dist/components/ui/NavBar.js +12 -0
- package/dist/components/ui/NeonSign.d.ts +14 -0
- package/dist/components/ui/NeonSign.js +7 -0
- package/dist/components/ui/OtpInput.d.ts +9 -0
- package/dist/components/ui/OtpInput.js +27 -0
- package/dist/components/ui/Pagination.d.ts +10 -0
- package/dist/components/ui/Pagination.js +24 -0
- package/dist/components/ui/Panel.d.ts +21 -0
- package/dist/components/ui/Panel.js +8 -0
- package/dist/components/ui/PixelFrame.d.ts +61 -0
- package/dist/components/ui/PixelFrame.js +29 -0
- package/dist/components/ui/Presence.d.ts +51 -0
- package/dist/components/ui/Presence.js +343 -0
- package/dist/components/ui/PricingCard.d.ts +30 -0
- package/dist/components/ui/PricingCard.js +21 -0
- package/dist/components/ui/PricingSection.d.ts +35 -0
- package/dist/components/ui/PricingSection.js +21 -0
- package/dist/components/ui/Progress.d.ts +17 -0
- package/dist/components/ui/Progress.js +9 -0
- package/dist/components/ui/RadioGroup.d.ts +10 -0
- package/dist/components/ui/RadioGroup.js +11 -0
- package/dist/components/ui/RangeSlider.d.ts +14 -0
- package/dist/components/ui/RangeSlider.js +11 -0
- package/dist/components/ui/Reveal.d.ts +48 -0
- package/dist/components/ui/Reveal.js +181 -0
- package/dist/components/ui/SceneFlash.d.ts +14 -0
- package/dist/components/ui/SceneFlash.js +51 -0
- package/dist/components/ui/ScrambleText.d.ts +31 -0
- package/dist/components/ui/ScrambleText.js +51 -0
- package/dist/components/ui/ScrollArea.d.ts +15 -0
- package/dist/components/ui/ScrollArea.js +18 -0
- package/dist/components/ui/SectionHeader.d.ts +12 -0
- package/dist/components/ui/SectionHeader.js +6 -0
- package/dist/components/ui/Select.d.ts +17 -0
- package/dist/components/ui/Select.js +31 -0
- package/dist/components/ui/Skeleton.d.ts +12 -0
- package/dist/components/ui/Skeleton.js +18 -0
- package/dist/components/ui/Spinner.d.ts +15 -0
- package/dist/components/ui/Spinner.js +24 -0
- package/dist/components/ui/Spotlight.d.ts +16 -0
- package/dist/components/ui/Spotlight.js +16 -0
- package/dist/components/ui/Sprite.d.ts +27 -0
- package/dist/components/ui/Sprite.js +19 -0
- package/dist/components/ui/StatCounter.d.ts +24 -0
- package/dist/components/ui/StatCounter.js +70 -0
- package/dist/components/ui/StatsSection.d.ts +14 -0
- package/dist/components/ui/StatsSection.js +13 -0
- package/dist/components/ui/Stepper.d.ts +10 -0
- package/dist/components/ui/Stepper.js +7 -0
- package/dist/components/ui/Table.d.ts +10 -0
- package/dist/components/ui/Table.js +8 -0
- package/dist/components/ui/Tabs.d.ts +12 -0
- package/dist/components/ui/Tabs.js +18 -0
- package/dist/components/ui/TeamSection.d.ts +18 -0
- package/dist/components/ui/TeamSection.js +19 -0
- package/dist/components/ui/TerminalTyper.d.ts +20 -0
- package/dist/components/ui/TerminalTyper.js +45 -0
- package/dist/components/ui/Testimonial.d.ts +19 -0
- package/dist/components/ui/Testimonial.js +9 -0
- package/dist/components/ui/TestimonialSection.d.ts +20 -0
- package/dist/components/ui/TestimonialSection.js +15 -0
- package/dist/components/ui/TextField.d.ts +26 -0
- package/dist/components/ui/TextField.js +13 -0
- package/dist/components/ui/TextmodeBackground.d.ts +52 -0
- package/dist/components/ui/TextmodeBackground.js +83 -0
- package/dist/components/ui/Timeline.d.ts +13 -0
- package/dist/components/ui/Timeline.js +8 -0
- package/dist/components/ui/Toast.d.ts +30 -0
- package/dist/components/ui/Toast.js +47 -0
- package/dist/components/ui/Toggle.d.ts +13 -0
- package/dist/components/ui/Toggle.js +10 -0
- package/dist/components/ui/Tooltip.d.ts +20 -0
- package/dist/components/ui/Tooltip.js +20 -0
- package/dist/components/ui/Typewriter.d.ts +20 -0
- package/dist/components/ui/Typewriter.js +46 -0
- package/dist/components/ui/VideoPlayer.d.ts +81 -0
- package/dist/components/ui/VideoPlayer.js +379 -0
- package/dist/components/ui/fill.d.ts +32 -0
- package/dist/components/ui/fill.js +27 -0
- package/dist/components/ui/intent.d.ts +20 -0
- package/dist/components/ui/intent.js +23 -0
- package/dist/components/ui/styles/kit.css +31 -0
- package/dist/components/ui/styles/ui-carousel.css +113 -0
- package/dist/components/ui/styles/ui-kit.css +1135 -0
- package/dist/components/ui/styles/ui-video.css +75 -0
- package/dist/components/ui/swiperCss.d.ts +15 -0
- package/dist/components/ui/swiperCss.js +15 -0
- package/dist/components/ui/variants.d.ts +12 -0
- package/dist/components/ui/variants.js +10 -0
- package/dist/index.d.ts +77 -0
- package/dist/index.js +77 -0
- package/dist/lib/asciify/painters.d.ts +25 -0
- package/dist/lib/asciify/painters.js +604 -0
- package/dist/lib/asciify/pointer.d.ts +12 -0
- package/dist/lib/asciify/pointer.js +54 -0
- package/dist/lib/asciify/shape-painters.d.ts +44 -0
- package/dist/lib/asciify/shape-painters.js +335 -0
- package/dist/lib/asciify/theme-painters.d.ts +8 -0
- package/dist/lib/asciify/theme-painters.js +437 -0
- package/dist/lib/cells.d.ts +46 -0
- package/dist/lib/cells.js +114 -0
- package/dist/lib/scroll/store.d.ts +21 -0
- package/dist/lib/scroll/store.js +25 -0
- package/dist/lib/sketches/aurora.d.ts +3 -0
- package/dist/lib/sketches/aurora.js +42 -0
- package/dist/lib/sketches/fire.d.ts +3 -0
- package/dist/lib/sketches/fire.js +80 -0
- package/dist/lib/sketches/flow.d.ts +3 -0
- package/dist/lib/sketches/flow.js +70 -0
- package/dist/lib/sketches/life.d.ts +3 -0
- package/dist/lib/sketches/life.js +107 -0
- package/dist/lib/sketches/matrix.d.ts +3 -0
- package/dist/lib/sketches/matrix.js +64 -0
- package/dist/lib/sketches/ocean.d.ts +3 -0
- package/dist/lib/sketches/ocean.js +56 -0
- package/dist/lib/sketches/plasma.d.ts +3 -0
- package/dist/lib/sketches/plasma.js +29 -0
- package/dist/lib/sketches/registry.d.ts +6 -0
- package/dist/lib/sketches/registry.js +60 -0
- package/dist/lib/sketches/ripples.d.ts +3 -0
- package/dist/lib/sketches/ripples.js +84 -0
- package/dist/lib/sketches/scroll-assemble.d.ts +8 -0
- package/dist/lib/sketches/scroll-assemble.js +90 -0
- package/dist/lib/sketches/scroll-parallax.d.ts +6 -0
- package/dist/lib/sketches/scroll-parallax.js +76 -0
- package/dist/lib/sketches/scroll-rain.d.ts +6 -0
- package/dist/lib/sketches/scroll-rain.js +82 -0
- package/dist/lib/sketches/scroll-stats.d.ts +7 -0
- package/dist/lib/sketches/scroll-stats.js +81 -0
- package/dist/lib/sketches/scroll-terminal.d.ts +6 -0
- package/dist/lib/sketches/scroll-terminal.js +87 -0
- package/dist/lib/sketches/scroll-zoom.d.ts +7 -0
- package/dist/lib/sketches/scroll-zoom.js +49 -0
- package/dist/lib/sketches/starfield.d.ts +3 -0
- package/dist/lib/sketches/starfield.js +54 -0
- package/dist/lib/sketches/text-3d.d.ts +6 -0
- package/dist/lib/sketches/text-3d.js +62 -0
- package/dist/lib/sketches/text-combo-figlet.d.ts +6 -0
- package/dist/lib/sketches/text-combo-figlet.js +91 -0
- package/dist/lib/sketches/text-glitch.d.ts +3 -0
- package/dist/lib/sketches/text-glitch.js +57 -0
- package/dist/lib/sketches/text-marquee.d.ts +3 -0
- package/dist/lib/sketches/text-marquee.js +35 -0
- package/dist/lib/sketches/text-particles.d.ts +9 -0
- package/dist/lib/sketches/text-particles.js +91 -0
- package/dist/lib/sketches/text-rain.d.ts +3 -0
- package/dist/lib/sketches/text-rain.js +73 -0
- package/dist/lib/sketches/text-scramble.d.ts +6 -0
- package/dist/lib/sketches/text-scramble.js +49 -0
- package/dist/lib/sketches/text-wave.d.ts +3 -0
- package/dist/lib/sketches/text-wave.js +43 -0
- package/dist/lib/sketches/theme-orbit.d.ts +6 -0
- package/dist/lib/sketches/theme-orbit.js +119 -0
- package/dist/lib/sketches/theme-pulse.d.ts +7 -0
- package/dist/lib/sketches/theme-pulse.js +84 -0
- package/dist/lib/sketches/tunnel.d.ts +3 -0
- package/dist/lib/sketches/tunnel.js +28 -0
- package/dist/lib/text/banner.d.ts +5 -0
- package/dist/lib/text/banner.js +35 -0
- package/dist/lib/text/mask.d.ts +40 -0
- package/dist/lib/text/mask.js +143 -0
- package/dist/lib/text/store.d.ts +23 -0
- package/dist/lib/text/store.js +86 -0
- package/dist/lib/ui/card-fields.d.ts +52 -0
- package/dist/lib/ui/card-fields.js +193 -0
- package/dist/lib/ui/fonts.d.ts +56 -0
- package/dist/lib/ui/fonts.js +94 -0
- package/dist/lib/ui/fx.d.ts +42 -0
- package/dist/lib/ui/fx.js +162 -0
- package/dist/lib/ui/icons.d.ts +437 -0
- package/dist/lib/ui/icons.js +314 -0
- package/dist/lib/ui/placeholder.d.ts +11 -0
- package/dist/lib/ui/placeholder.js +65 -0
- package/dist/lib/ui/tokens.d.ts +49 -0
- package/dist/lib/ui/tokens.js +129 -0
- package/dist/lib/ui/useTokens.d.ts +10 -0
- package/dist/lib/ui/useTokens.js +32 -0
- package/package.json +80 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { createPointer, eachCell, hash2, hsv, mix } from "../cells.js";
|
|
2
|
+
import { clamp, scrollState, smooth, span } from "../scroll/store.js";
|
|
3
|
+
import { getTextMask } from "../text/mask.js";
|
|
4
|
+
const BRAND = "PULSO";
|
|
5
|
+
/**
|
|
6
|
+
* Pulso: ciudad nocturna con lluvia, tres capas de edificios con ventanas parpadeantes y
|
|
7
|
+
* un cartel de neón. Al bajar, la cámara sube de la calle a las azoteas y el neón vira de
|
|
8
|
+
* rosa a cian.
|
|
9
|
+
*/
|
|
10
|
+
export function thPulse(t) {
|
|
11
|
+
const ptr = createPointer(t);
|
|
12
|
+
t.draw(() => {
|
|
13
|
+
ptr.update();
|
|
14
|
+
const p = scrollState.p;
|
|
15
|
+
const s = t.secs;
|
|
16
|
+
const { cols, rows } = t.grid;
|
|
17
|
+
const asp = t.grid.cellHeight / t.grid.cellWidth;
|
|
18
|
+
const cam = p * rows * 0.55;
|
|
19
|
+
const hueA = mix(0.88, 0.5, smooth(span(p, 0.35, 0.8))); // rosa → cian
|
|
20
|
+
const signRows = Math.floor(rows * 0.5);
|
|
21
|
+
const sign = getTextMask(BRAND, cols, signRows, asp); // el cartel ocupa la mitad superior
|
|
22
|
+
// altura de edificios por columna y capa (bloques de ancho variable)
|
|
23
|
+
const layers = [
|
|
24
|
+
{ f: 0.4, base: 0.42, amp: 0.3, w: 9, hue: 0.72, v: 0.18 },
|
|
25
|
+
{ f: 0.7, base: 0.34, amp: 0.34, w: 7, hue: 0.78, v: 0.13 },
|
|
26
|
+
{ f: 1.0, base: 0.22, amp: 0.36, w: 5, hue: 0.85, v: 0.08 },
|
|
27
|
+
];
|
|
28
|
+
t.background(4, 2, 12);
|
|
29
|
+
eachCell(t, (_x, _y, i, j) => {
|
|
30
|
+
const sy = rows - 1 - j;
|
|
31
|
+
// capas de cerca a lejos
|
|
32
|
+
for (let k = layers.length - 1; k >= 0; k--) {
|
|
33
|
+
const L = layers[k];
|
|
34
|
+
const bi = Math.floor((i + 1000) / L.w);
|
|
35
|
+
const h = rows * (L.base + hash2(bi, k * 7) * L.amp);
|
|
36
|
+
const top = h - cam * L.f;
|
|
37
|
+
if (sy < top) {
|
|
38
|
+
// ventanas
|
|
39
|
+
const inX = (i % L.w) % 2 === 1;
|
|
40
|
+
const inY = Math.floor(sy + cam * L.f) % 3 === 1;
|
|
41
|
+
const seed = hash2(bi * 13 + (i % L.w), Math.floor(sy + cam * L.f));
|
|
42
|
+
const lit = inX && inY && seed > 0.45 && Math.sin(s * (0.8 + seed * 2) + seed * 40) > -0.4;
|
|
43
|
+
if (lit) {
|
|
44
|
+
t.char("#");
|
|
45
|
+
t.charColor(...hsv(seed > 0.75 ? hueA : 0.12, 0.75, 0.95));
|
|
46
|
+
t.cellColor(...hsv(L.hue, 0.7, L.v * 1.4));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
t.char(sy > top - 1.2 ? "=" : " ");
|
|
50
|
+
t.charColor(...hsv(L.hue, 0.5, L.v + 0.15));
|
|
51
|
+
t.cellColor(...hsv(L.hue, 0.7, L.v * 0.55));
|
|
52
|
+
}
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// cartel de neón en el cielo
|
|
57
|
+
const m = j < signRows ? sign.data[j * cols + i] / 255 : 0;
|
|
58
|
+
if (m > 0.4) {
|
|
59
|
+
const flick = Math.sin(s * 30 + hash2(i, 3) * 6) > 0.92 ? 0.35 : 1;
|
|
60
|
+
t.char("#");
|
|
61
|
+
t.charColor(...hsv(hueA, 0.55, 0.85 * flick));
|
|
62
|
+
t.cellColor(...hsv(hueA, 0.85, 0.25 * flick));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// cielo + lluvia
|
|
66
|
+
const alt = clamp((sy + cam) / rows / 1.6);
|
|
67
|
+
t.cellColor(...hsv(mix(0.8, 0.66, alt), 0.7, mix(0.16, 0.04, alt)));
|
|
68
|
+
const rain = hash2(i, Math.floor(j + s * (9 + hash2(i, 1) * 8)));
|
|
69
|
+
if (rain > 0.965) {
|
|
70
|
+
t.char("|");
|
|
71
|
+
t.charColor(110, 190, 255, 150);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const star = hash2(i + 7, j + Math.floor(cam)) > 0.993 - alt * 0.01;
|
|
75
|
+
if (star && alt > 0.25) {
|
|
76
|
+
t.char(".");
|
|
77
|
+
t.charColor(255, 255, 255, 140);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
t.char(" ");
|
|
81
|
+
});
|
|
82
|
+
void ptr;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { aspect, clamp01, eachCell, hsv, smoothstep } from "../cells.js";
|
|
2
|
+
/** Túnel infinito de tablero de ajedrez con el centro en órbita lenta. */
|
|
3
|
+
export function tunnel(t) {
|
|
4
|
+
const ramp = t.createGlyphRamp(" .:-=+*#%@");
|
|
5
|
+
t.draw(() => {
|
|
6
|
+
const s = t.secs;
|
|
7
|
+
const asp = aspect(t);
|
|
8
|
+
const cx = Math.sin(s * 0.5) * t.grid.cols * 0.06;
|
|
9
|
+
const cy = Math.cos(s * 0.7) * t.grid.rows * 0.06;
|
|
10
|
+
const reach = t.grid.cols * 0.28;
|
|
11
|
+
t.background(0);
|
|
12
|
+
eachCell(t, (x, y) => {
|
|
13
|
+
const dx = x - cx;
|
|
14
|
+
const dy = (y - cy) * asp;
|
|
15
|
+
const r = Math.hypot(dx, dy) + 0.001;
|
|
16
|
+
const a = Math.atan2(dy, dx);
|
|
17
|
+
const u = 14 / r + s * 1.6;
|
|
18
|
+
const v = (a / Math.PI) * 5 + s * 0.25;
|
|
19
|
+
const check = (Math.floor(u) + Math.floor(v)) & 1;
|
|
20
|
+
const fog = smoothstep(0, reach, r);
|
|
21
|
+
// Paleta que oscila entre magenta y azul, con el brillo atenuado hacia el centro
|
|
22
|
+
const hue = 0.72 + 0.16 * Math.sin(u * 0.15 + s * 0.4) + 0.05 * Math.sin(v);
|
|
23
|
+
t.char(ramp.at(fog * (check ? 0.85 : 0.35)));
|
|
24
|
+
t.charColor(...hsv(hue, 0.65, clamp01(fog * (check ? 0.95 : 0.5))));
|
|
25
|
+
t.cellColor(...hsv(hue + 0.08, 0.85, fog * (check ? 0.05 : 0.2)));
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arte de texto de asciify-engine convertido en líneas de caracteres:
|
|
3
|
+
* fuentes FIGlet (`createStudioText`) o la fuente bitmap 7×7 (`asciifyText`).
|
|
4
|
+
* Se carga bajo demanda y se guarda en caché.
|
|
5
|
+
*/
|
|
6
|
+
const cache = new Map();
|
|
7
|
+
function trim(lines) {
|
|
8
|
+
const out = [...lines];
|
|
9
|
+
while (out.length && !out[out.length - 1].trim())
|
|
10
|
+
out.pop();
|
|
11
|
+
while (out.length && !out[0].trim())
|
|
12
|
+
out.shift();
|
|
13
|
+
return out.length ? out : [" "];
|
|
14
|
+
}
|
|
15
|
+
/** `char` y `scale` solo afectan a la fuente Bitmap; las FIGlet traen sus propios caracteres. */
|
|
16
|
+
export function bannerLines(text, font, opts = {}) {
|
|
17
|
+
const char = opts.char || "#";
|
|
18
|
+
const scale = opts.scale || 1;
|
|
19
|
+
const key = `${font}|${char}|${scale}|${text}`;
|
|
20
|
+
let hit = cache.get(key);
|
|
21
|
+
if (!hit) {
|
|
22
|
+
hit =
|
|
23
|
+
font === "Bitmap"
|
|
24
|
+
? import("asciify-engine/core").then((m) => trim(m.asciifyText(text, { char, scale }).split("\n")))
|
|
25
|
+
: import("asciify-engine/studio").then(async (m) => {
|
|
26
|
+
const r = await m.createStudioText(text, font);
|
|
27
|
+
return trim(r.ascii.split("\n"));
|
|
28
|
+
});
|
|
29
|
+
hit = hit.catch(() => [text]);
|
|
30
|
+
cache.set(key, hit);
|
|
31
|
+
if (cache.size > 60)
|
|
32
|
+
cache.delete(cache.keys().next().value);
|
|
33
|
+
}
|
|
34
|
+
return hit;
|
|
35
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Utilidades para convertir texto en formas: ajuste de líneas y máscara por celdas. */
|
|
2
|
+
export declare const BOLD_FONT: (size: number) => string;
|
|
3
|
+
/**
|
|
4
|
+
* Elige el reparto en líneas que permite el mayor tamaño de fuente dentro de w×h
|
|
5
|
+
* y devuelve las líneas con ese tamaño.
|
|
6
|
+
*/
|
|
7
|
+
export declare function fitLines(ctx: CanvasRenderingContext2D, text: string, w: number, h: number): {
|
|
8
|
+
lines: string[];
|
|
9
|
+
size: number;
|
|
10
|
+
};
|
|
11
|
+
/** Dibuja el texto centrado; devuelve el tamaño de fuente usado. */
|
|
12
|
+
export declare function drawFittedText(ctx: CanvasRenderingContext2D, text: string, w: number, h: number, yOffset?: number): number;
|
|
13
|
+
export type TextMask = {
|
|
14
|
+
key: string;
|
|
15
|
+
cols: number;
|
|
16
|
+
rows: number;
|
|
17
|
+
data: Uint8ClampedArray;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Máscara de cobertura (0..255) del texto sobre una rejilla cols×rows. `asp` es la
|
|
21
|
+
* relación alto/ancho de una celda, para que las letras no salgan deformadas.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getTextMask(text: string, cols: number, rows: number, asp?: number): TextMask;
|
|
24
|
+
export type FineMask = {
|
|
25
|
+
key: string;
|
|
26
|
+
cols: number;
|
|
27
|
+
rows: number;
|
|
28
|
+
/** supermuestreo: celdas de máscara por celda de pantalla */
|
|
29
|
+
ss: number;
|
|
30
|
+
w: number;
|
|
31
|
+
h: number;
|
|
32
|
+
data: Uint8ClampedArray;
|
|
33
|
+
/** punto interior de una letra cerca del centro (en celdas de máscara, no finas) */
|
|
34
|
+
focus: {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
/** Máscara con supermuestreo, para hacer zoom sobre el texto sin que se vea a bloques. */
|
|
40
|
+
export declare function getFineMask(text: string, cols: number, rows: number, asp?: number, ss?: number): FineMask;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/** Utilidades para convertir texto en formas: ajuste de líneas y máscara por celdas. */
|
|
2
|
+
/** Divide el texto en `n` líneas equilibradas por palabras. */
|
|
3
|
+
function splitLines(words, n) {
|
|
4
|
+
const total = words.join(" ").length;
|
|
5
|
+
const lines = [];
|
|
6
|
+
let cur = "";
|
|
7
|
+
for (const w of words) {
|
|
8
|
+
const next = cur ? `${cur} ${w}` : w;
|
|
9
|
+
if (cur && next.length > total / n + 1 && lines.length < n - 1) {
|
|
10
|
+
lines.push(cur);
|
|
11
|
+
cur = w;
|
|
12
|
+
}
|
|
13
|
+
else
|
|
14
|
+
cur = next;
|
|
15
|
+
}
|
|
16
|
+
if (cur)
|
|
17
|
+
lines.push(cur);
|
|
18
|
+
return lines;
|
|
19
|
+
}
|
|
20
|
+
export const BOLD_FONT = (size) => `900 ${size}px "Arial Black", Impact, system-ui, sans-serif`;
|
|
21
|
+
/**
|
|
22
|
+
* Elige el reparto en líneas que permite el mayor tamaño de fuente dentro de w×h
|
|
23
|
+
* y devuelve las líneas con ese tamaño.
|
|
24
|
+
*/
|
|
25
|
+
export function fitLines(ctx, text, w, h) {
|
|
26
|
+
const words = text.trim().split(/\s+/).filter(Boolean);
|
|
27
|
+
if (!words.length)
|
|
28
|
+
return { lines: [" "], size: h * 0.5 };
|
|
29
|
+
ctx.font = BOLD_FONT(100);
|
|
30
|
+
let best = { lines: [text], size: 1 };
|
|
31
|
+
for (let n = 1; n <= Math.min(4, words.length); n++) {
|
|
32
|
+
const lines = splitLines(words, n);
|
|
33
|
+
const widest = Math.max(...lines.map((l) => ctx.measureText(l).width)) / 100;
|
|
34
|
+
const size = Math.min((w * 0.92) / widest, (h * 0.8) / (lines.length * 1.08));
|
|
35
|
+
if (size > best.size)
|
|
36
|
+
best = { lines, size };
|
|
37
|
+
}
|
|
38
|
+
return best;
|
|
39
|
+
}
|
|
40
|
+
/** Dibuja el texto centrado; devuelve el tamaño de fuente usado. */
|
|
41
|
+
export function drawFittedText(ctx, text, w, h, yOffset = 0) {
|
|
42
|
+
const { lines, size } = fitLines(ctx, text, w, h);
|
|
43
|
+
ctx.font = BOLD_FONT(size);
|
|
44
|
+
ctx.textAlign = "center";
|
|
45
|
+
ctx.textBaseline = "middle";
|
|
46
|
+
const lh = size * 1.08;
|
|
47
|
+
const top = h / 2 - ((lines.length - 1) * lh) / 2;
|
|
48
|
+
lines.forEach((l, i) => ctx.fillText(l, w / 2, top + i * lh + size * 0.04 + yOffset));
|
|
49
|
+
return size;
|
|
50
|
+
}
|
|
51
|
+
let cached = null;
|
|
52
|
+
let big = null;
|
|
53
|
+
let small = null;
|
|
54
|
+
/**
|
|
55
|
+
* Máscara de cobertura (0..255) del texto sobre una rejilla cols×rows. `asp` es la
|
|
56
|
+
* relación alto/ancho de una celda, para que las letras no salgan deformadas.
|
|
57
|
+
*/
|
|
58
|
+
export function getTextMask(text, cols, rows, asp = 1) {
|
|
59
|
+
const key = `${text}|${cols}|${rows}|${asp.toFixed(2)}`;
|
|
60
|
+
if (cached && cached.key === key)
|
|
61
|
+
return cached;
|
|
62
|
+
const S = 6;
|
|
63
|
+
big ??= document.createElement("canvas");
|
|
64
|
+
small ??= document.createElement("canvas");
|
|
65
|
+
big.width = cols * S;
|
|
66
|
+
big.height = Math.max(2, Math.round(rows * S * asp));
|
|
67
|
+
const bctx = big.getContext("2d");
|
|
68
|
+
bctx.fillStyle = "#000";
|
|
69
|
+
bctx.fillRect(0, 0, big.width, big.height);
|
|
70
|
+
bctx.fillStyle = "#fff";
|
|
71
|
+
drawFittedText(bctx, text, big.width, big.height);
|
|
72
|
+
small.width = cols;
|
|
73
|
+
small.height = rows;
|
|
74
|
+
const sctx = small.getContext("2d", { willReadFrequently: true });
|
|
75
|
+
sctx.imageSmoothingEnabled = true;
|
|
76
|
+
sctx.drawImage(big, 0, 0, cols, rows);
|
|
77
|
+
const px = sctx.getImageData(0, 0, cols, rows).data;
|
|
78
|
+
const data = new Uint8ClampedArray(cols * rows);
|
|
79
|
+
for (let i = 0; i < data.length; i++)
|
|
80
|
+
data[i] = px[i * 4];
|
|
81
|
+
cached = { key, cols, rows, data };
|
|
82
|
+
return cached;
|
|
83
|
+
}
|
|
84
|
+
let fineCached = null;
|
|
85
|
+
let fineBig = null;
|
|
86
|
+
let fineSmall = null;
|
|
87
|
+
/** Máscara con supermuestreo, para hacer zoom sobre el texto sin que se vea a bloques. */
|
|
88
|
+
export function getFineMask(text, cols, rows, asp = 1, ss = 3) {
|
|
89
|
+
const key = `${text}|${cols}|${rows}|${asp.toFixed(2)}|${ss}`;
|
|
90
|
+
if (fineCached && fineCached.key === key)
|
|
91
|
+
return fineCached;
|
|
92
|
+
const w = cols * ss;
|
|
93
|
+
const h = rows * ss;
|
|
94
|
+
fineBig ??= document.createElement("canvas");
|
|
95
|
+
fineSmall ??= document.createElement("canvas");
|
|
96
|
+
fineBig.width = w;
|
|
97
|
+
fineBig.height = Math.max(2, Math.round(h * asp));
|
|
98
|
+
const bctx = fineBig.getContext("2d");
|
|
99
|
+
bctx.fillStyle = "#000";
|
|
100
|
+
bctx.fillRect(0, 0, fineBig.width, fineBig.height);
|
|
101
|
+
bctx.fillStyle = "#fff";
|
|
102
|
+
drawFittedText(bctx, text, fineBig.width, fineBig.height);
|
|
103
|
+
fineSmall.width = w;
|
|
104
|
+
fineSmall.height = h;
|
|
105
|
+
const sctx = fineSmall.getContext("2d", { willReadFrequently: true });
|
|
106
|
+
sctx.drawImage(fineBig, 0, 0, w, h);
|
|
107
|
+
const px = sctx.getImageData(0, 0, w, h).data;
|
|
108
|
+
const data = new Uint8ClampedArray(w * h);
|
|
109
|
+
for (let i = 0; i < data.length; i++)
|
|
110
|
+
data[i] = px[i * 4];
|
|
111
|
+
// Busca, cerca del centro, el punto más "interior" de una letra (mayor distancia a un borde)
|
|
112
|
+
const lit = (x, y) => x >= 0 && y >= 0 && x < w && y < h && data[y * w + x] > 200;
|
|
113
|
+
const solidRadius = (x, y) => {
|
|
114
|
+
let r = 0;
|
|
115
|
+
for (; r < 14; r++) {
|
|
116
|
+
const q = r + 1;
|
|
117
|
+
if (![[q, 0], [-q, 0], [0, q], [0, -q], [q, q], [-q, q], [q, -q], [-q, -q]].every(([dx, dy]) => lit(x + dx, y + dy)))
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
return r;
|
|
121
|
+
};
|
|
122
|
+
let focus = { x: cols / 2, y: rows / 2 };
|
|
123
|
+
let bestR = -1;
|
|
124
|
+
const cx = Math.floor(w / 2);
|
|
125
|
+
const cy = Math.floor(h / 2);
|
|
126
|
+
search: for (let r = 0; r < Math.max(w, h) * 0.35; r += 3) {
|
|
127
|
+
for (let a = 0; a < 360; a += 15) {
|
|
128
|
+
const x = Math.round(cx + Math.cos((a * Math.PI) / 180) * r);
|
|
129
|
+
const y = Math.round(cy + Math.sin((a * Math.PI) / 180) * r * 0.6);
|
|
130
|
+
if (!lit(x, y))
|
|
131
|
+
continue;
|
|
132
|
+
const rad = solidRadius(x, y);
|
|
133
|
+
if (rad > bestR) {
|
|
134
|
+
bestR = rad;
|
|
135
|
+
focus = { x: x / ss, y: y / ss };
|
|
136
|
+
if (rad >= 12)
|
|
137
|
+
break search;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
fineCached = { key, cols, rows, ss, w, h, data, focus };
|
|
142
|
+
return fineCached;
|
|
143
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estado compartido de los demos de texto: el texto que escribe el usuario, la
|
|
3
|
+
* fuente FIGlet y el efecto de hover. Los sketches lo leen en cada fotograma, así
|
|
4
|
+
* que teclear se refleja al instante sin remontar nada.
|
|
5
|
+
*/
|
|
6
|
+
export type TextState = {
|
|
7
|
+
text: string;
|
|
8
|
+
font: string;
|
|
9
|
+
effect: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const DEFAULT_TEXT = "TEXTMODE";
|
|
12
|
+
export declare const textStore: {
|
|
13
|
+
get(): TextState;
|
|
14
|
+
/** Texto efectivo: si el cajón está vacío se usa el de por defecto. */
|
|
15
|
+
text(): string;
|
|
16
|
+
server(): TextState;
|
|
17
|
+
set(patch: Partial<TextState>): void;
|
|
18
|
+
subscribe(fn: () => void): () => void;
|
|
19
|
+
};
|
|
20
|
+
/** Fuentes FIGlet de asciify-engine/studio (+ la fuente bitmap 7×7 del motor). */
|
|
21
|
+
export declare const BANNER_FONTS: readonly ["Bitmap", "Standard", "Slant", "Small", "Big", "Banner", "Block", "Bubble", "Digital", "Doom", "Lean", "Mini", "Script", "Shadow", "Speed", "Starwars", "Stop", "Straight", "Thin", "ThreeD", "Univers", "Wavy"];
|
|
22
|
+
/** Efectos de hover del motor clásico de asciify-engine. */
|
|
23
|
+
export declare const HOVER_EFFECTS: readonly ["spotlight", "magnify", "repel", "glow", "colorShift", "attract", "shatter", "trail", "glitchText"];
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export const DEFAULT_TEXT = "TEXTMODE";
|
|
2
|
+
const DEFAULTS = { text: DEFAULT_TEXT, font: "Standard", effect: "spotlight" };
|
|
3
|
+
const KEY = "fondos-text-v1";
|
|
4
|
+
let state = DEFAULTS;
|
|
5
|
+
let loaded = false;
|
|
6
|
+
const listeners = new Set();
|
|
7
|
+
function load() {
|
|
8
|
+
if (loaded || typeof window === "undefined")
|
|
9
|
+
return;
|
|
10
|
+
loaded = true;
|
|
11
|
+
try {
|
|
12
|
+
const raw = window.localStorage.getItem(KEY);
|
|
13
|
+
if (raw)
|
|
14
|
+
state = { ...DEFAULTS, ...JSON.parse(raw) };
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
/* almacenamiento no disponible: se usan los valores por defecto */
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export const textStore = {
|
|
21
|
+
get() {
|
|
22
|
+
load();
|
|
23
|
+
return state;
|
|
24
|
+
},
|
|
25
|
+
/** Texto efectivo: si el cajón está vacío se usa el de por defecto. */
|
|
26
|
+
text() {
|
|
27
|
+
return textStore.get().text.trim() || DEFAULT_TEXT;
|
|
28
|
+
},
|
|
29
|
+
server() {
|
|
30
|
+
return DEFAULTS;
|
|
31
|
+
},
|
|
32
|
+
set(patch) {
|
|
33
|
+
load();
|
|
34
|
+
state = { ...state, ...patch };
|
|
35
|
+
try {
|
|
36
|
+
window.localStorage.setItem(KEY, JSON.stringify(state));
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
/* ignorar */
|
|
40
|
+
}
|
|
41
|
+
listeners.forEach((fn) => fn());
|
|
42
|
+
},
|
|
43
|
+
subscribe(fn) {
|
|
44
|
+
listeners.add(fn);
|
|
45
|
+
return () => {
|
|
46
|
+
listeners.delete(fn);
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
/** Fuentes FIGlet de asciify-engine/studio (+ la fuente bitmap 7×7 del motor). */
|
|
51
|
+
export const BANNER_FONTS = [
|
|
52
|
+
"Bitmap",
|
|
53
|
+
"Standard",
|
|
54
|
+
"Slant",
|
|
55
|
+
"Small",
|
|
56
|
+
"Big",
|
|
57
|
+
"Banner",
|
|
58
|
+
"Block",
|
|
59
|
+
"Bubble",
|
|
60
|
+
"Digital",
|
|
61
|
+
"Doom",
|
|
62
|
+
"Lean",
|
|
63
|
+
"Mini",
|
|
64
|
+
"Script",
|
|
65
|
+
"Shadow",
|
|
66
|
+
"Speed",
|
|
67
|
+
"Starwars",
|
|
68
|
+
"Stop",
|
|
69
|
+
"Straight",
|
|
70
|
+
"Thin",
|
|
71
|
+
"ThreeD",
|
|
72
|
+
"Univers",
|
|
73
|
+
"Wavy",
|
|
74
|
+
];
|
|
75
|
+
/** Efectos de hover del motor clásico de asciify-engine. */
|
|
76
|
+
export const HOVER_EFFECTS = [
|
|
77
|
+
"spotlight",
|
|
78
|
+
"magnify",
|
|
79
|
+
"repel",
|
|
80
|
+
"glow",
|
|
81
|
+
"colorShift",
|
|
82
|
+
"attract",
|
|
83
|
+
"shatter",
|
|
84
|
+
"trail",
|
|
85
|
+
"glitchText",
|
|
86
|
+
];
|
|
@@ -0,0 +1,52 @@
|
|
|
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 declare const CARD_FIELDS: readonly ["plasma", "waves", "rings", "noise", "rain", "stars", "dither", "topo", "maze", "grid", "halftone", "vortex", "tunnel", "binary", "scan"];
|
|
8
|
+
export type CardField = (typeof CARD_FIELDS)[number];
|
|
9
|
+
/** Rampas de claro a denso. `glyph` usa el carácter de la tarjeta con distinta opacidad. */
|
|
10
|
+
export declare const CARD_CHARSETS: {
|
|
11
|
+
readonly detailed: " .:-=+*#%@";
|
|
12
|
+
readonly standard: " .:-=+*#";
|
|
13
|
+
readonly blocks: " ░▒▓█";
|
|
14
|
+
readonly braille: " ⠁⠃⠇⡇⡏⡟⡿⣿";
|
|
15
|
+
readonly dots: " .·•●";
|
|
16
|
+
readonly lines: " -=≡";
|
|
17
|
+
readonly binary: " 01";
|
|
18
|
+
readonly glyph: "";
|
|
19
|
+
};
|
|
20
|
+
export type CardCharset = keyof typeof CARD_CHARSETS;
|
|
21
|
+
/** mut: discreto · accent: el acento · gradient: de --acc a --acc2 en diagonal · value: --mut en lo bajo, --acc en lo alto */
|
|
22
|
+
export type CardFieldColor = "mut" | "accent" | "gradient" | "value";
|
|
23
|
+
/** reacción al puntero: glow ilumina con el acento · ripple lanza ondas · repel aparta el campo · reveal solo muestra lo cercano */
|
|
24
|
+
export type CardFieldHover = "none" | "glow" | "ripple" | "repel" | "reveal";
|
|
25
|
+
export type FieldOptions = {
|
|
26
|
+
field: CardField;
|
|
27
|
+
charset: CardCharset;
|
|
28
|
+
color: CardFieldColor;
|
|
29
|
+
hover: CardFieldHover;
|
|
30
|
+
/** tamaño de celda (alto de la fuente) en px */
|
|
31
|
+
size: number;
|
|
32
|
+
/** 0..1 */
|
|
33
|
+
opacity: number;
|
|
34
|
+
seed: number;
|
|
35
|
+
glyph: string;
|
|
36
|
+
colors: {
|
|
37
|
+
mut: string;
|
|
38
|
+
acc: string;
|
|
39
|
+
acc2: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Pinta el campo en el canvas. `pointer` (0..1 del tamaño de la tarjeta) y `intensity` (0..1) controlan la reacción
|
|
44
|
+
* al puntero; `t` en segundos.
|
|
45
|
+
*/
|
|
46
|
+
export declare function drawCardField(ctx: CanvasRenderingContext2D, w: number, h: number, t: number, o: FieldOptions, pointer: {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
intensity: number;
|
|
50
|
+
}): void;
|
|
51
|
+
/** Campos que cambian con el tiempo (los demás solo se repintan al mover el puntero o al cambiar de tema). */
|
|
52
|
+
export declare const ANIMATED_FIELDS: ReadonlySet<CardField>;
|