Skip to content

Commit

Permalink
修改网站logo
Browse files Browse the repository at this point in the history
  • Loading branch information
white0dew committed Jun 13, 2024
1 parent 5f2c8cc commit 1852b28
Show file tree
Hide file tree
Showing 16 changed files with 289 additions and 134 deletions.
55 changes: 37 additions & 18 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,57 @@

import { allPosts } from 'contentlayer/generated';
import Head from 'next/head';
import { redirect } from 'next/navigation';
import CustomLink from "@/components/Link"
import ProductList from "@/components/home/ProductShow"
import { allPosts } from "contentlayer/generated";
import CustomLink from "@/components/Link";
import ProductList from "@/components/home/ProductShow";
import Image from "next/image";
import Logo from "@/public/images/home.png";

// 示例产品数据
// 产品数据
const products = [
{ id: 1, name: 'Product 1', description: 'Description for Product 1', image: '/product1.jpg' },
{ id: 2, name: 'Product 2', description: 'Description for Product 2', image: '/product2.jpg' },
{
id: 1,
name: "Product 1",
description: "Description for Product 1",
image: "/product1.jpg",
},
{
id: 2,
name: "Product 2",
description: "Description for Product 2",
image: "/product2.jpg",
},
// ...更多产品
];


export default function Home() {

return (
<div className="min-h-screen bg-gray-100 dark:bg-slate-900">

{/* Hero Section */}
<section className="text-center py-20 bg-gradient-to-r from-teal-700 to-blue-500 text-white">
<div className="m-2 animate-bounce flex justify-center">
<Image src={Logo} alt="logo" width={150} height={150} />
</div>
<h1 className="text-6xl font-bold mb-4 animate-bounce">OffewNow</h1>

<p className="text-xl">立即拿到Offer哦!</p>
<p className="text-xl">分享最新的面试技巧、题库和编程知识</p>
{/* 数据统计组件 */}
<div className="text-center space-y-3 flex flex-col items-center">
<span className="text-2xl font-semibold">当前网站共有 <span className="text-green-500">{allPosts.length}</span> 份学习资料</span>

<div className='flex items-center justify-center '>
<div className=' animate-bounce-right flex items-center self-center text-lg'>👉</div>
<CustomLink className='w-fit font-semibold bg-teal-500 dark:bg-teal-800 rounded-md py-1 px-2 hover:bg-teal-600'
<span className="text-2xl font-semibold">
当前网站共有{" "}
<span className="text-green-500">{allPosts.length}</span> 份学习资料
</span>

<div className="flex items-center justify-center ">
<div className=" animate-bounce-right flex items-center self-center text-xl">
👉
</div>
<CustomLink
className="w-fit font-semibold bg-teal-500 dark:bg-teal-800 rounded-md py-1 px-2 hover:bg-teal-600"
href={"/s/language"}
> 赶紧卷起来!</CustomLink>
>
{" "}
赶紧卷起来!
</CustomLink>
</div>
</div>
</section>
Expand All @@ -41,4 +60,4 @@ export default function Home() {
<ProductList />
</div>
);
};
}
48 changes: 27 additions & 21 deletions components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
"use client"
import Link from '@/components/Link';
import Logo from '@/public/blog.svg';
import siteMetadata from '@/assets/siteMetadata';
import ThemeSwitch from '@/components/nav/ThemeSwitch';
import MobileNav from '@/components/nav/MobileNav';
import Navigation from './nav/WebNav';
import { ChapterTree } from '@/lib/elog';
"use client";
import Link from "@/components/Link";
import Logo from "@/public/images/home.png";
import siteMetadata from "@/assets/siteMetadata";
import ThemeSwitch from "@/components/nav/ThemeSwitch";
import MobileNav from "@/components/nav/MobileNav";
import Navigation from "./nav/WebNav";
import { ChapterTree } from "@/lib/elog";
import Image from "next/image";

export default function Header() {
// 检查当前路径是否包含特定的路径段

return (
<header className="sticky w-screen min-w-screen px-1 md:px-10 xl:px-20 z-50 flex bg-slate-50
<header
className="sticky w-screen min-w-screen px-1 md:px-10 xl:px-20 z-50 flex bg-slate-50
dark:bg-slate-700
justify-between
opacity-95 top-0">
opacity-95 top-0"
>
<div>
<Link href="/" aria-label={siteMetadata.headerTitle}>
<div className="flex items-center justify-between">
<div className="mr-3">
<Logo />
<div className="m-2">
<Image src={Logo} alt="logo" width={50} height={50} />
</div>
{typeof siteMetadata.headerTitle === 'string' ? (
{typeof siteMetadata.headerTitle === "string" ? (
<div className="hidden h-6 text-2xl font-semibold sm:block">
{siteMetadata.headerTitle}
</div>
Expand All @@ -30,7 +33,10 @@ export default function Header() {
)}
</div>
</Link>
<link href="https://artalk.aistar.cool/dist/Artalk.css" rel="stylesheet" />
<link
href="https://artalk.aistar.cool/dist/Artalk.css"
rel="stylesheet"
/>
</div>

<div className="flex items-center px-4 lg:pr-14">
Expand All @@ -44,24 +50,24 @@ export default function Header() {

function getCurTab(input: string) {
if (input.includes("/posts")) {
return "/posts"
return "/posts";
}

if (input.includes("/projects")) {
return "/projects"
return "/projects";
}

if (input.includes("/tags")) {
return "/tags"
return "/tags";
}

if (input.includes("/about")) {
return "/about"
return "/about";
}

if (input.includes("/archive")) {
return "/archive"
return "/archive";
}

return input
}
return input;
}
Loading

0 comments on commit 1852b28

Please sign in to comment.