@joewinke/jatui 0.1.33 → 0.2.1
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/floating.d.ts +53 -0
- package/dist/actions/floating.js +158 -0
- 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/carousel/index.d.ts +1 -0
- package/dist/carousel/index.js +2 -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/index.d.ts +4 -0
- package/dist/components/graph/index.js +4 -0
- package/dist/components/graph/theme.d.ts +27 -0
- package/dist/components/graph/theme.js +136 -0
- 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/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/index.d.ts +3 -0
- package/dist/components/table/index.js +3 -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/index.d.ts +51 -0
- package/dist/index.js +64 -0
- 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/backdrop/index.d.ts +5 -0
- package/dist/showcase/backdrop/index.js +6 -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/globe/index.d.ts +1 -0
- package/dist/showcase/globe/index.js +2 -0
- package/dist/showcase/index.d.ts +25 -0
- package/dist/showcase/index.js +39 -0
- package/dist/showcase/scroll/SmoothScroll.svelte +49 -0
- package/dist/showcase/scroll/SmoothScroll.svelte.d.ts +12 -0
- package/dist/showcase/scroll/index.d.ts +5 -0
- package/dist/showcase/scroll/index.js +4 -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/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/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/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 +78 -4
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
duration?: number;
|
|
6
|
+
class?: string;
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { duration = 12, class: className = '', children }: Props = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
class="aurora-drift-root {className}"
|
|
15
|
+
style="--aurora-duration: {duration}s;"
|
|
16
|
+
>
|
|
17
|
+
<div class="aurora-drift-backdrop" aria-hidden="true"></div>
|
|
18
|
+
<div class="aurora-drift-content">
|
|
19
|
+
{#if children}
|
|
20
|
+
{@render children()}
|
|
21
|
+
{/if}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<style>
|
|
26
|
+
.aurora-drift-root {
|
|
27
|
+
position: relative;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.aurora-drift-backdrop {
|
|
32
|
+
position: absolute;
|
|
33
|
+
inset: -40%;
|
|
34
|
+
background:
|
|
35
|
+
radial-gradient(
|
|
36
|
+
40% 50% at 30% 38%,
|
|
37
|
+
color-mix(in srgb, oklch(var(--p)) 30%, transparent),
|
|
38
|
+
transparent 60%
|
|
39
|
+
),
|
|
40
|
+
radial-gradient(
|
|
41
|
+
45% 55% at 72% 62%,
|
|
42
|
+
color-mix(in srgb, oklch(var(--s)) 30%, transparent),
|
|
43
|
+
transparent 60%
|
|
44
|
+
),
|
|
45
|
+
radial-gradient(
|
|
46
|
+
40% 50% at 50% 82%,
|
|
47
|
+
color-mix(in srgb, oklch(var(--a)) 25%, transparent),
|
|
48
|
+
transparent 60%
|
|
49
|
+
);
|
|
50
|
+
filter: blur(16px);
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
animation: aurora-drift var(--aurora-duration) ease-in-out infinite alternate;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.aurora-drift-content {
|
|
56
|
+
position: relative;
|
|
57
|
+
z-index: 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@keyframes aurora-drift {
|
|
61
|
+
0% {
|
|
62
|
+
transform: translate(-6%, -4%) rotate(0deg) scale(1.1);
|
|
63
|
+
}
|
|
64
|
+
100% {
|
|
65
|
+
transform: translate(6%, 4%) rotate(8deg) scale(1.3);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@media (prefers-reduced-motion: reduce) {
|
|
70
|
+
.aurora-drift-backdrop {
|
|
71
|
+
animation: none;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
duration?: number;
|
|
4
|
+
class?: string;
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
}
|
|
7
|
+
declare const AuroraDrift: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type AuroraDrift = ReturnType<typeof AuroraDrift>;
|
|
9
|
+
export default AuroraDrift;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// pattern after magicui.design (MIT)
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
/** Column span (default 1) */
|
|
7
|
+
colSpan?: number;
|
|
8
|
+
/** Row span (default 1) */
|
|
9
|
+
rowSpan?: number;
|
|
10
|
+
/** Hover tint color (CSS color). No tint if omitted (house rule: no shadows). */
|
|
11
|
+
hoverTint?: string;
|
|
12
|
+
class?: string;
|
|
13
|
+
children: Snippet;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let { colSpan = 1, rowSpan = 1, hoverTint, class: className = '', children }: Props = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<div
|
|
20
|
+
class="bento-card {className}"
|
|
21
|
+
role="listitem"
|
|
22
|
+
style="
|
|
23
|
+
grid-column: span {colSpan};
|
|
24
|
+
grid-row: span {rowSpan};
|
|
25
|
+
{hoverTint ? `--bento-tint: ${hoverTint};` : ''}
|
|
26
|
+
"
|
|
27
|
+
>
|
|
28
|
+
{@render children()}
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<style>
|
|
32
|
+
.bento-card {
|
|
33
|
+
position: relative;
|
|
34
|
+
border-radius: var(--jatui-radius-box);
|
|
35
|
+
border: var(--jatui-border-w) solid oklch(var(--bc) / 0.1);
|
|
36
|
+
background: oklch(var(--b1));
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
transition: background var(--motion-fast) var(--motion-glide);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.bento-card:hover {
|
|
42
|
+
background: var(--bento-tint, oklch(var(--b2, var(--b1))));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (prefers-reduced-motion: reduce) {
|
|
46
|
+
.bento-card {
|
|
47
|
+
transition: none;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Column span (default 1) */
|
|
4
|
+
colSpan?: number;
|
|
5
|
+
/** Row span (default 1) */
|
|
6
|
+
rowSpan?: number;
|
|
7
|
+
/** Hover tint color (CSS color). No tint if omitted (house rule: no shadows). */
|
|
8
|
+
hoverTint?: string;
|
|
9
|
+
class?: string;
|
|
10
|
+
children: Snippet;
|
|
11
|
+
}
|
|
12
|
+
declare const BentoCard: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type BentoCard = ReturnType<typeof BentoCard>;
|
|
14
|
+
export default BentoCard;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// pattern after magicui.design (MIT)
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
/** Number of columns in the grid (default 3) */
|
|
7
|
+
cols?: number;
|
|
8
|
+
/** Gap between cells */
|
|
9
|
+
gap?: string;
|
|
10
|
+
class?: string;
|
|
11
|
+
children: Snippet;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let { cols = 3, gap = '1rem', class: className = '', children }: Props = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div
|
|
18
|
+
class="bento-grid {className}"
|
|
19
|
+
style="--bento-cols: {cols}; --bento-gap: {gap};"
|
|
20
|
+
role="list"
|
|
21
|
+
>
|
|
22
|
+
{@render children()}
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<style>
|
|
26
|
+
.bento-grid {
|
|
27
|
+
display: grid;
|
|
28
|
+
grid-template-columns: repeat(var(--bento-cols), 1fr);
|
|
29
|
+
gap: var(--bento-gap);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@media (max-width: 768px) {
|
|
33
|
+
.bento-grid {
|
|
34
|
+
grid-template-columns: 1fr;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (min-width: 769px) and (max-width: 1024px) {
|
|
39
|
+
.bento-grid {
|
|
40
|
+
grid-template-columns: repeat(min(var(--bento-cols), 2), 1fr);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Number of columns in the grid (default 3) */
|
|
4
|
+
cols?: number;
|
|
5
|
+
/** Gap between cells */
|
|
6
|
+
gap?: string;
|
|
7
|
+
class?: string;
|
|
8
|
+
children: Snippet;
|
|
9
|
+
}
|
|
10
|
+
declare const BentoGrid: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type BentoGrid = ReturnType<typeof BentoGrid>;
|
|
12
|
+
export default BentoGrid;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
duration?: number;
|
|
6
|
+
colorFrom?: string;
|
|
7
|
+
colorTo?: string;
|
|
8
|
+
borderRadius?: string;
|
|
9
|
+
class?: string;
|
|
10
|
+
children?: Snippet;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
duration = 3,
|
|
15
|
+
colorFrom = 'oklch(var(--p))',
|
|
16
|
+
colorTo = 'oklch(var(--a))',
|
|
17
|
+
borderRadius = '0.75rem',
|
|
18
|
+
class: className = '',
|
|
19
|
+
children
|
|
20
|
+
}: Props = $props();
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<div
|
|
24
|
+
class="border-beam-root {className}"
|
|
25
|
+
style="--beam-duration: {duration}s; --beam-color-from: {colorFrom}; --beam-color-to: {colorTo}; --beam-radius: {borderRadius};"
|
|
26
|
+
>
|
|
27
|
+
<div class="border-beam-inner">
|
|
28
|
+
{#if children}
|
|
29
|
+
{@render children()}
|
|
30
|
+
{/if}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<style>
|
|
35
|
+
.border-beam-root {
|
|
36
|
+
position: relative;
|
|
37
|
+
padding: 1.5px;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
border-radius: var(--beam-radius);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.border-beam-root::before {
|
|
43
|
+
content: '';
|
|
44
|
+
position: absolute;
|
|
45
|
+
top: 50%;
|
|
46
|
+
left: 50%;
|
|
47
|
+
width: 200%;
|
|
48
|
+
height: 200%;
|
|
49
|
+
transform: translate(-50%, -50%);
|
|
50
|
+
background: conic-gradient(
|
|
51
|
+
from 0deg,
|
|
52
|
+
transparent 0 72%,
|
|
53
|
+
var(--beam-color-from) 84%,
|
|
54
|
+
var(--beam-color-to) 90%,
|
|
55
|
+
transparent 96% 100%
|
|
56
|
+
);
|
|
57
|
+
animation: beam-spin var(--beam-duration) linear infinite;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.border-beam-inner {
|
|
61
|
+
position: relative;
|
|
62
|
+
z-index: 1;
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
border-radius: calc(var(--beam-radius) - 1.5px);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@keyframes beam-spin {
|
|
69
|
+
to {
|
|
70
|
+
transform: translate(-50%, -50%) rotate(1turn);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@media (prefers-reduced-motion: reduce) {
|
|
75
|
+
.border-beam-root::before {
|
|
76
|
+
animation: none;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
duration?: number;
|
|
4
|
+
colorFrom?: string;
|
|
5
|
+
colorTo?: string;
|
|
6
|
+
borderRadius?: string;
|
|
7
|
+
class?: string;
|
|
8
|
+
children?: Snippet;
|
|
9
|
+
}
|
|
10
|
+
declare const BorderBeam: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type BorderBeam = ReturnType<typeof BorderBeam>;
|
|
12
|
+
export default BorderBeam;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte';
|
|
3
|
+
|
|
4
|
+
type Direction = 'left' | 'right' | 'top' | 'bottom';
|
|
5
|
+
type TriggerMode = 'mount' | 'intersect';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
direction?: Direction;
|
|
9
|
+
triggerMode?: TriggerMode;
|
|
10
|
+
duration?: number;
|
|
11
|
+
class?: string;
|
|
12
|
+
children: import('svelte').Snippet;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
direction = 'left',
|
|
17
|
+
triggerMode = 'mount',
|
|
18
|
+
duration = 500,
|
|
19
|
+
class: className = '',
|
|
20
|
+
children,
|
|
21
|
+
}: Props = $props();
|
|
22
|
+
|
|
23
|
+
const startClip: Record<Direction, string> = {
|
|
24
|
+
left: 'inset(0 100% 0 0)',
|
|
25
|
+
right: 'inset(0 0 0 100%)',
|
|
26
|
+
top: 'inset(100% 0 0 0)',
|
|
27
|
+
bottom: 'inset(0 0 100% 0)',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const endClip = 'inset(0 0 0 0)';
|
|
31
|
+
|
|
32
|
+
let prefersReducedMotion = false;
|
|
33
|
+
let revealed = $state(false);
|
|
34
|
+
let el: HTMLDivElement | undefined = $state();
|
|
35
|
+
|
|
36
|
+
function trigger() {
|
|
37
|
+
revealed = true;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
onMount(() => {
|
|
41
|
+
prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
42
|
+
|
|
43
|
+
if (prefersReducedMotion) {
|
|
44
|
+
revealed = true;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (triggerMode === 'mount') {
|
|
49
|
+
// Defer one frame so the initial clip-path is painted before transitioning
|
|
50
|
+
requestAnimationFrame(() => {
|
|
51
|
+
trigger();
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
const observer = new IntersectionObserver(
|
|
55
|
+
(entries) => {
|
|
56
|
+
for (const entry of entries) {
|
|
57
|
+
if (entry.intersectionRatio >= 0.5) {
|
|
58
|
+
trigger();
|
|
59
|
+
observer.disconnect();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{ threshold: 0.5 }
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
if (el) {
|
|
67
|
+
observer.observe(el);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return () => observer.disconnect();
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<div
|
|
76
|
+
bind:this={el}
|
|
77
|
+
class={className}
|
|
78
|
+
style:clip-path={prefersReducedMotion ? endClip : revealed ? endClip : startClip[direction]}
|
|
79
|
+
style:transition={prefersReducedMotion ? 'none' : `clip-path ${duration}ms var(--motion-glide)`}
|
|
80
|
+
>
|
|
81
|
+
{@render children()}
|
|
82
|
+
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type Direction = 'left' | 'right' | 'top' | 'bottom';
|
|
2
|
+
type TriggerMode = 'mount' | 'intersect';
|
|
3
|
+
interface Props {
|
|
4
|
+
direction?: Direction;
|
|
5
|
+
triggerMode?: TriggerMode;
|
|
6
|
+
duration?: number;
|
|
7
|
+
class?: string;
|
|
8
|
+
children: import('svelte').Snippet;
|
|
9
|
+
}
|
|
10
|
+
declare const ClipWipe: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type ClipWipe = ReturnType<typeof ClipWipe>;
|
|
12
|
+
export default ClipWipe;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
count?: number;
|
|
4
|
+
colors?: string[];
|
|
5
|
+
class?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
count = 24,
|
|
10
|
+
colors = ['#FF8A00', '#5B8DEF', '#4CD08A', '#EDE9E0'],
|
|
11
|
+
class: className = ''
|
|
12
|
+
}: Props = $props();
|
|
13
|
+
|
|
14
|
+
let container: HTMLElement;
|
|
15
|
+
|
|
16
|
+
export function fire() {
|
|
17
|
+
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return;
|
|
18
|
+
|
|
19
|
+
for (let i = 0; i < count; i++) {
|
|
20
|
+
const angle = (2 * Math.PI * i) / count + (Math.random() - 0.5) * 0.4;
|
|
21
|
+
const dist = 55 + Math.random() * 55;
|
|
22
|
+
const tx = `calc(-50% + ${Math.cos(angle) * dist}px)`;
|
|
23
|
+
const ty = `calc(-50% + ${Math.sin(angle) * dist}px)`;
|
|
24
|
+
const rot = `${Math.floor(Math.random() * 360)}deg`;
|
|
25
|
+
const color = colors[Math.floor(Math.random() * colors.length)];
|
|
26
|
+
|
|
27
|
+
const el = document.createElement('span');
|
|
28
|
+
el.style.setProperty('--tx', tx);
|
|
29
|
+
el.style.setProperty('--ty', ty);
|
|
30
|
+
el.style.setProperty('--rot', rot);
|
|
31
|
+
el.style.position = 'absolute';
|
|
32
|
+
el.style.top = '50%';
|
|
33
|
+
el.style.left = '50%';
|
|
34
|
+
el.style.width = '7px';
|
|
35
|
+
el.style.height = '7px';
|
|
36
|
+
el.style.borderRadius = '2px';
|
|
37
|
+
el.style.backgroundColor = color;
|
|
38
|
+
el.style.pointerEvents = 'none';
|
|
39
|
+
el.style.animation = `confetti-fly 0.9s var(--motion-glide, ease-out) forwards`;
|
|
40
|
+
|
|
41
|
+
container.appendChild(el);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
const particles = container.querySelectorAll('span');
|
|
46
|
+
particles.forEach((p) => p.remove());
|
|
47
|
+
}, 950);
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<div bind:this={container} class="confetti-root {className}"></div>
|
|
52
|
+
|
|
53
|
+
<style>
|
|
54
|
+
.confetti-root {
|
|
55
|
+
position: relative;
|
|
56
|
+
overflow: visible;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@keyframes confetti-fly {
|
|
60
|
+
0% {
|
|
61
|
+
translate: -50% -50%;
|
|
62
|
+
rotate: 0deg;
|
|
63
|
+
opacity: 1;
|
|
64
|
+
}
|
|
65
|
+
100% {
|
|
66
|
+
translate: var(--tx) var(--ty);
|
|
67
|
+
rotate: var(--rot);
|
|
68
|
+
opacity: 0;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { onMount } from 'svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
size?: number;
|
|
7
|
+
class?: string;
|
|
8
|
+
children?: Snippet;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { size = 220, class: className = '', children }: Props = $props();
|
|
12
|
+
|
|
13
|
+
let el = $state<HTMLDivElement | null>(null);
|
|
14
|
+
let glowX = $state(-300);
|
|
15
|
+
let glowY = $state(-300);
|
|
16
|
+
let hasFinePointer = $state(false);
|
|
17
|
+
|
|
18
|
+
onMount(() => {
|
|
19
|
+
hasFinePointer = window.matchMedia('(pointer: fine)').matches;
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
function onMouseMove(e: MouseEvent) {
|
|
23
|
+
if (!el || !hasFinePointer) return;
|
|
24
|
+
const rect = el.getBoundingClientRect();
|
|
25
|
+
glowX = e.clientX - rect.left;
|
|
26
|
+
glowY = e.clientY - rect.top;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function onMouseLeave() {
|
|
30
|
+
glowX = -300;
|
|
31
|
+
glowY = -300;
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<div
|
|
36
|
+
bind:this={el}
|
|
37
|
+
class="cursor-spotlight-root {className}"
|
|
38
|
+
onmousemove={onMouseMove}
|
|
39
|
+
onmouseleave={onMouseLeave}
|
|
40
|
+
role="presentation"
|
|
41
|
+
>
|
|
42
|
+
{#if hasFinePointer}
|
|
43
|
+
<div
|
|
44
|
+
class="cursor-spotlight-glow"
|
|
45
|
+
style="left: {glowX}px; top: {glowY}px; width: {size}px; height: {size}px;"
|
|
46
|
+
aria-hidden="true"
|
|
47
|
+
></div>
|
|
48
|
+
{/if}
|
|
49
|
+
<div class="cursor-spotlight-content">
|
|
50
|
+
{#if children}
|
|
51
|
+
{@render children()}
|
|
52
|
+
{/if}
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<style>
|
|
57
|
+
.cursor-spotlight-root {
|
|
58
|
+
position: relative;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.cursor-spotlight-glow {
|
|
63
|
+
position: absolute;
|
|
64
|
+
border-radius: 50%;
|
|
65
|
+
background: radial-gradient(
|
|
66
|
+
circle,
|
|
67
|
+
color-mix(in srgb, oklch(var(--p)) 18%, transparent),
|
|
68
|
+
transparent 70%
|
|
69
|
+
);
|
|
70
|
+
transform: translate(-50%, -50%);
|
|
71
|
+
pointer-events: none;
|
|
72
|
+
transition: opacity 0.3s ease;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.cursor-spotlight-content {
|
|
76
|
+
position: relative;
|
|
77
|
+
z-index: 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@media (prefers-reduced-motion: reduce) {
|
|
81
|
+
.cursor-spotlight-glow {
|
|
82
|
+
display: none;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
size?: number;
|
|
4
|
+
class?: string;
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
}
|
|
7
|
+
declare const CursorSpotlight: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type CursorSpotlight = ReturnType<typeof CursorSpotlight>;
|
|
9
|
+
export default CursorSpotlight;
|