Skip to content

Commit 4c6f21d

Browse files
committed
ui: add loading placeholder for images
1 parent 96fa70e commit 4c6f21d

File tree

11 files changed

+12
-11
lines changed

11 files changed

+12
-11
lines changed

src/components/ArticleList.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const articlesWithExcerpts = await Promise.all(
6363
alt="カバー画像"
6464
src={article.data.image}
6565
class:list={[
66-
"min-h-0 w-full rounded-xl object-center",
66+
"skeleton min-h-0 w-full rounded-xl object-center",
6767
additionalProps.imageClassName,
6868
]}
6969
/>

src/components/ProjectList.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const { projects, variant = "full" } = props;
2828
loading={i < 6 && variant === "full" ? "eager" : "lazy"}
2929
alt="プロジェクトのイメージ画像"
3030
src={project.data.image}
31-
class="max-h-[24rem] w-full object-contain"
31+
class="skeleton max-h-[24rem] w-full object-contain"
3232
/>
3333
<div class="p-4">
3434
<h3 class="text-xl font-bold text-gray-800">

src/layouts/meta.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const url = Astro.url.href;
1111

1212
<meta charset="utf-8" />
1313
<title>{title ? title + " | ut.code();" : "ut.code();"}</title>
14-
<link rel="icon" href="/public/favicon-64x.png" />
14+
<link rel="icon" href="/favicon-64x.png" />
1515
<link rel="sitemap" href="/sitemap-index.xml" />
1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1717
<meta

src/pages/articles/[article].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if (article.data.author && !author)
3636
<Picture
3737
loading="eager"
3838
formats={["avif", "webp"]}
39-
class="mx-auto md:max-w-xl md:rounded-2xl"
39+
class="skeleton mx-auto md:max-w-xl md:rounded-2xl"
4040
alt="イメージ画像"
4141
src={article.data.image}
4242
/>

src/pages/contact.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { Focus } from "../schema";
2222
src={Header}
2323
width="1920"
2424
height="600"
25-
class="h-30 object-cover sm:h-50 md:h-100"
25+
class="h-30 bg-amber-200 object-cover sm:h-50 md:h-100"
2626
/>
2727
<main class="prose mx-auto max-w-none px-16 py-16 md:px-32">
2828
<h2>お問い合わせ</h2>

src/pages/donation.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { Focus } from "../schema";
2121
src={Header}
2222
width="1920"
2323
height="600"
24-
class="my-8 h-100 w-full object-cover md:h-150"
24+
class="my-8 h-100 w-full bg-stone-500 object-cover md:h-150"
2525
/>
2626
<article class="prose mx-5 mb-20 max-w-xl sm:mx-10 md:mx-auto">
2727
<p>ut.code(); は、学生の手で自主的に運営されている団体です。</p><p>

src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ articles.splice(3);
3636
formats={["avif", "webp"]}
3737
alt=""
3838
loading="lazy"
39-
class="fixed bottom-0 -z-10 h-full max-w-full object-cover object-center select-none"
39+
class="skeleton fixed bottom-0 -z-10 h-full max-w-full object-cover object-center select-none"
4040
src={Hero}
4141
/>
4242
<div class="absolute top-[40%] left-10 mr-10 max-w-lg bg-gray-50 p-8 pb-24">

src/pages/join.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { Focus } from "../schema";
2121
width="1920"
2222
height="600"
2323
quality="mid"
24-
class="top-0 w-full object-cover object-top"
24+
class="top-0 w-full bg-pink-100 object-cover object-top"
2525
/>
2626
<main class="px-16 py-16">
2727
<div class="prose max-w-none">

src/pages/members.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const members = (await getCollection("members")).sort(
2121
loading="eager"
2222
alt=""
2323
src={Header}
24-
class="fixed bottom-0 -z-100 h-[100vh] object-cover"
24+
class="fixed bottom-0 -z-100 h-[100vh] bg-neutral-400 object-cover"
2525
style="object-position: 75% 20%;"
2626
aria-hidden
2727
/>
@@ -47,6 +47,7 @@ const members = (await getCollection("members")).sort(
4747
src={member.data.upperBodyImage}
4848
width="400"
4949
height="400"
50+
class="skeleton"
5051
/>
5152
<div class="absolute bottom-0 w-full min-w-45 bg-gradient-to-b from-transparent to-black px-6 pt-12 pb-6 text-white">
5253
<h2 class="text-3xl">{member.data.nameJa}</h2>

src/pages/members/[member].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const { Content } = await render(member);
8888
<div class="flex-1">
8989
<Picture
9090
fit="cover"
91-
class="w-40 rounded-full sm:w-100 sm:rounded-none lg:w-150"
91+
class="skeleton w-40 rounded-full sm:w-100 sm:rounded-none lg:w-150"
9292
alt="メンバー写真"
9393
width="600"
9494
height="600"

0 commit comments

Comments
 (0)