Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new home preview #52

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions projects/fastgpt/app/[[...lang]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import CTA from '@/components/home/CTA';
import FAQ from '@/components/home/FAQ';
import Feature from '@/components/home/Feature';
import Hero from '@/components/home/Hero';
import Pricing from '@/components/home/Pricing';
import SocialProof from '@/components/home/SocialProof';
// import SocialProof from '@/components/home/SocialProof';
import VideoPlayer from '@/components/home/Video';
import { defaultLocale, getDictionary, localeNames } from '@/lib/i18n';

Expand All @@ -21,15 +20,15 @@ export default async function LangHome({ params: { lang } }: { params: { lang?:
if (stargazers_count) {
stars = stargazers_count;
}
} catch (error) {}
} catch (error) { }

return (
<>
<Header dict={dict} />
<main className="flex flex-col items-center py-6">
<main className="flex flex-col items-center mt-12 sm:mt-14 lg:mt-20">
{/* Hero Section */}
<Hero locale={dict.Hero} CTALocale={dict.CTAButton} stars={stars} />
<SocialProof locale={dict.SocialProof} />
{/* <SocialProof locale={dict.SocialProof} /> */}
{/* Can be used to display technology stack, partners, project honors, etc. */}
{/*<ScrollingLogos />*/}
<VideoPlayer dict={dict} />
Expand All @@ -40,12 +39,12 @@ export default async function LangHome({ params: { lang } }: { params: { lang?:
<Feature id="Features" locale={dict.Feature} langName={langName} />

{/* Pricing */}
<Pricing id="Pricing" locale={dict.Pricing} langName={langName} />
{/* <Pricing id="Pricing" locale={dict.Pricing} langName={langName} /> */}

{/* FAQ (Frequently Asked Questions) */}
<FAQ id="FAQ" locale={dict.FAQ} langName={langName} />

{/* CTA (Call to Action) */}
{/* CTA (Call to Action) Footer */}
<CTA locale={dict.CTA} CTALocale={dict.CTAButton} stars={stars} />
</main>
</>
Expand Down
3 changes: 1 addition & 2 deletions projects/fastgpt/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import BaiDuAnalytics from '@/app/BaiDuAnalytics';
import GoogleAnalytics from '@/app/GoogleAnalytics';
import { TailwindIndicator } from '@/components/TailwindIndicator';
import { ThemeProvider } from '@/components/ThemeProvider';
import Footer from '@/components/footer/Footer';
import { siteConfig } from '@/config/site';
import { defaultLocale } from '@/lib/i18n';
import { cn } from '@/lib/utils';
Expand Down Expand Up @@ -51,7 +50,7 @@ export default async function RootLayout({
<body className={cn('min-h-screen bg-background font-sans antialiased', fontSans.variable)}>
<ThemeProvider attribute="class" defaultTheme={siteConfig.nextThemeColor} enableSystem>
{children}
<Footer />
{/* <Footer /> */}
<Analytics />
<TailwindIndicator />
</ThemeProvider>
Expand Down
5 changes: 4 additions & 1 deletion projects/fastgpt/components/ThemedButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ export function ThemedButton() {
setIsClient(typeof window !== "undefined");
}, []);
return (
<div onClick={() => setTheme(theme === "light" ? "dark" : "light")}>
<div onClick={() => setTheme(theme === "light" ? "dark" : "light")} className="flex gap-4 font-medium">
{theme === "light" && isClient ? <PhMoonFill /> : <PhSunBold />}
<div className="md:hidden">
{theme === "light" && isClient ? "Night Mode" : "Light Mode"}
</div>
</div>
);
}
Expand Down
192 changes: 86 additions & 106 deletions projects/fastgpt/components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,125 +20,105 @@ const Header = ({
};
}) => {
const [isMenuOpen, setIsMenuOpen] = useState(false);
return (
<header className="py-10 mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<nav className="relative z-50 flex justify-between">
<div className="flex items-center md:gap-x-12">


const LogoFC = () => (<div className="flex items-center md:gap-x-12">
<Link
href="/"
aria-label="FastGPT"
title="FastGPT"
className="flex items-center space-x-2 font-bold "
>
<Image
alt={siteConfig.name}
src="/logo.svg"
className="w-8 h-8 bg-[#E9E9E9] p-1 rounded-md dark:bg-opacity-20"
width={32}
height={32}
/>
<span className="text-white hidden md:block">
FastGPT
</span>
</Link>

<ul className="hidden items-center gap-6 md:flex">
{dict?.links.map((link) => (
<li key={link.label}>
<Link
href="/"
aria-label="FastGPT"
title="FastGPT"
className="flex items-center space-x-1 font-bold"
href={link.href}
aria-label={link.label}
title={link.label}
className="tracking-wide transition-colors duration-200 font-norma"
>
<Image
alt={siteConfig.name}
src="/logo.svg"
className="w-8 h-8"
width={32}
height={32}
/>
<span className="text-gray-950 dark:text-gray-300 hidden md:block">
FastGPT
</span>
{link.label}
</Link>
</div>

<ul className="hidden items-center gap-6 md:flex">
{dict?.links.map((link) => (
<li key={link.label}>
<Link
href={link.href}
aria-label={link.label}
title={link.label}
className="tracking-wide transition-colors duration-200 font-norma"
>
{link.label}
</Link>
</li>
))}
</ul>
</li>
))}
</ul>
</div>)

return (
<header className="relative py-2 mx-auto max-w-8xl px-4 sm:px-6 lg:px-8 flex justify-between">
<nav className="z-50 flex justify-between w-full">
<LogoFC />
<div className="hidden md:flex items-center gap-x-6">
<HeaderLinks />
<ThemedButton />
<LangSwitcher />
</div>
</nav>

<div className="md:hidden">
<button
aria-label="Open Menu"
title="Open Menu"
className="p-2 -mr-1 transition duration-200 rounded focus:outline-none focus:shadow-outline hover:bg-deep-purple-50 focus:bg-deep-purple-50"
onClick={() => setIsMenuOpen(true)}
>
<MenuIcon />
</button>
{isMenuOpen && (
<div className="absolute top-0 left-0 w-full z-50">
<div className="p-5 bg-background border rounded shadow-sm">
<div className="flex items-center justify-between mb-4">
<div>
<Link
href="/"
aria-label="FastGPT"
title="FastGPT"
className="inline-flex items-center"
>
<Image
alt={siteConfig.name}
src="/logo.svg"
className="w-8 h-8"
width={32}
height={32}
/>
<span className="ml-2 text-xl font-bold tracking-wide text-gray-950 dark:text-gray-300">
FastGPT
</span>
</Link>
</div>
<div>
<button
aria-label="Close Menu"
title="Close Menu"
className="tracking-wide transition-colors duration-200 font-norma"
onClick={() => setIsMenuOpen(false)}
>
<CgClose />
</button>
</div>
</div>
<nav>
<ul className="space-y-4">
{dict?.links.map((link) => (
<li key={link.label}>
<Link
href={link.href}
aria-label={link.label}
title={link.label}
className="font-medium tracking-wide transition-colors duration-200 hover:text-deep-purple-accent-400"
onClick={() => setIsMenuOpen(false)}
>
{link.label}
</Link>
</li>
))}
</ul>
</nav>
<div className="pt-2">
<div className="py-2 font-bold">Links</div>
<div className="flex items-center gap-x-5 justify-between">
<HeaderLinks />
<div className="flex items-center justify-end gap-x-5">
<ThemedButton />
<LangSwitcher />
</div>
</div>
<div className="md:hidden">
<button
aria-label="Open Menu"
title="Open Menu"
className="p-2 -mr-1 transition duration-200 rounded focus:outline-none focus:shadow-outline hover:bg-deep-purple-50 focus:bg-deep-purple-50"
onClick={() => setIsMenuOpen(true)}
>
<MenuIcon />
</button>
{isMenuOpen && (
<div className="absolute top-0 left-0 z-50 w-screen h-screen bg-overlay/50">
<div className="p-5 bg-background rounded shadow-sm">
<div className="flex items-center justify-between mb-4">
<LogoFC />
<div>
<button
aria-label="Close Menu"
title="Close Menu"
className="tracking-wide transition-colors duration-200 font-norma"
onClick={() => setIsMenuOpen(false)}
>
<CgClose />
</button>
</div>
</div>
<nav>
<ul className="space-y-4">
{dict?.links.map((link) => (
<li key={link.label}>
<Link
href={link.href}
aria-label={link.label}
title={link.label}
className="font-medium tracking-wide transition-colors duration-200 hover:text-deep-purple-accent-400"
onClick={() => setIsMenuOpen(false)}
>
{link.label}
</Link>
</li>
))}
</ul>
</nav>
<div className="mt-4 border-t-1 flex flex-col gap-6 pt-4">
<HeaderLinks />
<ThemedButton />
<LangSwitcher />
</div>
</div>
)}
</div>
</nav>
</div>
)}
</div>
</header>
);
};
Expand Down
8 changes: 4 additions & 4 deletions projects/fastgpt/components/header/HeaderLinks.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { siteConfig } from "@/config/site";
import { Button } from "@/components/ui/button";
import Link from "next/link";
import React from "react";

const HeaderLinks = () => {
const links = siteConfig.headerLinks;

return (
<div className="flex flex-row items-center gap-6">
<div className="flex items-start gap-6 md:flex-row flex-col">
{links.map((link, index) => (
<Link
key={link.name}
href={link.href}
target="_blank"
rel="noopener norefferer nofollow"
className={` flex max-w-[24px] flex-col items-center justify-center`}
className={` flex md:max-w-[24px] items-center justify-center gap-4`}
>
{link.icon &&
React.createElement(link.icon, { className: "text-lg" })}
React.createElement(link.icon, { className: "text-xl" })}
<div className="md:hidden font-medium">{link.name}</div>
</Link>
))}
</div>
Expand Down
4 changes: 2 additions & 2 deletions projects/fastgpt/components/header/LangSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
SelectTrigger,
SelectValue
} from '@/components/ui/select';
import { useParams, useRouter } from 'next/navigation';
import { defaultLocale, localeNames } from '@/lib/i18n';
import { useParams, useRouter } from 'next/navigation';
import { useEffect } from 'react';

export const LangSwitcher = () => {
Expand Down Expand Up @@ -36,7 +36,7 @@ export const LangSwitcher = () => {

return (
<Select value={langName} onValueChange={handleSwitchLanguage}>
<SelectTrigger className="w-fit">
<SelectTrigger className="w-fit bg-white/20">
<SelectValue placeholder="Language" />
</SelectTrigger>
<SelectContent>
Expand Down
Loading
Loading