Compare commits

...

2 Commits

Author SHA1 Message Date
4d1b71bf30
remove unused import 2024-08-02 15:09:41 +02:00
b9f26ce320
fix mobile stars 2024-08-02 12:49:17 +02:00
2 changed files with 3 additions and 5 deletions

BIN
bun.lockb

Binary file not shown.

View File

@ -1,6 +1,6 @@
"use client"; "use client";
import { CSSProperties, HTMLAttributes, useEffect, useState } from "react"; import { CSSProperties, useEffect, useState } from "react";
type Props = { type Props = {
count: number; count: number;
@ -24,8 +24,6 @@ const Stars = ({ count }: Props) => {
background: `radial-gradient(circle, ${randomRgba(0.6)} 0%, ${randomRgba(0)} 100%)`, background: `radial-gradient(circle, ${randomRgba(0.6)} 0%, ${randomRgba(0)} 100%)`,
width: radius, width: radius,
height: radius, height: radius,
transform: "translate(-50%)",
animation: "spinner 5s linear infinite"
}; };
if (key) { if (key) {
style = { style = {
@ -59,14 +57,14 @@ const Stars = ({ count }: Props) => {
height: containerRadius, height: containerRadius,
animation: `${animation} ${duration}s linear infinite` animation: `${animation} ${duration}s linear infinite`
}} }}
className="absolute"> className="absolute z-10 max-w-full max-h-full">
{star()} {star()}
</div> </div>
) )
} }
return ( return (
<div> <div className="absolute w-screen h-screen overflow-hidden">
{Array.from({ length: count }).map((_it, i) => { {Array.from({ length: count }).map((_it, i) => {
return i % 4 === 0 ? spinningStar(i) : star(i) return i % 4 === 0 ? spinningStar(i) : star(i)
})} })}