Skip to content

Commit 436c0d9

Browse files
committed
perf(experimental): use avif and reduce transition length
1 parent 0add17b commit 436c0d9

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/components/ArticleList.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const articlesWithExcerpts = await Promise.all(
7171
width={48 * 4 * 4}
7272
src={article.data.image}
7373
class:list={[
74-
"animate-move w-full rounded-xl object-center",
74+
"w-full rounded-xl object-center",
7575
additionalProps.imageClassName,
7676
]}
7777
/>

src/components/Header.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import { ClientRouter } from "astro:transitions";
2+
import { ClientRouter, fade } from "astro:transitions";
33
import { Icon } from "astro-icon/components";
44
55
import banner from "../content/banner.ts";
@@ -20,7 +20,7 @@ interface Props {
2020
const { focus } = Astro.props;
2121
---
2222

23-
<ClientRouter />
23+
<ClientRouter transition:animate={fade({ duration: 30 })} />
2424
<header class="fixed top-0 z-20 w-full bg-gray-50">
2525
{
2626
banner.shown && (

src/pages/members.astro

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import { Image } from "astro:assets";
2+
import { Picture } from "astro:assets";
33
import { getCollection } from "astro:content";
44
import JoinUsCTA from "../components/JoinUsCTA.astro";
55
import GlobalLayout from "../layouts/GlobalLayout.astro";
@@ -17,8 +17,9 @@ const members = (await getCollection("members")).sort(
1717
description="ut.code(); のメンバーの一覧"
1818
focus={Focus.members}
1919
>
20-
<Image
20+
<Picture
2121
loading="eager"
22+
formats={["avif", "webp"]}
2223
alt=""
2324
src={MembersHeader}
2425
width="1920"
@@ -43,8 +44,8 @@ const members = (await getCollection("members")).sort(
4344
href={`/members/${member.id}`}
4445
class="relative block drop-shadow-lg transition-colors duration-150 hover:brightness-110 active:top-0.5"
4546
>
46-
<Image
47-
transition:animate="fade"
47+
<Picture
48+
formats={["avif", "webp"]}
4849
transition:name={`member:image:${member.id}`}
4950
alt={`${member.data?.nameJa} の写真`}
5051
src={member.data.upperBodyImage}

0 commit comments

Comments
 (0)