Skip to content

Commit

Permalink
Merge pull request #357 from vuejs-jp/fix/resize-images
Browse files Browse the repository at this point in the history
fix: 画像サイズを修正
  • Loading branch information
jiyuujin authored Oct 3, 2024
2 parents 4b5881b + b2fda42 commit ea27cdd
Show file tree
Hide file tree
Showing 24 changed files with 152 additions and 74 deletions.
4 changes: 2 additions & 2 deletions apps/web/app/components/AccessPageSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ const { color } = useColor()
</div>

<figure class="place_image">
<img src="/access/fig_access01.jpg" alt="" />
<img src="/access/fig_access02.jpg" alt="" />
<img src="/access/fig_access01.jpg" alt="" loading="lazy" />
<img src="/access/fig_access02.jpg" alt="" loading="lazy" />
</figure>

</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/components/CooperationPartnerSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<source srcset="/logo/logo_vueconf-de.png" media="(min-width: 768px)" />
<img
src="/logo/logo_vueconf-de_sp.png"
loading="lazy"
alt="vuejs.de"
class="partner-image"
loading="lazy"
/>
</picture>
</NuxtLink>
Expand Down
25 changes: 18 additions & 7 deletions apps/web/app/components/TeamPageSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ const props = defineProps<{
const config = useRuntimeConfig()
const coreTeam = config.public.staffDatasource === 'supabase' ? props.data.coreStaffs.list : teamData
const volunteerTeam = config.public.staffDatasource === 'supabase'
? props.data.volunteerStaffs.list.map((staff) => staff.name)
: volunteers
const coreTeam =
config.public.staffDatasource === 'supabase' ? props.data.coreStaffs.list : teamData
const volunteerTeam =
config.public.staffDatasource === 'supabase'
? props.data.volunteerStaffs.list.map((staff) => staff.name)
: volunteers
// const team = teamData
</script>

Expand All @@ -32,8 +34,13 @@ const volunteerTeam = config.public.staffDatasource === 'supabase'
<div class="team-members-container">
<div v-for="member in coreTeam" :key="member.name" class="team-member-wrapper">
<template v-if="member.x_id !== ''">
<a :href="`https://x.com/${member.x_id}`" target="_blank" :aria-label="member.name">
<VFAvatar :src="member.image_url" :alt="member.name" />
<a
:href="`https://x.com/${member.x_id}`"
target="_blank"
:aria-label="member.name"
class="team-member-link"
>
<VFAvatar :src="member.image_url" :alt="member.name" size="medium" />
</a>
<div class="team-member-info">
<VFTextLink
Expand All @@ -47,7 +54,7 @@ const volunteerTeam = config.public.staffDatasource === 'supabase'
</div>
</template>
<template v-else>
<VFAvatar :src="member.image_url" :alt="member.name" />
<VFAvatar :src="member.image_url" :alt="member.name" size="medium" />
<div class="team-member-info">
<span class="team-member-name">{{ member.name }} </span>
</div>
Expand Down Expand Up @@ -153,6 +160,10 @@ const volunteerTeam = config.public.staffDatasource === 'supabase'
gap: 8px;
}
.team-member-link {
width: 100%;
}
.team-member-name {
--team-member-name-font-size: 0.875rem;
Expand Down
8 changes: 5 additions & 3 deletions apps/web/app/components/TopPageSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const getAnchorPath = computed(
<p class="place">
Otemachi PLACE HALL &amp; CONFERENCE
<br /><time datetime="2024-10-19T00:00+09:00"
>{{ $t('top_page.date') }}<template v-if="locale === 'ja'"><span class="day-of-week">SAT</span></template></time
>{{ $t('top_page.date')
}}<template v-if="locale === 'ja'"><span class="day-of-week">SAT</span></template></time
>
</p>
</div>
Expand Down Expand Up @@ -80,11 +81,12 @@ const getAnchorPath = computed(
z-index: -1;
width: 100%;
}
.image-wrapper {
position: relative;
width: 100%;
height: var(--background-image-height);
background-image: url('/main-visual.png');
background-image: url('/main-visual.jpg');
background-size: cover;
background-repeat: no-repeat;
background-position: top;
Expand Down Expand Up @@ -149,8 +151,8 @@ const getAnchorPath = computed(
}
.image-wrapper {
background-size: auto 100%;
background-image: url('/main-visual-mobile.jpg');
}
.section-title {
font-size: var(--font-size-heading500);
font-weight: 700;
Expand Down
13 changes: 11 additions & 2 deletions apps/web/app/components/event/EventAsset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@
import type { Event } from '@vuejs-jp/model'
interface EventAssetProps {
title: Extract<Event, 'creative-wall' | 'free-drinks-and-snacks' | 'tattoo-space' | 'cocktail-bash'>
title: Extract<
Event,
'creative-wall' | 'free-drinks-and-snacks' | 'tattoo-space' | 'cocktail-bash'
>
marginTop?: number
}
const props = defineProps<EventAssetProps>()
</script>

<template>
<img :src="`/event/${title}.png`" alt="" class="eventcard-image" :style="{ marginTop: `${marginTop}px` }" />
<NuxtImg
:src="`/event/${title}.png`"
alt=""
class="eventcard-image"
:style="{ marginTop: `${marginTop}px` }"
loading="lazy"
/>
</template>

<style scoped>
Expand Down
8 changes: 8 additions & 0 deletions apps/web/app/components/event/EventCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const props = defineProps<EventCardProps>()
:title="$t(`event.${title.replaceAll('-', '_')}`)"
:font-class
:padding-class
class="frame"
>
<template #content>
<div class="eventcard-content">
Expand All @@ -34,6 +35,13 @@ const props = defineProps<EventCardProps>()
<style scoped>
@import url('~/assets/media.css');
.frame {
display: flex;
flex-direction: column;
align-items: space-between;
justify-content: space-between;
}
.eventcard-content {
font-size: 16px;
font-weight: 500;
Expand Down
17 changes: 14 additions & 3 deletions apps/web/app/components/event/EventMultipleAssets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ const props = defineProps<EventMultipleAssetsProps>()
'--head-img-height': `${imgHeight}px`,
}"
>
<img v-for="(title, key) in titleList" :key :src="`/event/${title}-${key + 1}.png`" alt="" />
<NuxtImg
v-for="(title, key) in titleList"
:key
:src="`/event/${title}-${key + 1}.png`"
alt=""
width="792"
height="512"
fit="cover"
loading="lazy"
class="image"
/>
</div>
</template>

Expand All @@ -34,9 +44,10 @@ const props = defineProps<EventMultipleAssetsProps>()
}
}
.eventcard-images ::v-deep(img) {
.image {
height: var(--head-img-height);
width: auto;
padding: 0;
margin: 0 auto;
height: var(--head-img-height);
}
</style>
7 changes: 6 additions & 1 deletion apps/web/app/components/sponsor/SponsorList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ const currentLocale = useLocaleCurrent().locale
class="sponsor-list-item-link"
:to="`${currentLocale === 'ja' ? '/' : `/${currentLocale}/`}sponsors/${item['detail_page_id']}`"
>
<img class="sponsor-list-item-image" :src="item['image_url']" :alt="item.name" />
<NuxtImg
class="sponsor-list-item-image"
:src="item['image_url']"
:alt="item.name"
loading="lazy"
/>
</NuxtLink>
</li>
</ul>
Expand Down
7 changes: 6 additions & 1 deletion apps/web/app/components/ticket/NamecardSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ const { locale: currentLocale } = useLocaleCurrent()
</div>

<div class="content-wrapper">
<img :src="'/namecard/namecard-samples.png'" alt="test" />
<NuxtImg
:src="'/namecard/namecard-samples.png'"
alt="test"
width="596"
loading="lazy"
/>
<div class="buttons-wrapper">
<VFLinkButton
class="action-button"
Expand Down
13 changes: 10 additions & 3 deletions apps/web/app/components/ticket/PersonalSponsorSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import { ticketUrl } from '~/utils/constants'
:key="i"
:title="$t(`personal_sponsor.merit${i}.title`)"
:detail="$t(`personal_sponsor.merit${i}.detail`)"
:caution="(i === 2 || i === 4) ? $t(`personal_sponsor.merit${i}.caution`) : ''"
:caution="i === 2 || i === 4 ? $t(`personal_sponsor.merit${i}.caution`) : ''"
>
<img alt="" :src="`/sponsor/merit-${i}.jpg`" />
<NuxtImg alt="" :src="`/sponsor/merit-${i}.jpg`" loading="lazy" class="image" />
</VFMeritCard>
</div>
<div class="personal-sponsor-text">
Expand Down Expand Up @@ -89,6 +89,12 @@ import { ticketUrl } from '~/utils/constants'
color: var(--color-white);
}
.image {
width: 100%;
height: 100%;
object-fit: cover;
}
.apply {
display: flex;
flex-direction: column;
Expand All @@ -109,7 +115,8 @@ import { ticketUrl } from '~/utils/constants'
@media (--tablet) {
.personal-sponsor-body {
--personal-sponsor-body-padding: calc(var(--unit) * 4) calc(var(--unit) * 2) calc(var(--unit) * 4);
--personal-sponsor-body-padding: calc(var(--unit) * 4) calc(var(--unit) * 2)
calc(var(--unit) * 4);
}
.personal-sponsor-body h3 {
Expand Down
1 change: 1 addition & 0 deletions apps/web/app/pages/sessions/[id]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ useHead({
:name="currentLocale === 'en' ? speakerData[0].name_en : speakerData[0].name_ja"
:github-id="speakerData[0].github_id"
:x-id="speakerData[0].x_id"
loading="eager"
/>
<div class="person-info">
{{ currentLocale === 'ja' ? speakerData[0].description_ja : speakerData[0].description_en }}
Expand Down
Binary file modified apps/web/app/public/event/creative-wall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/web/app/public/event/tattoo-space.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web/app/public/main-visual-mobile.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web/app/public/main-visual.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed apps/web/app/public/main-visual.png
Binary file not shown.
27 changes: 12 additions & 15 deletions apps/web/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,23 @@ export default defineNuxtConfig({
},
},
},
modules: [
'@vuejs-jp/vuefes-ui',
[
'@nuxtjs/device',
{
device: {
refreshOnResize: true,
},
modules: ['@vuejs-jp/vuefes-ui', [
'@nuxtjs/device',
{
device: {
refreshOnResize: true,
},
],
'@nuxtjs/i18n',
'@nuxtjs/supabase',
'@nuxt/content',
'@pinia/nuxt',
'nuxt-gtag',
],
},
], '@nuxtjs/i18n', '@nuxtjs/supabase', '@nuxt/content', '@pinia/nuxt', 'nuxt-gtag', '@nuxt/image'],
// .env の NUXT_PUBLIC_SITE_URL を設定したので、一旦コメントアウトする
// site: {
// url: 'https://vuefes.jp/2024/',
// },
image: {
domains: ['jjdlwtezpdclgxxagxpj.supabase.co'],
quality: 80,
format: ['avif', 'webp']
},
i18n: {
legacy: false,
strategy: 'prefix_except_default',
Expand Down
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@nuxt/content": "2.12.1",
"@nuxt/types": "^2.17.3",
"@nuxtjs/device": "3.1.1",
"@nuxt/image": "1.8.0",
"@nuxtjs/i18n": "8.2.0",
"@nuxtjs/supabase": "1.2.0",
"@pinia/nuxt": "0.5.3",
Expand Down
Binary file modified bun.lockb
Binary file not shown.
24 changes: 22 additions & 2 deletions packages/ui/components/speaker/Avatar.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,39 @@
<script setup lang="ts">
import { computed } from 'vue'
type AvatarProps = {
src: string
alt: string
loading?: 'lazy' | 'eager'
size?: 'large' | 'medium' | 'small'
}
const props = withDefaults(defineProps<AvatarProps>(), {
loading: 'lazy',
size: 'large',
})
defineProps<AvatarProps>()
const size = computed(() => {
const size = props.size || 'large'
return size === 'large' ? 600 : size === 'medium' ? 344 : 206
})
</script>

<template>
<img :src="src" :alt="alt" />
<NuxtImg
:src="src"
:alt="alt"
:loading="loading"
placeholder
:width="size"
:height="size"
fit="cover"
/>
</template>

<style scoped>
img {
width: 100%;
height: 100%;
aspect-ratio: 1 / 1;
object-fit: cover;
border-radius: 12px;
Expand Down
12 changes: 10 additions & 2 deletions packages/ui/components/speaker/Speaker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,24 @@ type SpeakerProps = {
githubId?: string
xId?: string
rowPosition?: boolean
loading?: 'lazy' | 'eager'
}
defineProps<SpeakerProps>()
withDefaults(defineProps<SpeakerProps>(), {
company: '',
division: '',
githubId: '',
xId: '',
rowPosition: false,
loading: 'lazy',
})
const { color } = useColor()
</script>

<template>
<div class="speaker-wrapper" :style="rowPosition ? '' : 'flex-direction: column;'">
<Avatar :src="image" :alt="name" />
<Avatar :src="image" :alt="name" :loading="loading" :size="rowPosition ? 'small' : 'large'" />
<div class="speaker-info">
<div class="speaker-affiliation">
<p
Expand Down
Loading

0 comments on commit ea27cdd

Please sign in to comment.