This commit is contained in:
parent
0a744e5869
commit
d0de866470
41
components/Starfield copy.tsx
Normal file
41
components/Starfield copy.tsx
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
"use client";
|
||||
import { motion } from "framer-motion";
|
||||
import { useState } from "react";
|
||||
import { Star } from "@/types/space"
|
||||
|
||||
export default function Starfield() {
|
||||
const [stars] = useState<Star[]>(() =>
|
||||
Array.from({ length: 80 }).map((_, i) => ({
|
||||
id: i,
|
||||
left: `${Math.random() * 100}%`,
|
||||
top: `${Math.random() * 100}%`,
|
||||
size: Math.random() * 2 + 1,
|
||||
duration: 2 + Math.random() * 3,
|
||||
delay: Math.random() * 5,
|
||||
}))
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 z-[-1] bg-[#020617] overflow-hidden">
|
||||
<div className="absolute inset-0 bg-[radial-gradient(circle_at_50%_50%,_rgba(30,58,138,0.2)_0%,_transparent_50%)]" />
|
||||
{stars.map((star) => (
|
||||
<motion.div
|
||||
key={star.id}
|
||||
className="absolute bg-white rounded-full shadow-[0_0_5px_white]"
|
||||
style={{
|
||||
top: star.top,
|
||||
left: star.left,
|
||||
width: star.size,
|
||||
height: star.size,
|
||||
}}
|
||||
animate={{ opacity: [0.2, 0.8, 0.2] }}
|
||||
transition={{
|
||||
duration: star.duration,
|
||||
repeat: Infinity,
|
||||
delay: star.delay,
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -16,7 +16,8 @@ export default function Starfield() {
|
|||
);
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 z-[-1] bg-[#020617] overflow-hidden">
|
||||
<div className="fixed inset-0 z-[-1] bg-[#01030F] overflow-hidden">
|
||||
{/* <div className="fixed inset-0 z-[-1] bg-[#020617] overflow-hidden"> */}
|
||||
<div className="absolute inset-0 bg-[radial-gradient(circle_at_50%_50%,_rgba(30,58,138,0.2)_0%,_transparent_50%)]" />
|
||||
{stars.map((star) => (
|
||||
<motion.div
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ services:
|
|||
- ./data:/app/data
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- NODE_OPTIONS=--dns-result-order=ipv4first
|
||||
depends_on:
|
||||
- web
|
||||
dns:
|
||||
|
|
|
|||
Loading…
Reference in a new issue