Skip to content

Commit c8ef4c1

Browse files
authored
fix(landing): show footer painting previews while loading (#7628)
* fix(landing): show footer painting previews while loading * fix(landing): include static image types in clean checkouts
1 parent 676f719 commit c8ef4c1

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

apps/sim/app/(landing)/components/cta/cta.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ import {
77
LANDING_CONTENT_WIDTH,
88
LANDING_GUTTER,
99
} from '@/app/(landing)/components/landing-layout'
10+
import ctaDark from '@/public/landing/cta-san-francisco-painted-dark.webp'
11+
import ctaLight from '@/public/landing/cta-san-francisco-painted-light.webp'
1012

1113
/** One shared closing statement, with a deliberate line break between sentences. */
1214
const CTA_HEADLINE = ['Every agent your company runs.', 'All in one place.'] as const
1315

1416
/**
1517
* Painted pre-footer CTA for every marketing page, mounted once by LandingShell.
1618
* Theme classes select the matching lazy-loaded painting without client state.
19+
* An embedded preview fills the scene while the full-resolution image loads.
1720
* The sky mask keeps the copy clear and the lower edge fades into the footer.
1821
*/
1922
export function Cta() {
@@ -50,17 +53,21 @@ export function Cta() {
5053
className='-mt-[clamp(96px,12.5vw,240px)] max-sm:-mt-6 pointer-events-none relative aspect-video w-full max-sm:aspect-[16/10]'
5154
>
5255
<Image
53-
src='/landing/cta-san-francisco-painted-light.webp'
56+
src={ctaLight}
5457
alt=''
5558
fill
59+
placeholder='blur'
60+
fetchPriority='high'
5661
quality={90}
5762
sizes='(max-width: 639px) 112vw, 100vw'
5863
className={cn('object-cover object-center dark:hidden', styles.plate)}
5964
/>
6065
<Image
61-
src='/landing/cta-san-francisco-painted-dark.webp'
66+
src={ctaDark}
6267
alt=''
6368
fill
69+
placeholder='blur'
70+
fetchPriority='high'
6471
quality={90}
6572
sizes='(max-width: 639px) 112vw, 100vw'
6673
className={cn('hidden object-cover object-center dark:block', styles.plate)}

apps/sim/app/(landing)/components/landing-shell/landing-shell.test.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import { createRoot, type Root } from 'react-dom/client'
1010
import { renderToStaticMarkup } from 'react-dom/server'
1111
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
1212
import { LandingShell } from '@/app/(landing)/components/landing-shell/landing-shell'
13+
import ctaDark from '@/public/landing/cta-san-francisco-painted-dark.webp'
14+
import ctaLight from '@/public/landing/cta-san-francisco-painted-light.webp'
1315

1416
interface TestLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
1517
href: string
@@ -111,8 +113,8 @@ describe('LandingShell shared closing section', () => {
111113
'Every agent your company runs. All in one place. '
112114
)
113115
expect(Array.from(cta.querySelectorAll('img'), (image) => image.getAttribute('src'))).toEqual([
114-
'/landing/cta-san-francisco-painted-light.webp',
115-
'/landing/cta-san-francisco-painted-dark.webp',
116+
ctaLight,
117+
ctaDark,
116118
])
117119
expect(Array.from(cta.querySelectorAll('img'), (image) => image.alt)).toEqual(['', ''])
118120
expect(

apps/sim/types/images.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/** Keep static image imports typed before Next.js generates next-env.d.ts. */
2+
import 'next/image-types/global'

0 commit comments

Comments
 (0)