Skip to content

Commit

Permalink
feat: ticket links and more link things
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Nov 30, 2024
1 parent 711c11f commit 3c0efdc
Show file tree
Hide file tree
Showing 13 changed files with 111 additions and 39 deletions.
5 changes: 0 additions & 5 deletions .astro/settings.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/AdNewsletterRich.astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Heading from "./Heading.astro";
Email Address
<input type="email" placeholder="cool.dev@awesome.com" />
</label>
<Button variant="light">Subscribe</Button>
<Button as="button" type="submit" variant="light">Subscribe</Button>
</form>

<Image
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdNewsletterThin.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import TextSquiggly from "./TextSquiggly.astro";
type="email"
placeholder="cool.dev@awesome.com"
/>
<Button variant="light">Subscribe</Button>
<Button as="button" type="submit" variant="light">Subscribe</Button>
</form>
</ContentArea>
</div>
Expand Down
5 changes: 4 additions & 1 deletion src/components/AdRegistration.astro
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
---
import { links } from "~/data/links";
import Button from "./Button.astro";
import ContentArea from "./ContentArea.astro";
import Heading from "./Heading.astro";
---

<ContentArea as="section">
<Heading level="h2">Registration is open!</Heading>
<Button>Get extra early bird tickets now!</Button>
<Button as="a" href={links.tickets} target="_blank" variant="accent"
>Get extra early bird tickets now!</Button
>
</ContentArea>
9 changes: 7 additions & 2 deletions src/components/AdTicketsThin.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import tripleSquiggly from "~/assets/design/triple-squiggly.svg";
import Button from "./Button.astro";
import ContentArea from "./ContentArea.astro";
import { links } from "~/data/links";
---

<section class="ad-tickets-thin">
Expand All @@ -12,8 +13,12 @@ import ContentArea from "./ContentArea.astro";
>
</div>
<ContentArea class="ad-tickets-content">
<Button size="large" variant="accent"
>Get extra early bird tickets now!</Button
<Button
as="a"
size="large"
variant="accent"
href={links.tickets}
target="_blank">Get extra early bird tickets now!</Button
>
</ContentArea>
</section>
Expand Down
22 changes: 16 additions & 6 deletions src/components/Button.astro
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
---
interface Props {
import { HTMLTag, Polymorphic } from "astro/types";
type Props<Tag extends HTMLTag> = Polymorphic<{
as: Tag;
class?: string;
size?: "normal" | "large";
variant: "accent" | "light";
}
}>;
const { class: className, size = "normal", variant, ...rest } = Astro.props;
const {
as: As,
class: className,
size = "normal",
variant,
...rest
} = Astro.props;
---

<button
<As
class:list={[
"button",
`button-size-${size}`,
Expand All @@ -18,13 +27,14 @@ const { class: className, size = "normal", variant, ...rest } = Astro.props;
{...rest}
>
<slot />
</button>
</As>

<style>
.button {
border: 0;
font-family: inherit;
cursor: pointer;
font-family: inherit;
text-decoration: none;
}

.button-size-normal {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Socials from "./Socials.astro";
</div>
<div class="right">
<div class="footer-links">
<a href="https://shop.squiggle.tools">Shop</a>
<a href="https://shop.squiggle.tools" target="_blank">Shop</a>
<a href="/code-of-conduct">Code of Conduct</a>
</div>
<Socials />
Expand Down
36 changes: 25 additions & 11 deletions src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
---
import { links } from "~/data/links";
import Button from "./Button.astro";
import ContentArea from "./ContentArea.astro";
import Logo from "./Logo.astro";
function hrefProps(pathname: string) {
return {
class: Astro.url.pathname === pathname ? "" : "header-link-inactive",
href: pathname,
};
}
---

<header>
Expand All @@ -11,21 +19,31 @@ import Logo from "./Logo.astro";
<details id="details">
<summary aria-label="Toggle header">≡</summary>
<div class="header-contents-mobile">
<a href="/">Home</a>
<a href="https://2024.squiggleconf.com">2024 Conf</a>
<Button class="header-button" variant="accent">Register</Button>
<a {...hrefProps("/")}>Home</a>
<a {...hrefProps("https://2024.squiggleconf.com")}>2024 Conf</a>
<Button
as="a"
class="header-button"
href={links.tickets}
target="_blank"
variant="accent">Register</Button
>
</div>
</details>
</ContentArea>

<ContentArea class="header-content-area-wide" width="wide">
<a class="logo" href="/"><Logo /></a>
<div class="header-links">
<a href="/">Home</a>
<a class="header-link-inactive" href="https://2024.squiggleconf.com"
>2024 Conf</a
<a {...hrefProps("/")}>Home</a>
<a {...hrefProps("https://2024.squiggleconf.com")}>2024 Conf</a>
<Button
as="a"
class="header-button"
href={links.tickets}
target="_blank"
variant="accent">Register</Button
>
<Button class="header-button" variant="accent">Register</Button>
</div>
</ContentArea>
</header>
Expand Down Expand Up @@ -59,10 +77,6 @@ import Logo from "./Logo.astro";
align-items: center;
}

a {
text-decoration: none;
}

details {
position: absolute;
top: 0;
Expand Down
3 changes: 3 additions & 0 deletions src/data/links.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const links = {
tickets: "https://buytickets.at/squiggleconf/1488622",
};
16 changes: 16 additions & 0 deletions src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
import "@fontsource-variable/josefin-sans";
import "@fontsource-variable/urbanist";
import Head, { Props as HeadProps } from "~/components/Head.astro";
import "./base.css";
import "./normalize.css";
type Props = HeadProps;
---

<html lang="en">
<Head {...Astro.props} />
<slot />
</html>
14 changes: 4 additions & 10 deletions src/layouts/PageLayout.astro
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
---
import "@fontsource-variable/josefin-sans";
import "@fontsource-variable/urbanist";
import Head, { Props as HeadProps } from "~/components/Head.astro";
import { Props as HeadProps } from "~/components/Head.astro";
import Header from "~/components/Header.astro";
import BodyArea from "~/components/BodyArea.astro";
import Footer from "~/components/Footer.astro";
import "./base.css";
import "./normalize.css";
import BaseLayout from "./BaseLayout.astro";
type Props = HeadProps;
---

<html lang="en">
<Head {...Astro.props} />
<BaseLayout {...Astro.props}>
<Header />
<BodyArea>
<slot />
</BodyArea>
<Footer />
</html>
</BaseLayout>
32 changes: 32 additions & 0 deletions src/pages/ad.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
import InlineBlock from "~/components/InlineBlock.astro";
import Logo from "~/components/Logo.astro";
import BaseLayout from "~/layouts/BaseLayout.astro";
---

<BaseLayout
description="A Boston conference for excellent web dev tooling."
title="Ad"
>
<div class="ad">
<Logo />
<div>
<InlineBlock>September 18-19, 2025 · </InlineBlock>
<InlineBlock>Boston New England Aquarium</InlineBlock>
</div>
</div>
</BaseLayout>

<style>
.ad {
align-items: center;
color: var(--colorAccentLight);
display: flex;
flex-direction: column;
font-size: 0.5rem;
gap: 1rem;
height: 100vh;
justify-content: center;
width: 100%;
}
</style>
2 changes: 1 addition & 1 deletion src/pages/code-of-conduct.astro
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ import PageLayout from "~/layouts/PageLayout.astro";
This Code of Conduct adapted from
<a
href="https://plone.org/foundation/materials/foundation-resolutions/code-of-conduct"
target="_blank"
rel="noreferrer"
target="_blank"
>
plone.org/foundation/materials/foundation-resolutions/code-of-conduct</a
>.
Expand Down

0 comments on commit 3c0efdc

Please sign in to comment.