@gfazioli/mantine-scene 1.0.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/CODE_OF_CONDUCT.md +128 -0
- package/CONTRIBUTING.md +18 -0
- package/LICENSE +21 -0
- package/README.md +120 -0
- package/dist/cjs/Scene.cjs +163 -0
- package/dist/cjs/Scene.cjs.map +1 -0
- package/dist/cjs/Scene.context.cjs +12 -0
- package/dist/cjs/Scene.context.cjs.map +1 -0
- package/dist/cjs/Scene.module.css.cjs +7 -0
- package/dist/cjs/Scene.module.css.cjs.map +1 -0
- package/dist/cjs/SceneAurora/SceneAurora.cjs +83 -0
- package/dist/cjs/SceneAurora/SceneAurora.cjs.map +1 -0
- package/dist/cjs/SceneDotGrid/SceneDotGrid.cjs +78 -0
- package/dist/cjs/SceneDotGrid/SceneDotGrid.cjs.map +1 -0
- package/dist/cjs/SceneGlow/SceneGlow.cjs +62 -0
- package/dist/cjs/SceneGlow/SceneGlow.cjs.map +1 -0
- package/dist/cjs/SceneGradient/SceneGradient.cjs +72 -0
- package/dist/cjs/SceneGradient/SceneGradient.cjs.map +1 -0
- package/dist/cjs/SceneMesh/SceneMesh.cjs +47 -0
- package/dist/cjs/SceneMesh/SceneMesh.cjs.map +1 -0
- package/dist/cjs/SceneNoise/SceneNoise.cjs +58 -0
- package/dist/cjs/SceneNoise/SceneNoise.cjs.map +1 -0
- package/dist/cjs/SceneShootingStar/SceneShootingStar.cjs +97 -0
- package/dist/cjs/SceneShootingStar/SceneShootingStar.cjs.map +1 -0
- package/dist/cjs/SceneSnow/SceneSnow.cjs +71 -0
- package/dist/cjs/SceneSnow/SceneSnow.cjs.map +1 -0
- package/dist/cjs/SceneStarField/SceneStarField.cjs +91 -0
- package/dist/cjs/SceneStarField/SceneStarField.cjs.map +1 -0
- package/dist/cjs/SceneStarWarp/SceneStarWarp.cjs +87 -0
- package/dist/cjs/SceneStarWarp/SceneStarWarp.cjs.map +1 -0
- package/dist/cjs/index.cjs +11 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/prng.cjs +15 -0
- package/dist/cjs/prng.cjs.map +1 -0
- package/dist/cjs/use-responsive-value.cjs +13 -0
- package/dist/cjs/use-responsive-value.cjs.map +1 -0
- package/dist/esm/Scene.context.mjs +9 -0
- package/dist/esm/Scene.context.mjs.map +1 -0
- package/dist/esm/Scene.mjs +161 -0
- package/dist/esm/Scene.mjs.map +1 -0
- package/dist/esm/Scene.module.css.mjs +5 -0
- package/dist/esm/Scene.module.css.mjs.map +1 -0
- package/dist/esm/SceneAurora/SceneAurora.mjs +81 -0
- package/dist/esm/SceneAurora/SceneAurora.mjs.map +1 -0
- package/dist/esm/SceneDotGrid/SceneDotGrid.mjs +76 -0
- package/dist/esm/SceneDotGrid/SceneDotGrid.mjs.map +1 -0
- package/dist/esm/SceneGlow/SceneGlow.mjs +60 -0
- package/dist/esm/SceneGlow/SceneGlow.mjs.map +1 -0
- package/dist/esm/SceneGradient/SceneGradient.mjs +70 -0
- package/dist/esm/SceneGradient/SceneGradient.mjs.map +1 -0
- package/dist/esm/SceneMesh/SceneMesh.mjs +45 -0
- package/dist/esm/SceneMesh/SceneMesh.mjs.map +1 -0
- package/dist/esm/SceneNoise/SceneNoise.mjs +56 -0
- package/dist/esm/SceneNoise/SceneNoise.mjs.map +1 -0
- package/dist/esm/SceneShootingStar/SceneShootingStar.mjs +95 -0
- package/dist/esm/SceneShootingStar/SceneShootingStar.mjs.map +1 -0
- package/dist/esm/SceneSnow/SceneSnow.mjs +69 -0
- package/dist/esm/SceneSnow/SceneSnow.mjs.map +1 -0
- package/dist/esm/SceneStarField/SceneStarField.mjs +89 -0
- package/dist/esm/SceneStarField/SceneStarField.mjs.map +1 -0
- package/dist/esm/SceneStarWarp/SceneStarWarp.mjs +85 -0
- package/dist/esm/SceneStarWarp/SceneStarWarp.mjs.map +1 -0
- package/dist/esm/index.mjs +3 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/prng.mjs +13 -0
- package/dist/esm/prng.mjs.map +1 -0
- package/dist/esm/use-responsive-value.mjs +11 -0
- package/dist/esm/use-responsive-value.mjs.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/styles.layer.css +1 -0
- package/dist/types/Scene.context.d.ts +20 -0
- package/dist/types/Scene.d.ts +88 -0
- package/dist/types/SceneAurora/SceneAurora.d.ts +40 -0
- package/dist/types/SceneDotGrid/SceneDotGrid.d.ts +49 -0
- package/dist/types/SceneGlow/SceneGlow.d.ts +65 -0
- package/dist/types/SceneGradient/SceneGradient.d.ts +62 -0
- package/dist/types/SceneMesh/SceneMesh.d.ts +40 -0
- package/dist/types/SceneNoise/SceneNoise.d.ts +40 -0
- package/dist/types/SceneShootingStar/SceneShootingStar.d.ts +48 -0
- package/dist/types/SceneSnow/SceneSnow.d.ts +49 -0
- package/dist/types/SceneStarField/SceneStarField.d.ts +45 -0
- package/dist/types/SceneStarWarp/SceneStarWarp.d.ts +57 -0
- package/dist/types/index.d.mts +4 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/prng.d.ts +2 -0
- package/dist/types/use-responsive-value.d.ts +9 -0
- package/package.json +51 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BoxProps, Factory, StylesApiProps } from '@mantine/core';
|
|
3
|
+
import { SceneAurora } from './SceneAurora/SceneAurora';
|
|
4
|
+
import { SceneDotGrid } from './SceneDotGrid/SceneDotGrid';
|
|
5
|
+
import { SceneGlow } from './SceneGlow/SceneGlow';
|
|
6
|
+
import { SceneGradient } from './SceneGradient/SceneGradient';
|
|
7
|
+
import { SceneMesh } from './SceneMesh/SceneMesh';
|
|
8
|
+
import { SceneNoise } from './SceneNoise/SceneNoise';
|
|
9
|
+
import { SceneShootingStar } from './SceneShootingStar/SceneShootingStar';
|
|
10
|
+
import { SceneSnow } from './SceneSnow/SceneSnow';
|
|
11
|
+
import { SceneStarField } from './SceneStarField/SceneStarField';
|
|
12
|
+
import { SceneStarWarp } from './SceneStarWarp/SceneStarWarp';
|
|
13
|
+
export type SceneStylesNames = 'root' | 'gradient' | 'dotGrid' | 'glow' | 'mesh' | 'noise' | 'starField' | 'shootingStar' | 'snow' | 'aurora' | 'starWarp';
|
|
14
|
+
export type SceneCssVariables = {
|
|
15
|
+
root: '--scene-z-index';
|
|
16
|
+
};
|
|
17
|
+
export interface SceneBaseProps {
|
|
18
|
+
/** Whether the scene covers the full viewport (fixed position) or acts as a contained box
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
fullscreen?: boolean;
|
|
22
|
+
/** z-index when fullscreen is true
|
|
23
|
+
* @default 0
|
|
24
|
+
*/
|
|
25
|
+
zIndex?: number;
|
|
26
|
+
/** Controls animation behavior for prefers-reduced-motion: 'auto' respects system preference, 'always' disables all animations, 'never' keeps animations regardless
|
|
27
|
+
* @default 'auto'
|
|
28
|
+
*/
|
|
29
|
+
reducedMotion?: 'auto' | 'always' | 'never';
|
|
30
|
+
/** Enable mouse tracking — sub-components can react to the cursor position
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
interactive?: boolean;
|
|
34
|
+
/** Easing factor for interactive mouse tracking (0 to 1). Lower values result in slower, smoother following. Set to 1 for instant tracking (no easing).
|
|
35
|
+
* @default 0.12
|
|
36
|
+
*/
|
|
37
|
+
interactiveEasing?: number;
|
|
38
|
+
/** Scene content (compound sub-components: Scene.Gradient, Scene.Glow, etc.) */
|
|
39
|
+
children?: React.ReactNode;
|
|
40
|
+
}
|
|
41
|
+
export interface SceneProps extends BoxProps, SceneBaseProps, StylesApiProps<SceneFactory> {
|
|
42
|
+
}
|
|
43
|
+
export type SceneFactory = Factory<{
|
|
44
|
+
props: SceneProps;
|
|
45
|
+
ref: HTMLDivElement;
|
|
46
|
+
stylesNames: SceneStylesNames;
|
|
47
|
+
vars: SceneCssVariables;
|
|
48
|
+
staticComponents: {
|
|
49
|
+
Gradient: typeof SceneGradient;
|
|
50
|
+
DotGrid: typeof SceneDotGrid;
|
|
51
|
+
Glow: typeof SceneGlow;
|
|
52
|
+
Mesh: typeof SceneMesh;
|
|
53
|
+
Noise: typeof SceneNoise;
|
|
54
|
+
StarField: typeof SceneStarField;
|
|
55
|
+
ShootingStar: typeof SceneShootingStar;
|
|
56
|
+
Snow: typeof SceneSnow;
|
|
57
|
+
Aurora: typeof SceneAurora;
|
|
58
|
+
StarWarp: typeof SceneStarWarp;
|
|
59
|
+
};
|
|
60
|
+
}>;
|
|
61
|
+
export declare const Scene: import("@mantine/core").MantineComponent<{
|
|
62
|
+
props: SceneProps;
|
|
63
|
+
ref: HTMLDivElement;
|
|
64
|
+
stylesNames: SceneStylesNames;
|
|
65
|
+
vars: SceneCssVariables;
|
|
66
|
+
staticComponents: {
|
|
67
|
+
Gradient: typeof SceneGradient;
|
|
68
|
+
DotGrid: typeof SceneDotGrid;
|
|
69
|
+
Glow: typeof SceneGlow;
|
|
70
|
+
Mesh: typeof SceneMesh;
|
|
71
|
+
Noise: typeof SceneNoise;
|
|
72
|
+
StarField: typeof SceneStarField;
|
|
73
|
+
ShootingStar: typeof SceneShootingStar;
|
|
74
|
+
Snow: typeof SceneSnow;
|
|
75
|
+
Aurora: typeof SceneAurora;
|
|
76
|
+
StarWarp: typeof SceneStarWarp;
|
|
77
|
+
};
|
|
78
|
+
}>;
|
|
79
|
+
export type { SceneGradientProps } from './SceneGradient/SceneGradient';
|
|
80
|
+
export type { SceneDotGridProps } from './SceneDotGrid/SceneDotGrid';
|
|
81
|
+
export type { SceneGlowProps } from './SceneGlow/SceneGlow';
|
|
82
|
+
export type { SceneMeshProps, SceneMeshStop } from './SceneMesh/SceneMesh';
|
|
83
|
+
export type { SceneNoiseProps } from './SceneNoise/SceneNoise';
|
|
84
|
+
export type { SceneStarFieldProps } from './SceneStarField/SceneStarField';
|
|
85
|
+
export type { SceneShootingStarProps } from './SceneShootingStar/SceneShootingStar';
|
|
86
|
+
export type { SceneSnowProps } from './SceneSnow/SceneSnow';
|
|
87
|
+
export type { SceneAuroraProps } from './SceneAurora/SceneAurora';
|
|
88
|
+
export type { SceneStarWarpProps } from './SceneStarWarp/SceneStarWarp';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MantineColor } from '@mantine/core';
|
|
3
|
+
export interface SceneAuroraProps {
|
|
4
|
+
/** Colors for the aurora bands — supports Mantine theme colors
|
|
5
|
+
* @default ['green', 'teal', 'cyan']
|
|
6
|
+
*/
|
|
7
|
+
colors?: MantineColor[];
|
|
8
|
+
/** Number of aurora bands
|
|
9
|
+
* @default 3
|
|
10
|
+
*/
|
|
11
|
+
bands?: number;
|
|
12
|
+
/** Vertical position of the aurora
|
|
13
|
+
* @default 'top'
|
|
14
|
+
*/
|
|
15
|
+
position?: 'top' | 'center' | 'bottom';
|
|
16
|
+
/** Enable animation
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
animate?: boolean;
|
|
20
|
+
/** Animation duration in seconds
|
|
21
|
+
* @default 8
|
|
22
|
+
*/
|
|
23
|
+
duration?: number;
|
|
24
|
+
/** Overall opacity (0-1)
|
|
25
|
+
* @default 0.3
|
|
26
|
+
*/
|
|
27
|
+
opacity?: number;
|
|
28
|
+
/** Blur amount in px
|
|
29
|
+
* @default 60
|
|
30
|
+
*/
|
|
31
|
+
blur?: number;
|
|
32
|
+
/** Additional className */
|
|
33
|
+
className?: string;
|
|
34
|
+
/** Additional inline styles */
|
|
35
|
+
style?: React.CSSProperties;
|
|
36
|
+
}
|
|
37
|
+
export declare function SceneAurora({ colors, bands, position, animate, duration, opacity, blur, className, style, }: SceneAuroraProps): React.JSX.Element;
|
|
38
|
+
export declare namespace SceneAurora {
|
|
39
|
+
var displayName: string;
|
|
40
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MantineColor } from '@mantine/core';
|
|
3
|
+
import { type ResponsiveValue } from '../use-responsive-value';
|
|
4
|
+
export interface SceneDotGridProps {
|
|
5
|
+
/** Dot color — supports Mantine theme colors
|
|
6
|
+
* @default 'gray'
|
|
7
|
+
*/
|
|
8
|
+
color?: MantineColor;
|
|
9
|
+
/** Mantine color shade (0-9)
|
|
10
|
+
* @default undefined
|
|
11
|
+
*/
|
|
12
|
+
shade?: number;
|
|
13
|
+
/** Dot radius in px
|
|
14
|
+
* @default 1
|
|
15
|
+
*/
|
|
16
|
+
dotSize?: number;
|
|
17
|
+
/** Spacing between dots in px — accepts a responsive object like `{ base: 16, md: 24 }`
|
|
18
|
+
* @default 24
|
|
19
|
+
*/
|
|
20
|
+
spacing?: ResponsiveValue<number>;
|
|
21
|
+
/** Stagger alternate rows by half the spacing
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
stagger?: boolean;
|
|
25
|
+
/** Fade mask at edges
|
|
26
|
+
* @default 'none'
|
|
27
|
+
*/
|
|
28
|
+
fade?: 'none' | 'radial' | 'top' | 'bottom' | 'edges';
|
|
29
|
+
/** Enable twinkle animation
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
animate?: boolean;
|
|
33
|
+
/** Animation duration in seconds
|
|
34
|
+
* @default 4
|
|
35
|
+
*/
|
|
36
|
+
duration?: number;
|
|
37
|
+
/** Overall opacity (0-1)
|
|
38
|
+
* @default 1
|
|
39
|
+
*/
|
|
40
|
+
opacity?: number;
|
|
41
|
+
/** Additional className */
|
|
42
|
+
className?: string;
|
|
43
|
+
/** Additional inline styles */
|
|
44
|
+
style?: React.CSSProperties;
|
|
45
|
+
}
|
|
46
|
+
export declare function SceneDotGrid({ color, shade, dotSize, spacing: spacingProp, stagger, fade, animate, duration, opacity, className, style, }: SceneDotGridProps): React.JSX.Element;
|
|
47
|
+
export declare namespace SceneDotGrid {
|
|
48
|
+
var displayName: string;
|
|
49
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MantineColor } from '@mantine/core';
|
|
3
|
+
import { type ResponsiveValue } from '../use-responsive-value';
|
|
4
|
+
export interface SceneGlowProps {
|
|
5
|
+
/** Color of the glow blob — supports Mantine theme colors
|
|
6
|
+
* @default 'violet'
|
|
7
|
+
*/
|
|
8
|
+
color?: MantineColor;
|
|
9
|
+
/** Mantine color shade (0-9)
|
|
10
|
+
* @default undefined
|
|
11
|
+
*/
|
|
12
|
+
shade?: number;
|
|
13
|
+
/** Size of the blob in px — accepts a responsive object like `{ base: 200, md: 400 }`
|
|
14
|
+
* @default 400
|
|
15
|
+
*/
|
|
16
|
+
size?: ResponsiveValue<number>;
|
|
17
|
+
/** Blur radius in px — accepts a responsive object like `{ base: 60, md: 120 }`
|
|
18
|
+
* @default 120
|
|
19
|
+
*/
|
|
20
|
+
blur?: ResponsiveValue<number>;
|
|
21
|
+
/** Opacity (0-1)
|
|
22
|
+
* @default 0.5
|
|
23
|
+
*/
|
|
24
|
+
opacity?: number;
|
|
25
|
+
/** Top position (CSS value, e.g. '10%', '200px')
|
|
26
|
+
* @default '10%'
|
|
27
|
+
*/
|
|
28
|
+
top?: string;
|
|
29
|
+
/** Left position (CSS value, e.g. '20%', '100px')
|
|
30
|
+
* @default '50%'
|
|
31
|
+
*/
|
|
32
|
+
left?: string;
|
|
33
|
+
/** Enable floating animation
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
animate?: boolean;
|
|
37
|
+
/** Animation type variant
|
|
38
|
+
* @default 'float'
|
|
39
|
+
*/
|
|
40
|
+
animationType?: 'float' | 'pulse' | 'breathe';
|
|
41
|
+
/** Animation duration in seconds
|
|
42
|
+
* @default 8
|
|
43
|
+
*/
|
|
44
|
+
duration?: number;
|
|
45
|
+
/** Animation delay in seconds
|
|
46
|
+
* @default 0
|
|
47
|
+
*/
|
|
48
|
+
delay?: number;
|
|
49
|
+
/** Horizontal drift distance (CSS value)
|
|
50
|
+
* @default '30px'
|
|
51
|
+
*/
|
|
52
|
+
driftX?: string;
|
|
53
|
+
/** Vertical drift distance (CSS value)
|
|
54
|
+
* @default '20px'
|
|
55
|
+
*/
|
|
56
|
+
driftY?: string;
|
|
57
|
+
/** Additional className */
|
|
58
|
+
className?: string;
|
|
59
|
+
/** Additional inline styles */
|
|
60
|
+
style?: React.CSSProperties;
|
|
61
|
+
}
|
|
62
|
+
export declare function SceneGlow({ color, shade, size: sizeProp, blur: blurProp, opacity, top, left, animate, animationType, duration, delay, driftX, driftY, className, style, }: SceneGlowProps): React.JSX.Element;
|
|
63
|
+
export declare namespace SceneGlow {
|
|
64
|
+
var displayName: string;
|
|
65
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MantineColor } from '@mantine/core';
|
|
3
|
+
export interface SceneGradientProps {
|
|
4
|
+
/** Gradient type
|
|
5
|
+
* @default 'radial'
|
|
6
|
+
*/
|
|
7
|
+
type?: 'radial' | 'linear' | 'conic';
|
|
8
|
+
/** CSS color stops, e.g. ['rgba(120,0,255,0.15) 0%', 'transparent 70%'] */
|
|
9
|
+
colors?: string[];
|
|
10
|
+
/** Start color — Mantine theme color (alternative to colors)
|
|
11
|
+
* @default undefined
|
|
12
|
+
*/
|
|
13
|
+
from?: MantineColor;
|
|
14
|
+
/** End color — Mantine theme color (alternative to colors)
|
|
15
|
+
* @default 'transparent'
|
|
16
|
+
*/
|
|
17
|
+
to?: MantineColor;
|
|
18
|
+
/** Opacity of the start color (0-1)
|
|
19
|
+
* @default 0.15
|
|
20
|
+
*/
|
|
21
|
+
fromOpacity?: number;
|
|
22
|
+
/** Opacity of the end color (0-1)
|
|
23
|
+
* @default 0
|
|
24
|
+
*/
|
|
25
|
+
toOpacity?: number;
|
|
26
|
+
/** Position for radial/conic gradient (e.g. 'center top', '50% 30%')
|
|
27
|
+
* @default 'center top'
|
|
28
|
+
*/
|
|
29
|
+
position?: string;
|
|
30
|
+
/** Angle for linear gradient in degrees
|
|
31
|
+
* @default 180
|
|
32
|
+
*/
|
|
33
|
+
angle?: number;
|
|
34
|
+
/** Overall opacity (0-1)
|
|
35
|
+
* @default 1
|
|
36
|
+
*/
|
|
37
|
+
opacity?: number;
|
|
38
|
+
/** Enable animation
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
animate?: boolean;
|
|
42
|
+
/** Animation duration in seconds
|
|
43
|
+
* @default 20
|
|
44
|
+
*/
|
|
45
|
+
duration?: number;
|
|
46
|
+
/** Animation type
|
|
47
|
+
* @default 'rotate'
|
|
48
|
+
*/
|
|
49
|
+
animationType?: 'rotate' | 'pulse';
|
|
50
|
+
/** Minimum opacity for pulse animation (0-1)
|
|
51
|
+
* @default 0.3
|
|
52
|
+
*/
|
|
53
|
+
pulseMinOpacity?: number;
|
|
54
|
+
/** Additional className */
|
|
55
|
+
className?: string;
|
|
56
|
+
/** Additional inline styles */
|
|
57
|
+
style?: React.CSSProperties;
|
|
58
|
+
}
|
|
59
|
+
export declare function SceneGradient({ type, colors, from, to, fromOpacity, toOpacity, position, angle, opacity, animate, duration, animationType, pulseMinOpacity, className, style, }: SceneGradientProps): React.JSX.Element;
|
|
60
|
+
export declare namespace SceneGradient {
|
|
61
|
+
var displayName: string;
|
|
62
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MantineColor } from '@mantine/core';
|
|
3
|
+
export interface SceneMeshStop {
|
|
4
|
+
/** Color — supports Mantine theme colors */
|
|
5
|
+
color: MantineColor;
|
|
6
|
+
/** Position as 'x% y%' (e.g. '20% 30%') */
|
|
7
|
+
position: string;
|
|
8
|
+
/** Spread radius as percentage
|
|
9
|
+
* @default 50
|
|
10
|
+
*/
|
|
11
|
+
spread?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface SceneMeshProps {
|
|
14
|
+
/** Array of color stops for the mesh */
|
|
15
|
+
stops?: SceneMeshStop[];
|
|
16
|
+
/** Overall opacity (0-1)
|
|
17
|
+
* @default 1
|
|
18
|
+
*/
|
|
19
|
+
opacity?: number;
|
|
20
|
+
/** Enable animated hue-rotate shift
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
animate?: boolean;
|
|
24
|
+
/** Animation duration in seconds
|
|
25
|
+
* @default 15
|
|
26
|
+
*/
|
|
27
|
+
duration?: number;
|
|
28
|
+
/** CSS mix-blend-mode
|
|
29
|
+
* @default 'normal'
|
|
30
|
+
*/
|
|
31
|
+
blend?: React.CSSProperties['mixBlendMode'];
|
|
32
|
+
/** Additional className */
|
|
33
|
+
className?: string;
|
|
34
|
+
/** Additional inline styles */
|
|
35
|
+
style?: React.CSSProperties;
|
|
36
|
+
}
|
|
37
|
+
export declare function SceneMesh({ stops, opacity, animate, duration, blend, className, style, }: SceneMeshProps): React.JSX.Element;
|
|
38
|
+
export declare namespace SceneMesh {
|
|
39
|
+
var displayName: string;
|
|
40
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MantineColor } from '@mantine/core';
|
|
3
|
+
export interface SceneNoiseProps {
|
|
4
|
+
/** Opacity of the noise overlay (0-1)
|
|
5
|
+
* @default 0.03
|
|
6
|
+
*/
|
|
7
|
+
opacity?: number;
|
|
8
|
+
/** Grain size — base frequency for the noise (smaller = finer)
|
|
9
|
+
* @default 0.65
|
|
10
|
+
*/
|
|
11
|
+
grain?: number;
|
|
12
|
+
/** Seed for feTurbulence
|
|
13
|
+
* @default 0
|
|
14
|
+
*/
|
|
15
|
+
seed?: number;
|
|
16
|
+
/** Type of SVG noise
|
|
17
|
+
* @default 'fractalNoise'
|
|
18
|
+
*/
|
|
19
|
+
type?: 'fractalNoise' | 'turbulence';
|
|
20
|
+
/** Number of octaves for the noise
|
|
21
|
+
* @default 4
|
|
22
|
+
*/
|
|
23
|
+
octaves?: number;
|
|
24
|
+
/** Tint color overlay — supports Mantine theme colors
|
|
25
|
+
* @default undefined
|
|
26
|
+
*/
|
|
27
|
+
tint?: MantineColor;
|
|
28
|
+
/** Opacity of the tint overlay (0-1)
|
|
29
|
+
* @default 0.5
|
|
30
|
+
*/
|
|
31
|
+
tintOpacity?: number;
|
|
32
|
+
/** Additional className */
|
|
33
|
+
className?: string;
|
|
34
|
+
/** Additional inline styles */
|
|
35
|
+
style?: React.CSSProperties;
|
|
36
|
+
}
|
|
37
|
+
export declare function SceneNoise({ opacity, grain, seed, type, octaves, tint, tintOpacity, className, style, }: SceneNoiseProps): React.JSX.Element;
|
|
38
|
+
export declare namespace SceneNoise {
|
|
39
|
+
var displayName: string;
|
|
40
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MantineColor } from '@mantine/core';
|
|
3
|
+
export interface SceneShootingStarProps {
|
|
4
|
+
/** Number of shooting star lanes
|
|
5
|
+
* @default 3
|
|
6
|
+
*/
|
|
7
|
+
count?: number;
|
|
8
|
+
/** Trail color — supports Mantine theme colors
|
|
9
|
+
* @default 'white'
|
|
10
|
+
*/
|
|
11
|
+
color?: MantineColor;
|
|
12
|
+
/** Trail length in px
|
|
13
|
+
* @default 80
|
|
14
|
+
*/
|
|
15
|
+
trailLength?: number;
|
|
16
|
+
/** Angle of the shooting star trajectory in degrees
|
|
17
|
+
* @default 215
|
|
18
|
+
*/
|
|
19
|
+
angle?: number;
|
|
20
|
+
/** Speed — animation duration in seconds
|
|
21
|
+
* @default 1
|
|
22
|
+
*/
|
|
23
|
+
speed?: number;
|
|
24
|
+
/** Minimum interval between shooting stars in seconds
|
|
25
|
+
* @default 3
|
|
26
|
+
*/
|
|
27
|
+
minInterval?: number;
|
|
28
|
+
/** Maximum interval between shooting stars in seconds
|
|
29
|
+
* @default 8
|
|
30
|
+
*/
|
|
31
|
+
maxInterval?: number;
|
|
32
|
+
/** PRNG seed for deterministic trail positions
|
|
33
|
+
* @default 42
|
|
34
|
+
*/
|
|
35
|
+
seed?: number;
|
|
36
|
+
/** Overall opacity (0-1)
|
|
37
|
+
* @default 0.8
|
|
38
|
+
*/
|
|
39
|
+
opacity?: number;
|
|
40
|
+
/** Additional className */
|
|
41
|
+
className?: string;
|
|
42
|
+
/** Additional inline styles */
|
|
43
|
+
style?: React.CSSProperties;
|
|
44
|
+
}
|
|
45
|
+
export declare function SceneShootingStar({ count, color, trailLength, angle, speed, minInterval, maxInterval, seed, opacity, className, style, }: SceneShootingStarProps): React.JSX.Element;
|
|
46
|
+
export declare namespace SceneShootingStar {
|
|
47
|
+
var displayName: string;
|
|
48
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MantineColor } from '@mantine/core';
|
|
3
|
+
import { type ResponsiveValue } from '../use-responsive-value';
|
|
4
|
+
export interface SceneSnowProps {
|
|
5
|
+
/** Number of snowflakes (recommended max ~80) — accepts a responsive object like `{ base: 25, md: 50 }`
|
|
6
|
+
* @default 50
|
|
7
|
+
*/
|
|
8
|
+
count?: ResponsiveValue<number>;
|
|
9
|
+
/** Snowflake color — supports Mantine theme colors
|
|
10
|
+
* @default 'white'
|
|
11
|
+
*/
|
|
12
|
+
color?: MantineColor;
|
|
13
|
+
/** Minimum snowflake size in px
|
|
14
|
+
* @default 2
|
|
15
|
+
*/
|
|
16
|
+
minSize?: number;
|
|
17
|
+
/** Maximum snowflake size in px
|
|
18
|
+
* @default 6
|
|
19
|
+
*/
|
|
20
|
+
maxSize?: number;
|
|
21
|
+
/** Speed factor (multiplier on duration)
|
|
22
|
+
* @default 1
|
|
23
|
+
*/
|
|
24
|
+
speed?: number;
|
|
25
|
+
/** Horizontal drift in px
|
|
26
|
+
* @default 30
|
|
27
|
+
*/
|
|
28
|
+
drift?: number;
|
|
29
|
+
/** Wind direction (-1 to 1): -1 = left, 0 = none, 1 = right
|
|
30
|
+
* @default 0
|
|
31
|
+
*/
|
|
32
|
+
wind?: number;
|
|
33
|
+
/** PRNG seed for deterministic flake positions
|
|
34
|
+
* @default 42
|
|
35
|
+
*/
|
|
36
|
+
seed?: number;
|
|
37
|
+
/** Overall opacity (0-1)
|
|
38
|
+
* @default 0.8
|
|
39
|
+
*/
|
|
40
|
+
opacity?: number;
|
|
41
|
+
/** Additional className */
|
|
42
|
+
className?: string;
|
|
43
|
+
/** Additional inline styles */
|
|
44
|
+
style?: React.CSSProperties;
|
|
45
|
+
}
|
|
46
|
+
export declare function SceneSnow({ count: countProp, color, minSize, maxSize, speed, drift, wind, seed, opacity, className, style, }: SceneSnowProps): React.JSX.Element;
|
|
47
|
+
export declare namespace SceneSnow {
|
|
48
|
+
var displayName: string;
|
|
49
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MantineColor } from '@mantine/core';
|
|
3
|
+
import { type ResponsiveValue } from '../use-responsive-value';
|
|
4
|
+
export interface SceneStarFieldProps {
|
|
5
|
+
/** Number of stars — accepts a responsive object like `{ base: 50, md: 100 }`
|
|
6
|
+
* @default 100
|
|
7
|
+
*/
|
|
8
|
+
count?: ResponsiveValue<number>;
|
|
9
|
+
/** Star color — supports Mantine theme colors
|
|
10
|
+
* @default 'white'
|
|
11
|
+
*/
|
|
12
|
+
color?: MantineColor;
|
|
13
|
+
/** Minimum star size in px
|
|
14
|
+
* @default 1
|
|
15
|
+
*/
|
|
16
|
+
minSize?: number;
|
|
17
|
+
/** Maximum star size in px
|
|
18
|
+
* @default 3
|
|
19
|
+
*/
|
|
20
|
+
maxSize?: number;
|
|
21
|
+
/** Enable twinkle animation
|
|
22
|
+
* @default true
|
|
23
|
+
*/
|
|
24
|
+
twinkle?: boolean;
|
|
25
|
+
/** Twinkle animation duration in seconds
|
|
26
|
+
* @default 3
|
|
27
|
+
*/
|
|
28
|
+
duration?: number;
|
|
29
|
+
/** PRNG seed for deterministic star positions
|
|
30
|
+
* @default 42
|
|
31
|
+
*/
|
|
32
|
+
seed?: number;
|
|
33
|
+
/** Overall opacity (0-1)
|
|
34
|
+
* @default 1
|
|
35
|
+
*/
|
|
36
|
+
opacity?: number;
|
|
37
|
+
/** Additional className */
|
|
38
|
+
className?: string;
|
|
39
|
+
/** Additional inline styles */
|
|
40
|
+
style?: React.CSSProperties;
|
|
41
|
+
}
|
|
42
|
+
export declare function SceneStarField({ count: countProp, color, minSize, maxSize, twinkle, duration, seed, opacity, className, style, }: SceneStarFieldProps): React.JSX.Element;
|
|
43
|
+
export declare namespace SceneStarField {
|
|
44
|
+
var displayName: string;
|
|
45
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MantineColor } from '@mantine/core';
|
|
3
|
+
import { type ResponsiveValue } from '../use-responsive-value';
|
|
4
|
+
export interface SceneStarWarpProps {
|
|
5
|
+
/** Number of stars (capped at 200) — accepts a responsive object like `{ base: 50, md: 100 }`
|
|
6
|
+
* @default 100
|
|
7
|
+
*/
|
|
8
|
+
count?: ResponsiveValue<number>;
|
|
9
|
+
/** Speed multiplier — higher = faster
|
|
10
|
+
* @default 1
|
|
11
|
+
*/
|
|
12
|
+
speed?: number;
|
|
13
|
+
/** Warp direction: 'out' = stars fly away from focal point, 'in' = stars fly toward it
|
|
14
|
+
* @default 'out'
|
|
15
|
+
*/
|
|
16
|
+
direction?: 'in' | 'out';
|
|
17
|
+
/** Focal point X position (CSS value)
|
|
18
|
+
* @default '50%'
|
|
19
|
+
*/
|
|
20
|
+
focalX?: string;
|
|
21
|
+
/** Focal point Y position (CSS value)
|
|
22
|
+
* @default '50%'
|
|
23
|
+
*/
|
|
24
|
+
focalY?: string;
|
|
25
|
+
/** Enable elongated trail effect on stars
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
trail?: boolean;
|
|
29
|
+
/** Star color — supports Mantine theme colors
|
|
30
|
+
* @default 'white'
|
|
31
|
+
*/
|
|
32
|
+
color?: MantineColor;
|
|
33
|
+
/** Minimum star size in px
|
|
34
|
+
* @default 1
|
|
35
|
+
*/
|
|
36
|
+
minSize?: number;
|
|
37
|
+
/** Maximum star size in px
|
|
38
|
+
* @default 3
|
|
39
|
+
*/
|
|
40
|
+
maxSize?: number;
|
|
41
|
+
/** Overall opacity (0-1)
|
|
42
|
+
* @default 1
|
|
43
|
+
*/
|
|
44
|
+
opacity?: number;
|
|
45
|
+
/** PRNG seed for deterministic star positions
|
|
46
|
+
* @default 42
|
|
47
|
+
*/
|
|
48
|
+
seed?: number;
|
|
49
|
+
/** Additional className */
|
|
50
|
+
className?: string;
|
|
51
|
+
/** Additional inline styles */
|
|
52
|
+
style?: React.CSSProperties;
|
|
53
|
+
}
|
|
54
|
+
export declare function SceneStarWarp({ count: countProp, speed, direction, focalX, focalY, trail, color, minSize, maxSize, opacity, seed, className, style, }: SceneStarWarpProps): React.JSX.Element;
|
|
55
|
+
export declare namespace SceneStarWarp {
|
|
56
|
+
var displayName: string;
|
|
57
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
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';
|
|
3
|
+
export { useSceneContext } from './Scene.context';
|
|
4
|
+
export type { ResponsiveValue } from './use-responsive-value';
|
|
@@ -0,0 +1,4 @@
|
|
|
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';
|
|
3
|
+
export { useSceneContext } from './Scene.context';
|
|
4
|
+
export type { ResponsiveValue } from './use-responsive-value';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type MantineBreakpoint } from '@mantine/core';
|
|
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>>;
|
|
4
|
+
/**
|
|
5
|
+
* Resolves a ResponsiveValue<T> to its current value based on the viewport.
|
|
6
|
+
* If the value is a plain value, returns it directly.
|
|
7
|
+
* If it's a responsive object (e.g. { base: 100, md: 200 }), uses Mantine's useMatches.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useResponsiveValue<T>(value: ResponsiveValue<T>): T;
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gfazioli/mantine-scene",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A composable decorative background component for React applications built with Mantine. Layer gradients, glow blobs, dot grids, mesh gradients, and noise textures to create rich atmospheric backgrounds.",
|
|
5
|
+
"homepage": "https://gfazioli.github.io/mantine-scene/",
|
|
6
|
+
"packageManager": "yarn@4.0.1",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "Giovambattista Fazioli <giovambattista.fazioli@gmail.com>",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"background",
|
|
11
|
+
"component",
|
|
12
|
+
"decorative",
|
|
13
|
+
"extension",
|
|
14
|
+
"glow",
|
|
15
|
+
"gradient",
|
|
16
|
+
"library",
|
|
17
|
+
"mantine",
|
|
18
|
+
"mesh",
|
|
19
|
+
"noise",
|
|
20
|
+
"react",
|
|
21
|
+
"react-component",
|
|
22
|
+
"scene",
|
|
23
|
+
"typescript",
|
|
24
|
+
"ui"
|
|
25
|
+
],
|
|
26
|
+
"main": "./dist/cjs/index.cjs",
|
|
27
|
+
"module": "./dist/esm/index.mjs",
|
|
28
|
+
"types": "./dist/types/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"import": {
|
|
32
|
+
"types": "./dist/types/index.d.mts",
|
|
33
|
+
"default": "./dist/esm/index.mjs"
|
|
34
|
+
},
|
|
35
|
+
"require": {
|
|
36
|
+
"types": "./dist/types/index.d.ts",
|
|
37
|
+
"default": "./dist/cjs/index.cjs"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"./styles.css": "./dist/styles.css",
|
|
41
|
+
"./styles.layer.css": "./dist/styles.layer.css"
|
|
42
|
+
},
|
|
43
|
+
"repository": "https://github.com/gfazioli/mantine-scene.git",
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@mantine/core": ">=7.0.0",
|
|
46
|
+
"@mantine/hooks": ">=7.0.0",
|
|
47
|
+
"react": "^18.x || ^19.x",
|
|
48
|
+
"react-dom": "^18.x || ^19.x"
|
|
49
|
+
},
|
|
50
|
+
"bugs": "https://github.com/gfazioli/mantine-scene/issues"
|
|
51
|
+
}
|