3d-effect-cinema 0.3.0 → 0.4.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # 🎬 3D Effect Cinema
2
2
 
3
- > High-performance, highly customizable 3D Cinema WebGL Experience, HOC & Dynamic Background for React and Next.js powered by `@react-three/fiber` & `three`.
3
+ > Componente de Fondo WebGL 3D de Alto Rendimiento, Motor de Efectos Bioluminiscentes y Pantalla de Carga / Intro Cinematográfica para React y Next.js impulsado por `@react-three/fiber` & `three`.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/3d-effect-cinema.svg?style=flat-square&color=blue)](https://www.npmjs.com/package/3d-effect-cinema)
6
6
  [![license](https://img.shields.io/npm/l/3d-effect-cinema.svg?style=flat-square)](https://github.com/esteban284/3d-effect-cinema)
@@ -9,28 +9,13 @@
9
9
 
10
10
  ---
11
11
 
12
- ## 🚀 Live Demo
12
+ ## 🚀 Demo Interactivo en Vivo
13
13
 
14
- 👉 **[Ver Demo en Vivo (Vercel)](https://cinema-animation-sample.vercel.app)**
14
+ 👉 **[Probar la Galería Interactiva en Vivo (Vercel)](https://cinema-animation-sample.vercel.app)**
15
15
 
16
16
  ---
17
17
 
18
- ## Features
19
-
20
- - 🪄 **Higher-Order Component (`withCinema3D`)**: Easily wrap any React component with a dynamic 3D WebGL background.
21
- - 🖼️ **Dynamic Container Background (`<CinemaBackground />`)**: Fits inside any parent container (`div`, `header`, `section`, `card`) with responsive auto-resizing.
22
- - ✍️ **Live 3D Title Control**: Dynamic text input that updates the 3D typography in real-time.
23
- - 🎛️ **Interactive FX Toggles Bar**: Toggle buttons to control 3D Fire Sparks, Shockwave rings, Electric Plasma, and Ambient Embers.
24
- - 💥 **Multiple Interactive 3D Effects**:
25
- - 🔥 **`ClickFireSparks`**: Explosive fire ember burst & local point light flash on click.
26
- - 🌊 **`ClickShockwave`**: Expanding 3D energy ring wave on click.
27
- - ⚡ **`ElectricPlasma`**: Interactive electric plasma tendrils reacting to pointer movement.
28
- - ✨ **`SceneParticles`**: Thermal rising ambient embers.
29
- - 🎨 **6 Material Themes**: `emerald` (Matrix Luxe), `crimson` (Ruby Fire), `gold`, `neon`, `obsidian`, `glass`.
30
-
31
- ---
32
-
33
- ## 📦 Installation
18
+ ## 📦 Instalación
34
19
 
35
20
  ```bash
36
21
  npm install 3d-effect-cinema three @react-three/fiber @react-three/drei @react-three/postprocessing postprocessing
@@ -38,64 +23,53 @@ npm install 3d-effect-cinema three @react-three/fiber @react-three/drei @react-t
38
23
 
39
24
  ---
40
25
 
41
- ## 🚀 Usage Examples
42
-
43
- ### 1. Using the HOC (`withCinema3D`)
26
+ ## Inicio Rápido
44
27
 
45
- Wrap any existing React component with the 3D WebGL background:
28
+ ### Modo 1: Fondo 3D Permanente
46
29
 
47
30
  ```tsx
48
31
  "use client";
49
32
 
50
- import { withCinema3D } from "3d-effect-cinema";
33
+ import AnimatedBackground from "3d-effect-cinema";
51
34
 
52
- function LandingHero() {
35
+ export default function App() {
53
36
  return (
54
- <div className="text-center text-white py-24">
55
- <h1 className="text-5xl font-bold uppercase tracking-widest">
56
- Enterprise Solutions
57
- </h1>
58
- <p className="mt-4 text-white/70 max-w-xl mx-auto">
59
- Build high-performance 3D web experiences effortlessly.
60
- </p>
37
+ // Fondo de Nubes de Energía Verde Bioluminiscente sobre Fondo Blanco
38
+ <div className="w-full h-screen">
39
+ <AnimatedBackground
40
+ effect="blobs"
41
+ effectColor="#00e676"
42
+ effectDensity={0.4}
43
+ effectSpeed={0.5}
44
+ backgroundColor="#ffffff"
45
+ />
61
46
  </div>
62
47
  );
63
48
  }
64
-
65
- // Export wrapped with 3D Cinema background
66
- export default withCinema3D(LandingHero, {
67
- text: "UNITED OF WEB",
68
- theme: "emerald",
69
- interactiveSparks: true,
70
- interactiveShockwave: true,
71
- interactivePlasma: true,
72
- });
73
49
  ```
74
50
 
75
51
  ---
76
52
 
77
- ### 2. Using the Component (`<CinemaBackground />`)
78
-
79
- Embed directly inside any container in your layout:
53
+ ### Modo 2: Pantalla de Carga / Intro Splash Screen (con Redirección Automática)
80
54
 
81
55
  ```tsx
82
56
  "use client";
83
57
 
84
- import { CinemaBackground } from "3d-effect-cinema";
58
+ import AnimatedBackground from "3d-effect-cinema";
85
59
 
86
- export default function CustomCard() {
60
+ export default function SplashIntro() {
87
61
  return (
88
- <div className="w-full h-[500px] rounded-2xl overflow-hidden shadow-2xl">
89
- <CinemaBackground
90
- text="CREATIVE"
91
- theme="crimson"
92
- interactiveSparks={true}
93
- interactivePlasma={true}
94
- >
95
- <button className="px-8 py-3 bg-red-600 hover:bg-red-500 text-white font-bold uppercase rounded-full">
96
- Get Started
97
- </button>
98
- </CinemaBackground>
62
+ // Mantiene la animación durante 5 segundos y luego redirecciona a /home
63
+ <div className="w-full h-screen">
64
+ <AnimatedBackground
65
+ title="CINEMULTIPLEX"
66
+ fontFamily="helvetiker"
67
+ effect="blobs,flames"
68
+ effectColor="#00e5ff"
69
+ loaderDuration={5}
70
+ redirectUrl="/home"
71
+ containerSelector="home"
72
+ />
99
73
  </div>
100
74
  );
101
75
  }
@@ -103,41 +77,133 @@ export default function CustomCard() {
103
77
 
104
78
  ---
105
79
 
106
- ### 3. Full Interactive Playground & Loader (`<CinemaLoader />`)
80
+ ## 🎨 Documentación Completa de la API
81
+
82
+ ### `<AnimatedBackground />`
83
+
84
+ | Propiedad | Tipo | Valor por Defecto | Descripción |
85
+ | :--- | :--- | :--- | :--- |
86
+ | `title` | `string` | `undefined` | Texto 3D renderizado en la escena. Si se omite o se pasa `""`, queda en blanco para usarse únicamente como **fondo de efectos 3D puro**. |
87
+ | `containerSelector` | `string` | `undefined` | ID o selector del contenedor objetivo en el DOM (ej: `containerSelector="home"` o `containerSelector="#main-hero"`) para montarse como fondo allí. |
88
+ | `effect` | `SingleEffectType \| SingleEffectType[] \| string` | `"flames"` | Efecto WebGL o **combinación múltiple de efectos** (ej: `effect="blobs,onda"` o `effect={["flames", "plasma"]}`). |
89
+ | `effectColor` | `string` | `undefined` | Color personalizado para **TODOS** los efectos 3D activos (soporta códigos `#HEX` como `#00e676`, `#ff0055` o nombres en español como `"azul"`, `"verde"`, `"magenta"`). |
90
+ | `effectDensity` | `number` | `0.3` | Densidad/cantidad de partículas y llamas (`0.1` a `1.0`, por defecto `0.3` para un aspecto limpio y equilibrado). |
91
+ | `effectSpeed` | `number` | `0.5` | Multiplicador de velocidad de movimiento 3D (`0.1` a `2.0`, por defecto `0.5` para un movimiento suave sin mareos). |
92
+ | `backgroundColor` | `string` | `undefined` | Color o gradiente de fondo (soporta códigos `#HEX` como `#ffffff`, `#3b0712`, gradientes CSS o nombres en español `"rojo"`, `"azul"`, `"verde"`). |
93
+ | `autoFitText` | `boolean` | `true` | Escala automáticamente el texto 3D para que jamás se desborde ni se corte del contenedor padre. |
94
+ | `loaderDuration` | `number` | `undefined` | *(Opcional)* Duración en **segundos** para usar el componente como pantalla de carga / intro splash screen. Si no se define, se mantiene como un fondo permanente. |
95
+ | `redirectUrl` | `string` | `undefined` | *(Opcional)* URL o ruta a la cual redireccionar automáticamente cuando finaliza la cuenta regresiva de `loaderDuration`. |
96
+ | `onComplete` | `() => void` | `undefined` | *(Opcional)* Callback ejecutado al finalizar el temporizador de `loaderDuration`. |
97
+ | `fontFamily` | `"cinema"` \| `"helvetiker"` \| `"gentilis"` \| `"optimer"` \| `string` | `"cinema"` | Tipografía 3D elegible (`"cinema"`, `"helvetiker"`, `"gentilis"`, `"optimer"` o URL personalizada). |
98
+ | `fontUrl` | `string` | `undefined` | URL personalizada de un archivo Typeface JSON 3D. |
99
+ | `letterSpacing` | `number` | `0.85` | Multiplicador del espaciado entre letras 3D. |
100
+ | `containerToDisplay` | `"lhome"` \| `"home"` \| `ReactNode` | `undefined` | Plantilla de vista superpuesta ("lhome" para la landing de cine, o cualquier componente React). |
101
+ | `theme` | `'emerald'` \| `'crimson'` \| `'gold'` \| `'neon'` \| `'obsidian'` \| `'glass'` | `'crimson'` | Tema de luces y material 3D del texto. |
102
+
103
+ ---
104
+
105
+ ## 🌟 Lista de Efectos Disponibles
106
+
107
+ | Nombre de Efecto | Valor de Prop `effect` | Icono | Descripción |
108
+ | :--- | :--- | :--- | :--- |
109
+ | **Nubes Bioluminiscentes** | `"blobs"` / `"energy-blobs"` / `"plasma-blobs"` | 🟢 | Nubes bioluminiscentes de energía líquida fusionándose suavemente. |
110
+ | **Llamas Orgánicas** | `"flames"` / `"fluid-flames"` / `"llamas"` | 🔥 | Partículas de llamas de fuego fluido de mezcla aditiva. |
111
+ | **Cristales 3D** | `"fire"` / `"crystal-flames"` / `"cristales"` | 💎 | Conos de llamas 3D de cristal facetado. |
112
+ | **Chispas 3D** | `"sparks"` / `"chispas"` | 💥 | Ráfagas de chispas incandescente con gravedad física. |
113
+ | **Onda de Choque 3D** | `"shockwave"` / `"wave"` / `"onda"` | 🌊 | Anillos emissivos de onda de choque expansivos. |
114
+ | **Plasma Eléctrico** | `"plasma"` / `"electric"` | ⚡ | Arcos de plasma eléctrico reactivos al cursor. |
115
+ | **Ascuas Ambientales** | `"embers"` / `"ascuas"` | ✨ | Ascuas y polvo estelar flotante en el aire. |
116
+ | **Todos los Efectos** | `"all"` / `"supernova"` / `"todos"` | 🌟 | Activa todos los efectos 3D en simultáneo. |
117
+
118
+ ---
119
+
120
+ ## 💡 Ejemplos de Uso
121
+
122
+ ### 1. Fondo de Nubes Bioluminiscentes sobre Fondo Blanco (Estilo Captura)
107
123
 
108
124
  ```tsx
109
- "use client";
125
+ import AnimatedBackground from "3d-effect-cinema";
110
126
 
111
- import { CinemaLoader } from "3d-effect-cinema";
127
+ export default function NubesVerdes() {
128
+ return (
129
+ <div className="w-full h-screen">
130
+ <AnimatedBackground
131
+ effect="blobs"
132
+ effectColor="#00e676"
133
+ backgroundColor="#ffffff"
134
+ effectDensity={0.4}
135
+ effectSpeed={0.5}
136
+ />
137
+ </div>
138
+ );
139
+ }
140
+ ```
141
+
142
+ ---
143
+
144
+ ### 2. Multi-Selección de Efectos (`effect="llamas,onda,plasma"`)
145
+
146
+ ```tsx
147
+ import AnimatedBackground from "3d-effect-cinema";
112
148
 
113
- export default function InteractiveDemo() {
149
+ export default function MultiEfectos() {
114
150
  return (
115
- <CinemaLoader
116
- cinemaName="NOVA CINEMA"
117
- defaultTheme="emerald"
118
- />
151
+ <div className="w-full h-[600px]">
152
+ <AnimatedBackground
153
+ title="UNITED OF WEB"
154
+ fontFamily="helvetiker"
155
+ effect="llamas,onda,plasma"
156
+ effectColor="#00e5ff"
157
+ backgroundColor="#021a38"
158
+ letterSpacing={0.85}
159
+ />
160
+ </div>
119
161
  );
120
162
  }
121
163
  ```
122
164
 
123
165
  ---
124
166
 
125
- ## 🛠️ Props Reference
167
+ ### 3. Pantalla de Carga de 5 Segundos con Redirección y Selector de Contenedor DOM
126
168
 
127
- ### `<CinemaBackground />` & `withCinema3D(Component, options)`
169
+ ```tsx
170
+ import AnimatedBackground from "3d-effect-cinema";
128
171
 
129
- | Prop / Option | Type | Default | Description |
130
- | :--- | :--- | :--- | :--- |
131
- | `text` | `string` | `"CINEMA"` | 3D Text rendered in world space |
132
- | `theme` | `'emerald' \| 'crimson' \| 'gold' \| 'neon' \| 'obsidian' \| 'glass'` | `'emerald'` | Material & lighting preset |
133
- | `customBackground` | `string` | `undefined` | Custom CSS gradient or color |
134
- | `interactiveSparks` | `boolean` | `true` | Enable/disable fire sparks on click |
135
- | `interactiveShockwave` | `boolean` | `true` | Enable/disable shockwave rings on click |
136
- | `interactivePlasma` | `boolean` | `true` | Enable/disable electric plasma arcs |
137
- | `showParticles` | `boolean` | `true` | Enable/disable ambient floating embers |
172
+ export default function SplashIntro() {
173
+ return (
174
+ <div id="home" className="w-full h-screen">
175
+ <AnimatedBackground
176
+ title="CINEMULTIPLEX"
177
+ fontFamily="helvetiker"
178
+ effect="blobs,flames"
179
+ effectColor="#00e5ff"
180
+ loaderDuration={5}
181
+ redirectUrl="/home"
182
+ containerSelector="home"
183
+ />
184
+ </div>
185
+ );
186
+ }
187
+ ```
188
+
189
+ ---
190
+
191
+ ## 🖱️ Interactividad Clic & Drag
192
+
193
+ Al hacer **clic o arrastrar el ratón/touch** sobre la escena 3D, brotan ráfagas instantáneas del efecto activo **en las coordenadas exactas del puntero**.
194
+
195
+ ---
196
+
197
+ ## 👤 Autor y Desarrollador
198
+
199
+ Creado con ❤️ por **Esteban Puentes**
200
+
201
+ - 🌐 **Portafolio**: [esteban-puentes.vercel.app](https://esteban-puentes.vercel.app)
202
+ - 💼 **LinkedIn**: [linkedin.com/in/esteban-puentes](https://www.linkedin.com/in/esteban-puentes/)
203
+ - 🚀 **Demo en Vivo**: [cinema-animation-sample.vercel.app](https://cinema-animation-sample.vercel.app)
138
204
 
139
205
  ---
140
206
 
141
- ## 📝 License
207
+ ## 📝 Licencia
142
208
 
143
- MIT © [Esteban](https://github.com/esteban284)
209
+ MIT © [Esteban Puentes](https://github.com/esteban284)
package/dist/index.d.mts CHANGED
@@ -13,6 +13,55 @@ interface AnimatedLetterProps {
13
13
  }
14
14
  declare function AnimatedLetter({ char, index, totalLetters, position, phase, theme, fontUrl, }: AnimatedLetterProps): react.JSX.Element | null;
15
15
 
16
+ type SingleEffectType = "fire" | "flames" | "crystal-flames" | "fluid-flames" | "blobs" | "energy-blobs" | "plasma-blobs" | "inferno" | "sparks" | "shockwave" | "wave" | "plasma" | "electric" | "embers" | "supernova" | "all";
17
+ type EffectType = SingleEffectType | SingleEffectType[] | string;
18
+ interface AnimatedBackgroundProps {
19
+ /** View template or component to display ("lhome", "home", or custom React component) */
20
+ containerToDisplay?: string | react__default.ReactNode;
21
+ /** DOM element ID/class or container target to attach as background (e.g. "home", "#main-hero", "lhome") */
22
+ containerSelector?: string;
23
+ /** 3D Effect type or multiple effects (e.g. "blobs,onda" or ["flames", "shockwave"]) */
24
+ effect?: EffectType;
25
+ /** 3D Title rendered in world space (omit or pass "" for blank pure background effects) */
26
+ title?: string;
27
+ /** Background color or gradient (supports Spanish names like "rojo", "azul", "verde", "dorado" or #HEX / CSS colors) */
28
+ backgroundColor?: string;
29
+ /** Custom color for ALL 3D WebGL effects (e.g. "azul", "verde", "magenta", "#00e5ff", "#ff0055") */
30
+ effectColor?: string;
31
+ /** Speed multiplier for 3D motion & animation (default 0.5 for smooth relaxing motion) */
32
+ effectSpeed?: number;
33
+ /** Density / quantity of flame & WebGL particles (range 0.1 to 1.0, default 0.3 for clean elegant flames) */
34
+ effectDensity?: number;
35
+ /** Automatically scale 3D text to fit parent container perfectly (default true) */
36
+ autoFitText?: boolean;
37
+ /** Optional duration in seconds when used as a Loader / Splash screen animation */
38
+ loaderDuration?: number;
39
+ /** Optional URL to redirect to automatically when loaderDuration timer reaches 0 */
40
+ redirectUrl?: string;
41
+ /** Optional callback triggered when loaderDuration timer finishes */
42
+ onComplete?: () => void;
43
+ /** 3D Font Family ("cinema", "helvetiker", "gentilis", "optimer" or custom font URL) */
44
+ fontFamily?: "cinema" | "helvetiker" | "gentilis" | "optimer" | string;
45
+ /** Custom 3D Typeface JSON URL */
46
+ fontUrl?: string;
47
+ /** 3D Material theme */
48
+ theme?: MaterialTheme;
49
+ /** Letter spacing multiplier (default 0.85 to prevent text overlaps) */
50
+ letterSpacing?: number;
51
+ /** Container CSS class name */
52
+ className?: string;
53
+ /** Inline CSS styles */
54
+ style?: react__default.CSSProperties;
55
+ /** Custom children overlay */
56
+ children?: react__default.ReactNode;
57
+ }
58
+ /**
59
+ * Main Animated Background Component for 3d-effect-cinema.
60
+ * Supports permanent 3D background mode OR cinematic Splash Screen / Loader mode (with loaderDuration & redirectUrl).
61
+ * Can be targeted to a DOM container via `containerSelector` (e.g. containerSelector="home").
62
+ */
63
+ declare function AnimatedBackground({ containerToDisplay, containerSelector, effect, title, backgroundColor, effectColor, effectSpeed, effectDensity, autoFitText, loaderDuration, redirectUrl, onComplete, fontFamily, fontUrl, theme, letterSpacing, className, style, children, }: AnimatedBackgroundProps): react__default.JSX.Element;
64
+
16
65
  interface CinemaBackgroundProps {
17
66
  /** 3D Text rendered in world space */
18
67
  text?: string;
@@ -43,8 +92,7 @@ interface CinemaBackgroundProps {
43
92
  */
44
93
  declare function CinemaBackground({ text, theme, customBackground, interactiveSparks, interactiveShockwave, interactivePlasma, showParticles, enableBloom, className, style, children, }: CinemaBackgroundProps): react.JSX.Element;
45
94
 
46
- interface WithCinema3DOptions extends Omit<CinemaBackgroundProps, "children"> {
47
- }
95
+ type WithCinema3DOptions = Omit<CinemaBackgroundProps, "children">;
48
96
  /**
49
97
  * Higher-Order Component (HOC) that wraps any React component with the 3D WebGL Cinema background.
50
98
  *
@@ -69,32 +117,67 @@ interface CinemaLoaderProps {
69
117
  }
70
118
  declare function CinemaLoader({ cinemaName, defaultTheme, customBackground, onEnterCinema, }: CinemaLoaderProps): react.JSX.Element;
71
119
 
72
- declare function ClickFireSparks({ theme, enabled, }: {
120
+ interface FireFlamesProps {
121
+ theme?: MaterialTheme;
122
+ effectColor?: string;
123
+ effectSpeed?: number;
124
+ effectDensity?: number;
125
+ mode?: "fluid" | "crystal" | "all";
126
+ enabled?: boolean;
127
+ }
128
+ /**
129
+ * Dual-Engine Fire Flames Component:
130
+ * Offers both Organic Liquid Energy Flame Clouds (mode="fluid") and 3D Crystal Flame Geometries (mode="crystal" or mode="all")
131
+ */
132
+ declare function FireFlames({ theme, effectColor, effectSpeed, effectDensity, mode, enabled, }: FireFlamesProps): react.JSX.Element | null;
133
+
134
+ interface PlasmaBlobsProps {
135
+ theme?: MaterialTheme;
136
+ effectColor?: string;
137
+ effectSpeed?: number;
138
+ effectDensity?: number;
139
+ enabled?: boolean;
140
+ }
141
+ /**
142
+ * Exact Bioluminescent Liquid Energy Blobs Effect (matching user screenshot)
143
+ */
144
+ declare function PlasmaBlobs({ theme, effectColor, effectSpeed, effectDensity, enabled, }: PlasmaBlobsProps): react.JSX.Element | null;
145
+
146
+ declare function ClickFireSparks({ theme, effectColor, effectSpeed, enabled, }: {
73
147
  theme?: MaterialTheme;
148
+ effectColor?: string;
149
+ effectSpeed?: number;
74
150
  enabled?: boolean;
75
151
  }): react.JSX.Element;
76
152
 
77
- declare function ClickShockwave({ theme, enabled, }: {
153
+ declare function ClickShockwave({ theme, effectColor, effectSpeed, enabled, }: {
78
154
  theme?: MaterialTheme;
155
+ effectColor?: string;
156
+ effectSpeed?: number;
79
157
  enabled?: boolean;
80
158
  }): react.JSX.Element | null;
81
159
 
82
160
  interface ElectricPlasmaProps {
83
161
  theme?: MaterialTheme;
162
+ effectColor?: string;
163
+ effectSpeed?: number;
84
164
  enabled?: boolean;
85
165
  }
86
- declare function ElectricPlasma({ theme, enabled, }: ElectricPlasmaProps): react.JSX.Element | null;
166
+ declare function ElectricPlasma({ theme, effectColor, effectSpeed, enabled, }: ElectricPlasmaProps): react.JSX.Element | null;
87
167
 
88
168
  interface SceneParticlesProps {
89
169
  theme: MaterialTheme;
170
+ effectColor?: string;
171
+ effectSpeed?: number;
90
172
  visible: boolean;
91
173
  }
92
- declare function SceneParticles({ theme, visible }: SceneParticlesProps): react.JSX.Element | null;
174
+ declare function SceneParticles({ theme, effectColor, effectSpeed, visible }: SceneParticlesProps): react.JSX.Element | null;
93
175
 
94
176
  interface CameraRigProps {
95
177
  phase: "loading" | "entering" | "idle" | "exiting";
178
+ effectSpeed?: number;
96
179
  }
97
- declare function CameraRig({ phase }: CameraRigProps): null;
180
+ declare function CameraRig({ phase, effectSpeed }: CameraRigProps): null;
98
181
 
99
182
  interface EffectState {
100
183
  sparks: boolean;
@@ -118,4 +201,4 @@ declare function CinemaHome({ cinemaName, webTheme }: {
118
201
  webTheme?: string;
119
202
  }): react.JSX.Element;
120
203
 
121
- export { AnimatedLetter, CameraRig, CinemaBackground, type CinemaBackgroundProps, CinemaHome, CinemaLoader, ClickFireSparks, ClickShockwave, type EffectState, ElectricPlasma, LoaderOverlay, type MaterialTheme, SceneParticles, type WithCinema3DOptions, withCinema3D };
204
+ export { AnimatedBackground, type AnimatedBackgroundProps, AnimatedLetter, CameraRig, CinemaBackground, type CinemaBackgroundProps, CinemaHome, CinemaLoader, ClickFireSparks, ClickShockwave, type EffectState, type EffectType, ElectricPlasma, FireFlames, LoaderOverlay, type MaterialTheme, PlasmaBlobs, SceneParticles, type WithCinema3DOptions, AnimatedBackground as default, withCinema3D };
package/dist/index.d.ts CHANGED
@@ -13,6 +13,55 @@ interface AnimatedLetterProps {
13
13
  }
14
14
  declare function AnimatedLetter({ char, index, totalLetters, position, phase, theme, fontUrl, }: AnimatedLetterProps): react.JSX.Element | null;
15
15
 
16
+ type SingleEffectType = "fire" | "flames" | "crystal-flames" | "fluid-flames" | "blobs" | "energy-blobs" | "plasma-blobs" | "inferno" | "sparks" | "shockwave" | "wave" | "plasma" | "electric" | "embers" | "supernova" | "all";
17
+ type EffectType = SingleEffectType | SingleEffectType[] | string;
18
+ interface AnimatedBackgroundProps {
19
+ /** View template or component to display ("lhome", "home", or custom React component) */
20
+ containerToDisplay?: string | react__default.ReactNode;
21
+ /** DOM element ID/class or container target to attach as background (e.g. "home", "#main-hero", "lhome") */
22
+ containerSelector?: string;
23
+ /** 3D Effect type or multiple effects (e.g. "blobs,onda" or ["flames", "shockwave"]) */
24
+ effect?: EffectType;
25
+ /** 3D Title rendered in world space (omit or pass "" for blank pure background effects) */
26
+ title?: string;
27
+ /** Background color or gradient (supports Spanish names like "rojo", "azul", "verde", "dorado" or #HEX / CSS colors) */
28
+ backgroundColor?: string;
29
+ /** Custom color for ALL 3D WebGL effects (e.g. "azul", "verde", "magenta", "#00e5ff", "#ff0055") */
30
+ effectColor?: string;
31
+ /** Speed multiplier for 3D motion & animation (default 0.5 for smooth relaxing motion) */
32
+ effectSpeed?: number;
33
+ /** Density / quantity of flame & WebGL particles (range 0.1 to 1.0, default 0.3 for clean elegant flames) */
34
+ effectDensity?: number;
35
+ /** Automatically scale 3D text to fit parent container perfectly (default true) */
36
+ autoFitText?: boolean;
37
+ /** Optional duration in seconds when used as a Loader / Splash screen animation */
38
+ loaderDuration?: number;
39
+ /** Optional URL to redirect to automatically when loaderDuration timer reaches 0 */
40
+ redirectUrl?: string;
41
+ /** Optional callback triggered when loaderDuration timer finishes */
42
+ onComplete?: () => void;
43
+ /** 3D Font Family ("cinema", "helvetiker", "gentilis", "optimer" or custom font URL) */
44
+ fontFamily?: "cinema" | "helvetiker" | "gentilis" | "optimer" | string;
45
+ /** Custom 3D Typeface JSON URL */
46
+ fontUrl?: string;
47
+ /** 3D Material theme */
48
+ theme?: MaterialTheme;
49
+ /** Letter spacing multiplier (default 0.85 to prevent text overlaps) */
50
+ letterSpacing?: number;
51
+ /** Container CSS class name */
52
+ className?: string;
53
+ /** Inline CSS styles */
54
+ style?: react__default.CSSProperties;
55
+ /** Custom children overlay */
56
+ children?: react__default.ReactNode;
57
+ }
58
+ /**
59
+ * Main Animated Background Component for 3d-effect-cinema.
60
+ * Supports permanent 3D background mode OR cinematic Splash Screen / Loader mode (with loaderDuration & redirectUrl).
61
+ * Can be targeted to a DOM container via `containerSelector` (e.g. containerSelector="home").
62
+ */
63
+ declare function AnimatedBackground({ containerToDisplay, containerSelector, effect, title, backgroundColor, effectColor, effectSpeed, effectDensity, autoFitText, loaderDuration, redirectUrl, onComplete, fontFamily, fontUrl, theme, letterSpacing, className, style, children, }: AnimatedBackgroundProps): react__default.JSX.Element;
64
+
16
65
  interface CinemaBackgroundProps {
17
66
  /** 3D Text rendered in world space */
18
67
  text?: string;
@@ -43,8 +92,7 @@ interface CinemaBackgroundProps {
43
92
  */
44
93
  declare function CinemaBackground({ text, theme, customBackground, interactiveSparks, interactiveShockwave, interactivePlasma, showParticles, enableBloom, className, style, children, }: CinemaBackgroundProps): react.JSX.Element;
45
94
 
46
- interface WithCinema3DOptions extends Omit<CinemaBackgroundProps, "children"> {
47
- }
95
+ type WithCinema3DOptions = Omit<CinemaBackgroundProps, "children">;
48
96
  /**
49
97
  * Higher-Order Component (HOC) that wraps any React component with the 3D WebGL Cinema background.
50
98
  *
@@ -69,32 +117,67 @@ interface CinemaLoaderProps {
69
117
  }
70
118
  declare function CinemaLoader({ cinemaName, defaultTheme, customBackground, onEnterCinema, }: CinemaLoaderProps): react.JSX.Element;
71
119
 
72
- declare function ClickFireSparks({ theme, enabled, }: {
120
+ interface FireFlamesProps {
121
+ theme?: MaterialTheme;
122
+ effectColor?: string;
123
+ effectSpeed?: number;
124
+ effectDensity?: number;
125
+ mode?: "fluid" | "crystal" | "all";
126
+ enabled?: boolean;
127
+ }
128
+ /**
129
+ * Dual-Engine Fire Flames Component:
130
+ * Offers both Organic Liquid Energy Flame Clouds (mode="fluid") and 3D Crystal Flame Geometries (mode="crystal" or mode="all")
131
+ */
132
+ declare function FireFlames({ theme, effectColor, effectSpeed, effectDensity, mode, enabled, }: FireFlamesProps): react.JSX.Element | null;
133
+
134
+ interface PlasmaBlobsProps {
135
+ theme?: MaterialTheme;
136
+ effectColor?: string;
137
+ effectSpeed?: number;
138
+ effectDensity?: number;
139
+ enabled?: boolean;
140
+ }
141
+ /**
142
+ * Exact Bioluminescent Liquid Energy Blobs Effect (matching user screenshot)
143
+ */
144
+ declare function PlasmaBlobs({ theme, effectColor, effectSpeed, effectDensity, enabled, }: PlasmaBlobsProps): react.JSX.Element | null;
145
+
146
+ declare function ClickFireSparks({ theme, effectColor, effectSpeed, enabled, }: {
73
147
  theme?: MaterialTheme;
148
+ effectColor?: string;
149
+ effectSpeed?: number;
74
150
  enabled?: boolean;
75
151
  }): react.JSX.Element;
76
152
 
77
- declare function ClickShockwave({ theme, enabled, }: {
153
+ declare function ClickShockwave({ theme, effectColor, effectSpeed, enabled, }: {
78
154
  theme?: MaterialTheme;
155
+ effectColor?: string;
156
+ effectSpeed?: number;
79
157
  enabled?: boolean;
80
158
  }): react.JSX.Element | null;
81
159
 
82
160
  interface ElectricPlasmaProps {
83
161
  theme?: MaterialTheme;
162
+ effectColor?: string;
163
+ effectSpeed?: number;
84
164
  enabled?: boolean;
85
165
  }
86
- declare function ElectricPlasma({ theme, enabled, }: ElectricPlasmaProps): react.JSX.Element | null;
166
+ declare function ElectricPlasma({ theme, effectColor, effectSpeed, enabled, }: ElectricPlasmaProps): react.JSX.Element | null;
87
167
 
88
168
  interface SceneParticlesProps {
89
169
  theme: MaterialTheme;
170
+ effectColor?: string;
171
+ effectSpeed?: number;
90
172
  visible: boolean;
91
173
  }
92
- declare function SceneParticles({ theme, visible }: SceneParticlesProps): react.JSX.Element | null;
174
+ declare function SceneParticles({ theme, effectColor, effectSpeed, visible }: SceneParticlesProps): react.JSX.Element | null;
93
175
 
94
176
  interface CameraRigProps {
95
177
  phase: "loading" | "entering" | "idle" | "exiting";
178
+ effectSpeed?: number;
96
179
  }
97
- declare function CameraRig({ phase }: CameraRigProps): null;
180
+ declare function CameraRig({ phase, effectSpeed }: CameraRigProps): null;
98
181
 
99
182
  interface EffectState {
100
183
  sparks: boolean;
@@ -118,4 +201,4 @@ declare function CinemaHome({ cinemaName, webTheme }: {
118
201
  webTheme?: string;
119
202
  }): react.JSX.Element;
120
203
 
121
- export { AnimatedLetter, CameraRig, CinemaBackground, type CinemaBackgroundProps, CinemaHome, CinemaLoader, ClickFireSparks, ClickShockwave, type EffectState, ElectricPlasma, LoaderOverlay, type MaterialTheme, SceneParticles, type WithCinema3DOptions, withCinema3D };
204
+ export { AnimatedBackground, type AnimatedBackgroundProps, AnimatedLetter, CameraRig, CinemaBackground, type CinemaBackgroundProps, CinemaHome, CinemaLoader, ClickFireSparks, ClickShockwave, type EffectState, type EffectType, ElectricPlasma, FireFlames, LoaderOverlay, type MaterialTheme, PlasmaBlobs, SceneParticles, type WithCinema3DOptions, AnimatedBackground as default, withCinema3D };