|
| 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