|
| 1 | +<script setup lang="ts"> |
| 2 | +import { useFetch, useHead } from '#imports' |
| 3 | +import type { SpeakerCategory, SpeakerInfo, SponsorCategory, SponsorInfo, StaffInfo } from '@vuejs-jp/model' |
| 4 | +import { useLocaleCurrent } from '~/composables/useLocaleCurrent' |
| 5 | +import { conferenceTitle, linkUrl, ogSharemapDescription } from '~/utils/constants' |
| 6 | +import { generalOg, twitterOg } from '~/utils/og.constants' |
| 7 | +
|
| 8 | +type _SpeakerCategory = Extract<SpeakerCategory, 'sessionSpeakers' | 'lightningTalkSpeakers' | 'sponsorSessionSpeakers'> |
| 9 | +type Speakers = Record<_SpeakerCategory, SpeakerInfo> |
| 10 | +
|
| 11 | +type Sponsors = Record<SponsorCategory, SponsorInfo> |
| 12 | +
|
| 13 | +type Staffs = Record<'allStaffs', StaffInfo> |
| 14 | +
|
| 15 | +const { data: speakers, error: error1 } = await useFetch('/api/speakers') |
| 16 | +const { sessionSpeakers, lightningTalkSpeakers, sponsorSessionSpeakers } = speakers.value as Speakers |
| 17 | +if (error1.value) { |
| 18 | + console.error(error1.value) |
| 19 | +} |
| 20 | +const { data: sponsors, error: error2 } = await useFetch('/api/sponsors') |
| 21 | +const { |
| 22 | + platinumSponsors, |
| 23 | + goldSponsors, |
| 24 | + silverSponsors, |
| 25 | + bronzeSponsors, |
| 26 | + specialNamingRightSponsors, |
| 27 | + namingRightSponsors, |
| 28 | + specialLunchSponsors, |
| 29 | + lunchSponsors, |
| 30 | + afterPartySponsors, |
| 31 | + nameCardSponsors, |
| 32 | + simultaneousInterpretationSponsors, |
| 33 | + childcareSponsors, |
| 34 | + handsonSponsors, |
| 35 | + mediaSponsors, |
| 36 | + toolSponsors, |
| 37 | +} = sponsors.value as Sponsors |
| 38 | +if (error2.value) { |
| 39 | + console.error(error2.value) |
| 40 | +} |
| 41 | +const { data: staffs, error: error3 } = await useFetch('/api/staffs') |
| 42 | +const { allStaffs } = staffs.value as Staffs |
| 43 | +if (error3.value) { |
| 44 | + console.error(error3.value) |
| 45 | +} |
| 46 | +
|
| 47 | +const { path: localePath } = useLocaleCurrent() |
| 48 | +
|
| 49 | +useHead({ |
| 50 | + // eslint-disable-next-line no-unused-vars |
| 51 | + titleTemplate: (titleChunk) => `シェアURL | ${conferenceTitle}`, |
| 52 | + meta: [ |
| 53 | + ...generalOg({ |
| 54 | + title: `シェアURL | ${conferenceTitle}`, |
| 55 | + description: ogSharemapDescription, |
| 56 | + url: `${linkUrl}sharemap`, |
| 57 | + }), |
| 58 | + ...twitterOg({ |
| 59 | + title: `シェアURL | ${conferenceTitle}`, |
| 60 | + description: ogSharemapDescription, |
| 61 | + url: `${linkUrl}sharemap`, |
| 62 | + }), |
| 63 | + ], |
| 64 | +}) |
| 65 | +</script> |
| 66 | + |
| 67 | +<template> |
| 68 | + <VFPageHeading>{{ $t('sharemap.title') }}</VFPageHeading> |
| 69 | + <div class="sharemap"> |
| 70 | + <div class="sharemap-body"> |
| 71 | + <div> |
| 72 | + <h2>{{ $t('speaker.title') }}</h2> |
| 73 | + <VFTextLink |
| 74 | + v-for="speaker in [...sessionSpeakers.list, ...lightningTalkSpeakers.list, ...sponsorSessionSpeakers.list]" |
| 75 | + :key="speaker.id" |
| 76 | + :href="`/sessions/${speaker.detail_page_id}/share`" |
| 77 | + color="vue-blue" |
| 78 | + target="_blank" |
| 79 | + > |
| 80 | + {{ speaker.name_ja }} |
| 81 | + </VFTextLink> |
| 82 | + </div> |
| 83 | + <div> |
| 84 | + <h2>{{ $t('sponsor.title') }}</h2> |
| 85 | + <VFTextLink |
| 86 | + v-for="sponsor in Array.from( |
| 87 | + new Map( |
| 88 | + [ |
| 89 | + ...platinumSponsors.list, |
| 90 | + ...goldSponsors.list, |
| 91 | + ...silverSponsors.list, |
| 92 | + ...bronzeSponsors.list, |
| 93 | + ...specialNamingRightSponsors.list, |
| 94 | + ...namingRightSponsors.list, |
| 95 | + ...specialLunchSponsors.list, |
| 96 | + ...lunchSponsors.list, |
| 97 | + ...afterPartySponsors.list, |
| 98 | + ...nameCardSponsors.list, |
| 99 | + ...simultaneousInterpretationSponsors.list, |
| 100 | + ...childcareSponsors.list, |
| 101 | + ...handsonSponsors.list, |
| 102 | + ...mediaSponsors.list, |
| 103 | + ...toolSponsors.list, |
| 104 | + ] |
| 105 | + .map((item) => [JSON.stringify(item), item]) |
| 106 | + ) |
| 107 | + .values() |
| 108 | + )" |
| 109 | + :key="sponsor.id" |
| 110 | + :href="`/sponsors/${sponsor.detail_page_id}/share`" |
| 111 | + color="vue-blue" |
| 112 | + target="_blank" |
| 113 | + > |
| 114 | + {{ sponsor.name }} |
| 115 | + </VFTextLink> |
| 116 | + </div> |
| 117 | + <div> |
| 118 | + <h2>{{ $t('staff.title') }}</h2> |
| 119 | + <VFTextLink |
| 120 | + v-for="staff in allStaffs.list" |
| 121 | + :key="staff.id" |
| 122 | + :href="`/staffs/${staff.detail_page_id}/share`" |
| 123 | + color="vue-blue" |
| 124 | + target="_blank" |
| 125 | + > |
| 126 | + {{ staff.name }} |
| 127 | + </VFTextLink> |
| 128 | + </div> |
| 129 | + </div> |
| 130 | + <div class="back"> |
| 131 | + <VFLinkButton |
| 132 | + class="back-action" |
| 133 | + background-color="white" |
| 134 | + color="vue-blue" |
| 135 | + target="" |
| 136 | + :href="`${localePath}/`" |
| 137 | + > |
| 138 | + {{ $t('back_to_top') }} |
| 139 | + </VFLinkButton> |
| 140 | + </div> |
| 141 | + </div> |
| 142 | +</template> |
| 143 | + |
| 144 | +<style scoped> |
| 145 | +@import url('../assets/base.css'); |
| 146 | +@import url('../assets/media.css'); |
| 147 | +
|
| 148 | +.sharemap { |
| 149 | + margin: 0; |
| 150 | + padding: 0 1.5%; |
| 151 | + background-image: linear-gradient(#fff, #ebf0f5); |
| 152 | + position: relative; |
| 153 | + z-index: 0; |
| 154 | + overflow: hidden; |
| 155 | +
|
| 156 | + @media (--tablet) { |
| 157 | + padding: 0 6%; |
| 158 | + } |
| 159 | +
|
| 160 | + &:before { |
| 161 | + content: ""; |
| 162 | + position: absolute; |
| 163 | + display: block; |
| 164 | + bottom: 0; |
| 165 | + left: 0; |
| 166 | + width: 100%; |
| 167 | + height: 100%; |
| 168 | + background-image: url('/form-bg.png'); |
| 169 | + background-size: auto; |
| 170 | + background-repeat: repeat; |
| 171 | + background-position: bottom left; |
| 172 | + opacity: 0.8; |
| 173 | + mix-blend-mode: overlay; |
| 174 | + z-index: -1; |
| 175 | + } |
| 176 | +} |
| 177 | +
|
| 178 | +.sharemap-body { |
| 179 | + margin: 0 auto; |
| 180 | + padding: 60px 0 120px; |
| 181 | + width: 100%; |
| 182 | + max-width: 960px; |
| 183 | + display: flex; |
| 184 | + flex-wrap: wrap; |
| 185 | + justify-content: center; |
| 186 | + gap: 40px; |
| 187 | +
|
| 188 | + > div { |
| 189 | + @media (--tablet) { |
| 190 | + width: 100%; |
| 191 | + } |
| 192 | + } |
| 193 | +
|
| 194 | + @media (--tablet) { |
| 195 | + padding: 20px 0 60px; |
| 196 | + max-width: 100%; |
| 197 | + } |
| 198 | +
|
| 199 | + a { |
| 200 | + border-radius: 12px; |
| 201 | + overflow: hidden; |
| 202 | + display: block; |
| 203 | + } |
| 204 | +} |
| 205 | +
|
| 206 | +.back { |
| 207 | + margin: 40px auto 120px; |
| 208 | + width: 100%; |
| 209 | + max-width: 260px; |
| 210 | +} |
| 211 | +.back-action { |
| 212 | + --height-button: 66px; |
| 213 | +
|
| 214 | + height: var(--height-button); |
| 215 | + border-radius: var(--height-button); |
| 216 | +} |
| 217 | +
|
| 218 | +@media (--tablet) { |
| 219 | + .back-action { |
| 220 | + --height-button: 58px; |
| 221 | + } |
| 222 | +} |
| 223 | +
|
| 224 | +@media (--mobile) { |
| 225 | + .back { |
| 226 | + width: 100%; |
| 227 | + padding: 0 23.5px; |
| 228 | + margin-top: 30px; |
| 229 | + margin-bottom: 60px; |
| 230 | + } |
| 231 | + .back-action { |
| 232 | + --height-button: 58px; |
| 233 | + } |
| 234 | +} |
| 235 | +</style> |
0 commit comments