Skip to content

Commit

Permalink
fix: πŸ› Add stargazers animated gif
Browse files Browse the repository at this point in the history
βœ… Closes: #1557
  • Loading branch information
yashksaini-coder committed Oct 29, 2024
1 parent fe17b1e commit 0cda65b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 11 deletions.
18 changes: 18 additions & 0 deletions src/components/Homepage/AnimatedGIF.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react";

const AnimatedGIF = ({ srcs, alts }) => {
return (
<div>
{srcs.map((src, index) => {
const isMP4 = src.endsWith('.mp4');
return isMP4 ? (
<video key={index} src={src} autoPlay loop muted />
) : (
<img key={index} src={src} alt={alts[index]} className="w-102 h-80 rounded-lg" />
);
})}
</div>
);
};

export default AnimatedGIF;
28 changes: 17 additions & 11 deletions src/components/Homepage/HeroSection.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React from "react";
import Link from "@docusaurus/Link";
import { FaGithub, FaArrowRight } from "react-icons/fa";
import AnimatedGIF from "./AnimatedGIF";
import mainGif from "./assets/main.gif";

const HeroSection: React.FC = () => {

const HeroSection = () => {
return (
<section className="relative bg-gray-100 dark:bg-gray-900 min-h-screen flex items-center justify-center py-16 px-8">
<div className="max-w-4xl text-center">
Expand All @@ -14,18 +16,22 @@ const HeroSection: React.FC = () => {
understanding from the basics to advanced topics.
</p>
<div className="flex flex-col md:flex-row items-center justify-center space-y-4 md:space-y-0 md:space-x-6">
<Link
to="/docs"
className="flex items-center px-6 py-3 text-lg font-medium hover:text-white text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition duration-300 ease-in-out shadow-lg transform hover:scale-105"
<a
href="/docs"
className="flex items-center px-6 py-3 text-lg font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition duration-300 ease-in-out shadow-lg transform hover:scale-105"
>
Explore Algorithms <FaArrowRight className="ml-2" />
</Link>
<Link
to="https://github.com/ajay-dhangar/algo"
className="flex items-center px-6 py-3 text-lg font-medium text-[var(--ifm-color-primary)] border-2 border-blue-600 dark:border-white rounded-lg transition duration-300 ease-in-out hover:bg-blue-600 hover:text-white dark:hover:bg-white dark:hover:text-blue-600"
</a>
<a
href="https://github.com/ajay-dhangar/algo"
className="flex items-center px-6 py-3 text-lg font-medium text-blue-600 dark:text-white border-2 border-blue-600 dark:border-white rounded-lg transition duration-300 ease-in-out hover:bg-blue-600 hover:text-white dark:hover:bg-white dark:hover:text-blue-600"
>
View on GitHub <FaGithub className="ml-2" />
</Link>
</a>
</div>
<br />
<div className="mt-12">
<AnimatedGIF srcs={[mainGif]} alts={["Animated GIF"]} />
</div>
</div>

Expand All @@ -38,4 +44,4 @@ const HeroSection: React.FC = () => {
);
};

export default HeroSection;
export default HeroSection;
Binary file added src/components/Homepage/assets/main.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/Homepage/assets/main.mp4
Binary file not shown.

0 comments on commit 0cda65b

Please sign in to comment.