Skip to content

Commit f60ae01

Browse files
RhysSullivanclaude
andauthored
marketing: keep duplicated and hidden text out of find-in-page (#2021)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 197ae08 commit f60ae01

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

‎apps/marketing/src/components/variants/doc-body.astro‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const { gh } = Astro.props;
4646
Connect{" "}
4747
<span class="doc__pop" tabindex="0">
4848
<span class="doc__pop-word">everything</span>
49-
<span class="doc__pop-panel" aria-hidden="true">
49+
<span class="doc__pop-panel" aria-hidden="true" inert>
5050
{toolLogos.map((n, i) => (
5151
<span class="doc__pop-tile" style={`--i:${i}`}><img src={logo(n)} alt="" width="18" height="18" /></span>
5252
))}
@@ -62,7 +62,7 @@ const { gh } = Astro.props;
6262
Give{" "}
6363
<span class="doc__pop" tabindex="0">
6464
<span class="doc__pop-word">your agent</span>
65-
<span class="doc__pop-panel" aria-hidden="true">
65+
<span class="doc__pop-panel" aria-hidden="true" inert>
6666
{agentLogos.map((n, i) => (
6767
<span class="doc__pop-tile" style={`--i:${i}`}><img src={logo(n)} alt="" width="18" height="18" /></span>
6868
))}
@@ -97,7 +97,7 @@ const { gh } = Astro.props;
9797
</span>
9898
</button></div>
9999
</div>
100-
<div role="tabpanel" data-doc-pane="local" data-inactive aria-hidden="true">
100+
<div role="tabpanel" data-doc-pane="local" data-inactive aria-hidden="true" inert>
101101
<p>Nothing leaves your machine. A desktop app for Mac, Windows, and Linux, or a CLI that runs in the background. Same local endpoint either way.</p>
102102
<div class="doc__actions"><span class="doc__dl" data-download>
103103
<a data-os="mac-arm64" href={`${gh}/releases/latest/download/executor-desktop-mac-arm64.dmg`} class="btn-primary">Download for Mac</a>
@@ -119,7 +119,7 @@ const { gh } = Astro.props;
119119
</span>
120120
</button></div>
121121
</div>
122-
<div role="tabpanel" data-doc-pane="self" data-inactive aria-hidden="true">
122+
<div role="tabpanel" data-doc-pane="self" data-inactive aria-hidden="true" inert>
123123
<p>One Docker image on your own box. It is the same code Cloud runs.</p>
124124
<div class="doc__actions"><a href="https://executor.sh/docs/hosted/docker" class="btn-primary">Self-hosting docs</a><a href={gh} class="btn-secondary">Source on GitHub</a></div>
125125
</div>
@@ -318,6 +318,7 @@ const { gh } = Astro.props;
318318
for (const p of root.querySelectorAll<HTMLElement>("[data-doc-pane]")) {
319319
const off = p.dataset.docPane !== key;
320320
p.toggleAttribute("data-inactive", off);
321+
p.toggleAttribute("inert", off);
321322
p.setAttribute("aria-hidden", String(off));
322323
for (const el of p.querySelectorAll<HTMLElement>("a, button")) {
323324
el.tabIndex = off ? -1 : 0;
@@ -364,7 +365,9 @@ const { gh } = Astro.props;
364365
for (const btn of root.querySelectorAll<HTMLAnchorElement>("a[data-os]")) {
365366
if (btn.dataset.os === detected) continue;
366367
btn.classList.add("hidden");
368+
btn.toggleAttribute("inert", true);
367369
const clone = btn.cloneNode(true) as HTMLAnchorElement;
370+
clone.removeAttribute("inert");
368371
clone.className = "";
369372
list.appendChild(clone);
370373
}

‎apps/marketing/src/components/variants/testimonials.astro‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const composeUrl = `https://x.com/intent/post?text=${encodeURIComponent(
3636
<div class="testi__row" data-row={r}>
3737
{/* Two copies of the row make the marquee loop seamless. */}
3838
{[0, 1].map((copy) => (
39-
<div class="testi__track" aria-hidden={copy === 1 ? "true" : undefined}>
39+
<div class="testi__track" aria-hidden={copy === 1 ? "true" : undefined} inert={copy === 1 ? true : undefined}>
4040
{r === 1 ? (
4141
<a
4242
class="testi__card testi__card--add"

‎apps/marketing/src/styles/variants/testimonials.css‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
.testi__row[data-row="1"] .testi__track {
3838
animation-direction: reverse;
3939
}
40+
/* The second copy exists only so the loop is seamless. Keep it out of
41+
find-in-page, selection, and the accessibility tree. */
42+
.testi__track[inert] {
43+
user-select: none;
44+
}
4045
.testi[data-seen]:hover .testi__track {
4146
animation-play-state: paused;
4247
}

0 commit comments

Comments
 (0)