From 7cf4d703fd8f6c1df8191eb6c0befb79b553c297 Mon Sep 17 00:00:00 2001 From: GeorgeWebberley Date: Thu, 29 Jan 2026 19:01:18 +0100 Subject: [PATCH] Made new star background --- components/Starfield copy.tsx | 41 ------------------ components/Starfield.tsx | 81 ++++++++++++++++++++++++++--------- 2 files changed, 60 insertions(+), 62 deletions(-) delete mode 100644 components/Starfield copy.tsx diff --git a/components/Starfield copy.tsx b/components/Starfield copy.tsx deleted file mode 100644 index 9f6947f..0000000 --- a/components/Starfield copy.tsx +++ /dev/null @@ -1,41 +0,0 @@ -"use client"; -import { motion } from "framer-motion"; -import { useState } from "react"; -import { Star } from "@/types/space" - -export default function Starfield() { - const [stars] = useState(() => - 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 ( -
-
- {stars.map((star) => ( - - ))} -
- ); -} \ No newline at end of file diff --git a/components/Starfield.tsx b/components/Starfield.tsx index 7c5f436..b7725c3 100644 --- a/components/Starfield.tsx +++ b/components/Starfield.tsx @@ -1,42 +1,81 @@ "use client"; import { motion } from "framer-motion"; import { useState } from "react"; -import { Star } from "@/types/space" -export default function Starfield() { - const [stars] = useState(() => +export default function ObservatoryBackground() { + const [stars] = useState(() => Array.from({ length: 80 }).map((_, i) => ({ id: i, left: `${Math.random() * 100}%`, - top: `${Math.random() * 100}%`, + top: `${Math.random() * 70}%`, size: Math.random() * 2 + 1, - duration: 2 + Math.random() * 3, + duration: 3 + Math.random() * 4, delay: Math.random() * 5, })) ); + const [skyline] = useState(() => { + const colors = ['#0b1420ff', '#0d1015ff', '#020408']; + const neons = ['#22d3ee', '#fb7185', '#60a5fa', '#ffffff', '#c084fc']; + + return Array.from({ length: 65 }).map((_, i) => ({ + id: i, + width: `${1.2 + Math.random() * 2.5}%`, + height: `${8 + Math.random() * 30}%`, + color: colors[i % colors.length], + neon: neons[Math.floor(Math.random() * neons.length)], + hasWindow: Math.random() > 0.4, + })); + }); + return ( -
- {/*
*/} -
+
+ +
+ {stars.map((star) => ( ))} + +
+ {skyline.map((b) => ( +
+
+
+ ))} +
+ +
); } \ No newline at end of file