@gfazioli/mantine-scene 2.0.0 → 2.1.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/README.md +6 -2
- package/dist/cjs/Scene.cjs +74 -5
- package/dist/cjs/Scene.cjs.map +1 -1
- package/dist/cjs/Scene.module.css.cjs +1 -1
- package/dist/cjs/SceneConfetti/SceneConfetti.cjs +152 -0
- package/dist/cjs/SceneConfetti/SceneConfetti.cjs.map +1 -0
- package/dist/cjs/SceneDotGrid/SceneDotGrid.cjs +38 -9
- package/dist/cjs/SceneDotGrid/SceneDotGrid.cjs.map +1 -1
- package/dist/cjs/SceneGlow/SceneGlow.cjs +43 -10
- package/dist/cjs/SceneGlow/SceneGlow.cjs.map +1 -1
- package/dist/cjs/SceneRain/SceneRain.cjs +111 -0
- package/dist/cjs/SceneRain/SceneRain.cjs.map +1 -0
- package/dist/cjs/SceneSnow/SceneSnow.cjs.map +1 -1
- package/dist/cjs/SceneStarField/SceneStarField.cjs.map +1 -1
- package/dist/cjs/SceneStarWarp/SceneStarWarp.cjs.map +1 -1
- package/dist/cjs/SceneWaves/SceneWaves.cjs +119 -0
- package/dist/cjs/SceneWaves/SceneWaves.cjs.map +1 -0
- package/dist/cjs/use-responsive-value.cjs.map +1 -1
- package/dist/esm/Scene.mjs +74 -5
- package/dist/esm/Scene.mjs.map +1 -1
- package/dist/esm/Scene.module.css.mjs +1 -1
- package/dist/esm/SceneConfetti/SceneConfetti.mjs +150 -0
- package/dist/esm/SceneConfetti/SceneConfetti.mjs.map +1 -0
- package/dist/esm/SceneDotGrid/SceneDotGrid.mjs +39 -10
- package/dist/esm/SceneDotGrid/SceneDotGrid.mjs.map +1 -1
- package/dist/esm/SceneGlow/SceneGlow.mjs +44 -11
- package/dist/esm/SceneGlow/SceneGlow.mjs.map +1 -1
- package/dist/esm/SceneRain/SceneRain.mjs +109 -0
- package/dist/esm/SceneRain/SceneRain.mjs.map +1 -0
- package/dist/esm/SceneSnow/SceneSnow.mjs.map +1 -1
- package/dist/esm/SceneStarField/SceneStarField.mjs.map +1 -1
- package/dist/esm/SceneStarWarp/SceneStarWarp.mjs.map +1 -1
- package/dist/esm/SceneWaves/SceneWaves.mjs +117 -0
- package/dist/esm/SceneWaves/SceneWaves.mjs.map +1 -0
- package/dist/esm/use-responsive-value.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.layer.css +1 -1
- package/dist/types/Scene.d.ts +25 -1
- package/dist/types/SceneConfetti/SceneConfetti.d.ts +68 -0
- package/dist/types/SceneDotGrid/SceneDotGrid.d.ts +3 -4
- package/dist/types/SceneGlow/SceneGlow.d.ts +4 -5
- package/dist/types/SceneRain/SceneRain.d.ts +74 -0
- package/dist/types/SceneSnow/SceneSnow.d.ts +2 -3
- package/dist/types/SceneStarField/SceneStarField.d.ts +2 -3
- package/dist/types/SceneStarWarp/SceneStarWarp.d.ts +2 -3
- package/dist/types/SceneWaves/SceneWaves.d.ts +62 -0
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/use-responsive-value.d.ts +13 -7
- package/package.json +9 -3
package/dist/types/Scene.d.ts
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BoxProps, Factory, StylesApiProps } from '@mantine/core';
|
|
3
|
+
import { type SceneMousePosition } from './Scene.context';
|
|
3
4
|
import { SceneAurora } from './SceneAurora/SceneAurora';
|
|
5
|
+
import { SceneConfetti } from './SceneConfetti/SceneConfetti';
|
|
4
6
|
import { SceneDotGrid } from './SceneDotGrid/SceneDotGrid';
|
|
5
7
|
import { SceneGlow } from './SceneGlow/SceneGlow';
|
|
6
8
|
import { SceneGradient } from './SceneGradient/SceneGradient';
|
|
7
9
|
import { SceneMesh } from './SceneMesh/SceneMesh';
|
|
8
10
|
import { SceneNoise } from './SceneNoise/SceneNoise';
|
|
11
|
+
import { SceneRain } from './SceneRain/SceneRain';
|
|
9
12
|
import { SceneShootingStar } from './SceneShootingStar/SceneShootingStar';
|
|
10
13
|
import { SceneSnow } from './SceneSnow/SceneSnow';
|
|
11
14
|
import { SceneStarField } from './SceneStarField/SceneStarField';
|
|
12
15
|
import { SceneStarWarp } from './SceneStarWarp/SceneStarWarp';
|
|
13
|
-
|
|
16
|
+
import { SceneWaves } from './SceneWaves/SceneWaves';
|
|
17
|
+
export type SceneStylesNames = 'root' | 'gradient' | 'dotGrid' | 'glow' | 'mesh' | 'noise' | 'starField' | 'shootingStar' | 'snow' | 'rain' | 'confetti' | 'aurora' | 'starWarp' | 'waves';
|
|
14
18
|
export type SceneCssVariables = {
|
|
15
19
|
root: '--scene-z-index';
|
|
16
20
|
};
|
|
@@ -35,6 +39,17 @@ export interface SceneBaseProps {
|
|
|
35
39
|
* @default 0.12
|
|
36
40
|
*/
|
|
37
41
|
interactiveEasing?: number;
|
|
42
|
+
/** Pause all child animations (and mouse-tracking rAF loop) when the scene is outside the viewport. Uses `IntersectionObserver`. Resumes automatically when the scene re-enters the viewport.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
lazy?: boolean;
|
|
46
|
+
/** Threshold (0-1) used by `IntersectionObserver` when `lazy` is true. A value of 0 pauses as soon as the scene leaves the viewport; higher values require more of the scene to be visible before resuming.
|
|
47
|
+
* @default 0
|
|
48
|
+
*/
|
|
49
|
+
lazyThreshold?: number;
|
|
50
|
+
/** Called on every smoothed mouse-position update when `interactive` is true. Receives `{ x, y }` as percentages (0-100) relative to the scene container. Useful for coordinating external UI with the scene's tracking.
|
|
51
|
+
*/
|
|
52
|
+
onMousePosition?: (position: SceneMousePosition) => void;
|
|
38
53
|
/** Scene content (compound sub-components: Scene.Gradient, Scene.Glow, etc.) */
|
|
39
54
|
children?: React.ReactNode;
|
|
40
55
|
}
|
|
@@ -54,8 +69,11 @@ export type SceneFactory = Factory<{
|
|
|
54
69
|
StarField: typeof SceneStarField;
|
|
55
70
|
ShootingStar: typeof SceneShootingStar;
|
|
56
71
|
Snow: typeof SceneSnow;
|
|
72
|
+
Rain: typeof SceneRain;
|
|
73
|
+
Confetti: typeof SceneConfetti;
|
|
57
74
|
Aurora: typeof SceneAurora;
|
|
58
75
|
StarWarp: typeof SceneStarWarp;
|
|
76
|
+
Waves: typeof SceneWaves;
|
|
59
77
|
};
|
|
60
78
|
}>;
|
|
61
79
|
export declare const Scene: import("@mantine/core").MantineComponent<{
|
|
@@ -72,8 +90,11 @@ export declare const Scene: import("@mantine/core").MantineComponent<{
|
|
|
72
90
|
StarField: typeof SceneStarField;
|
|
73
91
|
ShootingStar: typeof SceneShootingStar;
|
|
74
92
|
Snow: typeof SceneSnow;
|
|
93
|
+
Rain: typeof SceneRain;
|
|
94
|
+
Confetti: typeof SceneConfetti;
|
|
75
95
|
Aurora: typeof SceneAurora;
|
|
76
96
|
StarWarp: typeof SceneStarWarp;
|
|
97
|
+
Waves: typeof SceneWaves;
|
|
77
98
|
};
|
|
78
99
|
}>;
|
|
79
100
|
export type { SceneGradientProps } from './SceneGradient/SceneGradient';
|
|
@@ -84,5 +105,8 @@ export type { SceneNoiseProps } from './SceneNoise/SceneNoise';
|
|
|
84
105
|
export type { SceneStarFieldProps } from './SceneStarField/SceneStarField';
|
|
85
106
|
export type { SceneShootingStarProps } from './SceneShootingStar/SceneShootingStar';
|
|
86
107
|
export type { SceneSnowProps } from './SceneSnow/SceneSnow';
|
|
108
|
+
export type { SceneRainProps } from './SceneRain/SceneRain';
|
|
109
|
+
export type { SceneConfettiOrigin, SceneConfettiProps, SceneConfettiShape, } from './SceneConfetti/SceneConfetti';
|
|
87
110
|
export type { SceneAuroraProps } from './SceneAurora/SceneAurora';
|
|
88
111
|
export type { SceneStarWarpProps } from './SceneStarWarp/SceneStarWarp';
|
|
112
|
+
export type { SceneWavesDirection, SceneWavesPosition, SceneWavesProps, } from './SceneWaves/SceneWaves';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MantineColor, type StyleProp } from '@mantine/core';
|
|
3
|
+
export type SceneConfettiShape = 'rectangle' | 'circle' | 'triangle';
|
|
4
|
+
export type SceneConfettiOrigin = 'top' | 'bottom';
|
|
5
|
+
export interface SceneConfettiProps {
|
|
6
|
+
/** Number of confetti pieces (recommended max ~200) — accepts a responsive object like `{ base: 60, md: 120 }`
|
|
7
|
+
* @default 80
|
|
8
|
+
*/
|
|
9
|
+
count?: StyleProp<number>;
|
|
10
|
+
/** Color palette — each piece is randomly assigned one of these colors. Accepts Mantine theme colors.
|
|
11
|
+
* @default ['red', 'orange', 'yellow', 'green', 'blue', 'violet', 'pink']
|
|
12
|
+
*/
|
|
13
|
+
colors?: MantineColor[];
|
|
14
|
+
/** Shape variants used for the pieces (each piece picks one at random)
|
|
15
|
+
* @default ['rectangle', 'circle', 'triangle']
|
|
16
|
+
*/
|
|
17
|
+
shapes?: SceneConfettiShape[];
|
|
18
|
+
/** Where the pieces originate from. `'top'` (default) lets them drift down with gravity. `'bottom'` shoots them upward in a parabolic arc and lets gravity bring them back — the classic "confetti cannon" look.
|
|
19
|
+
* @default 'top'
|
|
20
|
+
*/
|
|
21
|
+
origin?: SceneConfettiOrigin;
|
|
22
|
+
/** Maximum rise distance in px when `origin` is `'bottom'`. Each piece gets a randomized rise between ~60% and 100% of this value.
|
|
23
|
+
* @default 320
|
|
24
|
+
*/
|
|
25
|
+
rise?: number;
|
|
26
|
+
/** Minimum piece size in px
|
|
27
|
+
* @default 6
|
|
28
|
+
*/
|
|
29
|
+
minSize?: number;
|
|
30
|
+
/** Maximum piece size in px
|
|
31
|
+
* @default 12
|
|
32
|
+
*/
|
|
33
|
+
maxSize?: number;
|
|
34
|
+
/** Animation duration in seconds (per piece — actual durations are jittered around this)
|
|
35
|
+
* @default 4
|
|
36
|
+
*/
|
|
37
|
+
duration?: number;
|
|
38
|
+
/** Speed factor (multiplier on duration — higher = faster)
|
|
39
|
+
* @default 1
|
|
40
|
+
*/
|
|
41
|
+
speed?: number;
|
|
42
|
+
/** Horizontal flutter range in px (back-and-forth sway during fall)
|
|
43
|
+
* @default 60
|
|
44
|
+
*/
|
|
45
|
+
flutter?: number;
|
|
46
|
+
/** When true, runs once and stops (single burst). When false, loops continuously.
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
burst?: boolean;
|
|
50
|
+
/** Called once the burst has finished settling (ignored when `burst` is false) */
|
|
51
|
+
onComplete?: () => void;
|
|
52
|
+
/** Overall opacity (0-1)
|
|
53
|
+
* @default 1
|
|
54
|
+
*/
|
|
55
|
+
opacity?: number;
|
|
56
|
+
/** PRNG seed for deterministic confetti distribution
|
|
57
|
+
* @default 42
|
|
58
|
+
*/
|
|
59
|
+
seed?: number;
|
|
60
|
+
/** Additional className */
|
|
61
|
+
className?: string;
|
|
62
|
+
/** Additional inline styles */
|
|
63
|
+
style?: React.CSSProperties;
|
|
64
|
+
}
|
|
65
|
+
export declare function SceneConfetti({ count: countProp, colors, shapes, minSize, maxSize, duration, speed, flutter, burst, origin, rise, onComplete, opacity, seed, className, style, }: SceneConfettiProps): React.JSX.Element;
|
|
66
|
+
export declare namespace SceneConfetti {
|
|
67
|
+
var displayName: string;
|
|
68
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type MantineColor } from '@mantine/core';
|
|
3
|
-
import { type ResponsiveValue } from '../use-responsive-value';
|
|
2
|
+
import { type MantineColor, type StyleProp } from '@mantine/core';
|
|
4
3
|
export interface SceneDotGridProps {
|
|
5
4
|
/** Dot color — supports Mantine theme colors
|
|
6
5
|
* @default 'gray'
|
|
@@ -17,7 +16,7 @@ export interface SceneDotGridProps {
|
|
|
17
16
|
/** Spacing between dots in px — accepts a responsive object like `{ base: 16, md: 24 }`
|
|
18
17
|
* @default 24
|
|
19
18
|
*/
|
|
20
|
-
spacing?:
|
|
19
|
+
spacing?: StyleProp<number>;
|
|
21
20
|
/** Stagger alternate rows by half the spacing
|
|
22
21
|
* @default false
|
|
23
22
|
*/
|
|
@@ -43,7 +42,7 @@ export interface SceneDotGridProps {
|
|
|
43
42
|
/** Additional inline styles */
|
|
44
43
|
style?: React.CSSProperties;
|
|
45
44
|
}
|
|
46
|
-
export declare function SceneDotGrid({ color, shade, dotSize, spacing
|
|
45
|
+
export declare function SceneDotGrid({ color, shade, dotSize, spacing, stagger, fade, animate, duration, opacity, className, style, }: SceneDotGridProps): React.JSX.Element;
|
|
47
46
|
export declare namespace SceneDotGrid {
|
|
48
47
|
var displayName: string;
|
|
49
48
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type MantineColor } from '@mantine/core';
|
|
3
|
-
import { type ResponsiveValue } from '../use-responsive-value';
|
|
2
|
+
import { type MantineColor, type StyleProp } from '@mantine/core';
|
|
4
3
|
export interface SceneGlowProps {
|
|
5
4
|
/** Color of the glow blob — supports Mantine theme colors
|
|
6
5
|
* @default 'violet'
|
|
@@ -13,11 +12,11 @@ export interface SceneGlowProps {
|
|
|
13
12
|
/** Size of the blob in px — accepts a responsive object like `{ base: 200, md: 400 }`
|
|
14
13
|
* @default 400
|
|
15
14
|
*/
|
|
16
|
-
size?:
|
|
15
|
+
size?: StyleProp<number>;
|
|
17
16
|
/** Blur radius in px — accepts a responsive object like `{ base: 60, md: 120 }`
|
|
18
17
|
* @default 120
|
|
19
18
|
*/
|
|
20
|
-
blur?:
|
|
19
|
+
blur?: StyleProp<number>;
|
|
21
20
|
/** Opacity (0-1)
|
|
22
21
|
* @default 0.5
|
|
23
22
|
*/
|
|
@@ -59,7 +58,7 @@ export interface SceneGlowProps {
|
|
|
59
58
|
/** Additional inline styles */
|
|
60
59
|
style?: React.CSSProperties;
|
|
61
60
|
}
|
|
62
|
-
export declare function SceneGlow({ color, shade, size
|
|
61
|
+
export declare function SceneGlow({ color, shade, size, blur, opacity, top, left, animate, animationType, duration, delay, driftX, driftY, className, style, }: SceneGlowProps): React.JSX.Element;
|
|
63
62
|
export declare namespace SceneGlow {
|
|
64
63
|
var displayName: string;
|
|
65
64
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MantineColor, type StyleProp } from '@mantine/core';
|
|
3
|
+
export interface SceneRainProps {
|
|
4
|
+
/** Number of raindrops (recommended max ~150) — accepts a responsive object like `{ base: 40, md: 80 }`
|
|
5
|
+
* @default 60
|
|
6
|
+
*/
|
|
7
|
+
count?: StyleProp<number>;
|
|
8
|
+
/** Raindrop color — supports Mantine theme colors
|
|
9
|
+
* @default 'blue'
|
|
10
|
+
*/
|
|
11
|
+
color?: MantineColor;
|
|
12
|
+
/** Mantine color shade (0-9)
|
|
13
|
+
* @default undefined
|
|
14
|
+
*/
|
|
15
|
+
shade?: number;
|
|
16
|
+
/** Minimum streak length in px
|
|
17
|
+
* @default 8
|
|
18
|
+
*/
|
|
19
|
+
minLength?: number;
|
|
20
|
+
/** Maximum streak length in px
|
|
21
|
+
* @default 18
|
|
22
|
+
*/
|
|
23
|
+
maxLength?: number;
|
|
24
|
+
/** Streak thickness in px
|
|
25
|
+
* @default 1
|
|
26
|
+
*/
|
|
27
|
+
thickness?: number;
|
|
28
|
+
/** Speed factor (multiplier on duration — higher = faster)
|
|
29
|
+
* @default 1
|
|
30
|
+
*/
|
|
31
|
+
speed?: number;
|
|
32
|
+
/** Streak tilt in degrees (0 = vertical, positive leans right, negative leans left)
|
|
33
|
+
* @default 15
|
|
34
|
+
*/
|
|
35
|
+
angle?: number;
|
|
36
|
+
/** Overall opacity (0-1)
|
|
37
|
+
* @default 0.5
|
|
38
|
+
*/
|
|
39
|
+
opacity?: number;
|
|
40
|
+
/** Render splash droplets at the bottom edge
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
splash?: boolean;
|
|
44
|
+
/** Number of splash droplets when `splash` is true
|
|
45
|
+
* @default 20
|
|
46
|
+
*/
|
|
47
|
+
splashCount?: number;
|
|
48
|
+
/** Splash color (defaults to the same as `color`) */
|
|
49
|
+
splashColor?: MantineColor;
|
|
50
|
+
/** Base splash droplet size in px (the actual size is randomized between ~50% and 150% of this value).
|
|
51
|
+
* @default 8
|
|
52
|
+
*/
|
|
53
|
+
splashSize?: number;
|
|
54
|
+
/** Splash droplet opacity (0-1). Higher values produce a more visible, dramatic splash.
|
|
55
|
+
* @default 0.7
|
|
56
|
+
*/
|
|
57
|
+
splashOpacity?: number;
|
|
58
|
+
/** Splash ring thickness in px — controls how prominent the splash outline appears.
|
|
59
|
+
* @default 1.5
|
|
60
|
+
*/
|
|
61
|
+
splashThickness?: number;
|
|
62
|
+
/** PRNG seed for deterministic raindrop positions
|
|
63
|
+
* @default 42
|
|
64
|
+
*/
|
|
65
|
+
seed?: number;
|
|
66
|
+
/** Additional className */
|
|
67
|
+
className?: string;
|
|
68
|
+
/** Additional inline styles */
|
|
69
|
+
style?: React.CSSProperties;
|
|
70
|
+
}
|
|
71
|
+
export declare function SceneRain({ count: countProp, color, shade, minLength, maxLength, thickness, speed, angle, opacity, splash, splashCount, splashColor, splashSize, splashOpacity, splashThickness, seed, className, style, }: SceneRainProps): React.JSX.Element;
|
|
72
|
+
export declare namespace SceneRain {
|
|
73
|
+
var displayName: string;
|
|
74
|
+
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type MantineColor } from '@mantine/core';
|
|
3
|
-
import { type ResponsiveValue } from '../use-responsive-value';
|
|
2
|
+
import { type MantineColor, type StyleProp } from '@mantine/core';
|
|
4
3
|
export interface SceneSnowProps {
|
|
5
4
|
/** Number of snowflakes (recommended max ~80) — accepts a responsive object like `{ base: 25, md: 50 }`
|
|
6
5
|
* @default 50
|
|
7
6
|
*/
|
|
8
|
-
count?:
|
|
7
|
+
count?: StyleProp<number>;
|
|
9
8
|
/** Snowflake color — supports Mantine theme colors
|
|
10
9
|
* @default 'white'
|
|
11
10
|
*/
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type MantineColor } from '@mantine/core';
|
|
3
|
-
import { type ResponsiveValue } from '../use-responsive-value';
|
|
2
|
+
import { type MantineColor, type StyleProp } from '@mantine/core';
|
|
4
3
|
export interface SceneStarFieldProps {
|
|
5
4
|
/** Number of stars — accepts a responsive object like `{ base: 50, md: 100 }`
|
|
6
5
|
* @default 100
|
|
7
6
|
*/
|
|
8
|
-
count?:
|
|
7
|
+
count?: StyleProp<number>;
|
|
9
8
|
/** Star color — supports Mantine theme colors
|
|
10
9
|
* @default 'white'
|
|
11
10
|
*/
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type MantineColor } from '@mantine/core';
|
|
3
|
-
import { type ResponsiveValue } from '../use-responsive-value';
|
|
2
|
+
import { type MantineColor, type StyleProp } from '@mantine/core';
|
|
4
3
|
export interface SceneStarWarpProps {
|
|
5
4
|
/** Number of stars (capped at 200) — accepts a responsive object like `{ base: 50, md: 100 }`
|
|
6
5
|
* @default 100
|
|
7
6
|
*/
|
|
8
|
-
count?:
|
|
7
|
+
count?: StyleProp<number>;
|
|
9
8
|
/** Speed multiplier — higher = faster
|
|
10
9
|
* @default 1
|
|
11
10
|
*/
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MantineColor } from '@mantine/core';
|
|
3
|
+
export type SceneWavesPosition = 'top' | 'bottom';
|
|
4
|
+
export type SceneWavesDirection = 'left' | 'right';
|
|
5
|
+
export interface SceneWavesProps {
|
|
6
|
+
/** Number of stacked wave layers — more layers create stronger parallax depth. Capped at 8.
|
|
7
|
+
* @default 3
|
|
8
|
+
*/
|
|
9
|
+
count?: number;
|
|
10
|
+
/** Wave color(s). Pass a single Mantine color to derive shades automatically across layers, or an array of colors mapped per layer.
|
|
11
|
+
* @default 'blue'
|
|
12
|
+
*/
|
|
13
|
+
colors?: MantineColor | MantineColor[];
|
|
14
|
+
/** Maximum wave amplitude in px — each layer gets a randomized fraction of this value.
|
|
15
|
+
* @default 40
|
|
16
|
+
*/
|
|
17
|
+
amplitude?: number;
|
|
18
|
+
/** Approximate wavelength in px — lower values produce more crests per layer.
|
|
19
|
+
* @default 480
|
|
20
|
+
*/
|
|
21
|
+
wavelength?: number;
|
|
22
|
+
/** Total height of the wave area in px (defines the SVG viewBox height).
|
|
23
|
+
* @default 240
|
|
24
|
+
*/
|
|
25
|
+
height?: number;
|
|
26
|
+
/** Speed multiplier for the horizontal pan animation (higher = faster). Combined with `parallax`, this defines the base speed shared by all layers.
|
|
27
|
+
* @default 1
|
|
28
|
+
*/
|
|
29
|
+
speed?: number;
|
|
30
|
+
/** Pan direction. `'left'` (default) scrolls layers leftward, `'right'` scrolls them rightward.
|
|
31
|
+
* @default 'left'
|
|
32
|
+
*/
|
|
33
|
+
direction?: SceneWavesDirection;
|
|
34
|
+
/** Parallax intensity — how much foreground layers differ in speed from background ones. `0` flattens parallax (all layers move at the same speed), `1` is the default differential, larger values exaggerate it. Negative values invert the parallax (background layers move faster than foreground), producing a dreamlike depth effect. Recommended range: `[-1, 2]`.
|
|
35
|
+
* @default 1
|
|
36
|
+
*/
|
|
37
|
+
parallax?: number;
|
|
38
|
+
/** Anchor side. `'bottom'` (default) renders waves rising from the bottom edge; `'top'` flips them to fall from the top edge.
|
|
39
|
+
* @default 'bottom'
|
|
40
|
+
*/
|
|
41
|
+
position?: SceneWavesPosition;
|
|
42
|
+
/** Optional Gaussian blur in px applied to each layer — useful for dreamy/soft waves.
|
|
43
|
+
* @default 0
|
|
44
|
+
*/
|
|
45
|
+
blur?: number;
|
|
46
|
+
/** Overall opacity (0-1) applied to the entire wave stack.
|
|
47
|
+
* @default 0.7
|
|
48
|
+
*/
|
|
49
|
+
opacity?: number;
|
|
50
|
+
/** PRNG seed for deterministic layer parameters (amplitude, frequency, phase).
|
|
51
|
+
* @default 42
|
|
52
|
+
*/
|
|
53
|
+
seed?: number;
|
|
54
|
+
/** Additional className */
|
|
55
|
+
className?: string;
|
|
56
|
+
/** Additional inline styles */
|
|
57
|
+
style?: React.CSSProperties;
|
|
58
|
+
}
|
|
59
|
+
export declare function SceneWaves({ count, colors, amplitude, wavelength, height, speed, direction, parallax, position, blur, opacity, seed, className, style, }: SceneWavesProps): React.JSX.Element;
|
|
60
|
+
export declare namespace SceneWaves {
|
|
61
|
+
var displayName: string;
|
|
62
|
+
}
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Scene } from './Scene';
|
|
2
|
-
export type { SceneAuroraProps, SceneBaseProps, SceneCssVariables, SceneDotGridProps, SceneFactory, SceneGlowProps, SceneGradientProps, SceneMeshProps, SceneMeshStop, SceneNoiseProps, SceneProps, SceneShootingStarProps, SceneSnowProps, SceneStarFieldProps, SceneStarWarpProps, SceneStylesNames, } from './Scene';
|
|
2
|
+
export type { SceneAuroraProps, SceneBaseProps, SceneConfettiOrigin, SceneConfettiProps, SceneConfettiShape, SceneCssVariables, SceneDotGridProps, SceneFactory, SceneGlowProps, SceneGradientProps, SceneMeshProps, SceneMeshStop, SceneNoiseProps, SceneProps, SceneRainProps, SceneShootingStarProps, SceneSnowProps, SceneStarFieldProps, SceneStarWarpProps, SceneStylesNames, SceneWavesDirection, SceneWavesPosition, SceneWavesProps, } from './Scene';
|
|
3
3
|
export { useSceneContext } from './Scene.context';
|
|
4
4
|
export type { ResponsiveValue } from './use-responsive-value';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Scene } from './Scene';
|
|
2
|
-
export type { SceneAuroraProps, SceneBaseProps, SceneCssVariables, SceneDotGridProps, SceneFactory, SceneGlowProps, SceneGradientProps, SceneMeshProps, SceneMeshStop, SceneNoiseProps, SceneProps, SceneShootingStarProps, SceneSnowProps, SceneStarFieldProps, SceneStarWarpProps, SceneStylesNames, } from './Scene';
|
|
2
|
+
export type { SceneAuroraProps, SceneBaseProps, SceneConfettiOrigin, SceneConfettiProps, SceneConfettiShape, SceneCssVariables, SceneDotGridProps, SceneFactory, SceneGlowProps, SceneGradientProps, SceneMeshProps, SceneMeshStop, SceneNoiseProps, SceneProps, SceneRainProps, SceneShootingStarProps, SceneSnowProps, SceneStarFieldProps, SceneStarWarpProps, SceneStylesNames, SceneWavesDirection, SceneWavesPosition, SceneWavesProps, } from './Scene';
|
|
3
3
|
export { useSceneContext } from './Scene.context';
|
|
4
4
|
export type { ResponsiveValue } from './use-responsive-value';
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
/** A value that can be either a plain value or a responsive object keyed by breakpoint */
|
|
3
|
-
export type ResponsiveValue<T> = T | Partial<Record<MantineBreakpoint | 'base', T>>;
|
|
1
|
+
import { type StyleProp } from '@mantine/core';
|
|
4
2
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
3
|
+
* Backwards-compatible alias for `StyleProp<T>` from `@mantine/core`.
|
|
4
|
+
* Prefer `StyleProp<T>` directly in new code.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated Use `StyleProp<T>` from `@mantine/core`.
|
|
8
7
|
*/
|
|
9
|
-
export
|
|
8
|
+
export type ResponsiveValue<T> = StyleProp<T>;
|
|
9
|
+
/**
|
|
10
|
+
* Resolves a `StyleProp<T>` to its current value based on the viewport.
|
|
11
|
+
* Reserved for JS-only props (e.g. canvas particle counts) that cannot be
|
|
12
|
+
* expressed as CSS variables. CSS-derivable props should use the
|
|
13
|
+
* `InlineStyles` + media queries pattern instead.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useResponsiveValue<T>(value: StyleProp<T>): T;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gfazioli/mantine-scene",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "A composable decorative background component for React applications built with Mantine. Layer gradients, glow blobs, dot grids, mesh gradients, and
|
|
3
|
+
"version": "2.1.1",
|
|
4
|
+
"description": "A composable decorative background component for React applications built with Mantine. Layer gradients, glow blobs, dot grids, mesh gradients, noise, particles, rain, confetti, and parallax SVG waves to create rich atmospheric backgrounds — with viewport-aware lazy mode and interactive mouse tracking.",
|
|
5
5
|
"homepage": "https://gfazioli.github.io/mantine-scene/",
|
|
6
6
|
"packageManager": "yarn@4.0.1",
|
|
7
7
|
"license": "MIT",
|
|
@@ -10,21 +10,27 @@
|
|
|
10
10
|
"aurora",
|
|
11
11
|
"background",
|
|
12
12
|
"component",
|
|
13
|
+
"confetti",
|
|
13
14
|
"decorative",
|
|
14
15
|
"extension",
|
|
15
16
|
"glow",
|
|
16
17
|
"gradient",
|
|
18
|
+
"lazy",
|
|
17
19
|
"mantine",
|
|
18
20
|
"mantine-ui",
|
|
19
21
|
"mantine-v9",
|
|
20
22
|
"mesh",
|
|
21
23
|
"noise",
|
|
24
|
+
"parallax",
|
|
22
25
|
"particles",
|
|
26
|
+
"rain",
|
|
23
27
|
"react",
|
|
24
28
|
"react-component",
|
|
25
29
|
"scene",
|
|
26
30
|
"starfield",
|
|
27
|
-
"
|
|
31
|
+
"svg",
|
|
32
|
+
"typescript",
|
|
33
|
+
"waves"
|
|
28
34
|
],
|
|
29
35
|
"main": "./dist/cjs/index.cjs",
|
|
30
36
|
"module": "./dist/esm/index.mjs",
|