init commit
This commit is contained in:
commit
73788ad2d2
20 files changed
+9086
No files matched your search
+14
@@ -0,0 +1,14 @@
|
||||
import Banner from "./components/Banner";
|
||||
import Header from "./components/Header";
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<div>
|
||||
<Header title="筱周の网站 - XiaoZhou's Website" />
|
||||
|
||||
<Banner />
|
||||
</div>
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 865 KiB |
@@ -0,0 +1,138 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import {
|
||||
Code2,
|
||||
Mail,
|
||||
LayoutDashboard,
|
||||
GitFork,
|
||||
ChevronDown
|
||||
} from "lucide-react";
|
||||
import bannerImg from "../assets/banner.png";
|
||||
|
||||
export default function Banner() {
|
||||
const fullText = "Xiaozhou's Website";
|
||||
const [text, setText] = useState("");
|
||||
const [offset, setOffset] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
let i = 0;
|
||||
const timer = setInterval(() => {
|
||||
setText(fullText.slice(0, i + 1));
|
||||
i++;
|
||||
if (i === fullText.length) clearInterval(timer);
|
||||
}, 100);
|
||||
|
||||
return () => clearInterval(timer);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const handleScroll = () => {
|
||||
setOffset(window.scrollY * 0.25);
|
||||
};
|
||||
window.addEventListener("scroll", handleScroll);
|
||||
return () => window.removeEventListener("scroll", handleScroll);
|
||||
}, []);
|
||||
|
||||
const navItems = [
|
||||
{
|
||||
name: "Blog",
|
||||
desc: "技术随笔与生活记录",
|
||||
path: "https://blog.xiaozhou233.cn",
|
||||
icon: <LayoutDashboard className="text-emerald-400" size={36} />,
|
||||
borderHover: "hover:border-emerald-500/50 hover:shadow-[0_0_20px_rgba(52,211,153,0.2)]"
|
||||
},
|
||||
{
|
||||
name: "Git",
|
||||
desc: "开源项目与代码托管",
|
||||
path: "https://git.xiaozhou233.cn",
|
||||
icon: <GitFork className="text-blue-400" size={36} />,
|
||||
borderHover: "hover:border-blue-500/50 hover:shadow-[0_0_20px_rgba(96,165,250,0.2)]"
|
||||
}
|
||||
];
|
||||
|
||||
return (
|
||||
<div
|
||||
className="relative w-full h-screen flex flex-col justify-between text-white overflow-hidden font-mono select-none"
|
||||
style={{
|
||||
backgroundImage: `url(${bannerImg})`,
|
||||
backgroundSize: "cover",
|
||||
backgroundPosition: `center ${-offset}px`,
|
||||
}}
|
||||
>
|
||||
<div className="absolute inset-0 bg-black/45 pointer-events-none" />
|
||||
|
||||
<header className="relative z-10 w-full px-6 py-4 flex justify-between items-center bg-linear-to-b from-black/60 to-transparent">
|
||||
<div className="text-emerald-400 font-medium tracking-tight text-sm md:text-base">
|
||||
root@Xiaozhou:~#
|
||||
</div>
|
||||
|
||||
|
||||
<div className="flex items-center gap-4 text-gray-400">
|
||||
<a href="https://github.com" target="_blank" rel="noopener noreferrer" className="hover:text-white transition-colors" title="GitHub">
|
||||
<svg className="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4" />
|
||||
<path d="M9 18c-4.51 2-5-2-7-2" />
|
||||
</svg>
|
||||
</a>
|
||||
<a href="#" className="hover:text-white transition-colors" title="Code"><Code2 size={20} /></a>
|
||||
<a href="#" className="hover:text-white transition-colors" title="Contact"><Mail size={20} /></a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main className="relative z-10 flex-1 flex flex-col items-center justify-center px-4 -translate-y-4">
|
||||
<h1 className="text-5xl md:text-7xl lg:text-8xl font-extrabold tracking-tighter text-transparent bg-clip-text bg-linear-to-r from-emerald-50 via-white to-emerald-50 drop-shadow-[0_0_15px_rgba(52,211,153,0.4)]">
|
||||
{text}
|
||||
<span className="animate-pulse text-emerald-400 ml-0.5">|</span>
|
||||
</h1>
|
||||
|
||||
<p className="mt-5 text-emerald-400/80 text-sm md:text-base tracking-tight font-light">
|
||||
{"< / Code. Deploy. Repeat. >"}
|
||||
</p>
|
||||
|
||||
<div className="w-12 h-0.5 bg-emerald-500 mt-5 shadow-[0_0_8px_#10b981]" />
|
||||
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-5 gap-6 mt-14 w-full max-w-6xl px-4">
|
||||
{navItems.map((item, index) => (
|
||||
<a
|
||||
key={index}
|
||||
href={item.path}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={`flex items-center md:flex-col md:text-center gap-5 md:gap-4 p-6 md:py-8 rounded-2xl bg-black/35 backdrop-blur-md border border-white/5 transition-all duration-300 cursor-pointer hover:-translate-y-1 hover:bg-black/45 ${item.borderHover} group block`}
|
||||
>
|
||||
<div className="shrink-0 transition-transform duration-300 group-hover:scale-105">
|
||||
{item.icon}
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col min-w-0 items-start md:items-center">
|
||||
<span className="text-xl md:text-3xl font-bold tracking-tight text-gray-100 transition-colors group-hover:text-white">
|
||||
{item.name}
|
||||
</span>
|
||||
<span className="text-xs md:text-sm text-gray-400/80 mt-1.5 tracking-wide line-clamp-1 group-hover:text-gray-300 transition-colors font-sans">
|
||||
{item.desc}
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer className="relative z-10 w-full pb-6 flex flex-col items-center justify-center gap-4 bg-linear-to-t from-black/40 to-transparent">
|
||||
<div className="animate-bounce">
|
||||
<ChevronDown size={26} className="text-emerald-400/50 cursor-pointer hover:text-emerald-400 transition-colors" />
|
||||
</div>
|
||||
|
||||
<div className="text-xs md:text-sm text-gray-400/70 tracking-wide font-sans flex items-center gap-1.5 selection:bg-emerald-500/30">
|
||||
<span className="text-red-500 animate-pulse">❤</span>
|
||||
<span>Built with</span>
|
||||
<span className="text-gray-200 font-medium hover:text-cyan-400 transition-colors duration-300 cursor-pointer">
|
||||
React
|
||||
</span>
|
||||
<span>&</span>
|
||||
<span className="text-gray-200 font-medium hover:text-sky-400 transition-colors duration-300 cursor-pointer">
|
||||
Tailwind CSS
|
||||
</span>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Helmet } from "react-helmet-async";
|
||||
|
||||
type HeaderProps = {
|
||||
title: string;
|
||||
};
|
||||
|
||||
export default function Header({ title }: HeaderProps) {
|
||||
return (
|
||||
<Helmet>
|
||||
<title>{title}</title>
|
||||
</Helmet>
|
||||
);
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
@import "tailwindcss";
|
||||
@import "tw-animate-css";
|
||||
@import "shadcn/tailwind.css";
|
||||
@import "@fontsource-variable/geist";
|
||||
|
||||
@custom-variant dark (&:is(.dark *));
|
||||
|
||||
@theme inline {
|
||||
--font-heading: var(--font-sans);
|
||||
--font-sans: 'Geist Variable', sans-serif;
|
||||
--color-sidebar-ring: var(--sidebar-ring);
|
||||
--color-sidebar-border: var(--sidebar-border);
|
||||
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
||||
--color-sidebar-accent: var(--sidebar-accent);
|
||||
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
||||
--color-sidebar-primary: var(--sidebar-primary);
|
||||
--color-sidebar-foreground: var(--sidebar-foreground);
|
||||
--color-sidebar: var(--sidebar);
|
||||
--color-chart-5: var(--chart-5);
|
||||
--color-chart-4: var(--chart-4);
|
||||
--color-chart-3: var(--chart-3);
|
||||
--color-chart-2: var(--chart-2);
|
||||
--color-chart-1: var(--chart-1);
|
||||
--color-ring: var(--ring);
|
||||
--color-input: var(--input);
|
||||
--color-border: var(--border);
|
||||
--color-destructive: var(--destructive);
|
||||
--color-accent-foreground: var(--accent-foreground);
|
||||
--color-accent: var(--accent);
|
||||
--color-muted-foreground: var(--muted-foreground);
|
||||
--color-muted: var(--muted);
|
||||
--color-secondary-foreground: var(--secondary-foreground);
|
||||
--color-secondary: var(--secondary);
|
||||
--color-primary-foreground: var(--primary-foreground);
|
||||
--color-primary: var(--primary);
|
||||
--color-popover-foreground: var(--popover-foreground);
|
||||
--color-popover: var(--popover);
|
||||
--color-card-foreground: var(--card-foreground);
|
||||
--color-card: var(--card);
|
||||
--color-foreground: var(--foreground);
|
||||
--color-background: var(--background);
|
||||
--radius-sm: calc(var(--radius) * 0.6);
|
||||
--radius-md: calc(var(--radius) * 0.8);
|
||||
--radius-lg: var(--radius);
|
||||
--radius-xl: calc(var(--radius) * 1.4);
|
||||
--radius-2xl: calc(var(--radius) * 1.8);
|
||||
--radius-3xl: calc(var(--radius) * 2.2);
|
||||
--radius-4xl: calc(var(--radius) * 2.6);
|
||||
}
|
||||
|
||||
:root {
|
||||
--background: oklch(1 0 0);
|
||||
--foreground: oklch(0.145 0 0);
|
||||
--card: oklch(1 0 0);
|
||||
--card-foreground: oklch(0.145 0 0);
|
||||
--popover: oklch(1 0 0);
|
||||
--popover-foreground: oklch(0.145 0 0);
|
||||
--primary: oklch(0.205 0 0);
|
||||
--primary-foreground: oklch(0.985 0 0);
|
||||
--secondary: oklch(0.97 0 0);
|
||||
--secondary-foreground: oklch(0.205 0 0);
|
||||
--muted: oklch(0.97 0 0);
|
||||
--muted-foreground: oklch(0.556 0 0);
|
||||
--accent: oklch(0.97 0 0);
|
||||
--accent-foreground: oklch(0.205 0 0);
|
||||
--destructive: oklch(0.577 0.245 27.325);
|
||||
--border: oklch(0.922 0 0);
|
||||
--input: oklch(0.922 0 0);
|
||||
--ring: oklch(0.708 0 0);
|
||||
--chart-1: oklch(0.87 0 0);
|
||||
--chart-2: oklch(0.556 0 0);
|
||||
--chart-3: oklch(0.439 0 0);
|
||||
--chart-4: oklch(0.371 0 0);
|
||||
--chart-5: oklch(0.269 0 0);
|
||||
--radius: 0.625rem;
|
||||
--sidebar: oklch(0.985 0 0);
|
||||
--sidebar-foreground: oklch(0.145 0 0);
|
||||
--sidebar-primary: oklch(0.205 0 0);
|
||||
--sidebar-primary-foreground: oklch(0.985 0 0);
|
||||
--sidebar-accent: oklch(0.97 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.205 0 0);
|
||||
--sidebar-border: oklch(0.922 0 0);
|
||||
--sidebar-ring: oklch(0.708 0 0);
|
||||
}
|
||||
|
||||
.dark {
|
||||
--background: oklch(0.145 0 0);
|
||||
--foreground: oklch(0.985 0 0);
|
||||
--card: oklch(0.205 0 0);
|
||||
--card-foreground: oklch(0.985 0 0);
|
||||
--popover: oklch(0.205 0 0);
|
||||
--popover-foreground: oklch(0.985 0 0);
|
||||
--primary: oklch(0.922 0 0);
|
||||
--primary-foreground: oklch(0.205 0 0);
|
||||
--secondary: oklch(0.269 0 0);
|
||||
--secondary-foreground: oklch(0.985 0 0);
|
||||
--muted: oklch(0.269 0 0);
|
||||
--muted-foreground: oklch(0.708 0 0);
|
||||
--accent: oklch(0.269 0 0);
|
||||
--accent-foreground: oklch(0.985 0 0);
|
||||
--destructive: oklch(0.704 0.191 22.216);
|
||||
--border: oklch(1 0 0 / 10%);
|
||||
--input: oklch(1 0 0 / 15%);
|
||||
--ring: oklch(0.556 0 0);
|
||||
--chart-1: oklch(0.87 0 0);
|
||||
--chart-2: oklch(0.556 0 0);
|
||||
--chart-3: oklch(0.439 0 0);
|
||||
--chart-4: oklch(0.371 0 0);
|
||||
--chart-5: oklch(0.269 0 0);
|
||||
--sidebar: oklch(0.205 0 0);
|
||||
--sidebar-foreground: oklch(0.985 0 0);
|
||||
--sidebar-primary: oklch(0.488 0.243 264.376);
|
||||
--sidebar-primary-foreground: oklch(0.985 0 0);
|
||||
--sidebar-accent: oklch(0.269 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.985 0 0);
|
||||
--sidebar-border: oklch(1 0 0 / 10%);
|
||||
--sidebar-ring: oklch(0.556 0 0);
|
||||
}
|
||||
|
||||
@layer base {
|
||||
* {
|
||||
@apply border-border outline-ring/50;
|
||||
}
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
html {
|
||||
@apply font-sans;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { clsx, type ClassValue } from "clsx"
|
||||
import { twMerge } from "tailwind-merge"
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import App from "./App";
|
||||
import './index.css'
|
||||
|
||||
ReactDOM.createRoot(document.getElementById("root")!).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
);
|
||||
Reference in new issue
Block a user