Skip to content

Commit 9111d4a

Browse files
Add Gleam and Lustre to footer
1 parent a543b88 commit 9111d4a

File tree

2 files changed

+70
-67
lines changed

2 files changed

+70
-67
lines changed

src/website/component/footer.gleam

Lines changed: 19 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,35 @@
1-
import gleam/list
21
import lustre/attribute
32
import lustre/element.{type Element}
43
import lustre/element/html
54

6-
pub type Social {
7-
Social(icon: String, name: String, url: String, description: String)
8-
}
9-
10-
pub const socials = [
11-
Social(
12-
icon: "youtube.png",
13-
name: "YouTube",
14-
url: "https://youtube.com/@GearsDatapacks",
15-
description: "Videos on Minecraft Datapacks and Gleam",
16-
),
17-
Social(
18-
icon: "github.png",
19-
name: "Github",
20-
url: "https://github.com/GearsDatapacks",
21-
description: "All my projects",
22-
),
23-
Social(
24-
icon: "bluesky.svg",
25-
name: "Bluesky",
26-
url: "https://bsky.app/profile/gearsco.de",
27-
description: "Random social media posting",
28-
),
29-
Social(
30-
icon: "twitch.png",
31-
name: "Twitch",
32-
url: "https://twitch.tv/gearsdatapacks",
33-
description: "Occasional programming livestreams",
34-
),
35-
Social(
36-
icon: "modrinth.svg",
37-
name: "Modrinth",
38-
url: "https://modrinth.com/user/GearsDatapacks",
39-
description: "Minecraft datapacks",
40-
),
41-
Social(
42-
icon: "discord.png",
43-
name: "Discord",
44-
url: "https://discord.gg/fmPKDqf9ze",
45-
description: "Discord Server",
46-
),
47-
Social(
48-
icon: "hex.png",
49-
name: "Hex",
50-
url: "https://hex.pm/users/Gears",
51-
description: "Gleam libraries",
52-
),
53-
]
54-
555
pub fn view() -> Element(a) {
566
html.footer(
577
[
58-
attribute.class(
59-
"right-3 bottom-3 fixed h-16 bg-blue-900 p-3.5 flex flex-row gap-4 items-center overflow-hidden rounded-full",
60-
),
8+
attribute.class("right-5 bottom-4 fixed"),
619
],
62-
list.map(socials, fn(social) {
10+
[
11+
element.text("Made with "),
12+
html.a(
13+
[
14+
attribute.href("https://lustre.build"),
15+
attribute.target("_blank"),
16+
attribute.class("underline"),
17+
],
18+
[
19+
element.text("Lustre"),
20+
],
21+
),
22+
element.text(" and "),
6323
html.a(
6424
[
65-
attribute.href(social.url),
25+
attribute.href("https://gleam.run"),
6626
attribute.target("_blank"),
67-
attribute.class("shrink-0"),
27+
attribute.class("underline"),
6828
],
6929
[
70-
html.img([
71-
attribute.src("/images/" <> social.icon),
72-
attribute.alt(social.name),
73-
attribute.title(social.name),
74-
attribute.class("w-icon"),
75-
]),
30+
element.text("Gleam"),
7631
],
77-
)
78-
}),
32+
),
33+
],
7934
)
8035
}

src/website/page/index.gleam

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import lustre/attribute
33
import lustre/element.{type Element}
44
import lustre/element/html
55
import website/component
6-
import website/component/footer
76

87
fn index() {
98
component.text_page("Hello and welcome to my website!", [
@@ -58,7 +57,7 @@ pub fn my_stuff() {
5857
html.h2([attribute.class("text-2xl font-bold leading-tight my-2")], [
5958
element.text("Links"),
6059
]),
61-
html.p([], list.map(footer.socials, social)),
60+
html.p([], list.map(socials, social)),
6261
html.h2([attribute.class("text-2xl font-bold leading-tight my-2")], [
6362
element.text("Talks"),
6463
]),
@@ -90,6 +89,55 @@ const talks = [
9089
),
9190
]
9291

92+
type Social {
93+
Social(icon: String, name: String, url: String, description: String)
94+
}
95+
96+
const socials = [
97+
Social(
98+
icon: "youtube.png",
99+
name: "YouTube",
100+
url: "https://youtube.com/@GearsDatapacks",
101+
description: "Videos on Minecraft Datapacks and Gleam",
102+
),
103+
Social(
104+
icon: "github.png",
105+
name: "Github",
106+
url: "https://github.com/GearsDatapacks",
107+
description: "All my projects",
108+
),
109+
Social(
110+
icon: "bluesky.svg",
111+
name: "Bluesky",
112+
url: "https://bsky.app/profile/gearsco.de",
113+
description: "Random social media posting",
114+
),
115+
Social(
116+
icon: "twitch.png",
117+
name: "Twitch",
118+
url: "https://twitch.tv/gearsdatapacks",
119+
description: "Occasional programming livestreams",
120+
),
121+
Social(
122+
icon: "modrinth.svg",
123+
name: "Modrinth",
124+
url: "https://modrinth.com/user/GearsDatapacks",
125+
description: "Minecraft datapacks",
126+
),
127+
Social(
128+
icon: "discord.png",
129+
name: "Discord",
130+
url: "https://discord.gg/fmPKDqf9ze",
131+
description: "Discord Server",
132+
),
133+
Social(
134+
icon: "hex.png",
135+
name: "Hex",
136+
url: "https://hex.pm/users/Gears",
137+
description: "Gleam libraries",
138+
),
139+
]
140+
93141
type Talk {
94142
Talk(
95143
description: String,
@@ -120,7 +168,7 @@ fn talk(talk: Talk) -> Element(a) {
120168
])
121169
}
122170

123-
fn social(social: footer.Social) -> Element(a) {
171+
fn social(social: Social) -> Element(a) {
124172
html.a([attribute.href(social.url), attribute.target("_blank")], [
125173
html.img([
126174
attribute.src("/images/" <> social.icon),

0 commit comments

Comments
 (0)