Skip to content

Commit 2686c54

Browse files
committed
feat: NuxtImageモジュールの導入-1
1 parent a550f3f commit 2686c54

File tree

5 files changed

+51
-12
lines changed

5 files changed

+51
-12
lines changed

apps/web/app/components/TeamPageSection.vue

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ const props = defineProps<{
1111
1212
const config = useRuntimeConfig()
1313
14-
const coreTeam = config.public.staffDatasource === 'supabase' ? props.data.coreStaffs.list : teamData
15-
const volunteerTeam = config.public.staffDatasource === 'supabase'
16-
? props.data.volunteerStaffs.list.map((staff) => staff.name)
17-
: volunteers
14+
const coreTeam =
15+
config.public.staffDatasource === 'supabase' ? props.data.coreStaffs.list : teamData
16+
const volunteerTeam =
17+
config.public.staffDatasource === 'supabase'
18+
? props.data.volunteerStaffs.list.map((staff) => staff.name)
19+
: volunteers
1820
// const team = teamData
1921
</script>
2022

@@ -32,8 +34,13 @@ const volunteerTeam = config.public.staffDatasource === 'supabase'
3234
<div class="team-members-container">
3335
<div v-for="member in coreTeam" :key="member.name" class="team-member-wrapper">
3436
<template v-if="member.x_id !== ''">
35-
<a :href="`https://x.com/${member.x_id}`" target="_blank" :aria-label="member.name">
36-
<VFAvatar :src="member.image_url" :alt="member.name" />
37+
<a
38+
:href="`https://x.com/${member.x_id}`"
39+
target="_blank"
40+
:aria-label="member.name"
41+
class="team-member-link"
42+
>
43+
<VFAvatar :src="member.image_url" :alt="member.name" size="medium" />
3744
</a>
3845
<div class="team-member-info">
3946
<VFTextLink
@@ -153,6 +160,10 @@ const volunteerTeam = config.public.staffDatasource === 'supabase'
153160
gap: 8px;
154161
}
155162
163+
.team-member-link {
164+
width: 100%;
165+
}
166+
156167
.team-member-name {
157168
--team-member-name-font-size: 0.875rem;
158169

apps/web/app/components/sponsor/SponsorList.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,16 @@ const currentLocale = useLocaleCurrent().locale
2222
class="sponsor-list-item-link"
2323
:to="`${currentLocale === 'ja' ? '/' : `/${currentLocale}/`}sponsors/${item['detail_page_id']}`"
2424
>
25-
<img class="sponsor-list-item-image" :src="item['image_url']" :alt="item.name" loading="lazy" />
25+
<NuxtImg
26+
class="sponsor-list-item-image"
27+
:src="item['image_url']"
28+
:alt="item.name"
29+
width="500"
30+
height="300"
31+
placeholder
32+
preload
33+
loading="lazy"
34+
/>
2635
</NuxtLink>
2736
</li>
2837
</ul>

apps/web/app/components/ticket/NamecardSection.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ const { locale: currentLocale } = useLocaleCurrent()
2727
<NuxtImg
2828
:src="'/namecard/namecard-samples.png'"
2929
alt="test"
30-
placeholder
30+
width="auto"
31+
height="auto"
32+
fit="cover"
3133
preload
3234
loading="lazy"
3335
/>

packages/ui/components/speaker/Avatar.vue

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,40 @@
11
<script setup lang="ts">
2+
import { computed } from 'vue'
3+
24
type AvatarProps = {
35
src: string
46
alt: string
57
loading?: 'lazy' | 'eager'
8+
size?: 'large' | 'medium' | 'small'
69
}
7-
withDefaults(defineProps<AvatarProps>(), {
10+
const props = withDefaults(defineProps<AvatarProps>(), {
811
loading: 'lazy',
12+
size: 'large',
13+
})
14+
15+
const size = computed(() => {
16+
const size = props.size || 'large'
17+
return size === 'large' ? 600 : size === 'medium' ? 344 : 206
918
})
1019
</script>
1120

1221
<template>
13-
<NuxtImg :src="src" :alt="alt" :loading="loading" placeholder preload />
22+
<NuxtImg
23+
:src="src"
24+
:alt="alt"
25+
:loading="loading"
26+
placeholder
27+
preload
28+
:width="size"
29+
:height="size"
30+
fit="cover"
31+
/>
1432
</template>
1533

1634
<style scoped>
1735
img {
1836
width: 100%;
37+
height: 100%;
1938
aspect-ratio: 1 / 1;
2039
object-fit: cover;
2140
border-radius: 12px;

packages/ui/components/ticket/TicketCard.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ const props = withDefaults(defineProps<TicketCardProps>(), {
1919
width="928"
2020
height="520"
2121
fit="cover"
22-
placeholder
2322
preload
24-
loading="lazy"
2523
/>
2624
<div class="ticket-title">
2725
<template v-if="!isClose">{{ props.title }}</template>

0 commit comments

Comments
 (0)