diff --git a/src/components/top/Sponsors.astro b/src/components/top/Sponsors.astro new file mode 100644 index 0000000..b4f217c --- /dev/null +++ b/src/components/top/Sponsors.astro @@ -0,0 +1,96 @@ +--- +import SectionTitle from "../ui/SectionTitle.astro"; + +import Gold from "./sponsor/Gold.astro"; +import Silver from "./sponsor/Silver.astro"; +import Drink from "./sponsor/Drink.astro"; +import Lunch from "./sponsor/Lunch.astro"; +import Bronze from "./sponsor/Bronze.astro"; +import Gopher from "./sponsor/Gopher.astro"; +import Tool from "./sponsor/Tool.astro"; +import { + goldSponsors, + silverSponsors, + drinkSponsors, + lunchSponsors, + bronzeSponsors, + gopherSponsors, + toolSponsors, +} from "./sponsors"; + +const currentLocale = Astro.currentLocale || "ja"; + +if ( + goldSponsors.length === 0 && + silverSponsors.length === 0 && + drinkSponsors.length === 0 && + lunchSponsors.length === 0 && + bronzeSponsors.length === 0 && + gopherSponsors.length === 0 && + toolSponsors.length === 0 +) { + return null; +} +--- + +
+ + { + currentLocale === "en" ? ( + + Sponsors + + ) : ( + + ポンサー + + ) + } + +
+ + + + + + + +
+
+ + diff --git a/src/components/top/TopPage.astro b/src/components/top/TopPage.astro index 2d95dee..a199c0d 100644 --- a/src/components/top/TopPage.astro +++ b/src/components/top/TopPage.astro @@ -3,6 +3,7 @@ import About from "./About.astro"; import FAQ from "./FAQ.astro"; import MainVisual from "./MainVisual.astro"; import News from "./News.astro"; +import Sponsors from "./Sponsors.astro"; import Layout from "../../layouts/Layout.astro"; --- @@ -12,5 +13,6 @@ import Layout from "../../layouts/Layout.astro"; + diff --git a/src/components/top/sponsor/Bronze.astro b/src/components/top/sponsor/Bronze.astro new file mode 100644 index 0000000..19643e5 --- /dev/null +++ b/src/components/top/sponsor/Bronze.astro @@ -0,0 +1,90 @@ +--- +import { Image } from "astro:assets"; +import type { Sponsor } from "../sponsors"; + +interface Props { + sponsors: Sponsor[]; +} + +const { sponsors } = Astro.props; + +if (sponsors.length === 0) { + return null; +} + +const currentLocale = Astro.currentLocale || "ja"; +--- + + + + diff --git a/src/components/top/sponsor/Drink.astro b/src/components/top/sponsor/Drink.astro new file mode 100644 index 0000000..487ec5b --- /dev/null +++ b/src/components/top/sponsor/Drink.astro @@ -0,0 +1,94 @@ +--- +import { Image } from "astro:assets"; +import type { SponsorWithUrl } from "../sponsors"; + +interface Props { + sponsors: SponsorWithUrl[]; +} + +const { sponsors } = Astro.props; + +if (sponsors.length === 0) { + return null; +} + +const currentLocale = Astro.currentLocale || "ja"; +--- + + + + diff --git a/src/components/top/sponsor/Gold.astro b/src/components/top/sponsor/Gold.astro new file mode 100644 index 0000000..5b6bf2c --- /dev/null +++ b/src/components/top/sponsor/Gold.astro @@ -0,0 +1,105 @@ +--- +import { Image } from "astro:assets"; +import type { SponsorWithUrl } from "../sponsors"; + +interface Props { + sponsors: SponsorWithUrl[]; +} + +const { sponsors } = Astro.props; + +if (sponsors.length === 0) { + return null; +} + +const currentLocale = Astro.currentLocale || "ja"; +--- + + + + diff --git a/src/components/top/sponsor/Gopher.astro b/src/components/top/sponsor/Gopher.astro new file mode 100644 index 0000000..f3bb4d1 --- /dev/null +++ b/src/components/top/sponsor/Gopher.astro @@ -0,0 +1,92 @@ +--- +import { Image } from "astro:assets"; +import type { Sponsor } from "../sponsors"; + +interface Props { + sponsors: Sponsor[]; +} + +const { sponsors } = Astro.props; + +if (sponsors.length === 0) { + return null; +} +--- + + + + diff --git a/src/components/top/sponsor/Lunch.astro b/src/components/top/sponsor/Lunch.astro new file mode 100644 index 0000000..6d3340b --- /dev/null +++ b/src/components/top/sponsor/Lunch.astro @@ -0,0 +1,97 @@ +--- +import { Image } from "astro:assets"; +import type { SponsorWithUrl } from "../sponsors"; + +interface Props { + sponsors: SponsorWithUrl[]; +} + +const { sponsors } = Astro.props; + +if (sponsors.length === 0) { + return null; +} + +const currentLocale = Astro.currentLocale || "ja"; +--- + + + + diff --git a/src/components/top/sponsor/Silver.astro b/src/components/top/sponsor/Silver.astro new file mode 100644 index 0000000..baa1964 --- /dev/null +++ b/src/components/top/sponsor/Silver.astro @@ -0,0 +1,96 @@ +--- +import { Image } from "astro:assets"; +import type { SponsorWithUrl } from "../sponsors"; + +interface Props { + sponsors: SponsorWithUrl[]; +} + +const { sponsors } = Astro.props; + +if (sponsors.length === 0) { + return null; +} + +const currentLocale = Astro.currentLocale || "ja"; +--- + + + + diff --git a/src/components/top/sponsor/Tool.astro b/src/components/top/sponsor/Tool.astro new file mode 100644 index 0000000..dcc22ef --- /dev/null +++ b/src/components/top/sponsor/Tool.astro @@ -0,0 +1,86 @@ +--- +import { Image } from "astro:assets"; +import type { Sponsor } from "../sponsors"; + +interface Props { + sponsors: Sponsor[]; +} + +const { sponsors } = Astro.props; + +if (sponsors.length === 0) { + return null; +} + +const currentLocale = Astro.currentLocale || "ja"; +--- + + + + diff --git a/src/components/top/sponsors.ts b/src/components/top/sponsors.ts new file mode 100644 index 0000000..644a296 --- /dev/null +++ b/src/components/top/sponsors.ts @@ -0,0 +1,34 @@ +import type { ImageMetadata } from "astro"; + +export type SponsorWithUrl = { + name: string; + imageSrc: ImageMetadata; + link: string; +}; + +export type Sponsor = { + name: string; + imageSrc: ImageMetadata; +}; + + +export const goldSponsors: SponsorWithUrl[] = [ +]; + +export const silverSponsors: SponsorWithUrl[] = [ +]; + +export const drinkSponsors: SponsorWithUrl[] = [ +]; + +export const lunchSponsors: SponsorWithUrl[] = [ +]; + +export const bronzeSponsors: Sponsor[] = [ +]; + +export const gopherSponsors: Sponsor[] = [ +]; + +export const toolSponsors: Sponsor[] = [ +];