Begin on the new landing page
This commit is contained in:
@ -6,6 +6,7 @@ import { useQuery } from "@tanstack/react-query";
|
||||
import { kyFetch } from "@ssr/common/utils/utils";
|
||||
import { Config } from "@ssr/common/config";
|
||||
import { useEffect, useState } from "react";
|
||||
import { User } from "lucide-react";
|
||||
|
||||
type AppStatisticsProps = {
|
||||
/**
|
||||
@ -29,13 +30,24 @@ export function AppStats({ initialStatistics }: AppStatisticsProps) {
|
||||
}, [data]);
|
||||
|
||||
return (
|
||||
<div className="flex items-center flex-col">
|
||||
<p className="font-semibold">Site Statistics</p>
|
||||
<Statistic title="Tracked Players" value={statistics.trackedPlayers} />
|
||||
<Statistic title="Tracked Scores" value={statistics.trackedScores} />
|
||||
<Statistic title="Additional Scores Data" value={statistics.additionalScoresData} />
|
||||
<Statistic title="Cached BeatSaver Maps" value={statistics.cachedBeatSaverMaps} />
|
||||
<Statistic title="Cached ScoreSaber Leaderboards" value={statistics.cachedScoreSaberLeaderboards} />
|
||||
<div className="grid grid-cols-2 gap-5 sm:grid-cols-3 sm:gap-7 md:grid-cols-4 md:gap-12 lg:grid-cols-5">
|
||||
<Statistic icon={<User className="size-10" />} title="Tracked Players" value={statistics.trackedPlayers} />
|
||||
<Statistic icon={<User className="size-10" />} title="Tracked Scores" value={statistics.trackedScores} />
|
||||
<Statistic
|
||||
icon={<User className="size-10" />}
|
||||
title="Additional Scores Data"
|
||||
value={statistics.additionalScoresData}
|
||||
/>
|
||||
<Statistic
|
||||
icon={<User className="size-10" />}
|
||||
title="Cached BeatSaver Maps"
|
||||
value={statistics.cachedBeatSaverMaps}
|
||||
/>
|
||||
<Statistic
|
||||
icon={<User className="size-10" />}
|
||||
title="Cached ScoreSaber Leaderboards"
|
||||
value={statistics.cachedScoreSaberLeaderboards}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
26
projects/website/src/components/home/data-collection.tsx
Normal file
26
projects/website/src/components/home/data-collection.tsx
Normal file
@ -0,0 +1,26 @@
|
||||
import { Database } from "lucide-react";
|
||||
|
||||
export default function DataCollection() {
|
||||
return (
|
||||
<div className="px-5 -mt-32 flex flex-col gap-10 select-none">
|
||||
{/* Header */}
|
||||
<div className="flex flex-col gap-2.5">
|
||||
<div className="flex gap-3.5 items-center">
|
||||
<Database className="size-7 text-pp" />
|
||||
<h1 className="text-4xl font-bold text-ssr">Data Collection</h1>
|
||||
</div>
|
||||
<p className="opacity-85">posidonium novum ancillae ius conclusionemque splendide vel.</p>
|
||||
</div>
|
||||
|
||||
{/* Content */}
|
||||
<div className="max-w-[900px]">
|
||||
<img
|
||||
className="w-full h-full rounded-xl border border-ssr/20"
|
||||
src="/assets/home/data-collection.png"
|
||||
alt="Data Collection"
|
||||
draggable={false}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
26
projects/website/src/components/home/friends.tsx
Normal file
26
projects/website/src/components/home/friends.tsx
Normal file
@ -0,0 +1,26 @@
|
||||
import { Database } from "lucide-react";
|
||||
|
||||
export default function Friends() {
|
||||
return (
|
||||
<div className="px-5 -mt-20 flex flex-col gap-10 items-end select-none">
|
||||
{/* Header */}
|
||||
<div className="flex flex-col gap-2.5 items-end">
|
||||
<div className="flex gap-3.5 items-center">
|
||||
<Database className="size-7 text-pp" />
|
||||
<h1 className="text-4xl font-bold text-ssr">Friends</h1>
|
||||
</div>
|
||||
<p className="opacity-85">posidonium novum ancillae ius conclusionemque splendide vel.</p>
|
||||
</div>
|
||||
|
||||
{/* Content */}
|
||||
<div className="max-w-[900px]">
|
||||
<img
|
||||
className="w-full h-full rounded-xl border border-ssr/20"
|
||||
src="/assets/home/friends.png"
|
||||
alt="Friends"
|
||||
draggable={false}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
82
projects/website/src/components/home/hero.tsx
Normal file
82
projects/website/src/components/home/hero.tsx
Normal file
@ -0,0 +1,82 @@
|
||||
import AnimatedShinyText from "@/components/ui/animated-shiny-text";
|
||||
import { ArrowRight, UserSearch } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { SiGithub } from "react-icons/si";
|
||||
import { BorderBeam } from "@/components/ui/border-beam";
|
||||
import { Separator } from "@/components/ui/separator";
|
||||
|
||||
export default function HeroSection() {
|
||||
return (
|
||||
<div className="flex flex-col gap-3.5 text-center items-center select-none">
|
||||
<Alert />
|
||||
<Title />
|
||||
<Buttons />
|
||||
<AppPreview />
|
||||
<Separator className="my-14 w-screen" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function Alert() {
|
||||
return (
|
||||
<Link
|
||||
className="group mb-1.5 bg-neutral-900 hover:opacity-85 border border-white/5 rounded-full transition-all transform-gpu"
|
||||
href="https://git.fascinated.cc/Fascinated/scoresaber-reloadedv3"
|
||||
target="_blank"
|
||||
draggable={false}
|
||||
>
|
||||
<AnimatedShinyText className="px-3.5 py-1 flex gap-2 items-center justify-center">
|
||||
<SiGithub className="size-5" />
|
||||
<span>Check out our Source Code</span>
|
||||
<ArrowRight className="size-4 group-hover:translate-x-0.5 transition-all transform-gpu" />
|
||||
</AnimatedShinyText>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
function Title() {
|
||||
return (
|
||||
<>
|
||||
<h1 className="text-4xl sm:text-5xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-ssr to-pp/85">
|
||||
ScoreSaber Reloaded
|
||||
</h1>
|
||||
<p className="max-w-sm md:max-w-xl md:text-lg opacity-85">
|
||||
Scoresaber Reloaded is a new way to view your scores and get more stats about your and your plays
|
||||
</p>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function Buttons() {
|
||||
return (
|
||||
<div className="mt-4 flex gap-4">
|
||||
<Link href="https://discord.gg/kmNfWGA4A8" target="_blank">
|
||||
<Button className="max-w-52 flex gap-2.5 bg-pp hover:bg-pp/85 text-white text-base">
|
||||
<UserSearch className="size-6" />
|
||||
<span>Player Search</span>
|
||||
</Button>
|
||||
</Link>
|
||||
|
||||
<Link href="https://discord.gg/kmNfWGA4A8" target="_blank">
|
||||
<Button className="max-w-52 flex gap-2.5 bg-[#5865F2] hover:bg-[#5865F2]/85 text-white text-base">
|
||||
<img className="size-6" src="/assets/logos/discord.svg" />
|
||||
<span>Join our Discord</span>
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AppPreview() {
|
||||
return (
|
||||
<div className="mx-5 my-24 relative max-w-[1280px] shadow-[0_3rem_20rem_-15px_rgba(15,15,15,0.6)] shadow-pp/50 rounded-xl overflow-hidden">
|
||||
<BorderBeam colorFrom="#6773ff" colorTo="#4858ff" />
|
||||
<img
|
||||
className="w-full h-full border-4 border-pp/20 rounded-xl"
|
||||
src="/assets/home/app-preview.png"
|
||||
draggable={false}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
26
projects/website/src/components/home/realtime-scores.tsx
Normal file
26
projects/website/src/components/home/realtime-scores.tsx
Normal file
@ -0,0 +1,26 @@
|
||||
import { Database } from "lucide-react";
|
||||
|
||||
export default function RealtimeScores() {
|
||||
return (
|
||||
<div className="px-5 -mt-20 flex flex-col gap-10 items-end select-none">
|
||||
{/* Header */}
|
||||
<div className="flex flex-col gap-2.5 items-end">
|
||||
<div className="flex gap-3.5 items-center">
|
||||
<Database className="size-7 text-pp" />
|
||||
<h1 className="text-4xl font-bold text-ssr">Realtime Scores</h1>
|
||||
</div>
|
||||
<p className="opacity-85">posidonium novum ancillae ius conclusionemque splendide vel.</p>
|
||||
</div>
|
||||
|
||||
{/* Content */}
|
||||
<div className="max-w-[900px]">
|
||||
<img
|
||||
className="w-full h-full rounded-xl border border-ssr/20"
|
||||
src="/assets/home/realtime-scores.png"
|
||||
alt="Realtime Scores"
|
||||
draggable={false}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
24
projects/website/src/components/home/site-stats.tsx
Normal file
24
projects/website/src/components/home/site-stats.tsx
Normal file
@ -0,0 +1,24 @@
|
||||
import { Database } from "lucide-react";
|
||||
import { kyFetch } from "@ssr/common/utils/utils";
|
||||
import { AppStatistics } from "@ssr/common/types/backend/app-statistics";
|
||||
import { Config } from "@ssr/common/config";
|
||||
import { AppStats } from "@/components/app-statistics";
|
||||
|
||||
export default async function SiteStats() {
|
||||
const statistics = await kyFetch<AppStatistics>(Config.apiUrl + "/statistics");
|
||||
return (
|
||||
<div className="px-5 -mt-20 flex flex-col gap-10 select-none">
|
||||
{/* Header */}
|
||||
<div className="flex flex-col gap-2.5">
|
||||
<div className="flex gap-3.5 items-center">
|
||||
<Database className="size-7 text-pp" />
|
||||
<h1 className="text-4xl font-bold text-ssr">Site Statistics</h1>
|
||||
</div>
|
||||
<p className="opacity-85">posidonium novum ancillae ius conclusionemque splendide vel.</p>
|
||||
</div>
|
||||
|
||||
{/* Content */}
|
||||
{statistics && <AppStats initialStatistics={statistics} />}
|
||||
</div>
|
||||
);
|
||||
}
|
@ -1,16 +1,22 @@
|
||||
"use client";
|
||||
|
||||
import CountUp from "react-countup";
|
||||
import { ReactElement } from "react";
|
||||
|
||||
type Statistic = {
|
||||
icon: ReactElement;
|
||||
title: string;
|
||||
value: number;
|
||||
};
|
||||
|
||||
export default function Statistic({ title, value }: Statistic) {
|
||||
export default function Statistic({ icon, title, value }: Statistic) {
|
||||
return (
|
||||
<p className="text-center">
|
||||
{title}: <CountUp end={value} duration={1.2} />
|
||||
</p>
|
||||
<div className="flex flex-col gap-2 text-center items-center text-lg">
|
||||
{icon}
|
||||
<h1 className="font-semibold text-ssr">{title}</h1>
|
||||
<span>
|
||||
<CountUp end={value} duration={1.2} enableScrollSpy scrollSpyOnce />
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ export default function FullscreenLoader({ reason }: Props) {
|
||||
<div className="absolute w-screen h-screen bg-background brightness-[66%] flex flex-col gap-6 items-center justify-center">
|
||||
<div className="flex flex-col items-center justify-center">
|
||||
<p className="text-white text-xl font-bold">ScoreSaber Reloaded</p>
|
||||
<p className="text-gray-300 text-md text-center">{reason}</p>
|
||||
<div className="text-gray-300 text-md text-center">{reason}</div>
|
||||
</div>
|
||||
<div className="animate-spin">
|
||||
<ScoreSaberLogo />
|
||||
|
@ -6,7 +6,6 @@ import NavbarButton from "./navbar-button";
|
||||
import ProfileButton from "./profile-button";
|
||||
import { TrendingUpIcon } from "lucide-react";
|
||||
import FriendsButton from "@/components/navbar/friends-button";
|
||||
import { PiSwordFill } from "react-icons/pi";
|
||||
|
||||
type NavbarItem = {
|
||||
name: string;
|
||||
|
35
projects/website/src/components/ui/animated-shiny-text.tsx
Normal file
35
projects/website/src/components/ui/animated-shiny-text.tsx
Normal file
@ -0,0 +1,35 @@
|
||||
import { CSSProperties, FC, ReactNode } from "react";
|
||||
import { cn } from "@/common/utils";
|
||||
|
||||
interface AnimatedShinyTextProps {
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
shimmerWidth?: number;
|
||||
}
|
||||
|
||||
const AnimatedShinyText: FC<AnimatedShinyTextProps> = ({ children, className, shimmerWidth = 100 }) => {
|
||||
return (
|
||||
<p
|
||||
style={
|
||||
{
|
||||
"--shiny-width": `${shimmerWidth}px`,
|
||||
} as CSSProperties
|
||||
}
|
||||
className={cn(
|
||||
"mx-auto max-w-md text-neutral-600/70 dark:text-neutral-400/70",
|
||||
|
||||
// Shine effect
|
||||
"animate-shiny-text bg-clip-text bg-no-repeat [background-position:0_0] [background-size:var(--shiny-width)_100%] [transition:background-position_1s_cubic-bezier(.6,.6,0,1)_infinite]",
|
||||
|
||||
// Shine gradient
|
||||
"bg-gradient-to-r from-transparent via-black/80 via-50% to-transparent dark:via-white/80",
|
||||
|
||||
className
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</p>
|
||||
);
|
||||
};
|
||||
|
||||
export default AnimatedShinyText;
|
49
projects/website/src/components/ui/border-beam.tsx
Normal file
49
projects/website/src/components/ui/border-beam.tsx
Normal file
@ -0,0 +1,49 @@
|
||||
import { cn } from "@/common/utils";
|
||||
|
||||
interface BorderBeamProps {
|
||||
className?: string;
|
||||
size?: number;
|
||||
duration?: number;
|
||||
borderWidth?: number;
|
||||
anchor?: number;
|
||||
colorFrom?: string;
|
||||
colorTo?: string;
|
||||
delay?: number;
|
||||
}
|
||||
|
||||
export const BorderBeam = ({
|
||||
className,
|
||||
size = 200,
|
||||
duration = 15,
|
||||
anchor = 90,
|
||||
borderWidth = 1.5,
|
||||
colorFrom = "#ffaa40",
|
||||
colorTo = "#9c40ff",
|
||||
delay = 0,
|
||||
}: BorderBeamProps) => {
|
||||
return (
|
||||
<div
|
||||
style={
|
||||
{
|
||||
"--size": size,
|
||||
"--duration": duration,
|
||||
"--anchor": anchor,
|
||||
"--border-width": borderWidth,
|
||||
"--color-from": colorFrom,
|
||||
"--color-to": colorTo,
|
||||
"--delay": `-${delay}s`,
|
||||
} as React.CSSProperties
|
||||
}
|
||||
className={cn(
|
||||
"pointer-events-none absolute inset-0 rounded-[inherit] [border:calc(var(--border-width)*1px)_solid_transparent]",
|
||||
|
||||
// mask styles
|
||||
"![mask-clip:padding-box,border-box] ![mask-composite:intersect] [mask:linear-gradient(transparent,transparent),linear-gradient(white,white)]",
|
||||
|
||||
// pseudo styles
|
||||
"after:absolute after:aspect-square after:w-[calc(var(--size)*1px)] after:animate-border-beam after:[animation-delay:var(--delay)] after:[background:linear-gradient(to_left,var(--color-from),var(--color-to),transparent)] after:[offset-anchor:calc(var(--anchor)*1%)_50%] after:[offset-path:rect(0_auto_auto_0_round_calc(var(--size)*1px))]",
|
||||
className
|
||||
)}
|
||||
/>
|
||||
);
|
||||
};
|
21
projects/website/src/components/ui/separator.tsx
Normal file
21
projects/website/src/components/ui/separator.tsx
Normal file
@ -0,0 +1,21 @@
|
||||
"use client";
|
||||
|
||||
import * as React from "react";
|
||||
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
||||
import { cn } from "@/common/utils";
|
||||
|
||||
const Separator = React.forwardRef<
|
||||
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
||||
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
||||
>(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => (
|
||||
<SeparatorPrimitive.Root
|
||||
ref={ref}
|
||||
decorative={decorative}
|
||||
orientation={orientation}
|
||||
className={cn("shrink-0 bg-border", orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", className)}
|
||||
{...props}
|
||||
/>
|
||||
));
|
||||
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
||||
|
||||
export { Separator };
|
Reference in New Issue
Block a user