Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions astro/src/components/EscapeRoomPanels.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
import { getCollection } from "astro:content";
import { sortBy } from "lodash-es";
import RoomPanel from "@components/RoomPanel.astro";
import RoomPanelGrid from "@components/RoomPanelGrid.astro";

interface Props {
headingLevel?: "h1" | "h2";
}

const { headingLevel } = Astro.props;
const panelHeadingLevel = headingLevel === "h1" ? "h2" : "h3";
const rooms = sortBy(await getCollection("escapeRoomThemes"), (room) => room.data.title);
---

<RoomPanelGrid
id="our-rooms"
title="Our Rooms"
description="Two rooms you set up in your own space, and one your group plays together online."
{headingLevel}
>
{rooms.map(({ id, data }) => (
<RoomPanel
headingLevel={panelHeadingLevel}
title={data.title}
image={data.image}
alt={data.alt}
description={data.tagline}
details={data.panelDetails}
borderAfterDetails={data.format === "virtual"}
availability={data.availability}
theme={data.page.theme}
href={data.link ?? `/escape-room/themes/${id}/`}
linkText={data.buttonText}
linkLabel={data.buttonLabel}
/>
))}
</RoomPanelGrid>
4 changes: 2 additions & 2 deletions astro/src/components/HeaderER.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const { title, brandedTitle = false, crumbs = undefined, } = Astro.props;
const breadCrumbs: Breadcrumbs = crumbs ?? [{ name: "Home", href: "/escape-room/" }];

const navLinks = [{
name: "Build-Your-Own Rooms",
href: "/escape-room/themes",
name: "Escape Rooms",
href: "/rooms/",
}, {
name: "How it Works",
href: "/escape-room/how-it-works",
Expand Down
65 changes: 65 additions & 0 deletions astro/src/components/RoomPanel.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
import { Image } from "astro:assets";
import type { ImageMetadata } from "astro";

interface Props {
title: string;
image: ImageMetadata;
alt?: string;
description: string;
details?: string[];
borderAfterDetails?: boolean;
availability: string;
theme: string;
href: string;
linkText: string;
linkLabel: string;
headingLevel?: "h2" | "h3";
}

const {
title,
image,
alt = "",
description,
details = [],
borderAfterDetails = false,
availability,
theme,
href,
linkText,
linkLabel,
headingLevel: Heading = "h3",
} = Astro.props;
---

<div class="col">
<article class:list={["card h-100 overflow-hidden", `border-${theme}-subtle`]}>
<Image src={image} {alt} width={720} class="card-img-top" />
<div class="card-body d-flex flex-column align-items-start">
<Heading class:list={["card-title h5 fw-semibold", `text-${theme}-emphasis`]}>{title}</Heading>
<p class="card-text mb-3">{description}</p>
{details.length > 0 && (
<ul class="list-unstyled w-100 mb-4" role="list">
{details.map((detail, index) => (
<li class:list={["py-1", (borderAfterDetails || index < details.length - 1) && "border-bottom"]}>
{detail}
</li>
))}
</ul>
)}
<p class="card-text w-100 mt-auto pt-3 border-top">{availability}</p>
<a class={`btn btn-${theme}`} {href} aria-label={linkLabel}>
{linkText}
</a>
</div>
</article>
</div>

<style>
.card-img-top {
aspect-ratio: 2 / 1;
height: auto;
object-fit: cover;
}
</style>
28 changes: 28 additions & 0 deletions astro/src/components/RoomPanelGrid.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
import Row from "@components/Row.astro";

interface Props {
id: string;
title: string;
description?: string;
headingLevel?: "h1" | "h2";
}

const { id, title, description, headingLevel: Heading = "h2" } = Astro.props;
---

<section {id} aria-labelledby={`${id}-heading`}>
<div class="text-center mb-4">
<Heading id={`${id}-heading`} class="h2 text-primary-emphasis fw-semibold">{title}</Heading>
{description && <p class="mb-0">{description}</p>}
</div>
<Row baseRowCols="1" mdRowCols="2" lgRowCols="3" g="4">
<slot />
</Row>
</section>

<style>
section {
scroll-margin-top: 5rem;
}
</style>
7 changes: 6 additions & 1 deletion astro/src/content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,14 @@ const escapeRoomThemes = defineCollection({
z.object({
title: z.string(),
tagline: z.string(),
format: z.enum(["kit", "virtual"]).default("kit"),
panelDetails: z.array(z.string()),
availability: z.string(),
link: z.string().url().optional(),
image: image(),
alt: z.string().optional(),
buttonText: z.string().optional().default("Learn more"),
buttonText: z.string(),
buttonLabel: z.string(),
page: z.object({
image: image(),
theme: z.string().default("dark"),
Expand Down
7 changes: 7 additions & 0 deletions astro/src/content/escape-room/themes/corporate.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
---
title: A Corporate Conundrum
format: kit
tagline: A ground-breaking technology your company has developed is missing. You've received a tip on how to retrieve it.
image: /src/images/escape-room/aleksandar-andreev-k2gRTJM9BPw-unsplash.jpg
alt: A gentleman wearing dark clothes holding a briefcase
buttonText: Learn more
buttonLabel: Learn more about A Corporate Conundrum
panelDetails:
- 6-8 players
- 30 minutes play time
- Set up in your own space
availability: Available as a build-your-own kit or a ready-made kit.
page:
image: /src/images/escape-room/aleksandar-andreev-k2gRTJM9BPw-unsplash.jpg
theme: corporate
Expand Down
7 changes: 7 additions & 0 deletions astro/src/content/escape-room/themes/kitchen.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
---
title: A Baking Bonanza
format: kit
tagline: You are looking for classic recipes to submit to the local fair. Will you find them in time to win the blue ribbon?
image: /src/images/escape-room/priscilla-du-preez-SU5jSHu1pK8-unsplash.jpg
alt: A freshly baked pie, next to a jar of flour and a rolling pin
buttonText: Learn more
buttonLabel: Learn more about A Baking Bonanza
panelDetails:
- 4-6 players
- 20 minutes play time
- Set up in your own space
availability: Available as a build-your-own kit or a ready-made kit.
page:
image: /src/images/escape-room/priscilla-du-preez-SU5jSHu1pK8-unsplash.jpg
theme: kitchen
Expand Down
19 changes: 19 additions & 0 deletions astro/src/content/escape-room/themes/virtual.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Virtual Escape Room
format: virtual
tagline: A piece of ground-breaking technology your company has developed is missing. You've received a tip on how to retrieve it.
image: /src/images/escape-room/aleksandar-andreev-k2gRTJM9BPw-unsplash.jpg
buttonText: Learn more
buttonLabel: Learn more about Virtual Escape Room
panelDetails:
- 4-X players
- X minutes play time
availability: Access our virtual escape room from the ..........
link: mailto:escaperoom@accessiblecommunity.org?subject=Virtual%20Escape%20Room
page:
image: /src/images/escape-room/aleksandar-andreev-k2gRTJM9BPw-unsplash.jpg
theme: kitchen
about:
players: 4-X
length: X minutes
---
4 changes: 2 additions & 2 deletions astro/src/layouts/EscapeRoomLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import Row from "../components/Row.astro";

// Single these from the Header.
const navLinks = [{
name: "Build-Your-Own Rooms",
href: "/escape-room/themes",
name: "Escape Rooms",
href: "/rooms/",
}, {
name: "How it Works",
href: "/escape-room/how-it-works",
Expand Down
64 changes: 7 additions & 57 deletions astro/src/pages/escape-room/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import type { Breadcrumbs, PageMetadata } from "@lib/types";

import { getOpenGraphImageData } from "@lib/og-image";
import { getCollection, type CollectionEntry } from "astro:content";
import { sortBy } from "lodash-es";

const title = "Home";
const metadata: PageMetadata = {
Expand All @@ -12,12 +10,6 @@ const metadata: PageMetadata = {
image: getOpenGraphImageData(Astro.site, "pages", "escape-room"),
};
const crumbs: Breadcrumbs = [];
const rooms: Array<CollectionEntry<"escapeRoomThemes">> =
sortBy(
await getCollection("escapeRoomThemes"),
(room: CollectionEntry<"escapeRoomThemes">) => room.data.title
);


import Branding from "@components/Branding.astro";
import Column from "@components/Column.astro";
Expand All @@ -27,7 +19,7 @@ import EscapeRoomLayout from "src/layouts/EscapeRoomLayout.astro";
import FlexColumn from "@components/FlexColumn.astro";
import Row from "@components/Row.astro";
import ThemedSection from "@components/ThemedSection.astro";
import ImageCard from "@components/ImageCard.astro";
import EscapeRoomPanels from "@components/EscapeRoomPanels.astro";
// TODO: Once the `peerDependencies are update, use the plugin.
// import { YouTube } from 'astro-lazy-youtube-embed'
import YouTube from "@components/YouTube.astro";
Expand All @@ -52,7 +44,7 @@ import woodenPuzzles from "src/images/escape-room/wooden-puzzles.png";
<Column>
<a
class="link-light link-offset-1 icon-link"
href="/escape-room/themes"
href="/rooms/"
>
<Icon name="bi:puzzle-fill" class="bi"></Icon>
Explore our rooms
Expand Down Expand Up @@ -91,6 +83,10 @@ import woodenPuzzles from "src/images/escape-room/wooden-puzzles.png";
</ThemedSection>

<ThemedSection>
<EscapeRoomPanels />
</ThemedSection>

<ThemedSection styling="tertiary">
<FlexColumn xlReverse gap="5" class="justify-content-xl-between align-items-xl-center">
<Column>
<h2 class="">I like puzzles. I would like to play.</h2>
Expand Down Expand Up @@ -118,45 +114,6 @@ import woodenPuzzles from "src/images/escape-room/wooden-puzzles.png";
</FlexColumn>
</ThemedSection>

<ThemedSection styling="subtle" theme="secondary">
<h2 class="text-center">Our build-your-own rooms.</h2>
<p class="lead">
Requests for the <Branding>Accessible Escape Room</Branding> have gone beyond
our ability to run them. Instead, we are providing kits to build and run your
own accessible escape room! Each kit includes information on what to purchase,
how to build and run the escape room, and access to all the electronic files
for the escape room you select.
</p>
<p class="lead">
If you would like to bring one of our accessible escape rooms to your business
or venue, we now offer the <a href="/escape-room/themes" class="link-info">following themes</a>:</p
>

<Row baseRowCols="2" g="3" class="align-items-stretch">
{
rooms.map(room => (
<ImageCard
image={room.data.image}
alt={room.data.alt || null}
title={room.data.title}
theme={room.data.page.theme}
href={`/escape-room/themes/${room.id}`}
buttonText={room.data.buttonText || "Learn more"}
titleClass={`text-truncate text-${room.data.page.theme}`}
>
<p class="card-text" set:text={room.data.tagline} />
</ImageCard>
))
}
</Row>
<p class="lead pt-4">
If you are interested in purchasing, please email us at <a
class="link-info link-truncate"
href="mailto:escaperoom@accessiblecommunity.org"
>escaperoom@accessiblecommunity.org</a
>.
</p>
</ThemedSection>
</EscapeRoomLayout>

<style>
Expand All @@ -168,18 +125,11 @@ import woodenPuzzles from "src/images/escape-room/wooden-puzzles.png";
width: 70%;
height: auto;
}
.card-img-top {
height: auto;
}
.card-title {
font-weight: 500;
font-size: 1.3rem;
}
.escape-img-column {
height: 325px;
}
h2, h3, h4 {
color: var(--bs-info);
color: var(--bs-info-text-emphasis);
font-weight: 600;
margin-bottom: 0.5em;
}
Expand Down
2 changes: 1 addition & 1 deletion astro/src/pages/escape-room/themes/[id].astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function getStaticPaths() {
];

const rooms: Array<CollectionEntry<"escapeRoomThemes">> =
await getCollection("escapeRoomThemes");
await getCollection("escapeRoomThemes", ({ data }) => data.format !== "virtual");

return rooms.map((room) => {
const metadata: PageMetadata = {
Expand Down
2 changes: 1 addition & 1 deletion astro/src/pages/escape-room/themes/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import ImageCard from "@components/ImageCard.astro";
import heroBg from "src/images/escape-room/jonathan-kemper-9tamF4J0vLk-unsplash.jpg";

const rooms = sortBy(
await getCollection("escapeRoomThemes"),
await getCollection("escapeRoomThemes", ({ data }) => data.format !== "virtual"),
(room: CollectionEntry<"escapeRoomThemes">) => room.data.title
);

Expand Down
Loading
Loading