Skip to content

Commit c2d1155

Browse files
committed
feat: NuxtImageモジュールの導入-1
1 parent 5bf1530 commit c2d1155

File tree

9 files changed

+59
-25
lines changed

9 files changed

+59
-25
lines changed

apps/web/app/components/event/EventAsset.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,26 @@
22
import type { Event } from '@vuejs-jp/model'
33
44
interface EventAssetProps {
5-
title: Extract<Event, 'creative-wall' | 'free-drinks-and-snacks' | 'tattoo-space' | 'cocktail-bash'>
5+
title: Extract<
6+
Event,
7+
'creative-wall' | 'free-drinks-and-snacks' | 'tattoo-space' | 'cocktail-bash'
8+
>
69
marginTop?: number
710
}
811
912
const props = defineProps<EventAssetProps>()
1013
</script>
1114

1215
<template>
13-
<img
16+
<NuxtImg
1417
:src="`/event/${title}.png`"
1518
alt=""
1619
class="eventcard-image"
1720
:style="{ marginTop: `${marginTop}px` }"
21+
width="920"
22+
height="444"
23+
fit="cover"
24+
preload
1825
loading="lazy"
1926
/>
2027
</template>

apps/web/app/components/event/EventMultipleAssets.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@ const props = defineProps<EventMultipleAssetsProps>()
1616
'--head-img-height': `${imgHeight}px`,
1717
}"
1818
>
19-
<img
19+
<NuxtImg
2020
v-for="(title, key) in titleList"
2121
:key
2222
:src="`/event/${title}-${key + 1}.png`"
2323
alt=""
24+
width="792"
25+
height="512"
26+
fit="cover"
27+
preload
2428
loading="lazy"
29+
class="image"
2530
/>
2631
</div>
2732
</template>
@@ -45,4 +50,9 @@ const props = defineProps<EventMultipleAssetsProps>()
4550
margin: 0 auto;
4651
height: var(--head-img-height);
4752
}
53+
54+
.image {
55+
width: auto;
56+
height: 100%;
57+
}
4858
</style>

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ const { locale: currentLocale } = useLocaleCurrent()
2424
</div>
2525

2626
<div class="content-wrapper">
27-
<img :src="'/namecard/namecard-samples.png'" alt="test" loading="lazy" />
27+
<NuxtImg
28+
:src="'/namecard/namecard-samples.png'"
29+
alt="test"
30+
placeholder
31+
preload
32+
loading="lazy"
33+
/>
2834
<div class="buttons-wrapper">
2935
<VFLinkButton
3036
class="action-button"

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import { ticketUrl } from '~/utils/constants'
1414
:key="i"
1515
:title="$t(`personal_sponsor.merit${i}.title`)"
1616
:detail="$t(`personal_sponsor.merit${i}.detail`)"
17-
:caution="(i === 2 || i === 4) ? $t(`personal_sponsor.merit${i}.caution`) : ''"
17+
:caution="i === 2 || i === 4 ? $t(`personal_sponsor.merit${i}.caution`) : ''"
1818
>
19-
<img alt="" :src="`/sponsor/merit-${i}.jpg`" loading="lazy" />
19+
<NuxtImg alt="" :src="`/sponsor/merit-${i}.jpg`" preload loading="lazy" />
2020
</VFMeritCard>
2121
</div>
2222
<div class="personal-sponsor-text">
@@ -109,7 +109,8 @@ import { ticketUrl } from '~/utils/constants'
109109
110110
@media (--tablet) {
111111
.personal-sponsor-body {
112-
--personal-sponsor-body-padding: calc(var(--unit) * 4) calc(var(--unit) * 2) calc(var(--unit) * 4);
112+
--personal-sponsor-body-padding: calc(var(--unit) * 4) calc(var(--unit) * 2)
113+
calc(var(--unit) * 4);
113114
}
114115
115116
.personal-sponsor-body h3 {

apps/web/nuxt.config.ts

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,23 @@ export default defineNuxtConfig({
2727
},
2828
},
2929
},
30-
modules: [
31-
'@vuejs-jp/vuefes-ui',
32-
[
33-
'@nuxtjs/device',
34-
{
35-
device: {
36-
refreshOnResize: true,
37-
},
30+
modules: ['@vuejs-jp/vuefes-ui', [
31+
'@nuxtjs/device',
32+
{
33+
device: {
34+
refreshOnResize: true,
3835
},
39-
],
40-
'@nuxtjs/i18n',
41-
'@nuxtjs/supabase',
42-
'@nuxt/content',
43-
'@pinia/nuxt',
44-
'nuxt-gtag',
45-
],
36+
},
37+
], '@nuxtjs/i18n', '@nuxtjs/supabase', '@nuxt/content', '@pinia/nuxt', 'nuxt-gtag', '@nuxt/image'],
4638
// .env の NUXT_PUBLIC_SITE_URL を設定したので、一旦コメントアウトする
4739
// site: {
4840
// url: 'https://vuefes.jp/2024/',
4941
// },
42+
image: {
43+
// provider: 'netlify',
44+
quality: 80,
45+
format: ['avif', 'webp']
46+
},
5047
i18n: {
5148
legacy: false,
5249
strategy: 'prefix_except_default',

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"@nuxt/content": "2.12.1",
2828
"@nuxt/types": "^2.17.3",
2929
"@nuxtjs/device": "3.1.1",
30+
"@nuxt/image": "1.8.0",
3031
"@nuxtjs/i18n": "8.2.0",
3132
"@nuxtjs/supabase": "1.2.0",
3233
"@pinia/nuxt": "0.5.3",

bun.lockb

22 KB
Binary file not shown.

packages/ui/components/speaker/Avatar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ withDefaults(defineProps<AvatarProps>(), {
1010
</script>
1111
1212
<template>
13-
<img :src="src" :alt="alt" :loading="loading" />
13+
<NuxtImg :src="src" :alt="alt" :loading="loading" placeholder preload />
1414
</template>
1515
1616
<style scoped>

packages/ui/components/ticket/TicketCard.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,22 @@ const props = withDefaults(defineProps<TicketCardProps>(), {
1212

1313
<template>
1414
<div class="ticket-card">
15-
<img class="ticket-img" :src="props.imgSrc" :alt="props.imgAlt" loading="lazy" />
15+
<NuxtImg
16+
class="ticket-img"
17+
:src="props.imgSrc"
18+
:alt="props.imgAlt"
19+
width="928"
20+
height="520"
21+
fit="cover"
22+
placeholder
23+
preload
24+
loading="lazy"
25+
/>
1626
<div class="ticket-title">
1727
<template v-if="!isClose">{{ props.title }}</template>
18-
<template v-else><s>{{ props.title }}</s></template>
28+
<template v-else
29+
><s>{{ props.title }}</s></template
30+
>
1931
</div>
2032
<div class="ticket-content">
2133
<slot />

0 commit comments

Comments
 (0)