Skip to content

Commit 680be02

Browse files
committed
chore: hero and home optimization
1 parent 0a1adc4 commit 680be02

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

src/components/Hero.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const {
2828
class="hero--main-content fade-in--small"
2929
data-reveal="fade-in--small--visible"
3030
data-reveal-immediate="true"
31-
data-reveal-delay="100"
3231
>
3332
{/* Hero Main Content */}
3433
{(title || description) && (

src/components/Nav.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ const {
2323
<nav
2424
class="nav--main fade-in--pure"
2525
data-reveal="fade-in--pure--visible"
26-
data-reveal-delay="100"
2726
data-reveal-immediate="true"
2827
>
2928
{/* Logo */}

src/components/home/FirstSection.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ if (content.data.images) {
3434
<Image
3535
src={sceneTree}
3636
layout="constrained"
37+
loading="lazy"
3738
alt="Scene tree illustration"
3839
class="ml-10 size-auto w-full max-w-3xl -scale-x-100 self-end"
3940
/>
@@ -43,7 +44,7 @@ if (content.data.images) {
4344
<Image
4445
src={asideNote}
4546
layout="constrained"
46-
alt="Scene tree illustration"
47+
alt="Aside note illustration"
4748
class="absolute -bottom-17 left-5 z-15 size-auto w-full max-w-67.25 md:-bottom-12 md:left-5 lg:-bottom-18 lg:-left-5 xl:-bottom-16 xl:-left-10"
4849
/>
4950
<!-- Scene Tree Image -->
@@ -60,7 +61,7 @@ if (content.data.images) {
6061
<h2 class="datum-text-8xl">{content.data.title}</h2>
6162
</div>
6263
<!-- Right: Body Text -->
63-
<div class="max-w-115 flex-grow self-center">
64+
<div class="max-w-115 grow self-center">
6465
<span class="datum-text-lg">
6566
<p>{content.body}</p>
6667
</span>
@@ -92,6 +93,7 @@ if (content.data.images) {
9293
<Image
9394
src={logo.src}
9495
alt={logo.alt}
96+
loading="lazy"
9597
class={`logo-cycle absolute mx-10 max-h-15 max-w-18 object-contain md:max-w-25 lg:max-w-30 ${logoIndex === 0 ? 'opacity-100' : 'opacity-0'}`}
9698
data-logo-index={logo.index}
9799
data-column-logo-index={logoIndex}

src/components/home/Hero.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const { title = '', description = '', class: className } = Astro.props as HeroPr
1919
class="fade-in--small max-width relative z-40 flex flex-col items-center justify-center gap-7 pt-16 pb-29 text-center md:pt-16 md:pb-44 lg:pt-18 lg:pb-32 xl:gap-9 xl:pt-20 xl:pb-44"
2020
data-reveal="fade-in--small--visible"
2121
data-reveal-immediate="true"
22-
data-reveal-delay="200"
2322
>
2423
<h1
2524
class="datum-text-10xl m-auto max-w-140 text-white"

src/layouts/Layout.astro

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { formatISODate } from '@utils/dateUtils';
55
import type { LayoutProps } from '@/src/types/common';
66
import Favicons from '@components/Favicons.astro';
77
import defaultOgImage from '@content/images/og/default.png';
8+
import homeIllustration from '@v1/assets/images/home-illustration.webp';
89
910
const {
1011
title,
@@ -59,6 +60,19 @@ const twitterImage =
5960
crossorigin
6061
/>
6162

63+
{
64+
/* Preload LCP image for homepage - improves Largest Contentful Paint */
65+
Astro.url.pathname === '/' && (
66+
<link
67+
rel="preload"
68+
as="image"
69+
href={homeIllustration.src}
70+
type="image/webp"
71+
fetchpriority="high"
72+
/>
73+
)
74+
}
75+
6276
<meta property="og:logo" content={new URL('/images/logo-datum.png', Astro.site).href} />
6377
<SEO
6478
title={titleValue}

0 commit comments

Comments
 (0)