perf: Reduce image load size by adjusting resolution (#1183)

* perf: Reduce image load size by adjusting resolution

* add missing
This commit is contained in:
pa
2025-03-13 05:14:05 +09:00
committed by GitHub
parent ef066bbe0e
commit f3c469e122
10 changed files with 75 additions and 34 deletions

View File

@@ -164,7 +164,7 @@
);
},
isNextDayBtnDisabled() {
return dayjs(this.selectedDate).isSame(this.allDateOfActivityArray[0], 'day');
return dayjs(this.selectedDate).isSameOrAfter(this.allDateOfActivityArray[0], 'day');
},
isPrevDayBtnDisabled() {
return dayjs(this.selectedDate).isSame(

View File

@@ -3,7 +3,7 @@
<div class="x-friend-item">
<template v-if="isLocalFavorite ? favorite.name : favorite.ref">
<div class="avatar">
<img v-lazy="localFavFakeRef.thumbnailImageUrl" />
<img v-lazy="smallThumbnail" />
</div>
<div class="detail">
<span class="name" v-text="localFavFakeRef.name"></span>
@@ -158,9 +158,14 @@
// local favorite no "ref" property
return this.isLocalFavorite ? this.favorite : this.favorite.ref;
},
tooltipContent() {
return $t(this.isLocalFavorite ? 'view.favorite.copy_tooltip' : 'view.favorite.move_tooltip');
},
smallThumbnail() {
return (
this.localFavFakeRef.thumbnailImageUrl.replace('256', '64') ||
this.localFavFakeRef.thumbnailImageUrl
);
}
},
methods: {

View File

@@ -2,7 +2,7 @@
<div @click="$emit('click')">
<div class="x-friend-item">
<div class="avatar">
<img v-lazy="favorite.thumbnailImageUrl" />
<img v-lazy="smallThumbnail" />
</div>
<div class="detail">
<span class="name" v-text="favorite.name"></span>
@@ -54,6 +54,11 @@
},
hideTooltips: Boolean
},
computed: {
smallThumbnail() {
return this.favorite.thumbnailImageUrl.replace('256', '64') || this.favorite.thumbnailImageUrl;
}
},
methods: {
selectAvatarWithConfirmation() {
this.$emit('select-avatar-with-confirmation', this.favorite.id);

View File

@@ -3,7 +3,7 @@
<div class="x-friend-item">
<template v-if="favorite.ref">
<div class="avatar" :class="userStatusClass(favorite.ref)">
<img v-lazy="userImage(favorite.ref)" />
<img v-lazy="userImage(favorite.ref, true)" />
</div>
<div class="detail">
<span

View File

@@ -3,7 +3,7 @@
<div class="x-friend-item">
<template v-if="isLocalFavorite ? favorite.name : favorite.ref">
<div class="avatar">
<img v-lazy="localFavFakeRef.thumbnailImageUrl" />
<img v-lazy="smallThumbnail" />
</div>
<div class="detail">
<span class="name">{{ localFavFakeRef.name }}</span>
@@ -154,6 +154,12 @@
localFavFakeRef() {
// local favorite no "ref" property
return this.isLocalFavorite ? this.favorite : this.favorite.ref;
},
smallThumbnail() {
return (
this.localFavFakeRef.thumbnailImageUrl.replace('256', '64') ||
this.localFavFakeRef.thumbnailImageUrl
);
}
},
methods: {