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 Feature]Add animation effects to Higress website for enhanced user experience #289

Merged
merged 2 commits into from
Aug 9, 2024
Merged
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
28 changes: 27 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@iconify-json/basil": "^1.1.5",
"@iconify-json/tabler": "^1.1.108",
"@serverless-cd/goat-ui": "^0.0.28",
"aos": "^2.3.4",
"astro": "4.9.1",
"astro-compress": "^2.2.11",
"date-fns": "^3.4.0",
Expand All @@ -43,14 +44,14 @@
},
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.24.3",
"@swc/core": "1.6.0",
"@tailwindcss/typography": "^0.5.10",
"@types/lodash": "^4.14.202",
"autoprefixer": "^10.4.2",
"daisyui": "^4.4.18",
"tailwindcss": "^3.3.5",
"vite-plugin-babel": "^1.2.0",
"vite-plugin-top-level-await": "1.4.1",
"@swc/core": "1.6.0"
"vite-plugin-top-level-await": "1.4.1"
},
"repository": "[email protected]:goat/goat-scaffold.git"
}
23 changes: 20 additions & 3 deletions src/components/home/AiStructure.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,26 @@ import { Headline } from "@serverless-cd/goat-ui";
const t = useTranslations(Astro);
---

<span class="ai-structure-wrapper ">
<span class="ai-structure-wrapper">
<ai-structure
class="ai-structure block bg-neutral py-10 flex justify-center items-center"
>
<div class="structure-container flex flex-col justify-center items-center">
<div
class="structure-container flex flex-col justify-center items-center"
data-aos="fade-up"
data-aos-duration="1200"
data-aos-delay="100"
>
<Headline
classes={{ subtitle: "text-sm" }}
title={t("home.ai.structure.title")}
subtitle={t("home.ai.structure.subtitle")}
titleTheme="error"
taglineTheme="info"
subtitleTheme="success"
data-aos="fade-up"
data-aos-duration="1200"
data-aos-delay="300"
/>

<img
Expand All @@ -25,7 +33,10 @@ const t = useTranslations(Astro);
src="https://img.alicdn.com/imgextra/i2/O1CN01a3TQwu1hUI8C4HYDb_!!6000000004280-2-tps-2669-1462.png"
decoding="async"
loading="lazy"
/>
data-aos="zoom-in"
data-aos-duration="1500"
data-aos-delay="500"
/>
</div>
</ai-structure>
</span>
Expand Down Expand Up @@ -54,3 +65,9 @@ const t = useTranslations(Astro);
}
}
</style>

<script client:only="browser">
import AOS from "aos";
import "aos/dist/aos.css";
AOS.init();
</script>
36 changes: 29 additions & 7 deletions src/components/home/ChooseReason.astro
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ const t = useTranslations(Astro);
/> -->
<div class="mb-8 md:mx-auto md:mb-12 text-center max-w-3xl">
<p
class=`text-[18px] md:text-[44px] leading-[76px] text-error font-medium mt-6 tracking-normal text-center`
class="text-[18px] md:text-[44px] leading-[76px] text-error font-medium mt-6 tracking-normal text-center"
data-aos="fade-up"
data-aos-duration="1200"
data-aos-delay="100"
>
{t("home.website.edge.title")}
</p>
Expand All @@ -30,19 +33,27 @@ const t = useTranslations(Astro);
class="advantage-btn rounded-3xl text-neutral"
href="/advantage/"
iconClass="text-neutral"
data-aos="zoom-in"
data-aos-duration="1500"
data-aos-delay="300"
>
查看Higress和其他主流网关的比对
</Button>
</div>

<div class="bottom-card flex flex-wrap">
{
CHOOSE_REASON_LIST.map((reason) => {
CHOOSE_REASON_LIST.map((reason, index) => {
const { title, svgKey, description } = reason;
return (
<div class="item px-5 border-success/50 border-l ">
<div
class="item px-5 border-success/50 border-l"
data-aos="fade-up"
data-aos-duration="1500"
data-aos-delay={100 + index * 200}
>
<div class="transfrom-header block">
<div class="w-12 h-12 bg-warning border border-link rounded-md flex justify-center items-center mb-5">
<div class="w-12 h-12 bg-warning border border-link rounded-md flex justify-center items-center mb-5">
{(() => {
switch (svgKey) {
case "adaptive":
Expand All @@ -58,12 +69,17 @@ const t = useTranslations(Astro);
}
})()}
</div>
<div class="py-4 text-info text-[.875rem] leading-4 tracking-[0.15em]">
<div
class="py-4 text-info text-[.875rem] leading-4 tracking-[0.15em]"
>
{t(title)}
</div>
</div>

<div class="text-success text-sm" set:html={t(description)} />
<div
class="text-success text-sm"
set:html={t(description)}
/>
</div>
);
})
Expand All @@ -77,7 +93,6 @@ const t = useTranslations(Astro);
.primary-fill {
fill: theme("colors.primary");
}
,
.top-title,
.bottom-card {
width: 85.125rem;
Expand Down Expand Up @@ -159,3 +174,10 @@ const t = useTranslations(Astro);
}
}
</style>

<script client:only="browser">
import AOS from "aos";
import "aos/dist/aos.css";

AOS.init();
</script>
18 changes: 15 additions & 3 deletions src/components/home/Contributors.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@ const getBackgroundRandomColor = () => colorList[Math.floor(Math.random() * col
<div class="contributors-container-wrapper md:flex block bg-[#1E1F24] p-9 mt-10 rounded-2xl">
<div class="left-container flex-1 h-full flex flex-col justify-around md:pl-[8.5rem]">
<div class="flex flex-col">
<div class="text-muted text-xs text-center tracking-[0.15em] md:text-left">{t('home.contributors.members')}</div>
<div class="title text-base-100 font-medium text-center text-lg leading-[3.5rem] md:mt-6 md:text-left md:text-[2.4rem] lg:text-[2.75rem] ">
<div class="text-muted text-xs text-center tracking-[0.15em] md:text-left" data-aos="fade-in" data-aos-duration="1000">
{t('home.contributors.members')}
</div>
<div class="title text-base-100 font-medium text-center text-lg leading-[3.5rem] md:mt-6 md:text-left md:text-[2.4rem] lg:text-[2.75rem]" data-aos="fade-up" data-aos-duration="1200" data-aos-delay="200">
{t('home.contributors.our')}<br class="hidden md:block" />{t('home.contributors.community.stars')}
</div>
</div>
<Button
size="large"
class="more hidden md:inline-block leading-[3.5] md:mt-[2.5rem] lg:mt-[4rem] rounded-3xl"
href="https://github.com/alibaba/higress/graphs/contributors"
data-aos="zoom-in"
data-aos-duration="1500"
data-aos-delay="400"
>
{t('home.contributors.learn.more')}
</Button>
Expand Down Expand Up @@ -80,4 +85,11 @@ const getBackgroundRandomColor = () => colorList[Math.floor(Math.random() * col
width: 100%;
}
}
</style>
</style>

<script client:only="browser">
import AOS from "aos";
import "aos/dist/aos.css";

AOS.init();
</script>
29 changes: 9 additions & 20 deletions src/components/home/HomeIntroduce.astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ const ifzh = isChinese(Astro);
type="video/mp4"
/>
</video>
<home-introduce
<div
class="introduce flex flex-col justify-center items-center bg-transparent h-full relative z-1"
data-aos="fade-up"
>
<div class="flex flex-col justify-center items-center h-[75%]">
<div
class=`top-introduce-title leading-[96px] text-base-100 font-medium text-[2rem] ${ifzh ? 'sm:text-[72px]' : 'sm:text-[76px]'}`
class={`top-introduce-title leading-[96px] text-base-100 font-medium text-[2rem] ${ifzh ? 'sm:text-[72px]' : 'sm:text-[76px]'}`}
>
<span class="ai-description">{t("home.title.native.ai")}</span>{
t("home.title.native.api.gateway")
Expand All @@ -35,7 +36,7 @@ const ifzh = isChinese(Astro);
</div>

<div class="flex h-[15%]">
<star-and-fork class="shortcut flex justify-center">
<div class="shortcut flex justify-center">
<Button
size="large"
class="rounded-3xl text-neutral"
Expand All @@ -45,8 +46,7 @@ const ifzh = isChinese(Astro);
iconClass="text-neutral"
>
<Github themeClass="neutral-fill" />
<span class="text-[0.875rem] leading-4 ml-2 text-neutral">GitHub</span
>
<span class="text-[0.875rem] leading-4 ml-2 text-neutral">GitHub</span>
</Button>

<Button
Expand All @@ -59,18 +59,18 @@ const ifzh = isChinese(Astro);
<Start themeClass="secondary-fill" />
<span class="ml-2">{t("common.base.quick.start")}</span>
</Button>
</star-and-fork>
</div>
</div>
<div class="versionInfo flex justify-end items-center h-[10%]">
<a
class="text-xs text-link block"
href="https://github.com/alibaba/higress/releases/tag/v1.4.1"
target="_blank"
>
Release Note of V1.4.1</a
>
Release Note of V1.4.1
</a>
</div>
</home-introduce>
</div>
</div>

<style is:global>
Expand All @@ -90,14 +90,9 @@ const ifzh = isChinese(Astro);
z-index: 0;
object-fit: cover;
}
/* a {
text-decoration: inherit;
color: theme("colors.link");
} */
.versionInfo {
width: 85.125rem;
}

.top-section {
width: 85.125rem;
overflow: hidden;
Expand Down Expand Up @@ -172,7 +167,6 @@ const ifzh = isChinese(Astro);
backdrop-filter: blur(36px);
}

/* 小于85.125rem */
@media (max-width: 85.125rem) {
.introduce {
min-height: 0;
Expand All @@ -182,10 +176,6 @@ const ifzh = isChinese(Astro);
.introduce {
width: 100%;
}
/* .top-introduce-title {
font-size: 1.875rem !important;
line-height: 2.25rem !important;
} */
.versionInfo {
width: 100%;
}
Expand Down Expand Up @@ -215,7 +205,6 @@ const ifzh = isChinese(Astro);
}
}

/* 大于50rem 小于 72rem 800px < width < 1440 */
@media (min-width: 50rem) and (max-width: 86rem) {
.introduce {
padding: 2.5rem;
Expand Down
Loading
Loading