Skip to content

Commit 2e8da20

Browse files
committed
Tweak code annotations
1 parent cccc780 commit 2e8da20

File tree

5 files changed

+140
-116
lines changed

5 files changed

+140
-116
lines changed

src/components/home/build-anything-section.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ import CategoryHeader from "./category-header";
2222
export default function BuildAnythingSection() {
2323
return (
2424
<div className="relative max-w-full">
25-
<div className="h-6 max-w-screen items-end px-2 font-mono text-xs/6 whitespace-pre text-black/10 max-sm:px-4 2xl:flex dark:text-white/15">
25+
<div
26+
aria-hidden="true"
27+
className="max-w-screen h-6 items-end whitespace-pre px-2 font-mono text-xs/6 text-black/20 max-sm:px-4 2xl:flex dark:text-white/25"
28+
>
2629
text-4xl <span className="inline dark:hidden">text-gray-950</span>
2730
<span className="hidden dark:inline">text-white</span> tracking-tighter
2831
</div>
@@ -32,12 +35,12 @@ export default function BuildAnythingSection() {
3235
</GridContainer>
3336

3437
<GridContainer>
35-
<h2 className="max-w-lg px-2 text-[2.5rem]/10 font-medium tracking-tighter text-balance max-sm:px-4">
38+
<h2 className="max-w-lg text-balance px-2 text-[2.5rem]/10 font-medium tracking-tighter max-sm:px-4">
3639
Build whatever you want, without touching your CSS file.
3740
</h2>
3841
</GridContainer>
3942

40-
<div className="flex h-6 items-end px-2 font-mono text-xs/6 whitespace-pre text-black/10 max-sm:px-4 sm:h-10 dark:text-white/15">
43+
<div className="flex h-6 items-end whitespace-pre px-2 font-mono text-xs/6 text-black/20 max-sm:px-4 sm:h-10 dark:text-white/25">
4144
text-base <span className="inline dark:hidden">text-gray-950</span>
4245
<span className="hidden dark:inline">text-white</span>
4346
</div>
@@ -51,7 +54,7 @@ export default function BuildAnythingSection() {
5154

5255
<GridContainer className="mt-18">
5356
<div className="h-auto bg-gray-950/5 p-2 dark:bg-white/10">
54-
<BentoItem className="flex h-full flex-row overflow-hidden p-0!">
57+
<BentoItem className="p-0! flex h-full flex-row overflow-hidden">
5558
<div className="hidden flex-col gap-2 lg:flex">
5659
<a
5760
href="https://openai.com/"
@@ -206,7 +209,7 @@ export default function BuildAnythingSection() {
206209

207210
function ExternalLinkLabel({ children }: { children: React.ReactNode }) {
208211
return (
209-
<div className="absolute top-1/2 left-1/2 z-10 hidden -translate-x-1/2 -translate-y-1/2 transform flex-row items-center gap-[calc(1rem/16*7)] rounded-full border border-gray-950 bg-gray-950/90 py-0.5 pr-2 pb-1 pl-3 text-center font-mono text-sm/6 font-medium text-white opacity-0 inset-ring inset-ring-white/10 transition-opacity group-hover:flex group-hover:opacity-100">
212+
<div className="inset-ring inset-ring-white/10 absolute left-1/2 top-1/2 z-10 hidden -translate-x-1/2 -translate-y-1/2 transform flex-row items-center gap-[calc(1rem/16*7)] rounded-full border border-gray-950 bg-gray-950/90 py-0.5 pb-1 pl-3 pr-2 text-center font-mono text-sm/6 font-medium text-white opacity-0 transition-opacity group-hover:flex group-hover:opacity-100">
210213
{children}
211214
<svg viewBox="0 0 16 16" fill="currentColor" className="size-4">
212215
<path

src/components/home/explainer-section.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ export default function ExplainerSection() {
102102

103103
return (
104104
<div className="relative max-w-full">
105-
<div className="hidden h-4 items-end px-2 font-mono text-xs/6 whitespace-pre text-black/10 max-sm:px-4 2xl:visible 2xl:flex dark:text-white/15">
105+
<div
106+
aria-hidden="true"
107+
className="hidden h-4 items-end whitespace-pre px-2 font-mono text-xs/6 text-black/20 max-sm:px-4 2xl:visible 2xl:flex dark:text-white/25"
108+
>
106109
text-4xl <span className="inline dark:hidden">text-gray-950</span>
107110
<span className="hidden dark:inline">text-white</span> tracking-tighter text-balance
108111
</div>
@@ -117,7 +120,7 @@ export default function ExplainerSection() {
117120
</h2>
118121
</GridContainer>
119122

120-
<div className="flex h-6 items-end px-2 font-mono text-xs/6 whitespace-pre text-black/10 max-sm:px-4 sm:h-10 dark:text-white/15">
123+
<div className="flex h-6 items-end whitespace-pre px-2 font-mono text-xs/6 text-black/20 max-sm:px-4 sm:h-10 dark:text-white/25">
121124
text-base <span className="inline dark:hidden">text-gray-950</span>
122125
<span className="hidden dark:inline">text-white</span>
123126
</div>
@@ -133,10 +136,10 @@ export default function ExplainerSection() {
133136
<GridContainer className="mt-16">
134137
<div className="w-full bg-gray-950/5 p-2 dark:bg-white/10">
135138
<div className="not-prose">
136-
<div className="@container rounded-xl bg-gray-950 in-[figure]:-mx-1 in-[figure]:-mb-1">
139+
<div className="@container in-[figure]:-mx-1 in-[figure]:-mb-1 rounded-xl bg-gray-950">
137140
<div
138141
className={clsx(
139-
"rounded-xl p-1 text-sm scheme-dark dark:bg-white/5 dark:inset-ring dark:inset-ring-white/10",
142+
"scheme-dark dark:inset-ring dark:inset-ring-white/10 rounded-xl p-1 text-sm dark:bg-white/5",
140143
)}
141144
>
142145
<EditorAnimation timeline={timeline}>
@@ -146,16 +149,16 @@ export default function ExplainerSection() {
146149
className={clsx(
147150
"inline-flex size-1.5 items-center justify-center rounded-full bg-white/20",
148151
"transition-opacity duration-300 ease-in",
149-
"opacity-0 group-data-modified:opacity-100 group-data-modified:duration-100 group-data-modified:ease-linear",
152+
"group-data-modified:opacity-100 group-data-modified:duration-100 group-data-modified:ease-linear opacity-0",
150153
)}
151154
></span>
152155
</span>
153156
<span className="size-3 rounded-full bg-white/20"></span>
154157
<span className="size-3 rounded-full bg-white/20"></span>
155158
</div>
156-
<div className="flex w-full flex-col gap-1 lg:h-132.5 lg:flex-row">
157-
<div className="flex flex-col gap-1 lg:w-1/2 xl:w-5/8">
158-
<Panel className="min-h-0 flex-1 max-lg:max-h-76" aria-label="panel, HTML editor, animated">
159+
<div className="lg:h-132.5 flex w-full flex-col gap-1 lg:flex-row">
160+
<div className="xl:w-5/8 flex flex-col gap-1 lg:w-1/2">
161+
<Panel className="max-lg:max-h-76 min-h-0 flex-1" aria-label="panel, HTML editor, animated">
159162
<Tabs>
160163
<Tab selected className="group-data-modified:italic">
161164
index.html
@@ -165,14 +168,14 @@ export default function ExplainerSection() {
165168
</Tabs>
166169
<HtmlFile className="with-line-numbers" />
167170
</Panel>
168-
<Panel className="h-32 shrink-0 lg:h-46" aria-label="panel, terminal, animated">
171+
<Panel className="lg:h-46 h-32 shrink-0" aria-label="panel, terminal, animated">
169172
<Tabs>
170173
<Tab selected>Terminal</Tab>
171174
</Tabs>
172175
<Terminal />
173176
</Panel>
174177
</div>
175-
<div className="flex h-66 flex-col gap-2.5 lg:h-auto lg:w-1/2 xl:w-3/8">
178+
<div className="h-66 xl:w-3/8 flex flex-col gap-2.5 lg:h-auto lg:w-1/2">
176179
<Panel className="h-full" aria-label="panel, built CSS, animated">
177180
<Tabs>
178181
<Tab selected>build.css</Tab>
@@ -224,7 +227,7 @@ function HtmlFile({ className }: { className?: string }) {
224227
<span {...props}>
225228
{'"'}
226229
<TypingAnimation />
227-
<span className="transition-opacity duration-300 group-data-finished:opacity-0 after:absolute after:mt-1.5 after:inline-block after:h-[1.2em] after:w-px after:border-r-2 after:border-sky-400 after:bg-transparent after:content-['']"></span>
230+
<span className="group-data-finished:opacity-0 transition-opacity duration-300 after:absolute after:mt-1.5 after:inline-block after:h-[1.2em] after:w-px after:border-r-2 after:border-sky-400 after:bg-transparent after:content-['']"></span>
228231
{'"'}
229232
</span>
230233
);
@@ -264,7 +267,7 @@ async function BuiltCss({ className, timeline }: { className?: string; timeline:
264267
<HighlightedCode
265268
aria-label="editor, readonly, built CSS"
266269
className={clsx(
267-
"opacity-0 group-data-finished:opacity-100 group-data-running:opacity-100",
270+
"group-data-finished:opacity-100 group-data-running:opacity-100 opacity-0",
268271
"*:flex *:*:max-w-none *:*:shrink-0 *:*:grow *:rounded-lg *:px-4 *:py-2",
269272
"**:[.line]:isolate **:[.line]:block **:[.line]:not-last:min-h-[1lh]",
270273
"**:[code]:pr-4",
@@ -422,7 +425,7 @@ function Panel({
422425
function Tabs({ children }: { children: React.ReactNode }) {
423426
return (
424427
<div
425-
className="sticky top-0 left-0 z-10 col-start-1 row-start-1 mb-px flex items-center gap-2 border-b border-b-white/5 bg-white/2.5 bg-clip-padding p-1 text-white backdrop-blur-lg"
428+
className="bg-white/2.5 sticky left-0 top-0 z-10 col-start-1 row-start-1 mb-px flex items-center gap-2 border-b border-b-white/5 bg-clip-padding p-1 text-white backdrop-blur-lg"
426429
role="presentation"
427430
aria-label="Tab Bar"
428431
>
@@ -435,7 +438,7 @@ function Tab({ className, selected, children }: { className?: string; selected?:
435438
return (
436439
<button
437440
className={clsx(
438-
"isolate rounded-sm px-2 py-1 text-xs/5 text-white inset-ring-white/5 hover:bg-white/10 aria-selected:bg-white/10 aria-selected:inset-ring",
441+
"inset-ring-white/5 aria-selected:inset-ring isolate rounded-sm px-2 py-1 text-xs/5 text-white hover:bg-white/10 aria-selected:bg-white/10",
439442
className,
440443
)}
441444
role="presentation"

src/components/home/hero.tsx

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ const Hero: React.FC = () => {
4949

5050
return (
5151
<div>
52-
<div className="flex h-16 items-end px-2 font-mono text-xs/6 whitespace-pre text-black/10 max-sm:px-4 sm:h-24 dark:text-white/15">
52+
<div
53+
aria-hidden="true"
54+
className="flex h-16 items-end whitespace-pre px-2 font-mono text-xs/6 text-black/20 max-sm:px-4 sm:h-24 dark:text-white/25"
55+
>
5356
<span className="hidden max-sm:inline">text-4xl </span>
5457
<span className="hidden sm:max-md:inline">text-5xl </span>
5558
<span className="hidden lg:max-xl:inline">text-6xl </span>
@@ -59,11 +62,14 @@ const Hero: React.FC = () => {
5962
<span className="max-sm:hidden">text-balance</span>
6063
</div>
6164
<GridContainer>
62-
<h1 className="px-2 text-4xl tracking-tighter text-balance max-lg:font-medium max-sm:px-4 sm:text-5xl lg:text-6xl xl:text-8xl">
65+
<h1 className="text-balance px-2 text-4xl tracking-tighter max-lg:font-medium max-sm:px-4 sm:text-5xl lg:text-6xl xl:text-8xl">
6366
Rapidly build modern websites without ever leaving your HTML.
6467
</h1>
6568
</GridContainer>
66-
<div className="flex h-6 items-end px-2 font-mono text-xs/6 whitespace-pre text-black/10 max-sm:px-4 sm:h-10 dark:text-white/15">
69+
<div
70+
aria-hidden="true"
71+
className="flex h-6 items-end whitespace-pre px-2 font-mono text-xs/6 text-black/20 max-sm:px-4 sm:h-10 dark:text-white/25"
72+
>
6773
text-lg <span className="inline dark:hidden">text-gray-950</span>
6874
<span className="hidden dark:inline">text-white</span> font-medium
6975
</div>
@@ -87,7 +93,7 @@ const Hero: React.FC = () => {
8793
<LinkButton href="docs/installation" className="z-1 max-sm:hidden">
8894
Get started
8995
</LinkButton>
90-
<SearchButton className="grid w-full grid-cols-[auto_1fr_auto] items-center gap-1 rounded-full px-4 py-2 text-left text-sm/6 text-gray-950/50 outline -outline-offset-1 outline-gray-950/8 sm:w-80 dark:bg-white/5 dark:text-white/50 dark:outline-white/15">
96+
<SearchButton className="outline-gray-950/8 grid w-full grid-cols-[auto_1fr_auto] items-center gap-1 rounded-full px-4 py-2 text-left text-sm/6 text-gray-950/50 outline -outline-offset-1 sm:w-80 dark:bg-white/5 dark:text-white/50 dark:outline-white/15">
9197
<svg
9298
xmlns="http://www.w3.org/2000/svg"
9399
viewBox="0 0 16 16"
@@ -103,7 +109,7 @@ const Hero: React.FC = () => {
103109
<kbd className="hidden font-sans text-xs/4 text-gray-500 dark:text-gray-400 [.os-macos_&]:block">
104110
<span className="opacity-60"></span>K
105111
</kbd>
106-
<kbd className="hidden font-sans text-xs/4 text-gray-500 not-[.os-macos_&]:block dark:text-gray-400">
112+
<kbd className="not-[.os-macos_&]:block hidden font-sans text-xs/4 text-gray-500 dark:text-gray-400">
107113
<span className="opacity-60">Ctrl</span>&nbsp;K
108114
</kbd>
109115
</SearchButton>
@@ -115,7 +121,7 @@ const Hero: React.FC = () => {
115121
<Editor>
116122
<div
117123
className={clsx(
118-
"*:flex *:*:max-w-none *:*:shrink-0 *:*:grow *:overflow-auto *:rounded-lg *:bg-white/10! *:p-5 dark:*:bg-white/5!",
124+
"*:bg-white/10! dark:*:bg-white/5! *:flex *:*:max-w-none *:*:shrink-0 *:*:grow *:overflow-auto *:rounded-lg *:p-5",
119125
"**:[.line]:isolate **:[.line]:block **:[.line]:not-last:min-h-[1lh]",
120126
"*:inset-ring *:inset-ring-white/10 dark:*:inset-ring-white/5",
121127
)}
@@ -347,7 +353,7 @@ const Hero: React.FC = () => {
347353
</div>
348354
</Editor>
349355
</div>
350-
<div className="relative border-(--pattern-fg) bg-[image:repeating-linear-gradient(315deg,_var(--pattern-fg)_0,_var(--pattern-fg)_1px,_transparent_0,_transparent_50%)] bg-[size:10px_10px] bg-fixed [--pattern-fg:var(--color-black)]/5 max-lg:h-66 max-lg:border-t lg:border-l dark:[--pattern-fg:var(--color-white)]/10">
356+
<div className="border-(--pattern-fg) [--pattern-fg:var(--color-black)]/5 max-lg:h-66 dark:[--pattern-fg:var(--color-white)]/10 relative bg-[image:repeating-linear-gradient(315deg,_var(--pattern-fg)_0,_var(--pattern-fg)_1px,_transparent_0,_transparent_50%)] bg-[size:10px_10px] bg-fixed max-lg:border-t lg:border-l">
351357
<div className="absolute right-1/2 max-lg:bottom-8 max-md:translate-x-1/2 md:right-16 lg:top-1/2 lg:-translate-y-1/2 2xl:right-1/2 2xl:translate-x-[calc(50%-3rem)]">
352358
<Example step={step} />
353359
</div>
@@ -389,7 +395,7 @@ function Example({ step }: { step: number }) {
389395
key={step}
390396
layout={true}
391397
className={clsx(
392-
"pointer-events-none absolute top-1/2 right-auto left-0 z-1 -mt-4 mr-0 -ml-4 rounded-full text-black",
398+
"z-1 pointer-events-none absolute left-0 right-auto top-1/2 -ml-4 -mt-4 mr-0 rounded-full text-black",
393399
)}
394400
initial={{ opacity: 0 }}
395401
animate={{ opacity: [0, 1, 0] }}
@@ -413,7 +419,7 @@ function Example({ step }: { step: number }) {
413419
layout="position"
414420
transition={TRANSITION}
415421
className={clsx(
416-
"size-48 shadow-xl transition-[border-radius] duration-350 dark:outline-1 dark:-outline-offset-1 dark:outline-white/10",
422+
"duration-350 size-48 shadow-xl transition-[border-radius] dark:outline-1 dark:-outline-offset-1 dark:outline-white/10",
417423
step > 1 ? "rounded-md" : null,
418424
)}
419425
src={cover.src}
@@ -429,7 +435,7 @@ function Example({ step }: { step: number }) {
429435
layout="position"
430436
transition={TRANSITION}
431437
className={clsx(
432-
"text-gray-950 transition-[font-size] duration-350 dark:text-white",
438+
"duration-350 text-gray-950 transition-[font-size] dark:text-white",
433439
step > 2 ? "text-2xl font-medium" : null,
434440
)}
435441
>
@@ -439,8 +445,8 @@ function Example({ step }: { step: number }) {
439445
transition={TRANSITION}
440446
layout="position"
441447
className={clsx(
442-
"text-gray-950 transition-colors duration-350 dark:text-white",
443-
step > 3 ? "font-medium text-sky-500!" : null,
448+
"duration-350 text-gray-950 transition-colors dark:text-white",
449+
step > 3 ? "text-sky-500! font-medium" : null,
444450
)}
445451
>
446452
The Anti-Patterns
@@ -449,8 +455,8 @@ function Example({ step }: { step: number }) {
449455
layout="position"
450456
transition={TRANSITION}
451457
className={clsx(
452-
"flex text-gray-950 transition-colors duration-350 dark:text-white",
453-
step > 4 ? "gap-2 font-medium text-gray-600! dark:text-gray-400!" : null,
458+
"duration-350 flex text-gray-950 transition-colors dark:text-white",
459+
step > 4 ? "text-gray-600! dark:text-gray-400! gap-2 font-medium" : null,
454460
)}
455461
>
456462
<motion.span layout="position" transition={TRANSITION}>

0 commit comments

Comments
 (0)