Skip to content

Commit 8865e6b

Browse files
committed
feat(ui): alternate the red separator hooks down each page
Mirror every other section separator so the raised (upward) end flips sides as you scroll (-1 1 -1 1 …) while the opposite end stays pinned low. Odd-of-type bands and page-sections raise the right end instead of the left, giving the landing page a continuous L R L R rhythm. Extend the zigzag into the footer via a `mirror` prop on LandingFooter (`.footer-alt`), set on the blog index and blog posts where one separator precedes the footer, so no two adjacent dividers raise the same end on any page.
1 parent 0ae634d commit 8865e6b

4 files changed

Lines changed: 43 additions & 3 deletions

File tree

src/components/astro/LandingFooter.astro

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
---
2+
interface Props {
3+
/* Mirror the red separator's hooks so the footer continues a page's
4+
alternating zigzag. Set true on pages where an even number of separators
5+
precede the footer (e.g. the blog index and blog posts). */
6+
mirror?: boolean;
7+
}
8+
9+
const { mirror = false } = Astro.props;
10+
211
const links = [
312
{ href: "https://github.com/seqra/opentaint", label: "GitHub", external: true },
413
{ href: "https://discord.gg/6BXDfbP4p9", label: "Discord", external: true },
@@ -8,7 +17,7 @@ const links = [
817
---
918

1019
<footer>
11-
<div class="footer-links grid grid-cols-2 sm:grid-cols-4">
20+
<div class:list={["footer-links grid grid-cols-2 sm:grid-cols-4", mirror && "footer-alt"]}>
1221
{links.map((link) => (
1322
<a
1423
href={link.href}

src/index.css

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,37 @@
273273
pointer-events: none;
274274
}
275275

276+
/* Alternating separators: every other divider mirrors the hooks so the
277+
raised (upward) end flips sides down the page (-1 1 -1 1 …), while the
278+
other end stays pinned low. The default rule above raises the left end;
279+
these odd-of-type sections raise the right end instead. `.footer-alt`
280+
opts the footer rule in so it keeps the page's zigzag going — set per
281+
page (see LandingFooter `mirror` prop) whenever an even number of
282+
separators precedes the footer. */
283+
.band:nth-of-type(odd):not(:first-child)::before,
284+
.page-section:nth-of-type(odd):not(:first-child)::before,
285+
.footer-links.footer-alt::before {
286+
/* Rule + left-hand hook curving down. */
287+
left: var(--rule-inset);
288+
right: calc(var(--rule-inset) + 23px);
289+
border-right: none;
290+
border-left: 1px solid hsl(var(--brand));
291+
border-top-right-radius: 0;
292+
border-top-left-radius: 24px;
293+
}
294+
295+
.band:nth-of-type(odd):not(:first-child)::after,
296+
.page-section:nth-of-type(odd):not(:first-child)::after,
297+
.footer-links.footer-alt::after {
298+
/* Right-hand hook curving up, meeting the rule flush. */
299+
left: auto;
300+
right: var(--rule-inset);
301+
border-left: none;
302+
border-right: 1px solid hsl(var(--brand));
303+
border-bottom-left-radius: 0;
304+
border-bottom-right-radius: 24px;
305+
}
306+
276307
.section-title {
277308
@apply font-mono text-base font-bold tracking-tight text-foreground lg:text-[17px];
278309
}

src/pages/blog/[slug].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const breadcrumbSchema = {
9797
<BlogPostView post={post} headings={headings}>
9898
{Content ? <Content /> : <Fragment set:html={post.body} />}
9999
</BlogPostView>
100-
<LandingFooter />
100+
<LandingFooter mirror />
101101
</div>
102102

103103
{toc.length > 0 && (

src/pages/blog/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const breadcrumbSchema = {
6565
</div>
6666
</section>
6767

68-
<LandingFooter />
68+
<LandingFooter mirror />
6969
</div>
7070
</main>
7171
</div>

0 commit comments

Comments
 (0)