|
| 1 | +"use client"; |
| 2 | + |
| 3 | +import {Button, Chip} from "@nextui-org/react"; |
| 4 | +import {useEffect, useState} from "react"; |
| 5 | +import {useTheme} from "next-themes"; |
| 6 | + |
| 7 | +import Marquee from "../demos/marquee"; |
| 8 | +import {sectionWrapper, title} from "../primitives"; |
| 9 | + |
| 10 | +import {useIsMobile} from "@/hooks/use-media-query"; |
| 11 | + |
| 12 | +export const NextUIProSection = () => { |
| 13 | + const [mounted, setMounted] = useState(false); |
| 14 | + |
| 15 | + useEffect(() => { |
| 16 | + setMounted(true); |
| 17 | + }, []); |
| 18 | + |
| 19 | + const isMobile = useIsMobile(); |
| 20 | + const {theme} = useTheme(); |
| 21 | + const isDarkMode = theme === "dark"; |
| 22 | + |
| 23 | + let imgSrc: string; |
| 24 | + |
| 25 | + if (isDarkMode) { |
| 26 | + imgSrc = isMobile ? "/images/hero-background@mobile.webp" : "/images/hero-background.webp"; |
| 27 | + } else { |
| 28 | + imgSrc = isMobile |
| 29 | + ? "/images/hero-background-light@mobile.webp" |
| 30 | + : "/images/hero-background-light.webp"; |
| 31 | + } |
| 32 | + |
| 33 | + const mobileClassName: string = isDarkMode |
| 34 | + ? "h-full w-full bg-[radial-gradient(at_50%_70%,_rgba(255,255,255,_0)_5%,_rgba(0,0,0,_0.8)_50%,_rgba(0,0,0,1)_100%)]" |
| 35 | + : "h-full w-full bg-[radial-gradient(at_50%_70%,_rgba(0,0,0,_0)_5%,_rgba(255,255,255,_0.8)_50%,_rgba(255,255,255,1)_100%)]"; |
| 36 | + |
| 37 | + const webClassName: string = isDarkMode |
| 38 | + ? "h-full w-full bg-[radial-gradient(at_80%_60%,_rgba(255,255,255,_0)_20%,_rgba(0,0,0,_0.8)_40%,_rgba(0,0,0,1)_100%)]" |
| 39 | + : "h-full w-full bg-[radial-gradient(at_80%_60%,_rgba(0,0,0,_0)_20%,_rgba(255,255,255,_0.8)_40%,_rgba(255,255,255,1)_100%)]"; |
| 40 | + |
| 41 | + if (!mounted) return null; |
| 42 | + |
| 43 | + return ( |
| 44 | + <section className={sectionWrapper({class: "mt-16 lg:mt-44 overflow-hidden"})}> |
| 45 | + <div className="flex flex-col gap-8 min-h-[480px]"> |
| 46 | + <div className="z-30 flex w-screen h-full flex-col items-start justify-center leading-8 pt-4"> |
| 47 | + <Chip |
| 48 | + classNames={{ |
| 49 | + base: "my-2 bg-gradient-to-r from-blue-400 to-blue-600 font-semibold", |
| 50 | + content: "font-medium text-default-900", |
| 51 | + }} |
| 52 | + color="primary" |
| 53 | + size="sm" |
| 54 | + variant="flat" |
| 55 | + > |
| 56 | + PRO |
| 57 | + </Chip> |
| 58 | + <div> |
| 59 | + <h1 className={title({size: "lg"})}>Ship </h1> |
| 60 | + <h1 className={title({size: "lg", color: "blue"})}>faster </h1> |
| 61 | + <h1 className={title({size: "lg"})}>with </h1> |
| 62 | + </div> |
| 63 | + <div> |
| 64 | + <h1 className={title({size: "lg"})}>beautiful components</h1> |
| 65 | + </div> |
| 66 | + <div className="mt-3 flex w-full max-w-2xl flex-wrap justify-center gap-3 md:mt-2 md:flex-nowrap text-foreground-400"> |
| 67 | + Premade templates of over 210+ beautiful and responsive components, professionally |
| 68 | + created by the team behind NextUI. |
| 69 | + </div> |
| 70 | + <div className="mt-4 text-foreground-500 font-medium"> |
| 71 | + <div className="flex gap-x-4 items-center"> |
| 72 | + <svg |
| 73 | + fill="none" |
| 74 | + height="11" |
| 75 | + viewBox="0 0 13 11" |
| 76 | + width="13" |
| 77 | + xmlns="http://www.w3.org/2000/svg" |
| 78 | + > |
| 79 | + <path |
| 80 | + d="M1 6.4L4.14286 10L12 1" |
| 81 | + stroke="#006FEE" |
| 82 | + strokeLinecap="round" |
| 83 | + strokeLinejoin="round" |
| 84 | + strokeWidth="2" |
| 85 | + /> |
| 86 | + </svg> |
| 87 | + 210+ Components |
| 88 | + </div> |
| 89 | + <div className="flex gap-x-4 items-center"> |
| 90 | + <svg |
| 91 | + fill="none" |
| 92 | + height="11" |
| 93 | + viewBox="0 0 13 11" |
| 94 | + width="13" |
| 95 | + xmlns="http://www.w3.org/2000/svg" |
| 96 | + > |
| 97 | + <path |
| 98 | + d="M1 6.4L4.14286 10L12 1" |
| 99 | + stroke="#006FEE" |
| 100 | + strokeLinecap="round" |
| 101 | + strokeLinejoin="round" |
| 102 | + strokeWidth="2" |
| 103 | + /> |
| 104 | + </svg> |
| 105 | + Lifetime Access |
| 106 | + </div> |
| 107 | + <div className="flex gap-x-4 items-center"> |
| 108 | + <svg |
| 109 | + fill="none" |
| 110 | + height="11" |
| 111 | + viewBox="0 0 13 11" |
| 112 | + width="13" |
| 113 | + xmlns="http://www.w3.org/2000/svg" |
| 114 | + > |
| 115 | + <path |
| 116 | + d="M1 6.4L4.14286 10L12 1" |
| 117 | + stroke="#006FEE" |
| 118 | + strokeLinecap="round" |
| 119 | + strokeLinejoin="round" |
| 120 | + strokeWidth="2" |
| 121 | + /> |
| 122 | + </svg> |
| 123 | + Free Updates |
| 124 | + </div> |
| 125 | + <div className="flex gap-x-4 items-center"> |
| 126 | + <svg |
| 127 | + fill="none" |
| 128 | + height="11" |
| 129 | + viewBox="0 0 13 11" |
| 130 | + width="13" |
| 131 | + xmlns="http://www.w3.org/2000/svg" |
| 132 | + > |
| 133 | + <path |
| 134 | + d="M1 6.4L4.14286 10L12 1" |
| 135 | + stroke="#006FEE" |
| 136 | + strokeLinecap="round" |
| 137 | + strokeLinejoin="round" |
| 138 | + strokeWidth="2" |
| 139 | + /> |
| 140 | + </svg> |
| 141 | + Figma Files Included |
| 142 | + </div> |
| 143 | + </div> |
| 144 | + <div className="mt-4"> |
| 145 | + <Button |
| 146 | + as={"a"} |
| 147 | + className="px-6 flex items-center" |
| 148 | + color="primary" |
| 149 | + href="https://nextui.pro?utm_source=nextui.org&utm_medium=nextui-homepage-section" |
| 150 | + rel="noopener noreferrer" |
| 151 | + > |
| 152 | + Explore NextUI Pro |
| 153 | + <svg |
| 154 | + fill="none" |
| 155 | + height="21" |
| 156 | + viewBox="0 0 20 21" |
| 157 | + width="20" |
| 158 | + xmlns="http://www.w3.org/2000/svg" |
| 159 | + > |
| 160 | + <path |
| 161 | + d="M12.0254 5.44189L17.0837 10.5002L12.0254 15.5586" |
| 162 | + stroke="white" |
| 163 | + strokeLinecap="round" |
| 164 | + strokeLinejoin="round" |
| 165 | + strokeMiterlimit="10" |
| 166 | + strokeWidth="1.5" |
| 167 | + /> |
| 168 | + <path |
| 169 | + d="M2.91602 10.5H16.941" |
| 170 | + stroke="white" |
| 171 | + strokeLinecap="round" |
| 172 | + strokeLinejoin="round" |
| 173 | + strokeMiterlimit="10" |
| 174 | + strokeWidth="1.5" |
| 175 | + /> |
| 176 | + </svg> |
| 177 | + </Button> |
| 178 | + </div> |
| 179 | + </div> |
| 180 | + <div className="overflow-hidden"> |
| 181 | + <Marquee |
| 182 | + vertical |
| 183 | + className="h-78 w-screen mt-4 md:absolute md:top-0 md:inset-0 isolate md:max-h-dvh" |
| 184 | + duration={isMobile ? 240 : 60} |
| 185 | + > |
| 186 | + <img |
| 187 | + alt="Hero Background" |
| 188 | + className="w-full" |
| 189 | + height={3255} |
| 190 | + loading="lazy" |
| 191 | + src={imgSrc} |
| 192 | + width={1920} |
| 193 | + /> |
| 194 | + </Marquee> |
| 195 | + <div className="absolute md:hidden inset-0 pointer-events-none top-0 z-20"> |
| 196 | + <div className={mobileClassName} /> |
| 197 | + </div> |
| 198 | + |
| 199 | + <div className="absolute hidden md:block md:inset-0 md:pointer-events-none md:top-0 md:z-20"> |
| 200 | + <div className={webClassName} /> |
| 201 | + </div> |
| 202 | + </div> |
| 203 | + </div> |
| 204 | + </section> |
| 205 | + ); |
| 206 | +}; |
0 commit comments