Skip to content

Commit 9c12206

Browse files
committed
Fix hero footer layout
1 parent 3c6cee0 commit 9c12206

2 files changed

Lines changed: 23 additions & 6 deletions

File tree

src/generator/generator.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,26 @@ describe("profile artifact generation", () => {
8686
expect(new DOMParser().parseFromString(svg, "image/svg+xml").querySelector("parsererror")).toBeNull();
8787
});
8888

89+
it("keeps workflow labels inside the content surface above one footer boundary", () => {
90+
const config = cloneDefaultConfig();
91+
92+
const desktop = renderHeroSvg(config, {
93+
viewport: "desktop",
94+
theme: "dark",
95+
motion: "static",
96+
});
97+
const mobile = renderHeroSvg(config, {
98+
viewport: "mobile",
99+
theme: "dark",
100+
motion: "static",
101+
});
102+
103+
expect(desktop).toContain('<rect x="1" y="64" width="1198" height="503" class="surface"/>');
104+
expect(desktop).toContain('<path d="M30 567H1170" class="line"/>');
105+
expect(mobile).toContain('<rect x="1" y="64" width="618" height="823" class="surface"/>');
106+
expect(mobile).toContain('<path d="M30 887H590" class="line"/>');
107+
});
108+
89109
it("keeps README asset references in sync with the generated files", () => {
90110
const artifacts = generateArtifacts(cloneDefaultConfig());
91111
const paths = new Set(artifacts.map((artifact) => artifact.path));

src/generator/svg.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export interface HeroVariant {
1414
interface Layout {
1515
width: number;
1616
height: number;
17-
contentBottom: number;
1817
nameX: number;
1918
nameY: number;
2019
headlineX: number;
@@ -45,7 +44,6 @@ const layouts: Record<HeroViewport, Layout> = {
4544
desktop: {
4645
width: 1200,
4746
height: 610,
48-
contentBottom: 546,
4947
nameX: 42,
5048
nameY: 129,
5149
headlineX: 38,
@@ -74,7 +72,6 @@ const layouts: Record<HeroViewport, Layout> = {
7472
mobile: {
7573
width: 620,
7674
height: 930,
77-
contentBottom: 866,
7875
nameX: 30,
7976
nameY: 113,
8077
headlineX: 28,
@@ -305,7 +302,7 @@ export function renderHeroSvg(config: ProfileConfig, variant: HeroVariant): stri
305302
"The terminal types a command, completes demo checks, and repeats. Motion stops when reduced motion is preferred."
306303
: config.accessibility.staticDescription ||
307304
"A static completed illustration of the configured demo checks.";
308-
const gridHeight = layout.contentBottom - 64;
305+
const contentHeight = layout.footerDividerY - 64;
309306
const headerSignalX = variant.viewport === "desktop" ? 1073 : 493;
310307
const profileTextX = layout.width - 30;
311308
const headlineMaxWidth = variant.viewport === "desktop"
@@ -327,8 +324,8 @@ export function renderHeroSvg(config: ProfileConfig, variant: HeroVariant): stri
327324
</defs>
328325
${styles(config, palette, variant, prefix, commandWidth)}
329326
<rect x=".5" y=".5" width="${layout.width - 1}" height="${layout.height - 1}" rx="${config.appearance.cornerRadius}" class="bg line"/>
330-
<rect x="1" y="64" width="${layout.width - 2}" height="${gridHeight}" class="surface"/>
331-
<rect x="1" y="64" width="${layout.width - 2}" height="${gridHeight}" fill="url(#${patternId})"/>
327+
<rect x="1" y="64" width="${layout.width - 2}" height="${contentHeight}" class="surface"/>
328+
<rect x="1" y="64" width="${layout.width - 2}" height="${contentHeight}" fill="url(#${patternId})"/>
332329
<path d="M1 64H${layout.width - 1}" class="line"/>
333330
<rect x="30" y="19" width="27" height="27" rx="5" class="soft"/>
334331
<path d="M36 27l5 5-5 5m9 0h6" stroke="${palette.accent}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>

0 commit comments

Comments
 (0)