Skip to content

Commit 2b46df1

Browse files
thebuilderclaude
andcommitted
fix(docs): OG element clips the true viewport edge
Two fixes to the intersection graphic: - The element was clipped ~72px short of the edge by the root's right padding; drop it so the element runs off the real right edge. - Replace the disconnected vertical line with a soft violet seam on the right edge itself — the viewport boundary the element intersects — with the "viewport" label naming it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 0d4d421 commit 2b46df1

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

‎apps/docs/public/og-home.png‎

-75 Bytes
Loading

‎apps/docs/scripts/generate-og.mjs‎

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -180,19 +180,21 @@ async function main() {
180180
],
181181
});
182182

183-
// The viewport boundary the element has crossed, and its label.
184-
const boundary = container({
183+
// The right edge of the card is the viewport boundary the element clips
184+
// against; a soft violet seam marks it and a label names it.
185+
const edgeSeam = container({
185186
style: {
186-
backgroundColor: "rgb(167 139 250 / 0.4)",
187-
height: 452,
188-
left: 686,
187+
backgroundImage:
188+
"linear-gradient(180deg, transparent, rgb(167 139 250 / 0.55) 18%, rgb(167 139 250 / 0.55) 82%, transparent)",
189+
bottom: 0,
189190
position: "absolute",
190-
top: 89,
191-
width: 2,
191+
right: 0,
192+
top: 0,
193+
width: 3,
192194
},
193195
});
194-
const boundaryLabel = container({
195-
style: { left: 686, position: "absolute", top: 56 },
196+
const viewportLabel = container({
197+
style: { position: "absolute", right: 30, top: 40 },
196198
children: [
197199
text("viewport", {
198200
color: "rgb(200 188 245 / 0.9)",
@@ -215,13 +217,13 @@ async function main() {
215217
justifyContent: "center",
216218
overflow: "hidden",
217219
paddingLeft: 72,
218-
paddingRight: 72,
220+
paddingRight: 0,
219221
position: "relative",
220222
width: WIDTH,
221223
},
222-
// Paint order: the element card, then the boundary line + label on top of
223-
// it (so the line reads as the edge it crossed), then the message.
224-
children: [observedElement(f.mono), boundary, boundaryLabel, message],
224+
// The element clips the right edge; the seam + label mark that edge as the
225+
// viewport boundary it is intersecting.
226+
children: [observedElement(f.mono), edgeSeam, viewportLabel, message],
225227
});
226228

227229
const png = await render(root, {

0 commit comments

Comments
 (0)