Skip to content

Commit 200d2d0

Browse files
committed
cleanup(landing): enterprise redesign polish + asset compression
- Fix ChipLink chrome overrides in navbar/mobile-nav to use variant='border' - Dedup elapsed-time reveal effects in enterprise-home-stage into one hook - Remove unused FeatureGraphicNode component and barrel export - Convert enterprise-hero-background.png (8.9MB lossless) to WebP q90 (1.07MB, near-lossless) - Fix team-avatar-1/2/3.png mislabeling (actual JPEG bytes) to correct .jpg extension
1 parent 345c13f commit 200d2d0

16 files changed

Lines changed: 65 additions & 204 deletions

apps/sim/app/(landing)/components/navbar/components/mobile-nav/mobile-nav.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,12 @@ export function MobileNav({ stars }: MobileNavProps) {
154154

155155
<div className='mt-3 flex flex-col gap-2'>
156156
<ChipLink
157+
variant='border'
157158
href='/login'
158159
fullWidth
159160
flush
160161
prefetch={false}
161-
className='h-[40px] justify-center border border-[var(--border-1)] [&>span]:flex-none'
162+
className='h-[40px] justify-center [&>span]:flex-none'
162163
onClick={() => setOpen(false)}
163164
>
164165
Log in

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export function Navbar({ stars, logoOnly = false }: NavbarProps) {
8787
<ChipLink href='/login' prefetch={false}>
8888
Log in
8989
</ChipLink>
90-
<ChipLink href='/demo' className='border border-[var(--border-1)]'>
90+
<ChipLink variant='border' href='/demo'>
9191
Contact sales
9292
</ChipLink>
9393
<ChipLink variant='primary' href='/signup' prefetch={false}>

apps/sim/app/(landing)/enterprise/components/enterprise-platform-loop/enterprise-home-stage.tsx

Lines changed: 51 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,55 @@ import {
2929

3030
const REPLY_WORDS = ENTERPRISE_REPLY.split(' ')
3131

32+
/**
33+
* Reveals an incrementing count (typed chars, streamed words) at a fixed
34+
* step interval while `active`, deriving progress from ELAPSED time so a
35+
* throttled background tab catches up instead of stalling mid-reveal.
36+
* Resets to 0 when inactive; jumps straight to `total` under
37+
* `prefers-reduced-motion`.
38+
*/
39+
function useElapsedReveal(active: boolean, stepMs: number, total: number) {
40+
const [revealed, setRevealed] = useState(0)
41+
42+
useEffect(() => {
43+
if (!active) {
44+
setRevealed(0)
45+
return
46+
}
47+
48+
const media = window.matchMedia('(prefers-reduced-motion: reduce)')
49+
let interval: ReturnType<typeof setInterval> | null = null
50+
51+
const run = () => {
52+
const startedAt = performance.now()
53+
interval = setInterval(() => {
54+
const elapsed = performance.now() - startedAt
55+
const n = Math.min(Math.floor(elapsed / stepMs) + 1, total)
56+
setRevealed(n)
57+
if (n >= total && interval) clearInterval(interval)
58+
}, stepMs)
59+
}
60+
61+
const syncMotionPreference = () => {
62+
if (interval) clearInterval(interval)
63+
if (media.matches) {
64+
setRevealed(total)
65+
return
66+
}
67+
run()
68+
}
69+
70+
syncMotionPreference()
71+
media.addEventListener('change', syncMotionPreference)
72+
return () => {
73+
media.removeEventListener('change', syncMotionPreference)
74+
if (interval) clearInterval(interval)
75+
}
76+
}, [active, stepMs, total])
77+
78+
return revealed
79+
}
80+
3281
/** Greyscale leading icons for the suggested-action rows, in row order. */
3382
const ACTION_ICONS = [Table, ShieldCheck, ClipboardList, Files] as const
3483

@@ -112,82 +161,8 @@ export function EnterpriseHomeStage({ phase, fading }: EnterpriseHomeStageProps)
112161
const isReply = phase === 'reply'
113162
const inConversation = phase === 'dispatch' || isReply
114163
const promptDone = phase === 'typed' || inConversation
115-
const [typedChars, setTypedChars] = useState(0)
116-
const [revealedWords, setRevealedWords] = useState(0)
117-
118-
useEffect(() => {
119-
if (!isTyping) {
120-
setTypedChars(0)
121-
return
122-
}
123-
124-
const media = window.matchMedia('(prefers-reduced-motion: reduce)')
125-
let interval: ReturnType<typeof setInterval> | null = null
126-
127-
const type = () => {
128-
const startedAt = performance.now()
129-
interval = setInterval(() => {
130-
const elapsed = performance.now() - startedAt
131-
const n = Math.min(Math.floor(elapsed / PROMPT_CHAR_MS) + 1, ENTERPRISE_PROMPT.length)
132-
setTypedChars(n)
133-
if (n >= ENTERPRISE_PROMPT.length && interval) clearInterval(interval)
134-
}, PROMPT_CHAR_MS)
135-
}
136-
137-
const syncMotionPreference = () => {
138-
if (interval) clearInterval(interval)
139-
if (media.matches) {
140-
setTypedChars(ENTERPRISE_PROMPT.length)
141-
return
142-
}
143-
type()
144-
}
145-
146-
syncMotionPreference()
147-
media.addEventListener('change', syncMotionPreference)
148-
return () => {
149-
media.removeEventListener('change', syncMotionPreference)
150-
if (interval) clearInterval(interval)
151-
}
152-
}, [isTyping])
153-
154-
// Stream the reply word by word while the phase holds on 'reply'; any other
155-
// phase (the next cycle's reset) rewinds it for the following pass.
156-
useEffect(() => {
157-
if (!isReply) {
158-
setRevealedWords(0)
159-
return
160-
}
161-
162-
const media = window.matchMedia('(prefers-reduced-motion: reduce)')
163-
let interval: ReturnType<typeof setInterval> | null = null
164-
165-
const stream = () => {
166-
const startedAt = performance.now()
167-
interval = setInterval(() => {
168-
const elapsed = performance.now() - startedAt
169-
const n = Math.min(Math.floor(elapsed / REPLY_WORD_MS) + 1, REPLY_WORDS.length)
170-
setRevealedWords(n)
171-
if (n >= REPLY_WORDS.length && interval) clearInterval(interval)
172-
}, REPLY_WORD_MS)
173-
}
174-
175-
const syncMotionPreference = () => {
176-
if (interval) clearInterval(interval)
177-
if (media.matches) {
178-
setRevealedWords(REPLY_WORDS.length)
179-
return
180-
}
181-
stream()
182-
}
183-
184-
syncMotionPreference()
185-
media.addEventListener('change', syncMotionPreference)
186-
return () => {
187-
media.removeEventListener('change', syncMotionPreference)
188-
if (interval) clearInterval(interval)
189-
}
190-
}, [isReply])
164+
const typedChars = useElapsedReveal(isTyping, PROMPT_CHAR_MS, ENTERPRISE_PROMPT.length)
165+
const revealedWords = useElapsedReveal(isReply, REPLY_WORD_MS, REPLY_WORDS.length)
191166

192167
const visiblePrompt = promptDone ? ENTERPRISE_PROMPT : ENTERPRISE_PROMPT.slice(0, typedChars)
193168
const hasText = visiblePrompt.length > 0

apps/sim/app/(landing)/enterprise/components/feature-graphics/access-control-graphic.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ const CANVAS = { WIDTH: 320, HEIGHT: 250 } as const
1010
const PORT_Y = { TEAM: 72, CHIP: 208 } as const
1111

1212
const TEAMS = [
13-
{ avatar: '/landing/team-avatar-1.png', name: 'Engineering', x: 64, leftClass: 'left-[64px]' },
14-
{ avatar: '/landing/team-avatar-2.png', name: 'Support', x: 160, leftClass: 'left-[160px]' },
15-
{ avatar: '/landing/team-avatar-3.png', name: 'Ops', x: 256, leftClass: 'left-[256px]' },
13+
{ avatar: '/landing/team-avatar-1.jpg', name: 'Engineering', x: 64, leftClass: 'left-[64px]' },
14+
{ avatar: '/landing/team-avatar-2.jpg', name: 'Support', x: 160, leftClass: 'left-[160px]' },
15+
{ avatar: '/landing/team-avatar-3.jpg', name: 'Ops', x: 256, leftClass: 'left-[256px]' },
1616
] as const
1717

1818
const CHIPS = [

apps/sim/app/(landing)/enterprise/components/feature-graphics/audit-trail-graphic.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,28 @@ const ENTRIES: readonly AuditEntry[] = [
3131
actor: 'Maya Chen',
3232
resource: 'Support agent v3',
3333
time: 'Now',
34-
avatar: '/landing/team-avatar-1.png',
34+
avatar: '/landing/team-avatar-1.jpg',
3535
},
3636
{
3737
action: 'Permission group updated',
3838
actor: 'Jordan Lee',
3939
resource: 'Support team',
4040
time: '2 min ago',
41-
avatar: '/landing/team-avatar-2.png',
41+
avatar: '/landing/team-avatar-2.jpg',
4242
},
4343
{
4444
action: 'Credential accessed',
4545
actor: 'Sam Ortiz',
4646
resource: 'Zendesk OAuth',
4747
time: '26 min ago',
48-
avatar: '/landing/team-avatar-3.png',
48+
avatar: '/landing/team-avatar-3.jpg',
4949
},
5050
{
5151
action: 'Workflow created',
5252
actor: 'Maya Chen',
5353
resource: 'Support agent',
5454
time: 'Jun 14',
55-
avatar: '/landing/team-avatar-1.png',
55+
avatar: '/landing/team-avatar-1.jpg',
5656
},
5757
] as const
5858

apps/sim/app/(landing)/enterprise/components/feature-graphics/feature-graphic-node.tsx

Lines changed: 0 additions & 114 deletions
This file was deleted.

apps/sim/app/(landing)/enterprise/components/feature-graphics/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ export { AccessControlGraphic } from './access-control-graphic'
22
export { AuditTrailGraphic } from './audit-trail-graphic'
33
export { BuildMethodsGraphic } from './build-methods-graphic'
44
export { DeployGraphic } from './deploy-graphic'
5-
export { FeatureGraphicNode, type FeatureGraphicNodeRow } from './feature-graphic-node'
65
export { FeatureGraphicShell } from './feature-graphic-shell'
76
export { FeaturePlatformPanel } from './feature-platform-panel'
87
export { ItPlatformTeamsGraphic } from './it-platform-teams-graphic'

apps/sim/app/(landing)/enterprise/components/feature-graphics/it-platform-teams-graphic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function ItPlatformTeamsGraphic() {
6767
<span className='flex shrink-0 items-center gap-1.5'>
6868
<span className='relative size-4 overflow-hidden rounded-full shadow-sm'>
6969
<Image
70-
src='/landing/team-avatar-3.png'
70+
src='/landing/team-avatar-3.jpg'
7171
alt=''
7272
width={16}
7373
height={16}

apps/sim/app/(landing)/enterprise/components/feature-graphics/staging-graphic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export function StagingGraphic() {
7676
<span className='mt-1.5 flex items-center gap-1.5'>
7777
<span className='relative size-4 overflow-hidden rounded-full'>
7878
<Image
79-
src='/landing/team-avatar-1.png'
79+
src='/landing/team-avatar-1.jpg'
8080
alt=''
8181
width={16}
8282
height={16}

apps/sim/app/(landing)/enterprise/components/feature-graphics/technical-teams-graphic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export function TechnicalTeamsGraphic() {
8686
<div className='mt-3 flex items-center gap-3 rounded-xl border border-[var(--border-1)] bg-[var(--white)] px-3 py-2.5 shadow-sm'>
8787
<span className='relative size-7 shrink-0 overflow-hidden rounded-full shadow-sm'>
8888
<Image
89-
src='/landing/team-avatar-2.png'
89+
src='/landing/team-avatar-2.jpg'
9090
alt=''
9191
width={28}
9292
height={28}

0 commit comments

Comments
 (0)