|
| 1 | +<script setup lang="ts"> |
| 2 | +import { |
| 3 | + RELATED_EVENTS as enRelatedEvents, |
| 4 | +} from "../../../i18n/en/related-events"; |
| 5 | +
|
| 6 | +import { |
| 7 | + RELATED_EVENTS as jaRelatedEvents, |
| 8 | +} from "../../../i18n/ja/related-events"; |
| 9 | +
|
| 10 | +import { |
| 11 | + VFSection, |
| 12 | + VFButton, |
| 13 | +} from "#components"; |
| 14 | +
|
| 15 | +import { |
| 16 | + computed, |
| 17 | + defineOgImage, |
| 18 | + useI18n, |
| 19 | + useRuntimeConfig, |
| 20 | + // eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 21 | + useHead, |
| 22 | + useSeoMeta, |
| 23 | +} from "#imports"; |
| 24 | +
|
| 25 | +const runtimeConfig = useRuntimeConfig(); |
| 26 | +const { t, locale } = useI18n(); |
| 27 | +
|
| 28 | +const relatedEvents = computed(() => locale.value === "en" ? enRelatedEvents : jaRelatedEvents); |
| 29 | +
|
| 30 | +const dateOption = computed(() => locale.value === "en" |
| 31 | + ? { |
| 32 | + year: "numeric" as const, |
| 33 | + month: "long" as const, |
| 34 | + day: "numeric" as const, |
| 35 | + weekday: "short" as const, |
| 36 | + } |
| 37 | + : { |
| 38 | + year: "numeric" as const, |
| 39 | + month: "short" as const, |
| 40 | + day: "numeric" as const, |
| 41 | + weekday: "short" as const, |
| 42 | + }); |
| 43 | +
|
| 44 | +defineOgImage({ |
| 45 | + component: "root", |
| 46 | + url: `${runtimeConfig.public.siteUrl}images/og/related-events.png`, |
| 47 | +}); |
| 48 | +
|
| 49 | +useSeoMeta({ |
| 50 | + title: t("relatedEvents.sectionTitle"), |
| 51 | + ogTitle: t("relatedEvents.sectionTitle"), |
| 52 | +}); |
| 53 | +</script> |
| 54 | + |
| 55 | +<template> |
| 56 | + <div id="pages-related-events"> |
| 57 | + <h1>{{ $t('relatedEvents.title') }}</h1> |
| 58 | + </div> |
| 59 | + |
| 60 | + <VFSection :title="t('relatedEvents.sectionTitle')" class="vf-section discussion-event"> |
| 61 | + <ul class="event-card"> |
| 62 | + <li v-for="event in relatedEvents" :key="event.id" class="event-card-item"> |
| 63 | + <img :src="event.coverUrl" :alt="event.coverAlt" width="400" height="164" class="event-card-image"> |
| 64 | + <div class="event-card-content"> |
| 65 | + <div> |
| 66 | + <h2 class="event-card-title"> |
| 67 | + {{ event.title }} |
| 68 | + </h2> |
| 69 | + <time :datetime="event.date" class="event-card-date"> |
| 70 | + {{ new Date(event.date).toLocaleDateString(locale, dateOption) }} |
| 71 | + </time> |
| 72 | + <template v-for="(paragraph, index) in event.description?.split('\n')" :key="index"> |
| 73 | + <p> |
| 74 | + {{ paragraph }} |
| 75 | + </p> |
| 76 | + </template> |
| 77 | + </div> |
| 78 | + <VFButton :link="event.linkUrl" external outlined> |
| 79 | + {{ t("relatedEvents.linkText") }} |
| 80 | + </VFButton> |
| 81 | + </div> |
| 82 | + </li> |
| 83 | + </ul> |
| 84 | + </VFSection> |
| 85 | +</template> |
| 86 | + |
| 87 | +<style scoped> |
| 88 | +@import "~/assets/styles/custom-media-query.css"; |
| 89 | +
|
| 90 | +#pages-related-events { |
| 91 | + display: grid; |
| 92 | + row-gap: 1.5rem; |
| 93 | +
|
| 94 | + @media (--mobile) { |
| 95 | + row-gap: 1rem; |
| 96 | + } |
| 97 | +
|
| 98 | + h1 { |
| 99 | + font-family: "ClashDisplay-Semibold"; |
| 100 | + font-size: 3rem; |
| 101 | + padding: 7rem 0 8rem; |
| 102 | + margin: 0; |
| 103 | + line-height: 1; |
| 104 | +
|
| 105 | + @media (--mobile) { |
| 106 | + padding: 2rem 0.75rem 3rem; |
| 107 | + } |
| 108 | + } |
| 109 | +} |
| 110 | +
|
| 111 | +.event-card { |
| 112 | + display: grid; |
| 113 | + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); |
| 114 | + gap: 32px; |
| 115 | +} |
| 116 | +
|
| 117 | +.event-card-image { |
| 118 | + width: 100%; |
| 119 | + height: auto; |
| 120 | +} |
| 121 | +
|
| 122 | +.event-card-item { |
| 123 | + display: flex; |
| 124 | + flex-direction: column; |
| 125 | + border: 1px solid var(--color-divider); |
| 126 | + border-radius: 10px; |
| 127 | + overflow: hidden; |
| 128 | + background: var(--color-white); |
| 129 | +} |
| 130 | +
|
| 131 | +.event-card-content { |
| 132 | + display: flex; |
| 133 | + flex-direction: column; |
| 134 | + align-items: center; |
| 135 | + justify-content: space-between; |
| 136 | + flex-grow: 1; |
| 137 | + gap: 32px; |
| 138 | + padding: 24px; |
| 139 | +
|
| 140 | + @media (--mobile) { |
| 141 | + gap: 24px; |
| 142 | + padding: 16px; |
| 143 | + } |
| 144 | +} |
| 145 | +
|
| 146 | +.event-card-title { |
| 147 | + margin: 0 0 8px; |
| 148 | +
|
| 149 | + @media (--mobile) { |
| 150 | + margin: 0 0 6px; |
| 151 | + } |
| 152 | +} |
| 153 | +
|
| 154 | +.event-card-date { |
| 155 | + display: block; |
| 156 | + margin-bottom: 24px; |
| 157 | + font-size: 0.8125rem; |
| 158 | + line-height: 1.5; |
| 159 | + text-align: end; |
| 160 | +
|
| 161 | + @media (--mobile) { |
| 162 | + margin-bottom: 16px; |
| 163 | + font-size: 0.75rem; |
| 164 | + } |
| 165 | +} |
| 166 | +</style> |
0 commit comments