hezarfen_landing
Clone
https://git.tahinli.com/archive/hezarfen_landing.git
0 watching0 forksTypeScript581.6 KiB94b1804Burak Boduroğlu2 months ago15 commits
| 1 | import { A } from "@solidjs/router"; |
| 2 | import { For } from "solid-js"; |
| 3 | import { FiArrowUpRight, FiLinkedin } from "solid-icons/fi"; |
| 4 | import Logo from "./Logo"; |
| 5 | import { anchors, mailto, routes, site } from "~/config"; |
| 6 | import { t } from "~/i18n"; |
| 7 | |
| 8 | export default function Footer() { |
| 9 | // Icons keyed by the `site.social` account names, so the row below iterates |
| 10 | // the config itself: an account added in `config.ts` fails the typecheck |
| 11 | // until it gains an icon here, and a removed one vanishes from the footer |
| 12 | // and from the JsonLd `sameAs` together — the list is never half-updated. |
| 13 | const socialMeta = { |
| 14 | linkedin: { label: "LinkedIn", icon: FiLinkedin }, |
| 15 | } as const; |
| 16 | |
| 17 | const columns = [ |
| 18 | { |
| 19 | title: t.footer.sections.product, |
| 20 | links: [ |
| 21 | { label: t.nav.products, href: anchors.products }, |
| 22 | { label: t.nav.platform, href: anchors.platform }, |
| 23 | { label: t.nav.theory, href: routes.how }, |
| 24 | { label: t.nav.roles, href: anchors.roles }, |
| 25 | ], |
| 26 | }, |
| 27 | { |
| 28 | title: t.footer.sections.company, |
| 29 | links: [ |
| 30 | { label: t.nav.problem, href: anchors.problem }, |
| 31 | { label: t.nav.trust, href: anchors.trust }, |
| 32 | { label: t.nav.audience, href: anchors.audience }, |
| 33 | { label: t.nav.about, href: anchors.about }, |
| 34 | { label: t.nav.faq, href: anchors.faq }, |
| 35 | ], |
| 36 | }, |
| 37 | ]; |
| 38 | |
| 39 | const socials = (Object.keys(site.social) as (keyof typeof site.social)[]).map(key => ({ |
| 40 | label: socialMeta[key].label, |
| 41 | href: site.social[key], |
| 42 | icon: socialMeta[key].icon, |
| 43 | })); |
| 44 | |
| 45 | return ( |
| 46 | <footer class="hz-footer"> |
| 47 | <div class="hz-footer-inner"> |
| 48 | <div class="hz-footer-cols"> |
| 49 | <div> |
| 50 | <Logo /> |
| 51 | <p class="hz-small mt-4 max-w-[36ch]">{t.footer.tagline}</p> |
| 52 | <p class="hz-small mt-4"> |
| 53 | <a |
| 54 | href={site.builder.url} |
| 55 | rel="noopener noreferrer" |
| 56 | target="_blank" |
| 57 | class="underline decoration-[var(--line-strong)] underline-offset-2 hover:text-[var(--brand-ink)]" |
| 58 | > |
| 59 | {t.footer.builtBy} |
| 60 | </a> |
| 61 | </p> |
| 62 | </div> |
| 63 | |
| 64 | <For each={columns}> |
| 65 | {column => ( |
| 66 | <div> |
| 67 | <h4>{column.title}</h4> |
| 68 | <ul> |
| 69 | <For each={column.links}> |
| 70 | {link => ( |
| 71 | <li> |
| 72 | <a href={link.href}>{link.label}</a> |
| 73 | </li> |
| 74 | )} |
| 75 | </For> |
| 76 | </ul> |
| 77 | </div> |
| 78 | )} |
| 79 | </For> |
| 80 | |
| 81 | {/* The address is the one thing anyone comes down here for, so it is |
| 82 | set larger than the links beside it. */} |
| 83 | <div> |
| 84 | <h4>{t.footer.sections.contact}</h4> |
| 85 | <ul> |
| 86 | <li> |
| 87 | <A href={routes.contact}>{t.nav.demo}</A> |
| 88 | </li> |
| 89 | </ul> |
| 90 | <a |
| 91 | href={mailto(t.cta.subject)} |
| 92 | class="group mt-3 inline-flex items-baseline gap-1 font-medium text-[var(--ink)] hover:text-[var(--brand-ink)]" |
| 93 | > |
| 94 | {site.email} |
| 95 | <FiArrowUpRight class="size-4 shrink-0 self-center transition-transform duration-300 group-hover:-translate-y-0.5 group-hover:translate-x-0.5" /> |
| 96 | </a> |
| 97 | </div> |
| 98 | </div> |
| 99 | |
| 100 | <div class="hz-footer-legal"> |
| 101 | <span> |
| 102 | © {new Date().getFullYear()} {site.legalName}. {t.footer.rights} |
| 103 | </span> |
| 104 | <div class="flex items-center gap-3"> |
| 105 | <span>{site.domain}</span> |
| 106 | <For each={socials}> |
| 107 | {social => ( |
| 108 | <a |
| 109 | href={social.href} |
| 110 | aria-label={social.label} |
| 111 | rel="noopener noreferrer" |
| 112 | target="_blank" |
| 113 | class="hz-social" |
| 114 | > |
| 115 | <social.icon class="size-4" /> |
| 116 | </a> |
| 117 | )} |
| 118 | </For> |
| 119 | </div> |
| 120 | </div> |
| 121 | </div> |
| 122 | </footer> |
| 123 | ); |
| 124 | } |