feat: add net-zero co2 badge (#30)

Reviewed-on: https://codeberg.org/nhcarrigan/portfolio/pulls/30
Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com>
Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
This commit is contained in:
Naomi Carrigan 2024-10-23 19:59:59 +00:00 committed by Naomi the Technomancer
parent 2e655fabbd
commit 561b588c6f
2 changed files with 70 additions and 22 deletions

View File

@ -4,6 +4,7 @@ import "./globals.css";
import { ClientNavigation } from "@/components/navigation";
import Script from "next/script";
import PlausibleProvider from "next-plausible";
import { ClientFooter } from "@/components/footer";
const inter = Inter({ subsets: ["latin"] });
@ -28,8 +29,21 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<PlausibleProvider domain="nhcarrigan.com" customDomain="https://analytics.nhcarrigan.com" trackFileDownloads={true} trackOutboundLinks={true}>
<link rel="icon" href="https://cdn.nhcarrigan.com/logo.png" sizes="any" />
<Script
strategy="beforeInteractive"
src="https://widgets.tree-nation.com/js/widgets/v1/widgets.min.js?v=1.0"
></Script>
<PlausibleProvider
domain="nhcarrigan.com"
customDomain="https://analytics.nhcarrigan.com"
trackFileDownloads={true}
trackOutboundLinks={true}
>
<link
rel="icon"
href="https://cdn.nhcarrigan.com/logo.png"
sizes="any"
/>
<body className={inter.className}>
<header>
<ClientNavigation />
@ -44,6 +58,9 @@ export default function RootLayout({
className="fixed top-0 left-0 w-full h-full object-cover opacity-25"
style={{ pointerEvents: "none" }}
/>
<footer>
<ClientFooter />
</footer>
</body>
<Script
type="text/javascript"

31
src/components/footer.tsx Normal file
View File

@ -0,0 +1,31 @@
"use client";
import React from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import {
faComments,
} from "@fortawesome/free-solid-svg-icons";
import { usePathname } from "next/navigation";
import Script from "next/script";
const Footer = (): JSX.Element => {
return (
<>
<div className="fixed w-full bottom-0 z-50 flex justify-between items-center h-14 px-4 bg-[--background] text-[--foreground]">
<p>&copy; Naomi Carrigan</p>
<a href="https://chat.nhcarrigan.com" target="_blank" rel="noreferrer">
<FontAwesomeIcon icon={faComments} size="lg" />
</a>
<div className="h-4/5" id="tree-nation-offset-website"></div>
<Script id="tree-nation">{`TreeNationOffsetWebsite({code: 'a17464e0cd351220', lang: 'en', theme: 'dark'}).render('#tree-nation-offset-website');`}</Script>
</div>
</>
);
};
export function ClientFooter() {
const pathname = usePathname();
const isRootPath = pathname === "/";
if (isRootPath) return null;
return <Footer />;
}