Skip to content

Commit 6acb3d2

Browse files
committed
[how-to] WIP layout + graphism
1 parent 8afdd20 commit 6acb3d2

2 files changed

Lines changed: 93 additions & 18 deletions

File tree

src/pages/how-to/index.astro

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
import Gephi from "../../components/how-to/Gephi.astro";
2+
import { Image } from "astro:assets";
3+
import Gephi from "../../components/how-to/Gephi.md";
34
import GephiLite from "../../components/how-to/GephiLite.md";
45
import Layout from "../../layouts/Layout.astro";
56
---
@@ -14,11 +15,37 @@ import Layout from "../../layouts/Layout.astro";
1415
<main class="py-5">
1516
<section class="how-to container">
1617
<article class="how-to-column" id="gephi">
17-
<h2>Gephi</h2>
18+
<h2>
19+
<label class="form-check-label" for="viewGephiHowTo">
20+
<Image
21+
src="/icons/gephi-desktop-logo-inverted.svg"
22+
class="mb-3 mb-md-0"
23+
alt="Gephi logo"
24+
width="100"
25+
height="100"
26+
/>
27+
<span class="label-content">Gephi</span></label
28+
>
29+
30+
<input class="form-check-input bg-gephi-lite" type="checkbox" role="switch" id="viewGephiHowTo" checked />
31+
</h2>
1832
<Gephi />
1933
</article>
2034
<article class="how-to-column" id="gephi-lite">
21-
<h2>Gephi Lite</h2>
35+
<h2>
36+
<label class="form-check-label" for="viewGephiLiteHowTo">
37+
<span class="label-content">Gephi Lite</span>
38+
39+
<Image
40+
src="/icons/gephi-lite-logo-inverted.svg"
41+
class="mb-3 mb-md-0"
42+
alt="Gephi logo"
43+
width="100"
44+
height="100"
45+
/>
46+
</label>
47+
<input class="form-check-input bg-gephi-lite" type="checkbox" role="switch" id="viewGephiLiteHowTo" checked />
48+
</h2>
2249
<GephiLite />
2350
</article>
2451
</section>

src/styles/_how-to.scss

Lines changed: 63 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,49 @@
22
$nb-sections: 50; // Nombre de sections par article
33
display: grid;
44
grid-template-columns: 50% 50%;
5-
@include media-breakpoint-down(lg) {
6-
grid-template-columns: 1fr;
7-
}
5+
86
grid-auto-rows: minmax(100px, auto);
9-
grid-column-gap: 1rem;
7+
grid-column-gap: 3rem;
108
grid-row-gap: 1rem;
119

10+
// &:has(.form-check-input:not(:checked)) {
11+
// }
12+
.form-check-input {
13+
display: none;
14+
}
15+
16+
&:has(#viewGephiHowTo:checked):has(#viewGephiLiteHowTo:not(:checked)) {
17+
// Gephi only
18+
grid-template-columns: 1fr 100px;
19+
20+
#gephi-lite {
21+
section,
22+
.label-content {
23+
display: none;
24+
}
25+
}
26+
}
27+
28+
&:has(#viewGephiHowTo:not(:checked)):has(#viewGephiLiteHowTo:checked) {
29+
// Gephi lite only
30+
grid-template-columns: 100px 1fr;
31+
#gephi {
32+
section,
33+
.label-content {
34+
display: none;
35+
}
36+
}
37+
#gephi-lite {
38+
section {
39+
h2,
40+
h3,
41+
h4 {
42+
text-align: start;
43+
}
44+
}
45+
}
46+
}
47+
1248
#gephi {
1349
> h2 {
1450
grid-column: 1;
@@ -19,22 +55,30 @@
1955
> h2 {
2056
grid-column: 2;
2157
grid-row: 1;
22-
@include media-breakpoint-down(lg) {
23-
grid-column: 1;
24-
grid-row: 2;
25-
}
58+
justify-content: end;
2659
}
27-
28-
@include media-breakpoint-down(lg) {
29-
text-align: end;
60+
section {
61+
h2,
62+
h3,
63+
h4 {
64+
text-align: end;
65+
}
3066
}
3167
}
3268

3369
.how-to-column {
3470
display: contents;
35-
h2 {
71+
72+
> h2 {
73+
display: flex;
74+
align-items: center;
75+
column-gap: 0.5rem;
76+
3677
@include media-breakpoint-up(lg) {
37-
text-align: center;
78+
// text-align: center;
79+
}
80+
.form-check-input {
81+
margin: 0;
3882
}
3983
}
4084
section {
@@ -83,18 +127,22 @@
83127
// place sections in the right rows
84128
@for $i from 1 through $nb-sections {
85129
#gephi > section:nth-child(#{$i}) {
86-
grid-column: 1;
87130
@include media-breakpoint-down(lg) {
88131
grid-row: 2 * $i - 2 + 1;
132+
grid-column: 1/3;
133+
margin-right: 5rem;
89134
}
90135
@include media-breakpoint-up(lg) {
91136
grid-row: $i;
137+
grid-column: 1;
92138
}
93139
}
94140
#gephi-lite > section:nth-child(#{$i}) {
95141
@include media-breakpoint-down(lg) {
96142
grid-row: 2 * $i - 1 + 1;
97-
grid-column: 1;
143+
grid-column: 1/3;
144+
border-right: 4px solid $gephi-lite-bg;
145+
margin-left: 5rem;
98146
}
99147
@include media-breakpoint-up(lg) {
100148
grid-row: $i;

0 commit comments

Comments
 (0)