|
| 1 | +import { NextSeo } from 'next-seo'; |
| 2 | +import Link from 'next/link'; |
| 3 | +import PostsCards from '@/components/PostsCards'; |
| 4 | +import { Post, PostType } from '@/models/post.model'; |
| 5 | +import Layout from '@/layout/Layout'; |
| 6 | +import BreakBarLeft from '@/components/home/BreakBarLeft'; |
| 7 | +import BreakBarRight from '@/components/home/BreakBarRight'; |
| 8 | + |
| 9 | +import Skills from '@/components/home/Skills'; |
| 10 | +import AJLogoLeft from '@/components/global/icons/AJAlt'; |
| 11 | +import KCAlt from '@/components/global/icons/KCAlt'; |
| 12 | +import AJHeartAlt from '@/components/global/icons/AJHeartAlt'; |
| 13 | +import Podcasts from '@/components/global/icons/nav/Podcasts'; |
| 14 | +import AJPrimary from '@/components/global/icons/AJPrimary'; |
| 15 | +import { Site } from '@/models/site.model'; |
| 16 | + |
| 17 | +interface StaticParams { |
| 18 | + site: Site; |
| 19 | + recentPosts: { |
| 20 | + [key: string]: Post[]; |
| 21 | + }; |
| 22 | +} |
| 23 | + |
| 24 | +const HomeDetail = ({ site, recentPosts }: StaticParams) => { |
| 25 | + return ( |
| 26 | + <> |
| 27 | + <div> |
| 28 | + {/* Hero */} |
| 29 | + <section className="grid justify-center grid-cols-1 p-8 mx-auto 2xl:gap-10 lg:grid-cols-2 lg:px-10 2xl:min-h-768 max-w-7xl"> |
| 30 | + <section className="grid items-center content-center grid-cols-1 gap-4 mx-auto 2xl:mx-0 2xl:justify-self-end"> |
| 31 | + <h1 className="pt-4 -mb-4 text-5xl leading-snug tracking-tight vertical-text-clip xl:tracking-wide xl:text-6xl xl:leading-snug 2xl:text-7xl 2xl:leading-snug"> |
| 32 | + Purrfect |
| 33 | + <br /> |
| 34 | + Web Tutorials |
| 35 | + </h1> |
| 36 | + <p className="font-sans 2xl:text-2xl" style={{ maxWidth: `40ch` }}> |
| 37 | + Get the skills you need to become a better web developer today. |
| 38 | + High quality courses with custom certificates and projects to show |
| 39 | + off your new skills. |
| 40 | + </p> |
| 41 | + <div className="flex flex-wrap gap-4"> |
| 42 | + <Link href="/courses"> |
| 43 | + <a className="btn-secondary justify-self-end" role="button"> |
| 44 | + Start Now |
| 45 | + </a> |
| 46 | + </Link> |
| 47 | + <Link href="/user/profile"> |
| 48 | + <a className="btn-primary justify-self-start" role="button"> |
| 49 | + Join CodingCat.dev |
| 50 | + </a> |
| 51 | + </Link> |
| 52 | + </div> |
| 53 | + </section> |
| 54 | + <section className="grid grid-cols-1 row-start-1 -ml-10 lg:col-start-2 place-items-center 3xl:justify-items-start 3xl:ml-0"> |
| 55 | + <AJPrimary className="w-1/2 max-w-xs lg:w-3/4 lg:max-w-md" /> |
| 56 | + </section> |
| 57 | + </section> |
| 58 | + {/* COURSES */} |
| 59 | + <BreakBarLeft> |
| 60 | + <Skills /> |
| 61 | + </BreakBarLeft> |
| 62 | + <section className="grid w-full gap-10 px-4 mx-auto mb-4 xl:px-10"> |
| 63 | + <h2 className="mt-4 text-4xl light:text-primary-900 lg:text-5xl"> |
| 64 | + Latest Courses |
| 65 | + </h2> |
| 66 | + <PostsCards posts={recentPosts[PostType.course]} /> |
| 67 | + <Link href="/courses"> |
| 68 | + <a className="justify-self-center"> |
| 69 | + <button className="btn-primary" type="button"> |
| 70 | + View All Courses |
| 71 | + </button> |
| 72 | + </a> |
| 73 | + </Link> |
| 74 | + </section> |
| 75 | + {/* TUTORIALS */} |
| 76 | + <BreakBarRight> |
| 77 | + <AJLogoLeft className="w-16 sm:w-16 md:w-20" /> |
| 78 | + <h3 className="absolute w-1/2 text-2xl text-center sm:left-0 sm:w-full left-1/4 text-basics-50 sm:text-4xl lg:text-4xl"> |
| 79 | + Learn with AJ and KC |
| 80 | + </h3> |
| 81 | + <KCAlt className="w-14 sm:w-14 md:w-20" /> |
| 82 | + </BreakBarRight> |
| 83 | + <section className="grid w-full gap-10 px-4 mx-auto mb-4 xl:px-10"> |
| 84 | + <h2 className="mt-4 text-4xl text-right light:text-primary-900 lg:text-5xl"> |
| 85 | + Latest Tutorials |
| 86 | + </h2> |
| 87 | + <PostsCards posts={recentPosts[PostType.tutorial]} /> |
| 88 | + <Link href="/tutorials"> |
| 89 | + <a className="justify-self-center"> |
| 90 | + <button className="btn-primary" type="button"> |
| 91 | + View All Tutorials |
| 92 | + </button> |
| 93 | + </a> |
| 94 | + </Link> |
| 95 | + </section> |
| 96 | + {/* BLOG */} |
| 97 | + <BreakBarLeft> |
| 98 | + <div className="relative flex items-center w-full"> |
| 99 | + <AJHeartAlt className="w-16 sm:w-16 md:w-20" /> |
| 100 | + <h3 className="absolute w-3/4 ml-4 text-2xl text-center sm:left-0 sm:w-full left-16 text-basics-50 sm:text-4xl md:text-2xl lg:text-4xl"> |
| 101 | + Read what's going on in web dev |
| 102 | + </h3> |
| 103 | + </div> |
| 104 | + </BreakBarLeft> |
| 105 | + <section className="grid w-full gap-10 px-4 mx-auto mb-4 xl:px-10"> |
| 106 | + <h2 className="mt-4 text-4xl light:text-primary-900 lg:text-5xl"> |
| 107 | + Blog Posts |
| 108 | + </h2> |
| 109 | + <PostsCards posts={recentPosts[PostType.post]} /> |
| 110 | + <Link href="/blog"> |
| 111 | + <a className="justify-self-center"> |
| 112 | + <button className="btn-primary" type="button"> |
| 113 | + View All Posts |
| 114 | + </button> |
| 115 | + </a> |
| 116 | + </Link> |
| 117 | + </section> |
| 118 | + {/* PODCASTS */} |
| 119 | + <BreakBarRight> |
| 120 | + <div className="relative flex items-center justify-end w-full"> |
| 121 | + <h3 className="absolute left-0 w-3/4 ml-4 text-2xl text-center sm:w-full text-basics-50 sm:text-3xl md:text-3xl lg:text-4xl"> |
| 122 | + Listen to the latest tech news |
| 123 | + </h3> |
| 124 | + <Podcasts className="w-16 sm:w-16 md:w-20" /> |
| 125 | + </div> |
| 126 | + </BreakBarRight> |
| 127 | + <section className="grid w-full gap-10 px-4 mx-auto mb-4 xl:px-10"> |
| 128 | + <h2 className="mt-4 text-4xl text-right light:text-primary-900 lg:text-5xl"> |
| 129 | + Latest Podcasts |
| 130 | + </h2> |
| 131 | + <PostsCards posts={recentPosts[PostType.podcast]} /> |
| 132 | + <Link href="/podcasts"> |
| 133 | + <a className="justify-self-center"> |
| 134 | + <button className="btn-primary" type="button"> |
| 135 | + View All Podcasts |
| 136 | + </button> |
| 137 | + </a> |
| 138 | + </Link> |
| 139 | + </section> |
| 140 | + </div> |
| 141 | + </> |
| 142 | + ); |
| 143 | +}; |
| 144 | +export default HomeDetail; |
0 commit comments