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

[Feature]Add animation effects to website for enhanced user experience #442

Merged
merged 2 commits into from
Aug 12, 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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@docusaurus/theme-search-algolia": "^3.4.0",
"@mdx-js/react": "3.0.1",
"@svgr/webpack": "^8.1.0",
"aos": "^2.3.4",
"clsx": "^2.1.1",
"docusaurus-plugin-image-zoom": "^2.0.0",
"docusaurus-plugin-sass": "^0.2.5",
Expand Down
71 changes: 41 additions & 30 deletions src/components/FeaturesList.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,45 @@
import React from 'react';
import HomePageFeatures from '../data/HomePageFeatures';
import React from "react";
import HomePageFeatures from "../data/HomePageFeatures";

const FeatureBlock = () => {
return (
<div className="hero">
<div className="container">
<section className="features">
<div className="container">
{
HomePageFeatures.map(({imgUrl, title, description, reverse}, index) => (
<div key={index} className="row feature">
<div className="col col--3">
<div className="text--center">
{imgUrl && <img className="featureImage" src={imgUrl} alt={title} />}
</div>
</div>
<div className="col col--9 featureDesc">
<div>
<h2>{title}</h2>
<div>{description}</div>
</div>
</div>
</div>
))
}
return (
<div className="hero" data-aos="fade-up">
<div className="container">
<section className="features">
<div className="container">
{HomePageFeatures.map(
({ imgUrl, title, description, reverse }, index) => (
<div
key={index}
className={`row feature ${reverse ? "reverse" : ""}`}
data-aos="fade-up"
data-aos-delay={index * 200} // Optional delay based on index
>
<div className="col col--3" data-aos="fade-right">
<div className="text--center">
{imgUrl && (
<img
className="featureImage"
src={imgUrl}
alt={title}
/>
)}
</div>
</section>
</div>
</div>
)
}
</div>
<div className="col col--9 featureDesc" data-aos="fade-left">
<div>
<h2>{title}</h2>
<div>{description}</div>
</div>
</div>
</div>
)
)}
</div>
</section>
</div>
</div>
);
};

export default FeatureBlock
export default FeatureBlock;
74 changes: 39 additions & 35 deletions src/components/WhatIs.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
import Translate, { translate } from '@docusaurus/Translate';
import useBaseUrl from '@docusaurus/useBaseUrl';
import Translate from "@docusaurus/Translate";
import useBaseUrl from "@docusaurus/useBaseUrl";
import React from "react";

const WhatIs = () => (
<div className="hero">
<div className="container">
<div className="row">
<div className="col col--6">
<h1><Translate>What is OpenYurt?</Translate></h1>
<p className="hero__subtitle">
<small>
<Translate>
OpenYurt is the intelligent edge computing platform which aims to extend the Cloud Native ecosystem to edge computing and IoT scenarios. By making non-intrusive enhancements, it empowers customer to manage large scale edge computing workloads in different architecture (e.g., ARM and X86) in a native Kubernetes manner.
</Translate>
<br />
<br />
<Translate>
OpenYurt has been widely used in typical edge computing scenarios such as the IoT, distributed cloud , logistics, transportation, manufacturing, retail, CDN etc.
</Translate>
{/*<br />*/}
{/*<br />*/}
{/*<Translate>*/}
{/* OpenYurt committed to becoming the reference architecture in edge computing infrastructure.*/}
{/*</Translate>*/}
</small>
</p>
</div>
<div className="col">
<img
className="image"
src={useBaseUrl("img/what-is-openyurt.png")}
align="right"
alt="what is OpenYurt"
/>
</div>
</div>
<div className="hero" data-aos="fade-up">
<div className="container">
<div className="row">
<div className="col col--6" data-aos="fade-right">
<h1>
<Translate>What is OpenYurt?</Translate>
</h1>
<p className="hero__subtitle">
<small>
<Translate>
OpenYurt is the intelligent edge computing platform which aims
to extend the Cloud Native ecosystem to edge computing and IoT
scenarios. By making non-intrusive enhancements, it empowers
customer to manage large scale edge computing workloads in
different architecture (e.g., ARM and X86) in a native
Kubernetes manner.
</Translate>
<br />
<br />
<Translate>
OpenYurt has been widely used in typical edge computing
scenarios such as the IoT, distributed cloud, logistics,
transportation, manufacturing, retail, CDN etc.
</Translate>
</small>
</p>
</div>
<div className="col" data-aos="fade-left">
<img
className="image"
src={useBaseUrl("img/what-is-openyurt.png")}
align="right"
alt="what is OpenYurt"
/>
</div>
</div>
</div>
</div>
);

export default WhatIs
export default WhatIs;
92 changes: 51 additions & 41 deletions src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,59 @@
import React from 'react';
import Layout from '@theme/Layout';
import Translate, { translate } from '@docusaurus/Translate';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import useBaseUrl from '@docusaurus/useBaseUrl';
import FeatureBlock from '../components/FeaturesList';
import WhatIs from '../components/WhatIs';
import Button from '../components/Button';
import GhButton from '../components/GitHubButton'
import React, { useEffect } from "react";
import Layout from "@theme/Layout";
import Translate from "@docusaurus/Translate";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import useBaseUrl from "@docusaurus/useBaseUrl";
import FeatureBlock from "../components/FeaturesList";
import WhatIs from "../components/WhatIs";
import Button from "../components/Button";
import GhButton from "../components/GitHubButton";
import AOS from "aos";
import "aos/dist/aos.css";

export default function Home() {
const context = useDocusaurusContext();
const { siteConfig = {} } = context;
const context = useDocusaurusContext();
const { siteConfig = {} } = context;

return (
<Layout title={siteConfig.tagline} description={siteConfig.tagline}>
<header className="hero">
<div className="container text--center">
{/*<div className={styles.heroLogoWrapper}>*/}
{/* <img className={styles.heroLogo} src={useBaseUrl('img/openyrut.png')} alt="OpenYurt Logo" />*/}
{/*</div>*/}
<h2 className="hero__title">{siteConfig.title}</h2>
useEffect(() => {
AOS.init({
duration: 1000, // 动画持续时间
easing: "ease-in-out", // 动画的缓动函数
once: true, // 是否只在第一次滚动时触发动画
});
}, []);

<GhButton />
return (
<Layout title={siteConfig.tagline} description={siteConfig.tagline}>
<header className="hero">
<div className="container text--center" data-aos="fade-up">
<h2 className="hero__title">{siteConfig.title}</h2>
<GhButton />
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className="heroButtons" data-aos="zoom-in">
<Button href={useBaseUrl("docs/installation/summary")}>
<Translate>Get Started</Translate>
</Button>
<Button href={useBaseUrl("docs/")}>
<Translate>Learn More</Translate>
</Button>
</div>
</div>
</header>

<p className="hero__subtitle">{siteConfig.tagline}</p>
<div
className="heroButtons">
<Button href={useBaseUrl('docs/installation/summary')}><Translate>Get Started</Translate></Button>
<Button href={useBaseUrl('docs/')}><Translate>Learn More</Translate></Button>
</div>
</div>
</header>
<WhatIs data-aos="fade-up" />

<WhatIs />
<FeatureBlock data-aos="fade-up" />

<FeatureBlock />

<div className="hero">
<div className="container text--center">
<h3 className="hero__subtitle">
<Translate>OpenYurt is a</Translate> <a href="https://cncf.io/">Cloud Native Computing Foundation</a> <Translate>sandbox project</Translate>
</h3>
<div className="cncf-logo" />
</div>
</div>
</Layout>
);
<div className="hero" data-aos="fade-up">
<div className="container text--center">
<h3 className="hero__subtitle">
<Translate>OpenYurt is a</Translate>{" "}
<a href="https://cncf.io/">Cloud Native Computing Foundation</a>{" "}
<Translate>sandbox project</Translate>
</h3>
<div className="cncf-logo" />
</div>
</div>
</Layout>
);
}
21 changes: 20 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2604,6 +2604,15 @@ anymatch@~3.1.2:
normalize-path "^3.0.0"
picomatch "^2.0.4"

aos@^2.3.4:
version "2.3.4"
resolved "https://registry.yarnpkg.com/aos/-/aos-2.3.4.tgz#eb1c29f5c1806a197cf6323080747547edd3db8e"
integrity sha512-zh/ahtR2yME4I51z8IttIt4lC1Nw0ktsFtmeDzID1m9naJnWXhCoARaCgNOGXb5CLy3zm+wqmRAEgMYB5E2HUw==
dependencies:
classlist-polyfill "^1.0.3"
lodash.debounce "^4.0.6"
lodash.throttle "^4.0.1"

arg@^5.0.0:
version "5.0.2"
resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.2.tgz#c81433cc427c92c4dcf4865142dbca6f15acd59c"
Expand Down Expand Up @@ -3017,6 +3026,11 @@ ci-info@^3.2.0:
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4"
integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==

classlist-polyfill@^1.0.3:
version "1.2.0"
resolved "https://registry.yarnpkg.com/classlist-polyfill/-/classlist-polyfill-1.2.0.tgz#935bc2dfd9458a876b279617514638bcaa964a2e"
integrity sha512-GzIjNdcEtH4ieA2S8NmrSxv7DfEV5fmixQeyTmqmRmRJPGpRBaSnA2a0VrCjyT8iW8JjEdMbKzDotAJf+ajgaQ==

clean-css@^5.2.2, clean-css@^5.3.2, clean-css@~5.3.2:
version "5.3.3"
resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-5.3.3.tgz#b330653cd3bd6b75009cc25c714cae7b93351ccd"
Expand Down Expand Up @@ -5243,7 +5257,7 @@ locate-path@^7.1.0:
dependencies:
p-locate "^6.0.0"

lodash.debounce@^4.0.8:
lodash.debounce@^4.0.6, lodash.debounce@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==
Expand All @@ -5253,6 +5267,11 @@ lodash.memoize@^4.1.2:
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==

lodash.throttle@^4.0.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
integrity sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==

lodash.uniq@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
Expand Down