@joewinke/jatui 0.1.31 → 0.2.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/CLAUDE.md +22 -0
- package/dist/actions/attention.d.ts +24 -0
- package/dist/actions/attention.js +94 -0
- package/dist/actions/collapse.js +29 -15
- package/dist/actions/floating.d.ts +53 -0
- package/dist/actions/floating.js +158 -0
- package/dist/actions/listNav.js +137 -108
- package/dist/actions/railNav.js +89 -72
- package/dist/actions/staggerEntrance.d.ts +28 -0
- package/dist/actions/staggerEntrance.js +71 -0
- package/dist/actions/tooltip.d.ts +28 -0
- package/dist/actions/tooltip.js +186 -0
- package/dist/assets/sounds/README.md +47 -0
- package/dist/assets/sounds/error.d.ts +1 -0
- package/dist/assets/sounds/error.js +4 -0
- package/dist/assets/sounds/notify.d.ts +1 -0
- package/dist/assets/sounds/notify.js +4 -0
- package/dist/assets/sounds/pop.d.ts +1 -0
- package/dist/assets/sounds/pop.js +4 -0
- package/dist/assets/sounds/send.d.ts +1 -0
- package/dist/assets/sounds/send.js +4 -0
- package/dist/assets/sounds/success.d.ts +1 -0
- package/dist/assets/sounds/success.js +4 -0
- package/dist/assets/sounds/toggle.d.ts +1 -0
- package/dist/assets/sounds/toggle.js +4 -0
- package/dist/components/AnimatedNumber.svelte +112 -0
- package/dist/components/AnimatedNumber.svelte.d.ts +8 -0
- package/dist/components/Badge.svelte +75 -4
- package/dist/components/Badge.svelte.d.ts +6 -1
- package/dist/components/Button.svelte +196 -21
- package/dist/components/Button.svelte.d.ts +10 -1
- package/dist/components/Carousel.svelte +265 -0
- package/dist/components/Carousel.svelte.d.ts +21 -0
- package/dist/components/ChipInput.svelte +63 -3
- package/dist/components/Collapse.svelte +70 -14
- package/dist/components/Collapse.svelte.d.ts +11 -0
- package/dist/components/ColorSelector.svelte +21 -24
- package/dist/components/CommandPalette.svelte +475 -0
- package/dist/components/CommandPalette.svelte.d.ts +3 -0
- package/dist/components/ContextMenu.svelte +9 -73
- package/dist/components/CopyButton.svelte +156 -0
- package/dist/components/CopyButton.svelte.d.ts +12 -0
- package/dist/components/HoldToConfirm.svelte +183 -0
- package/dist/components/HoldToConfirm.svelte.d.ts +11 -0
- package/dist/components/KeyboardShortcutsOverlay.svelte +54 -8
- package/dist/components/KeyboardShortcutsOverlay.svelte.d.ts +3 -0
- package/dist/components/PasswordMeter.svelte +87 -0
- package/dist/components/PasswordMeter.svelte.d.ts +8 -0
- package/dist/components/PinInput.svelte +186 -0
- package/dist/components/PinInput.svelte.d.ts +13 -0
- package/dist/components/QuantityStepper.svelte +185 -0
- package/dist/components/QuantityStepper.svelte.d.ts +12 -0
- package/dist/components/Skeleton.svelte +123 -0
- package/dist/components/Skeleton.svelte.d.ts +12 -0
- package/dist/components/SpeechForm.svelte +37 -0
- package/dist/components/StatusBadge.svelte +31 -3
- package/dist/components/StatusBadge.svelte.d.ts +0 -5
- package/dist/components/Tabs.svelte +270 -0
- package/dist/components/Tabs.svelte.d.ts +15 -0
- package/dist/components/TextInput.svelte +138 -38
- package/dist/components/TextInput.svelte.d.ts +9 -1
- package/dist/components/VoicePlayer.svelte +51 -0
- package/dist/components/basic/Alert.svelte +36 -0
- package/dist/components/basic/Alert.svelte.d.ts +9 -0
- package/dist/components/basic/Breadcrumb.svelte +27 -0
- package/dist/components/basic/Breadcrumb.svelte.d.ts +11 -0
- package/dist/components/basic/ButtonGroup.svelte +15 -0
- package/dist/components/basic/ButtonGroup.svelte.d.ts +8 -0
- package/dist/components/basic/Checkbox.svelte +85 -0
- package/dist/components/basic/Checkbox.svelte.d.ts +15 -0
- package/dist/components/basic/Empty.svelte +17 -0
- package/dist/components/basic/Empty.svelte.d.ts +8 -0
- package/dist/components/basic/Kbd.svelte +16 -0
- package/dist/components/basic/Kbd.svelte.d.ts +8 -0
- package/dist/components/basic/Pagination.svelte +104 -0
- package/dist/components/basic/Pagination.svelte.d.ts +12 -0
- package/dist/components/basic/RadioGroup.svelte +71 -0
- package/dist/components/basic/RadioGroup.svelte.d.ts +18 -0
- package/dist/components/basic/Separator.svelte +19 -0
- package/dist/components/basic/Separator.svelte.d.ts +8 -0
- package/dist/components/basic/Slider.svelte +72 -0
- package/dist/components/basic/Slider.svelte.d.ts +17 -0
- package/dist/components/basic/Switch.svelte +88 -0
- package/dist/components/basic/Switch.svelte.d.ts +14 -0
- package/dist/components/basic/Toggle.svelte +43 -0
- package/dist/components/basic/Toggle.svelte.d.ts +14 -0
- package/dist/components/graph/GraphCanvas.svelte +103 -0
- package/dist/components/graph/GraphCanvas.svelte.d.ts +22 -0
- package/dist/components/graph/JatuiNode.svelte +128 -0
- package/dist/components/graph/JatuiNode.svelte.d.ts +14 -0
- package/dist/components/graph/theme.d.ts +27 -0
- package/dist/components/graph/theme.js +136 -0
- package/dist/components/markup.js +62 -59
- package/dist/components/messaging/MessageItem.svelte +92 -0
- package/dist/components/messaging/MessageItem.svelte.d.ts +5 -0
- package/dist/components/messaging/TypingIndicator.svelte +63 -0
- package/dist/components/messaging/TypingIndicator.svelte.d.ts +7 -0
- package/dist/components/pipeline/PipelineColumn.svelte +44 -3
- package/dist/components/progress/ProgressBar.svelte +189 -0
- package/dist/components/progress/ProgressBar.svelte.d.ts +17 -0
- package/dist/components/progress/ProgressRing.svelte +138 -0
- package/dist/components/progress/ProgressRing.svelte.d.ts +12 -0
- package/dist/components/progress/Steps.svelte +195 -0
- package/dist/components/progress/Steps.svelte.d.ts +14 -0
- package/dist/components/session-nav/transcriptModel.js +66 -49
- package/dist/components/shell/NavigationMenu.svelte +422 -0
- package/dist/components/shell/NavigationMenu.svelte.d.ts +43 -0
- package/dist/components/shell/Sidebar.svelte +276 -0
- package/dist/components/shell/Sidebar.svelte.d.ts +32 -0
- package/dist/components/shell/SidebarGroup.svelte +180 -0
- package/dist/components/shell/SidebarGroup.svelte.d.ts +19 -0
- package/dist/components/shell/SidebarItem.svelte +170 -0
- package/dist/components/shell/SidebarItem.svelte.d.ts +24 -0
- package/dist/components/shell/shell.d.ts +30 -0
- package/dist/components/shell/shell.js +65 -0
- package/dist/components/table/DataTable.svelte +364 -0
- package/dist/components/table/DataTable.svelte.d.ts +4 -0
- package/dist/components/table/flexRender.d.ts +31 -0
- package/dist/components/table/flexRender.js +32 -0
- package/dist/components/table/types.d.ts +28 -0
- package/dist/components/table/types.js +1 -0
- package/dist/components/toast/ToastHost.svelte +21 -0
- package/dist/components/toast/ToastHost.svelte.d.ts +3 -0
- package/dist/components/toast/ToastItem.svelte +287 -0
- package/dist/components/toast/ToastItem.svelte.d.ts +9 -0
- package/dist/data/emojis.js +4 -4
- package/dist/dnd/autoScroll.js +12 -10
- package/dist/dnd/createDndBoard.svelte.js +110 -76
- package/dist/dnd/createDndBoard.test.js +161 -85
- package/dist/dnd/draggable.js +23 -15
- package/dist/dnd/dropTarget.js +29 -15
- package/dist/dnd/index.d.ts +0 -1
- package/dist/dnd/index.js +0 -1
- package/dist/dnd/types.d.ts +0 -9
- package/dist/dnd/types.js +14 -2
- package/dist/index.d.ts +60 -6
- package/dist/index.js +73 -6
- package/dist/showcase/AnimatedBeam.svelte +183 -0
- package/dist/showcase/AnimatedBeam.svelte.d.ts +26 -0
- package/dist/showcase/AuroraDrift.svelte +74 -0
- package/dist/showcase/AuroraDrift.svelte.d.ts +9 -0
- package/dist/showcase/BentoCard.svelte +50 -0
- package/dist/showcase/BentoCard.svelte.d.ts +14 -0
- package/dist/showcase/BentoGrid.svelte +43 -0
- package/dist/showcase/BentoGrid.svelte.d.ts +12 -0
- package/dist/showcase/BorderBeam.svelte +79 -0
- package/dist/showcase/BorderBeam.svelte.d.ts +12 -0
- package/dist/showcase/ClipWipe.svelte +82 -0
- package/dist/showcase/ClipWipe.svelte.d.ts +12 -0
- package/dist/showcase/Confetti.svelte +71 -0
- package/dist/showcase/Confetti.svelte.d.ts +10 -0
- package/dist/showcase/CursorSpotlight.svelte +85 -0
- package/dist/showcase/CursorSpotlight.svelte.d.ts +9 -0
- package/dist/showcase/DeviceMock.svelte +186 -0
- package/dist/showcase/DeviceMock.svelte.d.ts +11 -0
- package/dist/showcase/Dock.svelte +123 -0
- package/dist/showcase/Dock.svelte.d.ts +17 -0
- package/dist/showcase/FlipCard.svelte +103 -0
- package/dist/showcase/FlipCard.svelte.d.ts +10 -0
- package/dist/showcase/FocusReveal.svelte +83 -0
- package/dist/showcase/FocusReveal.svelte.d.ts +11 -0
- package/dist/showcase/Globe.svelte +202 -0
- package/dist/showcase/Globe.svelte.d.ts +16 -0
- package/dist/showcase/KenBurns.svelte +105 -0
- package/dist/showcase/KenBurns.svelte.d.ts +13 -0
- package/dist/showcase/Marquee.svelte +89 -0
- package/dist/showcase/Marquee.svelte.d.ts +9 -0
- package/dist/showcase/ParallaxTilt.svelte +98 -0
- package/dist/showcase/ParallaxTilt.svelte.d.ts +10 -0
- package/dist/showcase/ScrambleText.svelte +98 -0
- package/dist/showcase/ScrambleText.svelte.d.ts +11 -0
- package/dist/showcase/ShineSweep.svelte +81 -0
- package/dist/showcase/ShineSweep.svelte.d.ts +9 -0
- package/dist/showcase/Terminal.svelte +230 -0
- package/dist/showcase/Terminal.svelte.d.ts +18 -0
- package/dist/showcase/TextSplitReveal.svelte +146 -0
- package/dist/showcase/TextSplitReveal.svelte.d.ts +13 -0
- package/dist/showcase/TextWave.svelte +55 -0
- package/dist/showcase/TextWave.svelte.d.ts +8 -0
- package/dist/showcase/TypewriterText.svelte +130 -0
- package/dist/showcase/TypewriterText.svelte.d.ts +9 -0
- package/dist/showcase/backdrop/GrainGradient.svelte +126 -0
- package/dist/showcase/backdrop/GrainGradient.svelte.d.ts +23 -0
- package/dist/showcase/backdrop/MeshGradient.svelte +104 -0
- package/dist/showcase/backdrop/MeshGradient.svelte.d.ts +20 -0
- package/dist/showcase/backdrop/Metaballs.svelte +116 -0
- package/dist/showcase/backdrop/Metaballs.svelte.d.ts +18 -0
- package/dist/showcase/backdrop/NeuroNoise.svelte +115 -0
- package/dist/showcase/backdrop/NeuroNoise.svelte.d.ts +20 -0
- package/dist/showcase/backdrop/ShowcaseBackdrop.svelte +48 -0
- package/dist/showcase/backdrop/ShowcaseBackdrop.svelte.d.ts +12 -0
- package/dist/showcase/generative/GenerativeBackdrop.svelte +234 -0
- package/dist/showcase/generative/GenerativeBackdrop.svelte.d.ts +9 -0
- package/dist/showcase/generative/intent.d.ts +7 -0
- package/dist/showcase/generative/intent.js +67 -0
- package/dist/showcase/generative/manifest.d.ts +9 -0
- package/dist/showcase/generative/manifest.js +97 -0
- package/dist/showcase/generative/types.d.ts +48 -0
- package/dist/showcase/generative/types.js +8 -0
- package/dist/showcase/index.d.ts +36 -0
- package/dist/showcase/index.js +46 -0
- package/dist/showcase/scroll/SmoothScroll.svelte +49 -0
- package/dist/showcase/scroll/SmoothScroll.svelte.d.ts +12 -0
- package/dist/showcase/scroll/scrollProgress.d.ts +24 -0
- package/dist/showcase/scroll/scrollProgress.js +65 -0
- package/dist/showcase/scroll/scrollReveal.d.ts +30 -0
- package/dist/showcase/scroll/scrollReveal.js +70 -0
- package/dist/stores/commandPalette.svelte.d.ts +24 -0
- package/dist/stores/commandPalette.svelte.js +82 -0
- package/dist/stores/confirmDialog.svelte.js +5 -5
- package/dist/stores/inputDialog.svelte.js +5 -5
- package/dist/stores/toast.svelte.d.ts +28 -0
- package/dist/stores/toast.svelte.js +33 -0
- package/dist/styles/motion.css +46 -0
- package/dist/styles/tokens.css +31 -0
- package/dist/transitions/glide.d.ts +31 -0
- package/dist/transitions/glide.js +58 -0
- package/dist/types/booking.js +4 -4
- package/dist/types/comments.js +2 -2
- package/dist/types/messaging.js +3 -3
- package/dist/types/pipeline.js +2 -2
- package/dist/utils/currency.js +4 -2
- package/dist/utils/daisyuiColors.js +27 -25
- package/dist/utils/dateFormatters.d.ts +20 -0
- package/dist/utils/dateFormatters.js +65 -44
- package/dist/utils/googleMapsLoader.js +100 -46
- package/dist/utils/mentionParser.js +30 -30
- package/dist/utils/phone.js +27 -21
- package/dist/utils/phoneFormat.js +9 -9
- package/dist/utils/sound.d.ts +6 -0
- package/dist/utils/sound.js +113 -0
- package/dist/utils/splitText.d.ts +25 -0
- package/dist/utils/splitText.js +94 -0
- package/dist/utils/taskUtils.js +1 -1
- package/dist/utils/themeWipe.d.ts +21 -0
- package/dist/utils/themeWipe.js +94 -0
- package/dist/utils/viewTransition.d.ts +23 -0
- package/dist/utils/viewTransition.js +75 -0
- package/package.json +56 -4
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount, onDestroy } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
phrases: string[];
|
|
6
|
+
cursor?: boolean;
|
|
7
|
+
loop?: boolean;
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let {
|
|
12
|
+
phrases,
|
|
13
|
+
cursor = true,
|
|
14
|
+
loop = false,
|
|
15
|
+
class: className = ''
|
|
16
|
+
}: Props = $props();
|
|
17
|
+
|
|
18
|
+
let displayed = $state('');
|
|
19
|
+
let caretVisible = $state(true);
|
|
20
|
+
let reducedMotion = $state(false);
|
|
21
|
+
let done = $state(false);
|
|
22
|
+
|
|
23
|
+
let timeout: ReturnType<typeof setTimeout> | null = null;
|
|
24
|
+
|
|
25
|
+
function schedule(fn: () => void, ms: number) {
|
|
26
|
+
timeout = setTimeout(fn, ms);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function clearScheduled() {
|
|
30
|
+
if (timeout !== null) {
|
|
31
|
+
clearTimeout(timeout);
|
|
32
|
+
timeout = null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function run(phraseIdx: number, charIdx: number, deleting: boolean) {
|
|
37
|
+
if (reducedMotion) return;
|
|
38
|
+
|
|
39
|
+
const phrase = phrases[phraseIdx];
|
|
40
|
+
|
|
41
|
+
if (!deleting) {
|
|
42
|
+
// Typing
|
|
43
|
+
if (charIdx <= phrase.length) {
|
|
44
|
+
displayed = phrase.slice(0, charIdx);
|
|
45
|
+
if (charIdx < phrase.length) {
|
|
46
|
+
schedule(() => run(phraseIdx, charIdx + 1, false), 55);
|
|
47
|
+
} else {
|
|
48
|
+
// Finished typing full phrase
|
|
49
|
+
schedule(() => {
|
|
50
|
+
// Pause at full phrase
|
|
51
|
+
const isLast = phraseIdx === phrases.length - 1;
|
|
52
|
+
if (!loop && isLast) {
|
|
53
|
+
done = true;
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
// Start deleting
|
|
57
|
+
schedule(() => run(phraseIdx, phrase.length, true), 0);
|
|
58
|
+
}, 1100);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
// Deleting
|
|
63
|
+
if (charIdx >= 0) {
|
|
64
|
+
displayed = phrase.slice(0, charIdx);
|
|
65
|
+
if (charIdx > 0) {
|
|
66
|
+
schedule(() => run(phraseIdx, charIdx - 1, true), 30);
|
|
67
|
+
} else {
|
|
68
|
+
// Finished deleting — pause then move to next phrase
|
|
69
|
+
const nextIdx = (phraseIdx + 1) % phrases.length;
|
|
70
|
+
schedule(() => run(nextIdx, 0, false), 320);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
onMount(() => {
|
|
77
|
+
reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
78
|
+
if (reducedMotion) {
|
|
79
|
+
displayed = phrases[0] ?? '';
|
|
80
|
+
} else {
|
|
81
|
+
run(0, 0, false);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
onDestroy(() => {
|
|
86
|
+
clearScheduled();
|
|
87
|
+
});
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<span class="typewriter {className}" class:no-caret={!cursor || done || reducedMotion}>
|
|
91
|
+
{displayed}<span class="caret" aria-hidden="true"></span>
|
|
92
|
+
</span>
|
|
93
|
+
|
|
94
|
+
<style>
|
|
95
|
+
.typewriter {
|
|
96
|
+
display: inline;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.caret::after {
|
|
100
|
+
content: '';
|
|
101
|
+
display: inline-block;
|
|
102
|
+
width: 2px;
|
|
103
|
+
height: 1.1em;
|
|
104
|
+
background: currentColor;
|
|
105
|
+
margin-left: 1px;
|
|
106
|
+
vertical-align: text-bottom;
|
|
107
|
+
animation: caret-blink 1s steps(1) infinite;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.no-caret .caret::after {
|
|
111
|
+
display: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@keyframes caret-blink {
|
|
115
|
+
0%,
|
|
116
|
+
100% {
|
|
117
|
+
opacity: 1;
|
|
118
|
+
}
|
|
119
|
+
50% {
|
|
120
|
+
opacity: 0;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@media (prefers-reduced-motion: reduce) {
|
|
125
|
+
.caret::after {
|
|
126
|
+
animation: none;
|
|
127
|
+
display: none;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
phrases: string[];
|
|
3
|
+
cursor?: boolean;
|
|
4
|
+
loop?: boolean;
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const TypewriterText: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type TypewriterText = ReturnType<typeof TypewriterText>;
|
|
9
|
+
export default TypewriterText;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import {
|
|
4
|
+
ShaderMount,
|
|
5
|
+
grainGradientFragmentShader,
|
|
6
|
+
GrainGradientShapes,
|
|
7
|
+
getShaderColorFromString,
|
|
8
|
+
getShaderNoiseTexture
|
|
9
|
+
} from '@paper-design/shaders';
|
|
10
|
+
import type { GrainGradientShape } from '@paper-design/shaders';
|
|
11
|
+
import ShowcaseBackdrop from './ShowcaseBackdrop.svelte';
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
/** Up to 7 gradient colors. Defaults to DaisyUI primary/secondary/accent. */
|
|
15
|
+
colors?: string[];
|
|
16
|
+
/** Background fill color. Defaults to DaisyUI base-100. */
|
|
17
|
+
colorBack?: string;
|
|
18
|
+
/** Animation speed multiplier. 0 = static. Default 0.3. */
|
|
19
|
+
speed?: number;
|
|
20
|
+
/** Color transition sharpness 0–1 (0 = hard, 1 = smooth). Default 0.6. */
|
|
21
|
+
softness?: number;
|
|
22
|
+
/** Distortion between color bands 0–1. Default 0.3. */
|
|
23
|
+
intensity?: number;
|
|
24
|
+
/** Grainy noise overlay 0–1. Default 0.35. */
|
|
25
|
+
noise?: number;
|
|
26
|
+
/** Shape type for the gradient pattern. Default 'blob'. */
|
|
27
|
+
shape?: GrainGradientShape;
|
|
28
|
+
class?: string;
|
|
29
|
+
children?: Snippet;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let {
|
|
33
|
+
colors,
|
|
34
|
+
colorBack,
|
|
35
|
+
speed = 0.3,
|
|
36
|
+
softness = 0.6,
|
|
37
|
+
intensity = 0.3,
|
|
38
|
+
noise = 0.35,
|
|
39
|
+
shape = 'blob',
|
|
40
|
+
class: className = '',
|
|
41
|
+
children
|
|
42
|
+
}: Props = $props();
|
|
43
|
+
|
|
44
|
+
let shaderMount: ShaderMount | undefined;
|
|
45
|
+
let observer: IntersectionObserver | undefined;
|
|
46
|
+
let pausedSpeed = speed;
|
|
47
|
+
|
|
48
|
+
function resolveColors(el: HTMLElement): { colors: string[]; colorBack: string } {
|
|
49
|
+
const style = getComputedStyle(el);
|
|
50
|
+
return {
|
|
51
|
+
colors: colors && colors.length > 0
|
|
52
|
+
? colors
|
|
53
|
+
: [
|
|
54
|
+
style.getPropertyValue('--color-primary').trim() || '#6c3ce1',
|
|
55
|
+
style.getPropertyValue('--color-secondary').trim() || '#e168b4',
|
|
56
|
+
style.getPropertyValue('--color-accent').trim() || '#0ea5e9'
|
|
57
|
+
],
|
|
58
|
+
colorBack: colorBack || style.getPropertyValue('--color-base-100').trim() || '#ffffff'
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function buildUniforms(el: HTMLElement) {
|
|
63
|
+
const resolved = resolveColors(el);
|
|
64
|
+
return {
|
|
65
|
+
u_colorBack: getShaderColorFromString(resolved.colorBack),
|
|
66
|
+
u_colors: resolved.colors.map(getShaderColorFromString),
|
|
67
|
+
u_colorsCount: resolved.colors.length,
|
|
68
|
+
u_softness: softness,
|
|
69
|
+
u_intensity: intensity,
|
|
70
|
+
u_noise: noise,
|
|
71
|
+
u_shape: GrainGradientShapes[shape],
|
|
72
|
+
u_noiseTexture: getShaderNoiseTexture()
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function handleMount(el: HTMLElement) {
|
|
77
|
+
const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
78
|
+
const effectiveSpeed = prefersReduced ? 0 : speed;
|
|
79
|
+
|
|
80
|
+
shaderMount = new ShaderMount(
|
|
81
|
+
el,
|
|
82
|
+
grainGradientFragmentShader,
|
|
83
|
+
buildUniforms(el),
|
|
84
|
+
undefined,
|
|
85
|
+
effectiveSpeed,
|
|
86
|
+
prefersReduced ? 1 : 0,
|
|
87
|
+
2,
|
|
88
|
+
1920 * 1080 * 4,
|
|
89
|
+
['u_noiseTexture']
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
observer = new IntersectionObserver(
|
|
93
|
+
(entries) => {
|
|
94
|
+
for (const entry of entries) {
|
|
95
|
+
if (!shaderMount) return;
|
|
96
|
+
if (entry.isIntersecting) {
|
|
97
|
+
shaderMount.setSpeed(pausedSpeed);
|
|
98
|
+
} else {
|
|
99
|
+
pausedSpeed = speed;
|
|
100
|
+
shaderMount.setSpeed(0);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{ threshold: 0 }
|
|
105
|
+
);
|
|
106
|
+
observer.observe(el);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function handleDispose() {
|
|
110
|
+
observer?.disconnect();
|
|
111
|
+
shaderMount?.dispose();
|
|
112
|
+
shaderMount = undefined;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
$effect(() => {
|
|
116
|
+
if (!shaderMount) return;
|
|
117
|
+
const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
118
|
+
pausedSpeed = prefersReduced ? 0 : speed;
|
|
119
|
+
shaderMount.setSpeed(pausedSpeed);
|
|
120
|
+
});
|
|
121
|
+
</script>
|
|
122
|
+
|
|
123
|
+
<!-- powered by @paper-design/shaders (Apache-2.0) -->
|
|
124
|
+
<ShowcaseBackdrop class={className} onmount={handleMount} ondispose={handleDispose}>
|
|
125
|
+
{#if children}{@render children()}{/if}
|
|
126
|
+
</ShowcaseBackdrop>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { GrainGradientShape } from '@paper-design/shaders';
|
|
3
|
+
interface Props {
|
|
4
|
+
/** Up to 7 gradient colors. Defaults to DaisyUI primary/secondary/accent. */
|
|
5
|
+
colors?: string[];
|
|
6
|
+
/** Background fill color. Defaults to DaisyUI base-100. */
|
|
7
|
+
colorBack?: string;
|
|
8
|
+
/** Animation speed multiplier. 0 = static. Default 0.3. */
|
|
9
|
+
speed?: number;
|
|
10
|
+
/** Color transition sharpness 0–1 (0 = hard, 1 = smooth). Default 0.6. */
|
|
11
|
+
softness?: number;
|
|
12
|
+
/** Distortion between color bands 0–1. Default 0.3. */
|
|
13
|
+
intensity?: number;
|
|
14
|
+
/** Grainy noise overlay 0–1. Default 0.35. */
|
|
15
|
+
noise?: number;
|
|
16
|
+
/** Shape type for the gradient pattern. Default 'blob'. */
|
|
17
|
+
shape?: GrainGradientShape;
|
|
18
|
+
class?: string;
|
|
19
|
+
children?: Snippet;
|
|
20
|
+
}
|
|
21
|
+
declare const GrainGradient: import("svelte").Component<Props, {}, "">;
|
|
22
|
+
type GrainGradient = ReturnType<typeof GrainGradient>;
|
|
23
|
+
export default GrainGradient;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import {
|
|
4
|
+
ShaderMount,
|
|
5
|
+
meshGradientFragmentShader,
|
|
6
|
+
getShaderColorFromString
|
|
7
|
+
} from '@paper-design/shaders';
|
|
8
|
+
import ShowcaseBackdrop from './ShowcaseBackdrop.svelte';
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
/** Up to 10 colors. Defaults to DaisyUI primary/secondary/accent. */
|
|
12
|
+
colors?: string[];
|
|
13
|
+
/** Animation speed multiplier. 0 = static. Default 0.4. */
|
|
14
|
+
speed?: number;
|
|
15
|
+
/** Noise distortion strength 0–1. Default 0.3. */
|
|
16
|
+
distortion?: number;
|
|
17
|
+
/** Vortex distortion 0–1. Default 0. */
|
|
18
|
+
swirl?: number;
|
|
19
|
+
/** Grain mixed into shape edges 0–1. Default 0. */
|
|
20
|
+
grainMixer?: number;
|
|
21
|
+
/** Post-processing grain overlay 0–1. Default 0. */
|
|
22
|
+
grainOverlay?: number;
|
|
23
|
+
class?: string;
|
|
24
|
+
children?: Snippet;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let {
|
|
28
|
+
colors,
|
|
29
|
+
speed = 0.4,
|
|
30
|
+
distortion = 0.3,
|
|
31
|
+
swirl = 0,
|
|
32
|
+
grainMixer = 0,
|
|
33
|
+
grainOverlay = 0,
|
|
34
|
+
class: className = '',
|
|
35
|
+
children
|
|
36
|
+
}: Props = $props();
|
|
37
|
+
|
|
38
|
+
let shaderMount: ShaderMount | undefined;
|
|
39
|
+
let observer: IntersectionObserver | undefined;
|
|
40
|
+
let pausedSpeed = speed;
|
|
41
|
+
|
|
42
|
+
function resolveColors(el: HTMLElement): string[] {
|
|
43
|
+
if (colors && colors.length > 0) return colors;
|
|
44
|
+
const style = getComputedStyle(el);
|
|
45
|
+
return [
|
|
46
|
+
style.getPropertyValue('--color-primary').trim() || '#6c3ce1',
|
|
47
|
+
style.getPropertyValue('--color-secondary').trim() || '#e168b4',
|
|
48
|
+
style.getPropertyValue('--color-accent').trim() || '#0ea5e9'
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function buildUniforms(el: HTMLElement) {
|
|
53
|
+
const resolved = resolveColors(el);
|
|
54
|
+
return {
|
|
55
|
+
u_colors: resolved.map(getShaderColorFromString),
|
|
56
|
+
u_colorsCount: resolved.length,
|
|
57
|
+
u_distortion: distortion,
|
|
58
|
+
u_swirl: swirl,
|
|
59
|
+
u_grainMixer: grainMixer,
|
|
60
|
+
u_grainOverlay: grainOverlay
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function handleMount(el: HTMLElement) {
|
|
65
|
+
const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
66
|
+
const effectiveSpeed = prefersReduced ? 0 : speed;
|
|
67
|
+
|
|
68
|
+
shaderMount = new ShaderMount(el, meshGradientFragmentShader, buildUniforms(el), undefined, effectiveSpeed, prefersReduced ? 1 : 0, 2, 1920 * 1080 * 4);
|
|
69
|
+
|
|
70
|
+
observer = new IntersectionObserver(
|
|
71
|
+
(entries) => {
|
|
72
|
+
for (const entry of entries) {
|
|
73
|
+
if (!shaderMount) return;
|
|
74
|
+
if (entry.isIntersecting) {
|
|
75
|
+
shaderMount.setSpeed(pausedSpeed);
|
|
76
|
+
} else {
|
|
77
|
+
pausedSpeed = speed;
|
|
78
|
+
shaderMount.setSpeed(0);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{ threshold: 0 }
|
|
83
|
+
);
|
|
84
|
+
observer.observe(el);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function handleDispose() {
|
|
88
|
+
observer?.disconnect();
|
|
89
|
+
shaderMount?.dispose();
|
|
90
|
+
shaderMount = undefined;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
$effect(() => {
|
|
94
|
+
if (!shaderMount) return;
|
|
95
|
+
const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
96
|
+
pausedSpeed = prefersReduced ? 0 : speed;
|
|
97
|
+
shaderMount.setSpeed(pausedSpeed);
|
|
98
|
+
});
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
<!-- powered by @paper-design/shaders (Apache-2.0) -->
|
|
102
|
+
<ShowcaseBackdrop class={className} onmount={handleMount} ondispose={handleDispose}>
|
|
103
|
+
{#if children}{@render children()}{/if}
|
|
104
|
+
</ShowcaseBackdrop>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Up to 10 colors. Defaults to DaisyUI primary/secondary/accent. */
|
|
4
|
+
colors?: string[];
|
|
5
|
+
/** Animation speed multiplier. 0 = static. Default 0.4. */
|
|
6
|
+
speed?: number;
|
|
7
|
+
/** Noise distortion strength 0–1. Default 0.3. */
|
|
8
|
+
distortion?: number;
|
|
9
|
+
/** Vortex distortion 0–1. Default 0. */
|
|
10
|
+
swirl?: number;
|
|
11
|
+
/** Grain mixed into shape edges 0–1. Default 0. */
|
|
12
|
+
grainMixer?: number;
|
|
13
|
+
/** Post-processing grain overlay 0–1. Default 0. */
|
|
14
|
+
grainOverlay?: number;
|
|
15
|
+
class?: string;
|
|
16
|
+
children?: Snippet;
|
|
17
|
+
}
|
|
18
|
+
declare const MeshGradient: import("svelte").Component<Props, {}, "">;
|
|
19
|
+
type MeshGradient = ReturnType<typeof MeshGradient>;
|
|
20
|
+
export default MeshGradient;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import {
|
|
4
|
+
ShaderMount,
|
|
5
|
+
metaballsFragmentShader,
|
|
6
|
+
getShaderColorFromString,
|
|
7
|
+
getShaderNoiseTexture
|
|
8
|
+
} from '@paper-design/shaders';
|
|
9
|
+
import ShowcaseBackdrop from './ShowcaseBackdrop.svelte';
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
/** Up to 8 blob colors. Defaults to DaisyUI primary/secondary/accent. */
|
|
13
|
+
colors?: string[];
|
|
14
|
+
/** Background fill color. Defaults to DaisyUI base-100. */
|
|
15
|
+
colorBack?: string;
|
|
16
|
+
/** Animation speed multiplier. 0 = static. Default 0.35. */
|
|
17
|
+
speed?: number;
|
|
18
|
+
/** Number of balls 1–20. Default 6. */
|
|
19
|
+
count?: number;
|
|
20
|
+
/** Ball size 0–1. Default 0.45. */
|
|
21
|
+
size?: number;
|
|
22
|
+
class?: string;
|
|
23
|
+
children?: Snippet;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let {
|
|
27
|
+
colors,
|
|
28
|
+
colorBack,
|
|
29
|
+
speed = 0.35,
|
|
30
|
+
count = 6,
|
|
31
|
+
size = 0.45,
|
|
32
|
+
class: className = '',
|
|
33
|
+
children
|
|
34
|
+
}: Props = $props();
|
|
35
|
+
|
|
36
|
+
let shaderMount: ShaderMount | undefined;
|
|
37
|
+
let observer: IntersectionObserver | undefined;
|
|
38
|
+
let pausedSpeed = speed;
|
|
39
|
+
|
|
40
|
+
function resolveColors(el: HTMLElement): { colors: string[]; colorBack: string } {
|
|
41
|
+
const style = getComputedStyle(el);
|
|
42
|
+
return {
|
|
43
|
+
colors: colors && colors.length > 0
|
|
44
|
+
? colors
|
|
45
|
+
: [
|
|
46
|
+
style.getPropertyValue('--color-primary').trim() || '#6c3ce1',
|
|
47
|
+
style.getPropertyValue('--color-secondary').trim() || '#e168b4',
|
|
48
|
+
style.getPropertyValue('--color-accent').trim() || '#0ea5e9'
|
|
49
|
+
],
|
|
50
|
+
colorBack: colorBack || style.getPropertyValue('--color-base-100').trim() || '#ffffff'
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function buildUniforms(el: HTMLElement) {
|
|
55
|
+
const resolved = resolveColors(el);
|
|
56
|
+
return {
|
|
57
|
+
u_colorBack: getShaderColorFromString(resolved.colorBack),
|
|
58
|
+
u_colors: resolved.colors.map(getShaderColorFromString),
|
|
59
|
+
u_colorsCount: resolved.colors.length,
|
|
60
|
+
u_count: count,
|
|
61
|
+
u_size: size,
|
|
62
|
+
u_noiseTexture: getShaderNoiseTexture()
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function handleMount(el: HTMLElement) {
|
|
67
|
+
const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
68
|
+
const effectiveSpeed = prefersReduced ? 0 : speed;
|
|
69
|
+
|
|
70
|
+
shaderMount = new ShaderMount(
|
|
71
|
+
el,
|
|
72
|
+
metaballsFragmentShader,
|
|
73
|
+
buildUniforms(el),
|
|
74
|
+
undefined,
|
|
75
|
+
effectiveSpeed,
|
|
76
|
+
prefersReduced ? 1 : 0,
|
|
77
|
+
2,
|
|
78
|
+
1920 * 1080 * 4,
|
|
79
|
+
['u_noiseTexture']
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
observer = new IntersectionObserver(
|
|
83
|
+
(entries) => {
|
|
84
|
+
for (const entry of entries) {
|
|
85
|
+
if (!shaderMount) return;
|
|
86
|
+
if (entry.isIntersecting) {
|
|
87
|
+
shaderMount.setSpeed(pausedSpeed);
|
|
88
|
+
} else {
|
|
89
|
+
pausedSpeed = speed;
|
|
90
|
+
shaderMount.setSpeed(0);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{ threshold: 0 }
|
|
95
|
+
);
|
|
96
|
+
observer.observe(el);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function handleDispose() {
|
|
100
|
+
observer?.disconnect();
|
|
101
|
+
shaderMount?.dispose();
|
|
102
|
+
shaderMount = undefined;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
$effect(() => {
|
|
106
|
+
if (!shaderMount) return;
|
|
107
|
+
const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
108
|
+
pausedSpeed = prefersReduced ? 0 : speed;
|
|
109
|
+
shaderMount.setSpeed(pausedSpeed);
|
|
110
|
+
});
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<!-- powered by @paper-design/shaders (Apache-2.0) -->
|
|
114
|
+
<ShowcaseBackdrop class={className} onmount={handleMount} ondispose={handleDispose}>
|
|
115
|
+
{#if children}{@render children()}{/if}
|
|
116
|
+
</ShowcaseBackdrop>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Up to 8 blob colors. Defaults to DaisyUI primary/secondary/accent. */
|
|
4
|
+
colors?: string[];
|
|
5
|
+
/** Background fill color. Defaults to DaisyUI base-100. */
|
|
6
|
+
colorBack?: string;
|
|
7
|
+
/** Animation speed multiplier. 0 = static. Default 0.35. */
|
|
8
|
+
speed?: number;
|
|
9
|
+
/** Number of balls 1–20. Default 6. */
|
|
10
|
+
count?: number;
|
|
11
|
+
/** Ball size 0–1. Default 0.45. */
|
|
12
|
+
size?: number;
|
|
13
|
+
class?: string;
|
|
14
|
+
children?: Snippet;
|
|
15
|
+
}
|
|
16
|
+
declare const Metaballs: import("svelte").Component<Props, {}, "">;
|
|
17
|
+
type Metaballs = ReturnType<typeof Metaballs>;
|
|
18
|
+
export default Metaballs;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import {
|
|
4
|
+
ShaderMount,
|
|
5
|
+
neuroNoiseFragmentShader,
|
|
6
|
+
getShaderColorFromString
|
|
7
|
+
} from '@paper-design/shaders';
|
|
8
|
+
import ShowcaseBackdrop from './ShowcaseBackdrop.svelte';
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
/** Highlight color. Defaults to DaisyUI primary. */
|
|
12
|
+
colorFront?: string;
|
|
13
|
+
/** Main web color. Defaults to DaisyUI secondary. */
|
|
14
|
+
colorMid?: string;
|
|
15
|
+
/** Background color. Defaults to DaisyUI base-100. */
|
|
16
|
+
colorBack?: string;
|
|
17
|
+
/** Animation speed multiplier. 0 = static. Default 0.3. */
|
|
18
|
+
speed?: number;
|
|
19
|
+
/** Luminosity of crossing points 0–1. Default 0.5. */
|
|
20
|
+
brightness?: number;
|
|
21
|
+
/** Sharpness of bright-dark transition 0–1. Default 0.4. */
|
|
22
|
+
contrast?: number;
|
|
23
|
+
class?: string;
|
|
24
|
+
children?: Snippet;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let {
|
|
28
|
+
colorFront,
|
|
29
|
+
colorMid,
|
|
30
|
+
colorBack,
|
|
31
|
+
speed = 0.3,
|
|
32
|
+
brightness = 0.5,
|
|
33
|
+
contrast = 0.4,
|
|
34
|
+
class: className = '',
|
|
35
|
+
children
|
|
36
|
+
}: Props = $props();
|
|
37
|
+
|
|
38
|
+
let shaderMount: ShaderMount | undefined;
|
|
39
|
+
let observer: IntersectionObserver | undefined;
|
|
40
|
+
let pausedSpeed = speed;
|
|
41
|
+
|
|
42
|
+
function resolveColors(el: HTMLElement): {
|
|
43
|
+
colorFront: string;
|
|
44
|
+
colorMid: string;
|
|
45
|
+
colorBack: string;
|
|
46
|
+
} {
|
|
47
|
+
const style = getComputedStyle(el);
|
|
48
|
+
return {
|
|
49
|
+
colorFront: colorFront || style.getPropertyValue('--color-primary').trim() || '#6c3ce1',
|
|
50
|
+
colorMid: colorMid || style.getPropertyValue('--color-secondary').trim() || '#e168b4',
|
|
51
|
+
colorBack: colorBack || style.getPropertyValue('--color-base-100').trim() || '#ffffff'
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function buildUniforms(el: HTMLElement) {
|
|
56
|
+
const resolved = resolveColors(el);
|
|
57
|
+
return {
|
|
58
|
+
u_colorFront: getShaderColorFromString(resolved.colorFront),
|
|
59
|
+
u_colorMid: getShaderColorFromString(resolved.colorMid),
|
|
60
|
+
u_colorBack: getShaderColorFromString(resolved.colorBack),
|
|
61
|
+
u_brightness: brightness,
|
|
62
|
+
u_contrast: contrast
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function handleMount(el: HTMLElement) {
|
|
67
|
+
const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
68
|
+
const effectiveSpeed = prefersReduced ? 0 : speed;
|
|
69
|
+
|
|
70
|
+
shaderMount = new ShaderMount(
|
|
71
|
+
el,
|
|
72
|
+
neuroNoiseFragmentShader,
|
|
73
|
+
buildUniforms(el),
|
|
74
|
+
undefined,
|
|
75
|
+
effectiveSpeed,
|
|
76
|
+
prefersReduced ? 1 : 0,
|
|
77
|
+
2,
|
|
78
|
+
1920 * 1080 * 4
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
observer = new IntersectionObserver(
|
|
82
|
+
(entries) => {
|
|
83
|
+
for (const entry of entries) {
|
|
84
|
+
if (!shaderMount) return;
|
|
85
|
+
if (entry.isIntersecting) {
|
|
86
|
+
shaderMount.setSpeed(pausedSpeed);
|
|
87
|
+
} else {
|
|
88
|
+
pausedSpeed = speed;
|
|
89
|
+
shaderMount.setSpeed(0);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{ threshold: 0 }
|
|
94
|
+
);
|
|
95
|
+
observer.observe(el);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function handleDispose() {
|
|
99
|
+
observer?.disconnect();
|
|
100
|
+
shaderMount?.dispose();
|
|
101
|
+
shaderMount = undefined;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
$effect(() => {
|
|
105
|
+
if (!shaderMount) return;
|
|
106
|
+
const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
107
|
+
pausedSpeed = prefersReduced ? 0 : speed;
|
|
108
|
+
shaderMount.setSpeed(pausedSpeed);
|
|
109
|
+
});
|
|
110
|
+
</script>
|
|
111
|
+
|
|
112
|
+
<!-- powered by @paper-design/shaders (Apache-2.0) -->
|
|
113
|
+
<ShowcaseBackdrop class={className} onmount={handleMount} ondispose={handleDispose}>
|
|
114
|
+
{#if children}{@render children()}{/if}
|
|
115
|
+
</ShowcaseBackdrop>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Highlight color. Defaults to DaisyUI primary. */
|
|
4
|
+
colorFront?: string;
|
|
5
|
+
/** Main web color. Defaults to DaisyUI secondary. */
|
|
6
|
+
colorMid?: string;
|
|
7
|
+
/** Background color. Defaults to DaisyUI base-100. */
|
|
8
|
+
colorBack?: string;
|
|
9
|
+
/** Animation speed multiplier. 0 = static. Default 0.3. */
|
|
10
|
+
speed?: number;
|
|
11
|
+
/** Luminosity of crossing points 0–1. Default 0.5. */
|
|
12
|
+
brightness?: number;
|
|
13
|
+
/** Sharpness of bright-dark transition 0–1. Default 0.4. */
|
|
14
|
+
contrast?: number;
|
|
15
|
+
class?: string;
|
|
16
|
+
children?: Snippet;
|
|
17
|
+
}
|
|
18
|
+
declare const NeuroNoise: import("svelte").Component<Props, {}, "">;
|
|
19
|
+
type NeuroNoise = ReturnType<typeof NeuroNoise>;
|
|
20
|
+
export default NeuroNoise;
|