Skip to content

Commit f25f2a2

Browse files
Add footer
1 parent 2f8a48e commit f25f2a2

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

src/website/component.gleam

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import website/component/footer
12
import lustre/attribute.{attribute}
23
import lustre/element.{type Element}
34
import lustre/element/html
@@ -38,6 +39,7 @@ pub fn page(name: String, content: List(Element(a))) -> Element(a) {
3839
html.body([attribute.class("min-h-screen bg-slate-800 text-white")], [
3940
header.view(name),
4041
html.main([attribute.class("py-24")], content),
42+
footer.view(),
4143
]),
4244
])
4345
}

src/website/component/footer.gleam

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import gleam/list
2+
import lustre/attribute
3+
import lustre/element.{type Element}
4+
import lustre/element/html
5+
6+
type Social {
7+
Social(icon: String, name: String, url: String)
8+
}
9+
10+
const socials = [
11+
Social(icon: "youtube.png", name: "YouTube", url: ""),
12+
Social(icon: "github.png", name: "Github", url: ""),
13+
Social(icon: "bluesky.svg", name: "Bluesky", url: ""),
14+
Social(icon: "modrinth.svg", name: "", url: ""),
15+
Social(icon: "discord.png", name: "", url: ""),
16+
]
17+
18+
pub fn view() -> Element(a) {
19+
html.footer(
20+
[
21+
attribute.class(
22+
"right-3 bottom-3 fixed h-16 bg-blue-900 p-3.5 flex flex-row gap-4 items-center overflow-hidden rounded-full",
23+
),
24+
],
25+
list.map(socials, fn(social) {
26+
html.a(
27+
[
28+
attribute.href(social.url),
29+
attribute.target("_blank"),
30+
attribute.class("shrink-0"),
31+
],
32+
[
33+
html.img([
34+
attribute.src("/images/" <> social.icon),
35+
attribute.alt(social.name),
36+
attribute.title(social.name),
37+
attribute.class("w-icon"),
38+
]),
39+
],
40+
)
41+
}),
42+
)
43+
}

0 commit comments

Comments
 (0)