Spaces:
Sleeping
Sleeping
File size: 814 Bytes
bea55e2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 'use client';
import dynamic from 'next/dynamic';
import { useMemo } from 'react';
import * as THREE from 'three';
// Force client-side execution to bypass Next.js Server-Side Rendering
const SmokeScene = dynamic(
() => import('react-smoke').then((mod: any) => mod.SmokeScene) as Promise<any>,
{ ssr: false }
) as React.ComponentType<any>;
export default function RealisticSmoke() {
// Memoize color to prevent unnecessary React re-renders on the canvas
const smokeColor = useMemo(() => new THREE.Color("#555555"), []);
return (
<div className="fixed inset-0 -z-50 w-screen h-screen bg-[#050508] overflow-hidden pointer-events-none">
<SmokeScene
smoke={{
color: smokeColor,
density: 45,
enableRotation: true
}}
/>
</div>
);
}
|