Skip to content

Commit 65df45e

Browse files
Merge pull request #68 from heavenmei/main
new home preview
2 parents 36eab16 + 6c71a39 commit 65df45e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+3012
-1725
lines changed

projects/fastgpt/app/[[...lang]]/page.tsx

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import CTA from '@/components/home/CTA';
44
import FAQ from '@/components/home/FAQ';
55
import Feature from '@/components/home/Feature';
66
import Hero from '@/components/home/Hero';
7-
import Pricing from '@/components/home/Pricing';
8-
import SocialProof from '@/components/home/SocialProof';
7+
// import SocialProof from '@/components/home/SocialProof';
98
import VideoPlayer from '@/components/home/Video';
109
import { defaultLocale, getDictionary, localeNames } from '@/lib/i18n';
1110

@@ -21,32 +20,35 @@ export default async function LangHome({ params: { lang } }: { params: { lang?:
2120
if (stargazers_count) {
2221
stars = stargazers_count;
2322
}
24-
} catch (error) {}
23+
} catch (error) { }
2524

2625
return (
2726
<>
2827
<Header dict={dict} />
29-
<main className="flex flex-col items-center py-6">
30-
{/* Hero Section */}
31-
<Hero locale={dict.Hero} CTALocale={dict.CTAButton} stars={stars} />
32-
<SocialProof locale={dict.SocialProof} />
33-
{/* Can be used to display technology stack, partners, project honors, etc. */}
34-
{/*<ScrollingLogos />*/}
35-
<VideoPlayer dict={dict} />
36-
37-
<Ability id="Ability" locale={dict.Ability} langName={langName} />
38-
39-
{/* USP (Unique Selling Proposition) */}
40-
<Feature id="Features" locale={dict.Feature} langName={langName} />
41-
42-
{/* Pricing */}
43-
<Pricing id="Pricing" locale={dict.Pricing} langName={langName} />
44-
45-
{/* FAQ (Frequently Asked Questions) */}
46-
<FAQ id="FAQ" locale={dict.FAQ} langName={langName} />
47-
48-
{/* CTA (Call to Action) */}
49-
<CTA locale={dict.CTA} CTALocale={dict.CTAButton} stars={stars} />
28+
<main className="flex flex-col items-center mt-12 sm:mt-14 lg:mt-20 ">
29+
<div className='mx-4 sm:mx-6 md:mx-12 xl:mx-[60px] 2xl:max-w-7xl 2xl:mx-auto flex flex-col items-center'>
30+
{/* Hero Section */}
31+
<Hero locale={dict.Hero} CTALocale={dict.CTAButton} stars={stars} />
32+
{/* <SocialProof locale={dict.SocialProof} /> */}
33+
{/* Can be used to display technology stack, partners, project honors, etc. */}
34+
{/*<ScrollingLogos />*/}
35+
<VideoPlayer dict={dict} />
36+
37+
<Ability id="Ability" locale={dict.Ability} langName={langName} />
38+
39+
{/* USP (Unique Selling Proposition) */}
40+
<Feature id="Features" locale={dict.Feature} langName={langName} />
41+
42+
{/* Pricing */}
43+
{/* <Pricing id="Pricing" locale={dict.Pricing} langName={langName} /> */}
44+
45+
{/* FAQ (Frequently Asked Questions) */}
46+
<FAQ id="FAQ" locale={dict.FAQ} langName={langName} />
47+
48+
{/* CTA (Call to Action) Footer */}
49+
<CTA locale={dict.CTA} CTALocale={dict.CTAButton} stars={stars} />
50+
</div>
51+
{/* <InterModal locale={dict.InterModal} /> */}
5052
</main>
5153
</>
5254
);

projects/fastgpt/app/layout.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import BaiDuAnalytics from '@/app/BaiDuAnalytics';
22
import GoogleAnalytics from '@/app/GoogleAnalytics';
33
import { TailwindIndicator } from '@/components/TailwindIndicator';
44
import { ThemeProvider } from '@/components/ThemeProvider';
5-
import Footer from '@/components/footer/Footer';
65
import { siteConfig } from '@/config/site';
76
import { defaultLocale } from '@/lib/i18n';
87
import { cn } from '@/lib/utils';
@@ -48,10 +47,12 @@ export default async function RootLayout({
4847
return (
4948
<html lang={(lang && lang[0]) || defaultLocale} suppressHydrationWarning>
5049
<head />
51-
<body className={cn('min-h-screen bg-background font-sans antialiased', fontSans.variable)}>
50+
<body className={cn('min-h-screen font-sans antialiased', fontSans.variable)}
51+
// style={{background: 'var(--background-gradient)'}}
52+
>
5253
<ThemeProvider attribute="class" defaultTheme={siteConfig.nextThemeColor} enableSystem>
5354
{children}
54-
<Footer />
55+
{/* <Footer /> */}
5556
<Analytics />
5657
<TailwindIndicator />
5758
</ThemeProvider>

projects/fastgpt/components/ThemedButton.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ export function ThemedButton() {
1212
setIsClient(typeof window !== "undefined");
1313
}, []);
1414
return (
15-
<div onClick={() => setTheme(theme === "light" ? "dark" : "light")}>
15+
<div onClick={() => setTheme(theme === "light" ? "dark" : "light")} className="flex gap-4 font-medium p-1 hover:bg-white/10 cursor-pointer rounded-md">
1616
{theme === "light" && isClient ? <PhMoonFill /> : <PhSunBold />}
17+
<div className="md:hidden">
18+
{theme === "light" && isClient ? "Night Mode" : "Light Mode"}
19+
</div>
1720
</div>
1821
);
1922
}

projects/fastgpt/components/header/Header.tsx

Lines changed: 88 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import Image from "next/image";
77
import Link from "next/link";
88
import { useState } from "react";
99
import { CgClose } from "react-icons/cg";
10-
import { ThemedButton } from "../ThemedButton";
1110

1211
const Header = ({
1312
dict,
@@ -20,125 +19,105 @@ const Header = ({
2019
};
2120
}) => {
2221
const [isMenuOpen, setIsMenuOpen] = useState(false);
23-
return (
24-
<header className="py-10 mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
25-
<nav className="relative z-50 flex justify-between">
26-
<div className="flex items-center md:gap-x-12">
22+
23+
24+
const LogoFC = () => (<div className="flex items-center md:gap-x-12">
25+
<Link
26+
href="/"
27+
aria-label="FastGPT"
28+
title="FastGPT"
29+
className="flex items-center space-x-3 font-bold "
30+
>
31+
<Image
32+
alt={siteConfig.name}
33+
src="/logo.svg"
34+
className="w-[30px] h-[30px] bg-[#E9E9E9] p-1 rounded-md dark:bg-opacity-20"
35+
width={32}
36+
height={32}
37+
/>
38+
<span className="text-white hidden md:block">
39+
FastGPT
40+
</span>
41+
</Link>
42+
43+
<ul className="hidden items-center gap-5 md:flex">
44+
{dict?.links.map((link) => (
45+
<li key={link.label} className="cursor-pointer hover:bg-white/10 px-2 py-1 rounded-md">
2746
<Link
28-
href="/"
29-
aria-label="FastGPT"
30-
title="FastGPT"
31-
className="flex items-center space-x-1 font-bold"
47+
href={link.href}
48+
aria-label={link.label}
49+
title={link.label}
50+
className="tracking-wide transition-colors duration-200 font-norma"
3251
>
33-
<Image
34-
alt={siteConfig.name}
35-
src="/logo.svg"
36-
className="w-8 h-8"
37-
width={32}
38-
height={32}
39-
/>
40-
<span className="text-gray-950 dark:text-gray-300 hidden md:block">
41-
FastGPT
42-
</span>
52+
{link.label}
4353
</Link>
44-
</div>
45-
46-
<ul className="hidden items-center gap-6 md:flex">
47-
{dict?.links.map((link) => (
48-
<li key={link.label}>
49-
<Link
50-
href={link.href}
51-
aria-label={link.label}
52-
title={link.label}
53-
className="tracking-wide transition-colors duration-200 font-norma"
54-
>
55-
{link.label}
56-
</Link>
57-
</li>
58-
))}
59-
</ul>
54+
</li>
55+
))}
56+
</ul>
57+
</div>)
6058

61-
<div className="hidden md:flex items-center gap-x-6">
59+
return (
60+
<header className="relative py-2 mx-auto max-w-8xl px-4 sm:px-6 lg:px-8 flex justify-between">
61+
<nav className="z-50 flex justify-between w-full">
62+
<LogoFC />
63+
<div className="hidden md:flex items-center gap-x-4">
6264
<HeaderLinks />
63-
<ThemedButton />
65+
{/* <ThemedButton /> */}
6466
<LangSwitcher />
6567
</div>
68+
</nav>
6669

67-
<div className="md:hidden">
68-
<button
69-
aria-label="Open Menu"
70-
title="Open Menu"
71-
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"
72-
onClick={() => setIsMenuOpen(true)}
73-
>
74-
<MenuIcon />
75-
</button>
76-
{isMenuOpen && (
77-
<div className="absolute top-0 left-0 w-full z-50">
78-
<div className="p-5 bg-background border rounded shadow-sm">
79-
<div className="flex items-center justify-between mb-4">
80-
<div>
81-
<Link
82-
href="/"
83-
aria-label="FastGPT"
84-
title="FastGPT"
85-
className="inline-flex items-center"
86-
>
87-
<Image
88-
alt={siteConfig.name}
89-
src="/logo.svg"
90-
className="w-8 h-8"
91-
width={32}
92-
height={32}
93-
/>
94-
<span className="ml-2 text-xl font-bold tracking-wide text-gray-950 dark:text-gray-300">
95-
FastGPT
96-
</span>
97-
</Link>
98-
</div>
99-
<div>
100-
<button
101-
aria-label="Close Menu"
102-
title="Close Menu"
103-
className="tracking-wide transition-colors duration-200 font-norma"
104-
onClick={() => setIsMenuOpen(false)}
105-
>
106-
<CgClose />
107-
</button>
108-
</div>
109-
</div>
110-
<nav>
111-
<ul className="space-y-4">
112-
{dict?.links.map((link) => (
113-
<li key={link.label}>
114-
<Link
115-
href={link.href}
116-
aria-label={link.label}
117-
title={link.label}
118-
className="font-medium tracking-wide transition-colors duration-200 hover:text-deep-purple-accent-400"
119-
onClick={() => setIsMenuOpen(false)}
120-
>
121-
{link.label}
122-
</Link>
123-
</li>
124-
))}
125-
</ul>
126-
</nav>
127-
<div className="pt-2">
128-
<div className="py-2 font-bold">Links</div>
129-
<div className="flex items-center gap-x-5 justify-between">
130-
<HeaderLinks />
131-
<div className="flex items-center justify-end gap-x-5">
132-
<ThemedButton />
133-
<LangSwitcher />
134-
</div>
135-
</div>
70+
<div className="md:hidden">
71+
<button
72+
aria-label="Open Menu"
73+
title="Open Menu"
74+
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"
75+
onClick={() => setIsMenuOpen(true)}
76+
>
77+
<MenuIcon />
78+
</button>
79+
{isMenuOpen && (
80+
<div className="absolute top-0 left-0 z-50 w-screen h-screen bg-overlay/50">
81+
<div className="p-5 bg-background rounded shadow-sm">
82+
<div className="flex items-center justify-between mb-4">
83+
<LogoFC />
84+
<div>
85+
<button
86+
aria-label="Close Menu"
87+
title="Close Menu"
88+
className="tracking-wide transition-colors duration-200 font-norma"
89+
onClick={() => setIsMenuOpen(false)}
90+
>
91+
<CgClose />
92+
</button>
13693
</div>
13794
</div>
95+
<nav>
96+
<ul className="space-y-4">
97+
{dict?.links.map((link) => (
98+
<li key={link.label}>
99+
<Link
100+
href={link.href}
101+
aria-label={link.label}
102+
title={link.label}
103+
className="font-medium tracking-wide transition-colors duration-200 hover:text-deep-purple-accent-400 hover:bg-white/10 p-1 rounded-md"
104+
onClick={() => setIsMenuOpen(false)}
105+
>
106+
{link.label}
107+
</Link>
108+
</li>
109+
))}
110+
</ul>
111+
</nav>
112+
<div className="mt-4 border-t-1 flex flex-col gap-6 pt-4 border-white/10">
113+
<HeaderLinks />
114+
{/* <ThemedButton /> */}
115+
<LangSwitcher />
116+
</div>
138117
</div>
139-
)}
140-
</div>
141-
</nav>
118+
</div>
119+
)}
120+
</div>
142121
</header>
143122
);
144123
};

projects/fastgpt/components/header/HeaderLinks.tsx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,41 @@
1+
"use client";
2+
import PhMoonFill from "@/components/icons/moon";
3+
import PhSunBold from "@/components/icons/sun";
14
import { siteConfig } from "@/config/site";
2-
import { Button } from "@/components/ui/button";
5+
import { useTheme } from "next-themes";
36
import Link from "next/link";
4-
import React from "react";
7+
import React, { useEffect, useState } from "react";
58

69
const HeaderLinks = () => {
710
const links = siteConfig.headerLinks;
11+
const { theme, setTheme } = useTheme();
12+
const [isClient, setIsClient] = useState(false);
13+
14+
useEffect(() => {
15+
setIsClient(typeof window !== "undefined");
16+
}, []);
817

918
return (
10-
<div className="flex flex-row items-center gap-6">
19+
<div className="flex items-start gap-4 md:flex-row flex-col w-full">
1120
{links.map((link, index) => (
1221
<Link
1322
key={link.name}
1423
href={link.href}
1524
target="_blank"
1625
rel="noopener norefferer nofollow"
17-
className={` flex max-w-[24px] flex-col items-center justify-center`}
26+
className={` flex items-center justify-center gap-4 hover:bg-white/10 p-1 rounded-md`}
1827
>
1928
{link.icon &&
20-
React.createElement(link.icon, { className: "text-lg" })}
29+
React.createElement(link.icon, { className: "text-2xl" })}
30+
<div className="md:hidden font-medium">{link.name}</div>
2131
</Link>
2232
))}
33+
<div onClick={() => setTheme(theme === "light" ? "dark" : "light")} className="flex gap-4 font-medium p-1 hover:bg-white/10 cursor-pointer rounded-md">
34+
{theme === "light" && isClient ? <PhMoonFill /> : <PhSunBold />}
35+
<div className="md:hidden">
36+
{theme === "light" && isClient ? "Night Mode" : "Light Mode"}
37+
</div>
38+
</div>
2339
</div>
2440
);
2541
};

projects/fastgpt/components/header/LangSwitcher.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import {
66
SelectTrigger,
77
SelectValue
88
} from '@/components/ui/select';
9-
import { useParams, useRouter } from 'next/navigation';
109
import { defaultLocale, localeNames } from '@/lib/i18n';
10+
import { useParams, useRouter } from 'next/navigation';
1111
import { useEffect } from 'react';
1212

1313
export const LangSwitcher = () => {
@@ -36,7 +36,7 @@ export const LangSwitcher = () => {
3636

3737
return (
3838
<Select value={langName} onValueChange={handleSwitchLanguage}>
39-
<SelectTrigger className="w-fit">
39+
<SelectTrigger className="w-fit bg-white/20 hover:bg-white/10">
4040
<SelectValue placeholder="Language" />
4141
</SelectTrigger>
4242
<SelectContent>

0 commit comments

Comments
 (0)