summaryrefslogtreecommitdiff
path: root/src/components/widgets/Footer.astro
diff options
context:
space:
mode:
authorDawid Rycerz <dawid@rycerz.xyz>2025-07-22 15:08:37 +0300
committerDawid Rycerz <dawid@rycerz.xyz>2025-07-22 15:08:37 +0300
commitfcc2f4704e39b0e69b377cc138f75027721dac22 (patch)
tree732fc94b354a26c08fba9cc9059f9c6c900182be /src/components/widgets/Footer.astro
Initial template
Diffstat (limited to 'src/components/widgets/Footer.astro')
-rw-r--r--src/components/widgets/Footer.astro61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/components/widgets/Footer.astro b/src/components/widgets/Footer.astro
new file mode 100644
index 0000000..70cac54
--- /dev/null
+++ b/src/components/widgets/Footer.astro
@@ -0,0 +1,61 @@
+---
+import { Icon } from 'astro-icon/components';
+import { SITE } from 'astrowind:config';
+import { getHomePermalink } from '~/utils/permalinks';
+
+interface Link {
+ text?: string;
+ href?: string;
+ ariaLabel?: string;
+ icon?: string;
+}
+
+interface Links {
+ title?: string;
+ links: Array<Link>;
+}
+
+export interface Props {
+ links: Array<Links>;
+ secondaryLinks: Array<Link>;
+ socialLinks: Array<Link>;
+ footNote?: string;
+ theme?: string;
+}
+
+const { socialLinks = [], secondaryLinks = [], links = [], footNote = '', theme = 'light' } = Astro.props;
+---
+
+<footer class:list={[{ dark: theme === 'dark' }, 'relative border-t border-gray-200 dark:border-slate-800 not-prose']}>
+ <div class="dark:bg-dark absolute inset-0 pointer-events-none" aria-hidden="true"></div>
+ <div
+ class="relative max-w-7xl mx-auto px-4 sm:px-6 dark:text-slate-300 intersect-once intersect-quarter intercept-no-queue motion-safe:md:opacity-0 motion-safe:md:intersect:animate-fade"
+ >
+ <div class="md:flex md:items-center md:justify-between py-6 md:py-8">
+ {
+ socialLinks?.length ? (
+ <ul class="flex mb-4 md:order-1 -ml-2 md:ml-4 md:mb-0 rtl:ml-0 rtl:-mr-2 rtl:md:ml-0 rtl:md:mr-4">
+ {socialLinks.map(({ ariaLabel, href, text, icon }) => (
+ <li>
+ <a
+ class="text-muted dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 inline-flex items-center"
+ aria-label={ariaLabel}
+ href={href}
+ >
+ {icon && <Icon name={icon} class="w-5 h-5" />}
+ <Fragment set:html={text} />
+ </a>
+ </li>
+ ))}
+ </ul>
+ ) : (
+ ''
+ )
+ }
+
+ <div class="text-sm mr-4 dark:text-muted">
+ <Fragment set:html={footNote} />
+ </div>
+ </div>
+ </div>
+</footer>