Skip to content

Commit 38d8334

Browse files
committed
chore: modify divider
1 parent 13b2234 commit 38d8334

File tree

6 files changed

+44
-40
lines changed

6 files changed

+44
-40
lines changed

.changeset/sad-cities-build.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"r.obin.ch": patch
3+
---
4+
5+
Modify divider

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ indent_style = space
1111
insert_final_newline = true
1212
trim_trailing_whitespace = false
1313

14+
1415
[{.*,*.md,*.json,*.toml,*.yml,*.json5}]
1516
indent_style = space

src/components/Divider.astro

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
type Props = {
3+
flipHorizontally?: boolean;
4+
flipVertically?: boolean;
5+
};
6+
7+
const flipHorizontally = Astro.props.flipHorizontally ? -1 : 1;
8+
const flipVertically = Astro.props.flipVertically ? -1 : 1;
9+
---
10+
11+
<style
12+
define:vars={{
13+
"flip-horizontally": flipHorizontally,
14+
"flip-vertically": flipVertically,
15+
}}
16+
>
17+
.rebound-divider {
18+
width: 100%;
19+
height: 1rem;
20+
background: var(--color-primary, #000);
21+
transform: scaleX(var(--flip-horizontally)) scaleY(var(--flip-vertically));
22+
clip-path: polygon(0 0, var(--padding-page, 24px) 100%, calc(100% - var(--padding-page, 24px)) 100%, 100% 0, 0 0);
23+
border-bottom: 5px solid var(--color-border, var(--color-primary-120));
24+
}
25+
26+
@media (max-width: 1280px) {
27+
.rebound-divider {
28+
clip-path: none;
29+
}
30+
}
31+
</style>
32+
33+
<div class="rebound-divider"></div>

src/components/ReboundDivider.astro

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/layouts/DefaultLayout.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Head from "./groups/Head.astro";
66
import Header from "./groups/Header.astro";
77
import Footer from "./groups/Footer.astro";
88
import Topbar from "./groups/Topbar.astro";
9-
import ReboundDivider from "../components/ReboundDivider.astro";
9+
import Divider from "../components/Divider.astro";
1010
import Meta from "./groups/Meta.astro";
1111
1212
type Props = {
@@ -26,11 +26,11 @@ const { translations } = Astro.props;
2626
<body>
2727
<Topbar translations={translations} />
2828
<Header />
29-
<ReboundDivider />
29+
<Divider />
3030
<main data-pagefind-body transition:animate="fade">
3131
<slot />
3232
</main>
33-
<ReboundDivider flipHorizontally flipVertically />
33+
<Divider flipHorizontally flipVertically />
3434
<Footer />
3535
</body>
3636
</html>

src/layouts/DefaultLayout.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ body > header {
7272
font-size: 2.2rem;
7373
column-gap: 4rem;
7474
padding-top: 2rem;
75-
padding-bottom: 2rem;
75+
padding-bottom: 1rem;
7676
font-family: var(--font-headings);
7777

7878
& > a {
@@ -253,7 +253,7 @@ footer {
253253
display: flex;
254254
justify-content: space-between;
255255
height: 3rem;
256-
padding-top: 1.75rem;
256+
padding-top: 0.75rem;
257257
}
258258

259259
footer nav ul {

0 commit comments

Comments
 (0)