|
| 1 | +import { ReactElement, ReactNode } from "react"; |
| 2 | + |
| 3 | +const ICON_FILL = "fill-blue-100 dark:fill-darksea-80 opacity-20"; |
| 4 | +const ICON_STROKE = "stroke-blue-100 dark:stroke-darksea-40"; |
| 5 | + |
| 6 | +const features: FeatureProps[] = [ |
| 7 | + { |
| 8 | + icon: ( |
| 9 | + <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 10 | + <path |
| 11 | + fillRule="evenodd" |
| 12 | + clipRule="evenodd" |
| 13 | + d="M11 3C10.4477 3 10 3.44772 10 4V4.56876C10 4.99658 9.71288 5.36825 9.31776 5.53229C8.9225 5.6964 8.46228 5.63386 8.15966 5.33123L7.75734 4.92891C7.36681 4.53839 6.73365 4.53839 6.34312 4.92891L4.92891 6.34313C4.53838 6.73365 4.53838 7.36681 4.92891 7.75734L5.33123 8.15966C5.63386 8.46229 5.6964 8.9225 5.53229 9.31776C5.36825 9.71288 4.99658 10 4.56877 10L4 10C3.44772 10 3 10.4477 3 11V13C3 13.5523 3.44772 14 4 14H4.56879C4.99659 14 5.36825 14.2871 5.53228 14.6822C5.69638 15.0775 5.63384 15.5377 5.33123 15.8403L4.92889 16.2426C4.53837 16.6331 4.53837 17.2663 4.92889 17.6568L6.34311 19.071C6.73363 19.4616 7.36679 19.4616 7.75732 19.071L8.1596 18.6688C8.46223 18.3661 8.92247 18.3036 9.31774 18.4677C9.71287 18.6317 10 19.0034 10 19.4313V20C10 20.5523 10.4477 21 11 21H13C13.5523 21 14 20.5523 14 20V19.4312C14 19.0034 14.2871 18.6318 14.6822 18.4677C15.0775 18.3036 15.5377 18.3661 15.8403 18.6688L16.2426 19.071C16.6331 19.4616 17.2663 19.4616 17.6568 19.071L19.071 17.6568C19.4616 17.2663 19.4616 16.6331 19.071 16.2426L18.6688 15.8403C18.3661 15.5377 18.3036 15.0775 18.4677 14.6822C18.6318 14.2871 19.0034 14 19.4312 14H20C20.5523 14 21 13.5523 21 13V11C21 10.4477 20.5523 10 20 10L19.4313 10C19.0034 10 18.6317 9.71287 18.4677 9.31774C18.3036 8.92247 18.3661 8.46223 18.6688 8.1596L19.071 7.75734C19.4615 7.36681 19.4616 6.73365 19.071 6.34312L17.6568 4.92891C17.2663 4.53838 16.6331 4.53838 16.2426 4.92891L15.8403 5.33123C15.5377 5.63384 15.0775 5.69638 14.6822 5.53228C14.2871 5.36825 14 4.99659 14 4.56879V4C14 3.44772 13.5523 3 13 3H11ZM12 14C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14Z" |
| 14 | + className={ICON_FILL} |
| 15 | + /> |
| 16 | + <path |
| 17 | + d="M11 3H13C13.5523 3 14 3.44772 14 4V4.56879C14 4.99659 14.2871 5.36825 14.6822 5.53228C15.0775 5.69638 15.5377 5.63384 15.8403 5.33123L16.2426 4.92891C16.6331 4.53838 17.2663 4.53838 17.6568 4.92891L19.071 6.34312C19.4616 6.73365 19.4615 7.36681 19.071 7.75734L18.6688 8.1596C18.3661 8.46223 18.3036 8.92247 18.4677 9.31774C18.6317 9.71287 19.0034 10 19.4313 10L20 10C20.5523 10 21 10.4477 21 11V13C21 13.5523 20.5523 14 20 14H19.4312C19.0034 14 18.6318 14.2871 18.4677 14.6822C18.3036 15.0775 18.3661 15.5377 18.6688 15.8403L19.071 16.2426C19.4616 16.6331 19.4616 17.2663 19.071 17.6568L17.6568 19.071C17.2663 19.4616 16.6331 19.4616 16.2426 19.071L15.8403 18.6688C15.5377 18.3661 15.0775 18.3036 14.6822 18.4677C14.2871 18.6318 14 19.0034 14 19.4312V20C14 20.5523 13.5523 21 13 21H11C10.4477 21 10 20.5523 10 20V19.4313C10 19.0034 9.71287 18.6317 9.31774 18.4677C8.92247 18.3036 8.46223 18.3661 8.1596 18.6688L7.75732 19.071C7.36679 19.4616 6.73363 19.4616 6.34311 19.071L4.92889 17.6568C4.53837 17.2663 4.53837 16.6331 4.92889 16.2426L5.33123 15.8403C5.63384 15.5377 5.69638 15.0775 5.53228 14.6822C5.36825 14.2871 4.99659 14 4.56879 14H4C3.44772 14 3 13.5523 3 13V11C3 10.4477 3.44772 10 4 10L4.56877 10C4.99658 10 5.36825 9.71288 5.53229 9.31776C5.6964 8.9225 5.63386 8.46229 5.33123 8.15966L4.92891 7.75734C4.53838 7.36681 4.53838 6.73365 4.92891 6.34313L6.34312 4.92891C6.73365 4.53839 7.36681 4.53839 7.75734 4.92891L8.15966 5.33123C8.46228 5.63386 8.9225 5.6964 9.31776 5.53229C9.71288 5.36825 10 4.99658 10 4.56876V4C10 3.44772 10.4477 3 11 3Z" |
| 18 | + className={ICON_STROKE} |
| 19 | + strokeWidth="1.5" |
| 20 | + /> |
| 21 | + <path |
| 22 | + d="M14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12C10 10.8954 10.8954 10 12 10C13.1046 10 14 10.8954 14 12Z" |
| 23 | + className={ICON_STROKE} |
| 24 | + strokeWidth="1.5" |
| 25 | + /> |
| 26 | + </svg> |
| 27 | + ), |
| 28 | + title: "Compile", |
| 29 | + desc: "Comes with built-in Cairo and StarkNet compiler, no need for setting up extra tooling.", |
| 30 | + }, |
| 31 | + { |
| 32 | + icon: ( |
| 33 | + <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 34 | + <path |
| 35 | + d="M4 7H20V18C20 19.1046 19.1046 20 18 20H6C4.89543 20 4 19.1046 4 18V7Z" |
| 36 | + className={ICON_FILL} |
| 37 | + /> |
| 38 | + <path |
| 39 | + d="M15 11C15 12.6569 13.6569 14 12 14C10.3431 14 9 12.6569 9 11M20 7L18 3H6L4 7M20 7H4M20 7V18C20 19.1046 19.1046 20 18 20H6C4.89543 20 4 19.1046 4 18V7" |
| 40 | + className={ICON_STROKE} |
| 41 | + strokeWidth="1.5" |
| 42 | + strokeLinecap="round" |
| 43 | + strokeLinejoin="round" |
| 44 | + /> |
| 45 | + </svg> |
| 46 | + ), |
| 47 | + title: "Install", |
| 48 | + desc: "Add, update and remove dependencies from the growing family of Cairo packages.", |
| 49 | + }, |
| 50 | + { |
| 51 | + icon: ( |
| 52 | + <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 53 | + <path |
| 54 | + d="M7 4H17V12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12V4Z" |
| 55 | + className={ICON_FILL} |
| 56 | + /> |
| 57 | + <path |
| 58 | + d="M8 21H16M12 21V17M12 17C9.23858 17 7 14.7614 7 12V4H17V12C17 14.7614 14.7614 17 12 17ZM17 6H18.5C19.8807 6 21 7.11929 21 8.5C21 9.88071 19.8807 11 18.5 11H17M7 11H5.5C4.11929 11 3 9.88071 3 8.5C3 7.11929 4.11929 6 5.5 6H7" |
| 59 | + className={ICON_STROKE} |
| 60 | + strokeWidth="1.5" |
| 61 | + strokeLinecap="round" |
| 62 | + strokeLinejoin="round" |
| 63 | + /> |
| 64 | + </svg> |
| 65 | + ), |
| 66 | + title: "Develop", |
| 67 | + desc: "Great support in the rest of Cairo ecosystem. Out of the box works with Cairo Language Server and Protostar.", |
| 68 | + }, |
| 69 | +]; |
| 70 | + |
| 71 | +export function Features(): ReactElement { |
| 72 | + return ( |
| 73 | + <section className="mb-16 grid gap-8 rounded-3xl bg-sea-40 p-12 text-blue-100 shadow-xl shadow-sea-20 dark:bg-black-40 dark:text-darksea-20 dark:shadow-black sm:grid-cols-2 md:grid-cols-3"> |
| 74 | + {features.map((feature, i) => ( |
| 75 | + <Feature key={i} {...feature} /> |
| 76 | + ))} |
| 77 | + </section> |
| 78 | + ); |
| 79 | +} |
| 80 | + |
| 81 | +interface FeatureProps { |
| 82 | + icon: ReactNode; |
| 83 | + title: ReactNode; |
| 84 | + desc: ReactNode; |
| 85 | +} |
| 86 | + |
| 87 | +function Feature({ icon, title, desc }: FeatureProps): ReactElement { |
| 88 | + return ( |
| 89 | + <div className="flex flex-col justify-center space-y-4 text-center"> |
| 90 | + <div className="mx-auto w-24">{icon}</div> |
| 91 | + <p className="mx-auto w-32 rounded-xl bg-sea-20 p-1 text-lg font-bold dark:bg-black-60"> |
| 92 | + {title} |
| 93 | + </p> |
| 94 | + <p>{desc}</p> |
| 95 | + </div> |
| 96 | + ); |
| 97 | +} |
0 commit comments