tangled
alpha
login
or
join now
kacaii.dev
/
blog
0
fork
atom
💻 My personal website
blog.kacaii.dev/
blog
gleam
lustre
0
fork
atom
overview
issues
pulls
pipelines
:lipstick: add marquee view
kacaii.dev
2 months ago
b07382f1
ac8b0d2d
+37
-3
4 changed files
expand all
collapse all
unified
split
input.css
src
blog
page
home.gleam
marquee.gleam
tailwind.config.js
+15
input.css
···
1
1
@import "tailwindcss";
2
2
@import "@catppuccin/tailwindcss/mocha.css";
3
3
+
4
4
+
5
5
+
@theme {
6
6
+
--animate-marquee: marquee 40s linear infinite;
7
7
+
8
8
+
@keyframes marquee {
9
9
+
0% {
10
10
+
transform: translateX(0%)
11
11
+
}
12
12
+
13
13
+
100% {
14
14
+
transform: translateX(-100%)
15
15
+
}
16
16
+
}
17
17
+
}
+5
-1
src/blog/page/home.gleam
···
1
1
import blog/page/footer
2
2
+
import blog/page/marquee
2
3
import blog/page/navbar
3
4
import blog/page/recent_posts
4
5
import blog/root
···
16
17
17
18
let content = [
18
19
navbar.view(),
19
19
-
html.main([main_style], [recent_posts.view(ctx.posts)]),
20
20
+
html.main([main_style], [
21
21
+
marquee.view([]),
22
22
+
recent_posts.view(ctx.posts),
23
23
+
]),
20
24
footer.view(),
21
25
]
22
26
+15
src/blog/page/marquee.gleam
···
1
1
+
import gleam/list
2
2
+
import lustre/attribute.{class}
3
3
+
import lustre/element
4
4
+
import lustre/element/html
5
5
+
6
6
+
pub fn view(elements: List(element.Element(_))) {
7
7
+
let track = {
8
8
+
use item <- list.map(elements)
9
9
+
html.span([class("inline-block")], [item])
10
10
+
}
11
11
+
12
12
+
html.div([class("overflow-x-hidden w-full")], [
13
13
+
html.div([class("flex gap-2 animate-marquee")], track),
14
14
+
])
15
15
+
}
+2
-2
tailwind.config.js
···
1
1
/** @type {import('tailwindcss').Config} */
2
2
module.exports = {
3
3
content: ["./src/**/*.gleam"],
4
4
-
theme: { extent: {} },
5
5
-
plugins: [],
4
4
+
theme: { extend: {} },
5
5
+
plugins: [require("@catppuccin/tailwindcss")],
6
6
};