|
1 | 1 | "use client"; |
| 2 | +import { useState } from "react"; |
2 | 3 | import Link from "next/link"; |
3 | 4 | import { motion } from "motion/react"; |
4 | | -import { LINKS } from "@/constants"; |
| 5 | +import { LINKS, SPONSOR } from "@/constants"; |
| 6 | +import GithubIcon from "@/icons/github-icon"; |
| 7 | +import TwitterXIcon from "@/icons/twitter-x-icon"; |
| 8 | +import HeartIcon from "@/icons/heart-icon"; |
| 9 | +import RocketIcon from "@/icons/rocket-icon"; |
| 10 | +import StarIcon from "@/icons/star-icon"; |
| 11 | +import SparklesIcon from "@/icons/sparkles-icon"; |
| 12 | +import CoffeeIcon from "@/icons/coffee-icon"; |
| 13 | +import CodeIcon from "@/icons/code-icon"; |
| 14 | +import BulbSvg from "@/icons/bulb-svg"; |
| 15 | +import FlameIcon from "@/icons/flame-icon"; |
| 16 | +import LikeIcon from "@/icons/like-icon"; |
| 17 | +import BookmarkIcon from "@/icons/bookmark-icon"; |
| 18 | +import CameraIcon from "@/icons/camera-icon"; |
| 19 | +import MoonIcon from "@/icons/moon-icon"; |
| 20 | +import BellOffIcon from "@/icons/bell-off-icon"; |
| 21 | +import LockIcon from "@/icons/lock-icon"; |
| 22 | +import RefreshIcon from "@/icons/refresh-icon"; |
| 23 | +import GearIcon from "@/icons/gear-icon"; |
| 24 | +import MessageCircleIcon from "@/icons/message-circle-icon"; |
| 25 | +import SendIcon from "@/icons/send-icon"; |
| 26 | +import CheckedIcon from "@/icons/checked-icon"; |
| 27 | + |
| 28 | +const CryptoAddress = ({ |
| 29 | + label, |
| 30 | + address, |
| 31 | +}: { |
| 32 | + label: string; |
| 33 | + address: string; |
| 34 | +}) => { |
| 35 | + const [copied, setCopied] = useState(false); |
| 36 | + |
| 37 | + const handleCopy = async () => { |
| 38 | + await navigator.clipboard.writeText(address); |
| 39 | + setCopied(true); |
| 40 | + setTimeout(() => setCopied(false), 2000); |
| 41 | + }; |
| 42 | + |
| 43 | + return ( |
| 44 | + <button |
| 45 | + onClick={handleCopy} |
| 46 | + className="hover:text-foreground group flex cursor-pointer items-center gap-1.5 text-left text-xs transition-colors" |
| 47 | + > |
| 48 | + <span className="truncate"> |
| 49 | + {label}: {address.slice(0, 20)}... |
| 50 | + </span> |
| 51 | + {copied && <CheckedIcon className="h-3 w-3 shrink-0 text-green-500" />} |
| 52 | + </button> |
| 53 | + ); |
| 54 | +}; |
5 | 55 |
|
6 | 56 | const Footer = () => { |
| 57 | + const featuredIcons = [ |
| 58 | + { Icon: HeartIcon, name: "heart" }, |
| 59 | + { Icon: RocketIcon, name: "rocket" }, |
| 60 | + { Icon: StarIcon, name: "star" }, |
| 61 | + { Icon: SparklesIcon, name: "sparkles" }, |
| 62 | + { Icon: CoffeeIcon, name: "coffee" }, |
| 63 | + { Icon: CodeIcon, name: "code" }, |
| 64 | + { Icon: BulbSvg, name: "bulb" }, |
| 65 | + { Icon: FlameIcon, name: "flame" }, |
| 66 | + { Icon: LikeIcon, name: "like" }, |
| 67 | + { Icon: BookmarkIcon, name: "bookmark" }, |
| 68 | + { Icon: CameraIcon, name: "camera" }, |
| 69 | + { Icon: MoonIcon, name: "moon" }, |
| 70 | + { Icon: BellOffIcon, name: "bell-off" }, |
| 71 | + { Icon: LockIcon, name: "lock" }, |
| 72 | + { Icon: RefreshIcon, name: "refresh" }, |
| 73 | + { Icon: GearIcon, name: "gear" }, |
| 74 | + { Icon: MessageCircleIcon, name: "message" }, |
| 75 | + { Icon: SendIcon, name: "send" }, |
| 76 | + { Icon: GithubIcon, name: "github" }, |
| 77 | + { Icon: TwitterXIcon, name: "twitter" }, |
| 78 | + ]; |
| 79 | + |
7 | 80 | return ( |
8 | 81 | <motion.footer |
9 | 82 | initial={{ opacity: 0, y: 20 }} |
10 | 83 | whileInView={{ opacity: 1, y: 0 }} |
11 | 84 | transition={{ duration: 0.5 }} |
12 | 85 | viewport={{ once: true }} |
13 | | - className="border-t py-6 md:py-0" |
| 86 | + className="border-t" |
14 | 87 | > |
15 | | - <div className="container mx-auto flex max-w-7xl flex-col items-center justify-between gap-4 md:h-24 md:flex-row"> |
16 | | - <div className="flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0"> |
17 | | - <p className="text-muted-foreground text-center text-sm leading-loose md:text-left"> |
18 | | - Built by{" "} |
19 | | - <Link |
20 | | - href={LINKS.CREATOR} |
21 | | - target="_blank" |
22 | | - rel="noreferrer" |
23 | | - className="font-medium underline underline-offset-4" |
24 | | - > |
25 | | - Abhijit |
26 | | - </Link> |
27 | | - . The source code is available on{" "} |
28 | | - <Link |
29 | | - href={LINKS.GITHUB} |
30 | | - target="_blank" |
31 | | - rel="noreferrer" |
32 | | - className="font-medium underline underline-offset-4" |
33 | | - > |
34 | | - GitHub |
35 | | - </Link> |
36 | | - . |
37 | | - </p> |
| 88 | + <div className="w-full px-4 py-12 md:px-8 lg:px-12"> |
| 89 | + <div className="grid grid-cols-1 gap-12 md:grid-cols-2 lg:grid-cols-4"> |
| 90 | + <div className="space-y-4"> |
| 91 | + <h3 className="text-lg font-semibold">Quick Links</h3> |
| 92 | + <nav className="flex flex-col space-y-3"> |
| 93 | + <Link |
| 94 | + href="/" |
| 95 | + className="text-muted-foreground hover:text-foreground transition-colors" |
| 96 | + > |
| 97 | + Home |
| 98 | + </Link> |
| 99 | + <Link |
| 100 | + href="/icons" |
| 101 | + className="text-muted-foreground hover:text-foreground transition-colors" |
| 102 | + > |
| 103 | + Icons |
| 104 | + </Link> |
| 105 | + <Link |
| 106 | + href="/sponsor" |
| 107 | + className="text-muted-foreground hover:text-foreground transition-colors" |
| 108 | + > |
| 109 | + Sponsor |
| 110 | + </Link> |
| 111 | + <Link |
| 112 | + href={LINKS.GITHUB} |
| 113 | + target="_blank" |
| 114 | + rel="noreferrer" |
| 115 | + className="text-muted-foreground hover:text-foreground transition-colors" |
| 116 | + > |
| 117 | + GitHub |
| 118 | + </Link> |
| 119 | + </nav> |
| 120 | + </div> |
| 121 | + |
| 122 | + <div className="space-y-4"> |
| 123 | + <h3 className="text-lg font-semibold">Sponsor</h3> |
| 124 | + <div className="flex flex-col space-y-3"> |
| 125 | + <Link |
| 126 | + href={SPONSOR.buymeacoffee} |
| 127 | + target="_blank" |
| 128 | + rel="noreferrer" |
| 129 | + className="text-muted-foreground hover:text-foreground inline-flex items-center gap-2 transition-colors" |
| 130 | + > |
| 131 | + <CoffeeIcon size={16} /> |
| 132 | + Buy Me a Coffee |
| 133 | + </Link> |
| 134 | + <div className="text-muted-foreground space-y-2 text-sm"> |
| 135 | + <p className="text-foreground font-medium">Crypto</p> |
| 136 | + <CryptoAddress label="BTC" address={SPONSOR.btc} /> |
| 137 | + <CryptoAddress label="ETH" address={SPONSOR.eth} /> |
| 138 | + <CryptoAddress label="SOL" address={SPONSOR.sol} /> |
| 139 | + </div> |
| 140 | + </div> |
| 141 | + </div> |
| 142 | + |
| 143 | + <div className="space-y-4 lg:col-span-2"> |
| 144 | + <h3 className="text-lg font-semibold">Featured Icons</h3> |
| 145 | + <div className="grid grid-cols-5 gap-3 sm:grid-cols-6 md:grid-cols-5 lg:grid-cols-10"> |
| 146 | + {featuredIcons.map(({ Icon, name }) => ( |
| 147 | + <motion.div |
| 148 | + key={name} |
| 149 | + whileHover={{ scale: 1.1 }} |
| 150 | + className="hover:bg-accent flex items-center justify-center rounded-lg border p-2 transition-colors" |
| 151 | + > |
| 152 | + <Icon size={20} /> |
| 153 | + </motion.div> |
| 154 | + ))} |
| 155 | + </div> |
| 156 | + </div> |
| 157 | + </div> |
| 158 | + |
| 159 | + <div className="mt-12 border-t pt-8"> |
| 160 | + <div className="flex flex-col items-center justify-between gap-4 md:flex-row"> |
| 161 | + <p className="text-muted-foreground text-center text-sm md:text-left"> |
| 162 | + Built by{" "} |
| 163 | + <Link |
| 164 | + href={LINKS.CREATOR} |
| 165 | + target="_blank" |
| 166 | + rel="noreferrer" |
| 167 | + className="hover:text-foreground font-medium underline underline-offset-4 transition-colors" |
| 168 | + > |
| 169 | + Abhijit |
| 170 | + </Link> |
| 171 | + . The source code is available on{" "} |
| 172 | + <Link |
| 173 | + href={LINKS.GITHUB} |
| 174 | + target="_blank" |
| 175 | + rel="noreferrer" |
| 176 | + className="hover:text-foreground font-medium underline underline-offset-4 transition-colors" |
| 177 | + > |
| 178 | + GitHub |
| 179 | + </Link> |
| 180 | + . |
| 181 | + </p> |
| 182 | + |
| 183 | + <div className="flex items-center gap-4"> |
| 184 | + <Link |
| 185 | + href={LINKS.GITHUB} |
| 186 | + target="_blank" |
| 187 | + rel="noreferrer" |
| 188 | + className="text-muted-foreground hover:text-foreground transition-colors" |
| 189 | + aria-label="GitHub" |
| 190 | + > |
| 191 | + <GithubIcon size={20} /> |
| 192 | + </Link> |
| 193 | + <Link |
| 194 | + href={LINKS.TWITTER} |
| 195 | + target="_blank" |
| 196 | + rel="noreferrer" |
| 197 | + className="text-muted-foreground hover:text-foreground transition-colors" |
| 198 | + aria-label="Twitter" |
| 199 | + > |
| 200 | + <TwitterXIcon size={20} /> |
| 201 | + </Link> |
| 202 | + </div> |
| 203 | + </div> |
38 | 204 | </div> |
39 | 205 | </div> |
40 | 206 | </motion.footer> |
|
0 commit comments