generated from antfu/starter-vscode
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
188 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"publisher": "oeyoews", | ||
"name": "usewiki2", | ||
"displayName": "usewiki2", | ||
"version": "2.7.2", | ||
"version": "2.8.0", | ||
"private": true, | ||
"packageManager": "[email protected]", | ||
"description": "", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"use client"; | ||
|
||
import { useEffect, useState } from "react"; | ||
|
||
import { cn } from "@/lib/utils"; | ||
|
||
interface MeteorsProps { | ||
number?: number; | ||
} | ||
export const Meteors = ({ number = 20 }: MeteorsProps) => { | ||
const [meteorStyles, setMeteorStyles] = useState<Array<React.CSSProperties>>( | ||
[], | ||
); | ||
|
||
useEffect(() => { | ||
const styles = [...new Array(number)].map(() => ({ | ||
top: -5, | ||
left: Math.floor(Math.random() * window.innerWidth) + "px", | ||
animationDelay: Math.random() * 1 + 0.2 + "s", | ||
animationDuration: Math.floor(Math.random() * 8 + 2) + "s", | ||
})); | ||
setMeteorStyles(styles); | ||
}, [number]); | ||
|
||
return ( | ||
<> | ||
{[...meteorStyles].map((style, idx) => ( | ||
// Meteor Head | ||
<span | ||
key={idx} | ||
className={cn( | ||
"pointer-events-none absolute left-1/2 top-1/2 size-0.5 rotate-[215deg] animate-meteor rounded-full bg-slate-500 shadow-[0_0_0_1px_#ffffff10]", | ||
)} | ||
style={style} | ||
> | ||
{/* Meteor Tail */} | ||
<div className="pointer-events-none absolute top-1/2 -z-10 h-px w-[50px] -translate-y-1/2 bg-gradient-to-r from-slate-500 to-transparent" /> | ||
</span> | ||
))} | ||
</> | ||
); | ||
}; | ||
|
||
export default Meteors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters