Night sky background with shooting stars on every page
Faint twinkling stars and, on average every 6 seconds, a gold shooting star, on a fixed canvas behind all content: anything with its own background (bands, cards, the header) covers it, so the meteor passes under them. With reduced motion only still stars are drawn. Replaces the home page hero's own starfield. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -12,21 +12,6 @@ import type { AnalysisContent, ChartResult } from "@/lib/types";
|
||||
/** The cards fanned out next to the tarot line (after a card back). */
|
||||
const TAROT_CARDS = ["major-2", "major-17"].map((id) => tarotCard(id)).filter((c) => c !== undefined);
|
||||
|
||||
// A quiet starfield, the same on every render.
|
||||
const STARS = (() => {
|
||||
let seed = 7;
|
||||
const rnd = () => {
|
||||
seed = (seed * 9301 + 49297) % 233280;
|
||||
return seed / 233280;
|
||||
};
|
||||
return Array.from({ length: 70 }, (_, i) => ({
|
||||
x: (rnd() * 1000).toFixed(1),
|
||||
y: (rnd() * 600).toFixed(1),
|
||||
r: (0.6 + rnd() * 1.4).toFixed(1),
|
||||
t: i % 5,
|
||||
}));
|
||||
})();
|
||||
|
||||
const MONTHS = ["márc", "ápr", "máj", "jún", "júl", "aug", "szept", "okt", "nov", "dec", "jan", "febr"];
|
||||
|
||||
/** Points of a ring of the comparison picture. */
|
||||
@@ -68,11 +53,6 @@ export function Landing({ inviteOnly }: { inviteOnly: boolean }) {
|
||||
<PublicHeader onHome />
|
||||
|
||||
<section className="lp-hero">
|
||||
<svg className="lp-stars" aria-hidden="true" viewBox="0 0 1000 600" preserveAspectRatio="xMidYMid slice">
|
||||
{STARS.map((s, i) => (
|
||||
<circle key={i} cx={s.x} cy={s.y} r={s.r} className={`lp-star lp-t${s.t}`} />
|
||||
))}
|
||||
</svg>
|
||||
<div className="lp-wrap lp-hero-grid">
|
||||
<div className="lp-hero-text">
|
||||
<span className="eyebrow lp-rise lp-r1">Születési képlet · Éves előrejelzés · Kapcsolat</span>
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
html, body { margin: 0; }
|
||||
/* The night sky behind everything (components/NightSky.tsx): drawn over the
|
||||
page background, under all content, so anything with its own background
|
||||
covers it. */
|
||||
.night-sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
|
||||
body {
|
||||
min-height: 100vh;
|
||||
overflow-x: clip; /* nothing may push the page sideways on a phone */
|
||||
|
||||
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
|
||||
import { Cormorant_Garamond, Inter } from "next/font/google";
|
||||
import { Suspense } from "react";
|
||||
|
||||
import { NightSky } from "@/components/NightSky";
|
||||
import { PaymentReturn } from "@/components/PaymentReturn";
|
||||
import { SiteHeader } from "@/components/SiteHeader";
|
||||
import { getMe } from "@/lib/server";
|
||||
@@ -30,6 +31,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
||||
return (
|
||||
<html lang="hu" className={`${cormorant.variable} ${inter.variable}`}>
|
||||
<body>
|
||||
<NightSky />
|
||||
{me && <SiteHeader me={me} />}
|
||||
{children}
|
||||
{me && (
|
||||
|
||||
Reference in New Issue
Block a user