|
| 1 | +import Link from '@docusaurus/Link'; |
| 2 | +import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; |
| 3 | +import Layout from '@theme/Layout'; |
| 4 | +import clsx from 'clsx'; |
| 5 | +import React from 'react'; |
| 6 | + |
| 7 | +import styles from './index.module.css'; |
| 8 | + |
| 9 | +const FeatureList = [ |
| 10 | + { |
| 11 | + title: 'Algorithms', |
| 12 | + description: ( |
| 13 | + <> |
| 14 | + Comprehensive collection of JavaScript algorithms with detailed explanations and |
| 15 | + implementation examples. |
| 16 | + </> |
| 17 | + ), |
| 18 | + }, |
| 19 | + { |
| 20 | + title: 'Data Structures', |
| 21 | + description: ( |
| 22 | + <> |
| 23 | + Learn about various data structures and their implementations in JavaScript, from basic to |
| 24 | + advanced concepts. |
| 25 | + </> |
| 26 | + ), |
| 27 | + }, |
| 28 | + { |
| 29 | + title: 'Code Challenges', |
| 30 | + description: ( |
| 31 | + <>Practice your skills with real-world coding challenges and their solutions in JavaScript.</> |
| 32 | + ), |
| 33 | + }, |
| 34 | +]; |
| 35 | + |
| 36 | +function Feature({title, description}) { |
| 37 | + return ( |
| 38 | + <div className={clsx('col col--4')}> |
| 39 | + <div className="text--center padding-horiz--md"> |
| 40 | + <h3>{title}</h3> |
| 41 | + <p>{description}</p> |
| 42 | + </div> |
| 43 | + </div> |
| 44 | + ); |
| 45 | +} |
| 46 | + |
| 47 | +function HomepageFeatures() { |
| 48 | + return ( |
| 49 | + <section className={styles.features}> |
| 50 | + <div className="container"> |
| 51 | + <div className="row"> |
| 52 | + {FeatureList.map((props, idx) => ( |
| 53 | + <Feature key={idx} {...props} /> |
| 54 | + ))} |
| 55 | + </div> |
| 56 | + </div> |
| 57 | + </section> |
| 58 | + ); |
| 59 | +} |
| 60 | + |
| 61 | +function HomepageHeader() { |
| 62 | + const {siteConfig} = useDocusaurusContext(); |
| 63 | + return ( |
| 64 | + <header className={clsx('hero hero--primary', styles.heroBanner)}> |
| 65 | + <div className="container"> |
| 66 | + <h1 className="hero__title">{siteConfig.title}</h1> |
| 67 | + <p className="hero__subtitle">{siteConfig.tagline}</p> |
| 68 | + <div className={styles.buttons}> |
| 69 | + <Link className="button button--secondary button--lg" to="/docs/intro"> |
| 70 | + Get Started |
| 71 | + </Link> |
| 72 | + </div> |
| 73 | + </div> |
| 74 | + </header> |
| 75 | + ); |
| 76 | +} |
| 77 | + |
| 78 | +export default function Home() { |
| 79 | + const {siteConfig} = useDocusaurusContext(); |
| 80 | + return ( |
| 81 | + <Layout |
| 82 | + title={`${siteConfig.title}`} |
| 83 | + description="JavaScript Algorithms and Data Structures Documentation" |
| 84 | + > |
| 85 | + <HomepageHeader /> |
| 86 | + <main> |
| 87 | + <HomepageFeatures /> |
| 88 | + </main> |
| 89 | + </Layout> |
| 90 | + ); |
| 91 | +} |
0 commit comments