Skip to content

Commit

Permalink
⚡ Optimize images and icons
Browse files Browse the repository at this point in the history
  • Loading branch information
66022523 committed Feb 20, 2024
1 parent 9f235e8 commit f29281f
Show file tree
Hide file tree
Showing 65 changed files with 46 additions and 65 deletions.
44 changes: 22 additions & 22 deletions assets/json/data.json

Large diffs are not rendered by default.

21 changes: 9 additions & 12 deletions components/AuthDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,41 +145,38 @@ defineProps({
href="https://accounts.google.com/"
target="_blank"
>
<NuxtImg
<img
class="rounded-full"
src="/assets/icons/google.png"
src="/assets/icons/google.webp"
alt="เข้าสู่ระบบด้วย Google"
width="40px"
format="svg"
preload
height="40px"
/>
</NuxtLink>
<NuxtLink
class="btn btn-circle btn-link"
href="https://www.facebook.com/login.php/"
target="_blank"
>
<NuxtImg
<img
class="rounded-full"
src="/assets/icons/facebook.png"
src="/assets/icons/facebook.webp"
alt="เข้าสู่ระบบด้วย Facebook"
width="40px"
format="svg"
preload
height="40px"
/>
</NuxtLink>
<NuxtLink
class="btn btn-circle btn-link"
href="https://access.line.me/oauth2/v2.1/login?returnUri=%2Foauth2%2Fv2.1%2Fauthorize%2Fconsent& loginChannelId=1521958360&loginState=CLn4LYQoulJIgLFHIw15nw#/"
target="_blank"
>
<NuxtImg
<img
class="rounded-full"
src="/assets/icons/line.png"
src="/assets/icons/line.webp"
alt="เข้าสู่ระบบด้วย Line"
width="40px"
format="svg"
preload
height="40px"
/>
</NuxtLink>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/Card/Result.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ defineProps({

<template>
<div
class="card mb-8 overflow-hidden rounded-badge bg-blackcurrant shadow-xl before:absolute before:left-0 before:top-0 before:block before:size-full before:bg-[url('/favicon.svg')] before:bg-[length:100px_100px] before:bg-[50px_50px] before:bg-repeat before:opacity-5 before:content-['']"
class="card mb-8 overflow-hidden rounded-badge bg-blackcurrant shadow-xl before:absolute before:left-0 before:top-0 before:block before:size-full before:bg-[url('/favicon.ico')] before:bg-[length:100px_100px] before:bg-[50px_50px] before:bg-repeat before:opacity-5 before:content-['']"
>
<div class="card-body relative">
<CardTarot
Expand Down
12 changes: 3 additions & 9 deletions components/Card/Tarot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defineProps({
},
icon: {
type: String,
default: "/favicon.svg",
default: "/favicon.ico",
},
alt: {
type: String,
Expand Down Expand Up @@ -45,8 +45,6 @@ defineProps({
default: null,
},
});
const img = useImage();
</script>

<template>
Expand All @@ -63,9 +61,7 @@ const img = useImage();
: null
"
:style="
flip && image
? 'background-image: url(\'' + img(image, { format: 'webp' }) + '\');'
: null
flip && image ? 'background-image: url(\'' + image + '\');' : null
"
>
<div
Expand All @@ -78,15 +74,13 @@ const img = useImage();
v-if="!flip"
class="m-auto flex items-center justify-center rounded-full border-8 border-blue-chalk bg-blue-chalk"
>
<NuxtImg
<img
v-if="!iAssets"
:class="assetsClass"
:src="icon"
:alt="alt"
:width="width"
:height="height"
:placeholder="[width, height]"
format="webp"
/>
<i v-else :class="[assetsClass, icon]"></i>
</div>
Expand Down
7 changes: 3 additions & 4 deletions components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ const goBack = (params) => {
<i class="fi fi-sr-angle-small-left text-2xl leading-[0]"></i>
</button>
<NuxtLink v-else class="btn btn-circle btn-ghost" to="/">
<NuxtImg
src="/favicon.svg"
<img
src="/favicon.ico"
alt="Hamtarot Favicon"
width="100px"
format="webp"
preload
height="100px"
/>
</NuxtLink>
</div>
Expand Down
7 changes: 3 additions & 4 deletions components/RatingDialog.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<template>
<dialog id="ratingModal" class="modal">
<div class="modal-box space-y-4 text-center">
<NuxtImg
<img
class="mx-auto"
src="/assets/icons/rating.png"
src="/assets/icons/rating.webp"
alt="Star Icon"
width="100px"
format="svg"
placeholder
height="100px"
/>
<h1 class="text-lg">
<b>คุณพึงพอใจกับเว็บไซต์เรามากแค่ไหน?</b>
Expand Down
8 changes: 1 addition & 7 deletions pages/account/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@
<div class="flex-none">
<div class="avatar">
<div class="w-24 rounded-full bg-blue-chalk p-2">
<NuxtImg
src="/assets/icons/person.png"
alt=""
format="webp"
loading="lazy"
placeholder
/>
<img src="/assets/icons/person.webp" alt="" loading="lazy" />
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion pages/dashboard/notification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const sendNotification = (event) => {
<InputText
v-model="filename"
class="w-full"
placeholder="https://hamtarot.com/favicon.svg"
placeholder="https://hamtarot.com/favicon.ico"
hint-top-left="ลิงค์รูปภาพ (ไม่จำเป็น)"
>
<i class="fi fi-rr-add-image leading-[0]"></i>
Expand Down
4 changes: 1 addition & 3 deletions pages/dashboard/users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,10 @@ const users = [
<div class="flex items-center gap-3">
<div class="avatar">
<div class="mask mask-squircle h-12 w-12">
<NuxtImg
<img
:src="user.image"
:alt="user.username"
format="webp"
loading="lazy"
placeholder
/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion pages/predict/[category]/[id]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const saveAsImage = async (extensions = "png", quality = 1, share = false) => {
parseInt($route.params.id) > 0 &&
parseInt($route.params.id) <= Object.keys(data.tarot).length
"
class="container mx-auto px-4"
class="container mx-auto p-4"
>
<RatingDialog />
<div class="mb-8 text-center">
Expand Down
2 changes: 1 addition & 1 deletion pages/predict/[category]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if (
ทำนาย
</NuxtLink>
</section>
<section v-else class="container mx-auto px-4 text-center">
<section v-else class="container mx-auto p-4 text-center">
<i class="fi fi-rr-loading text-6xl text-portica"></i>
<h2 class="text-portica">ไม่พบหมวดหมู่ '{{ $route.params.category }}'</h2>
<p class="mb-8">ดูเหมือนว่าคุณจะดวงไม่ดีมาเจอหน้าว่างเปล่านี้นะ</p>
Expand Down
Binary file removed public/assets/icons/facebook.png
Binary file not shown.
Binary file added public/assets/icons/facebook.webp
Binary file not shown.
Binary file removed public/assets/icons/google.png
Binary file not shown.
Binary file added public/assets/icons/google.webp
Binary file not shown.
Binary file removed public/assets/icons/line.png
Binary file not shown.
Binary file added public/assets/icons/line.webp
Binary file not shown.
Binary file removed public/assets/icons/person.png
Binary file not shown.
Binary file added public/assets/icons/person.webp
Binary file not shown.
Binary file removed public/assets/icons/rating.png
Binary file not shown.
Binary file added public/assets/icons/rating.webp
Binary file not shown.
Binary file removed public/assets/images/cards/death.jpg
Binary file not shown.
Binary file added public/assets/images/cards/death.webp
Binary file not shown.
Binary file removed public/assets/images/cards/judgement.jpg
Binary file not shown.
Binary file added public/assets/images/cards/judgement.webp
Binary file not shown.
Binary file removed public/assets/images/cards/justice.png
Binary file not shown.
Binary file added public/assets/images/cards/justice.webp
Binary file not shown.
Binary file removed public/assets/images/cards/temperance.jpg
Binary file not shown.
Binary file added public/assets/images/cards/temperance.webp
Binary file not shown.
Binary file removed public/assets/images/cards/the-chariot.jpg
Binary file not shown.
Binary file added public/assets/images/cards/the-chariot.webp
Binary file not shown.
Binary file removed public/assets/images/cards/the-devil.jpg
Binary file not shown.
Binary file added public/assets/images/cards/the-devil.webp
Binary file not shown.
Binary file removed public/assets/images/cards/the-emperror.jpg
Binary file not shown.
Binary file added public/assets/images/cards/the-emperror.webp
Binary file not shown.
Binary file removed public/assets/images/cards/the-empress.jpg
Binary file not shown.
Binary file added public/assets/images/cards/the-empress.webp
Binary file not shown.
Binary file removed public/assets/images/cards/the-fool.jpg
Binary file not shown.
Binary file added public/assets/images/cards/the-fool.webp
Binary file not shown.
Binary file removed public/assets/images/cards/the-hanged-man.jpg
Binary file not shown.
Binary file added public/assets/images/cards/the-hanged-man.webp
Binary file not shown.
Binary file removed public/assets/images/cards/the-hermit.jpg
Binary file not shown.
Binary file added public/assets/images/cards/the-hermit.webp
Binary file not shown.
Binary file removed public/assets/images/cards/the-hierophant.jpg
Binary file not shown.
Binary file added public/assets/images/cards/the-hierophant.webp
Binary file not shown.
Binary file removed public/assets/images/cards/the-high-priestess.png
Binary file not shown.
Binary file not shown.
Binary file removed public/assets/images/cards/the-lovers.jpg
Binary file not shown.
Binary file added public/assets/images/cards/the-lovers.webp
Binary file not shown.
Binary file removed public/assets/images/cards/the-magician.png
Binary file not shown.
Binary file added public/assets/images/cards/the-magician.webp
Binary file not shown.
Binary file removed public/assets/images/cards/the-moon.jpg
Binary file not shown.
Binary file added public/assets/images/cards/the-moon.webp
Binary file not shown.
Binary file removed public/assets/images/cards/the-star.jpg
Binary file not shown.
Binary file added public/assets/images/cards/the-star.webp
Binary file not shown.
Binary file removed public/assets/images/cards/the-strength.jpg
Binary file not shown.
Binary file added public/assets/images/cards/the-strength.webp
Binary file not shown.
Binary file removed public/assets/images/cards/the-sun.png
Binary file not shown.
Binary file added public/assets/images/cards/the-sun.webp
Binary file not shown.
Binary file removed public/assets/images/cards/the-tower.jpg
Binary file not shown.
Binary file added public/assets/images/cards/the-tower.webp
Binary file not shown.
Binary file removed public/assets/images/cards/the-world.png
Diff not rendered.
Binary file added public/assets/images/cards/the-world.webp
Binary file not shown.
Binary file removed public/assets/images/cards/wheel-of-fortune.jpg
Diff not rendered.
Binary file added public/assets/images/cards/wheel-of-fortune.webp
Binary file not shown.

0 comments on commit f29281f

Please sign in to comment.