tangled
alpha
login
or
join now
oppi.li
/
gleam-ci-tests
forked from
lesbian.skin/website
0
fork
atom
not my website
0
fork
atom
overview
issues
pulls
pipelines
TailwindCSS + Small Screen Support
lesbian.skin
2 years ago
8ef10a59
657d6f96
+267
-337
7 changed files
expand all
collapse all
unified
split
index.html
src
ffi.mjs
input.css
website
common.gleam
style.gleam
website.gleam
tailwind.config.js
+1
index.html
···
11
11
<title>🐈 naomieow</title>
12
12
13
13
<script type="module" src="/priv/static/website.mjs"></script>
14
14
+
<link rel="stylesheet" href="/priv/static/website.css">
14
15
</head>
15
16
16
17
<body style="margin: 0;">
+10
-1
src/ffi.mjs
···
2
2
return window.location.pathname
3
3
}
4
4
5
5
+
// TODO: Add localStorage as well
5
6
export function prefers_dark_mode() {
6
6
-
return window.matchMedia('(prefers-color-scheme:dark)').matches
7
7
+
const matches = window.matchMedia('(prefers-color-scheme:dark)').matches
8
8
+
if (matches) {
9
9
+
document.documentElement.classList.add("dark")
10
10
+
}
11
11
+
return matches
12
12
+
}
13
13
+
14
14
+
export function switch_theme() {
15
15
+
document.documentElement.classList.toggle("dark")
7
16
}
+3
src/input.css
···
1
1
+
@tailwind base;
2
2
+
@tailwind components;
3
3
+
@tailwind utilities;
+221
-166
src/website.gleam
···
2
2
import gleam/string
3
3
import gleam/uri.{type Uri}
4
4
import lustre
5
5
-
import lustre/attribute
5
5
+
import lustre/attribute as attr
6
6
import lustre/effect.{type Effect}
7
7
import lustre/element.{type Element}
8
8
import lustre/element/html
···
13
13
import website/common
14
14
import website/posts
15
15
import website/projects
16
16
-
import website/style
17
16
18
17
// Main
19
18
···
49
48
@external(javascript, "./ffi.mjs", "prefers_dark_mode")
50
49
fn prefers_dark_mode() -> Bool
51
50
51
51
+
@external(javascript, "./ffi.mjs", "switch_theme")
52
52
+
fn do_switch_theme() -> Nil
53
53
+
54
54
+
fn switch_theme() -> Effect(Msg) {
55
55
+
effect.from(fn(disp) {
56
56
+
do_switch_theme()
57
57
+
DoneChangeDarkMode
58
58
+
|> disp
59
59
+
})
60
60
+
}
61
61
+
52
62
fn get_route() -> Route {
53
63
case do_get_route() |> string.split("/") {
54
64
["", "projects", id] | ["", "project", id] -> Project(id)
···
86
96
pub opaque type Msg {
87
97
OnRouteChange(Route)
88
98
ChangeDarkMode
99
99
+
DoneChangeDarkMode
89
100
}
90
101
91
102
fn update(model: Model, msg: Msg) -> #(Model, Effect(Msg)) {
···
96
107
)
97
108
ChangeDarkMode -> #(
98
109
Model(..model, dark_mode: !model.dark_mode),
99
99
-
effect.none(),
110
110
+
switch_theme(),
100
111
)
112
112
+
DoneChangeDarkMode -> #(model, effect.none())
101
113
}
102
114
}
103
115
···
112
124
Post(id) -> view_post(model, id)
113
125
}
114
126
115
115
-
ui.stack([attribute.style(style.page(model.dark_mode))], [
116
116
-
html.div([attribute.style(style.page_padding)], [view_navbar(model), page]),
117
117
-
])
127
127
+
// padding: 3vh;
128
128
+
ui.stack(
129
129
+
[
130
130
+
attr.class(
131
131
+
"font-inter font-normal not-italic min-h-screen p-5 bg-gray-100 dark:bg-neutral-900",
132
132
+
),
133
133
+
],
134
134
+
[
135
135
+
html.div(
136
136
+
[attr.class("mx-0 sm:mx-6 md:mx-10 lg:mx-20 xl:mx-48 2xl:mx-64")],
137
137
+
[view_navbar(model), page],
138
138
+
),
139
139
+
],
140
140
+
)
118
141
}
119
142
120
143
fn view_navbar(model: Model) -> Element(Msg) {
121
121
-
let navitem_style = style.navitem(model.dark_mode)
122
122
-
let navbar_style = style.navbar(model.dark_mode)
123
123
-
124
144
let view_nav_item = fn(path, text) {
125
125
-
html.a([attribute.href("/" <> path), attribute.style(navitem_style)], [
126
126
-
element.text(text),
127
127
-
])
145
145
+
html.a(
146
146
+
[
147
147
+
attr.href("/" <> path),
148
148
+
attr.class(
149
149
+
"drop-shadow-md no-underline bg-gray-300 dark:bg-neutral-900 p-3 rounded-xl text-black dark:text-neutral-200",
150
150
+
),
151
151
+
],
152
152
+
[element.text(text)],
153
153
+
)
128
154
}
129
155
130
130
-
html.span(
131
131
-
[
132
132
-
attribute.style([
133
133
-
#("display", "flex"),
134
134
-
#("gap", "1em"),
135
135
-
#("width", "100%"),
136
136
-
]),
137
137
-
],
138
138
-
[
139
139
-
cluster.of(html.nav, [attribute.style(navbar_style)], [
140
140
-
html.h1([attribute.style([#("margin", "0"), #("color", "#f380b1")])], [
156
156
+
html.span([attr.class("drop-shadow-md flex gap-4 w-full")], [
157
157
+
// margin-bottom: 3vh;
158
158
+
cluster.of(
159
159
+
html.nav,
160
160
+
[
161
161
+
attr.class(
162
162
+
"flex rounded-xl p-4 items-center gap-4 border-0 grow mb-5 bg-gray-200 dark:bg-neutral-800",
163
163
+
),
164
164
+
],
165
165
+
[
166
166
+
html.h1([attr.class("hidden md:block text-3xl m-0 text-pink-400")], [
141
167
element.text("naomieow"),
142
168
]),
143
169
view_nav_item("", "Home"),
144
170
view_nav_item("projects", "Projects"),
145
171
view_nav_item("posts", "Posts"),
146
146
-
]),
147
147
-
ui.button(
148
148
-
[
149
149
-
attribute.style(style.button(model.dark_mode)),
150
150
-
event.on_click(ChangeDarkMode),
151
151
-
],
152
152
-
[
153
153
-
html.h1([attribute.style([#("margin", "0")])], [
154
154
-
case model.dark_mode {
155
155
-
True -> element.text("☀️")
156
156
-
False -> element.text("🌕")
157
157
-
},
158
158
-
]),
159
159
-
],
160
160
-
),
161
161
-
],
162
162
-
)
172
172
+
],
173
173
+
),
174
174
+
ui.button(
175
175
+
[
176
176
+
// width: 6%;
177
177
+
// margin-bottom: 3vh;
178
178
+
attr.class(
179
179
+
"min-w-9 text-3xl border-0 aspect-square items-center mb-5 p-4 rounded-xl bg-gray-200 dark:bg-neutral-800",
180
180
+
),
181
181
+
event.on_click(ChangeDarkMode),
182
182
+
],
183
183
+
[
184
184
+
html.h1([attr.class("m-0")], [
185
185
+
case model.dark_mode {
186
186
+
True -> element.text("🌕")
187
187
+
False -> element.text("☀️")
188
188
+
},
189
189
+
]),
190
190
+
],
191
191
+
),
192
192
+
])
163
193
}
164
194
165
165
-
fn view_home(model: Model) -> Element(Msg) {
166
166
-
let home_style = style.home(model.dark_mode)
167
167
-
168
168
-
html.div([attribute.style(home_style)], [
169
169
-
html.p([], [
170
170
-
element.text(
171
171
-
"Hi! I'm Naomi (or Mia), a trans girl from the UK who loves to code! I mostly make Minecraft mods, but have started
195
195
+
fn view_home(_model: Model) -> Element(Msg) {
196
196
+
html.div(
197
197
+
[
198
198
+
attr.class(
199
199
+
"drop-shadow-md text-xl p-4 mb-4 rounded-xl bg-gray-200 dark:bg-neutral-800 dark:text-neutral-200",
200
200
+
),
201
201
+
],
202
202
+
[
203
203
+
html.p([attr.class("mb-4")], [
204
204
+
element.text(
205
205
+
"Hi! I'm Naomi (or Mia), a trans girl from the UK who loves to code! I mostly make Minecraft mods, but have started
172
206
to begin other projects like ",
173
173
-
),
174
174
-
common.link("Sheetr", "https://sheetr.app/"),
175
175
-
element.text(" and "),
176
176
-
common.link("Lilypad", "https://codeberg.org/naomi/lilypad"),
177
177
-
element.text(
178
178
-
". Both projects are in their infancy, but I hope that they can both become useful to someone
207
207
+
),
208
208
+
common.link("Sheetr", "https://sheetr.app/"),
209
209
+
element.text(" and "),
210
210
+
common.link("Lilypad", "https://codeberg.org/naomi/lilypad"),
211
211
+
element.text(
212
212
+
". Both projects are in their infancy, but I hope that they can both become useful to someone
179
213
out there!",
180
180
-
),
181
181
-
]),
182
182
-
html.p([], [
183
183
-
element.text(
184
184
-
"I absolutely love learning new languages, so here is what I know:",
185
185
-
),
186
186
-
cluster.of(
187
187
-
html.div,
188
188
-
[attribute.style([#("display", "flex"), #("gap", "5em")])],
189
189
-
[
190
190
-
ui.stack([], [
191
191
-
html.h3([], [element.text("Proficient")]),
192
192
-
html.ul([], [
193
193
-
html.li([], [element.text("⭐ Gleam")]),
194
194
-
html.li([], [element.text("☕ Java")]),
195
195
-
html.li([], [element.text("📜 JavaScript")]),
196
196
-
html.li([], [element.text("🐍 Python")]),
197
197
-
html.li([], [element.text("❓mcfunction")]),
214
214
+
),
215
215
+
]),
216
216
+
html.p([], [
217
217
+
element.text(
218
218
+
"I absolutely love learning new languages, so here is what I know:",
219
219
+
),
220
220
+
cluster.of(
221
221
+
html.div,
222
222
+
[attr.class("gap-4 sm:gap-20 flex flex-col sm:flex-row")],
223
223
+
[
224
224
+
ui.stack([], [
225
225
+
html.h3([attr.class("text-2xl underline")], [
226
226
+
element.text("Proficient"),
227
227
+
]),
228
228
+
html.ul([attr.class("list-disc pl-8")], [
229
229
+
html.li([], [element.text("⭐ Gleam")]),
230
230
+
html.li([], [element.text("☕ Java")]),
231
231
+
html.li([], [element.text("📜 JavaScript")]),
232
232
+
html.li([], [element.text("🐍 Python")]),
233
233
+
html.li([], [element.text("❓mcfunction")]),
234
234
+
]),
198
235
]),
199
199
-
]),
200
200
-
ui.stack([], [
201
201
-
html.h3([], [element.text("Learning")]),
202
202
-
html.ul([], [
203
203
-
html.li([], [element.text("🦀 Rust")]),
204
204
-
html.li([], [element.text("🟦 Go")]),
205
205
-
html.li([], [element.text("🎮 C#")]),
206
206
-
html.li([], [element.text("💀 C++")]),
236
236
+
ui.stack([], [
237
237
+
html.h3([attr.class("text-2xl underline")], [
238
238
+
element.text("Learning"),
239
239
+
]),
240
240
+
html.ul([attr.class("list-disc pl-8")], [
241
241
+
html.li([], [element.text("🦀 Rust")]),
242
242
+
html.li([], [element.text("🟦 Go")]),
243
243
+
html.li([], [element.text("🎮 C#")]),
244
244
+
html.li([], [element.text("💀 C++")]),
245
245
+
]),
207
246
]),
208
208
-
]),
209
209
-
ui.stack([], [
210
210
-
html.h3([], [element.text("Want to learn")]),
211
211
-
html.ul([], [
212
212
-
html.li([], [element.text("⚡ Zig")]),
213
213
-
html.li([], [element.text("♻️ Kotlin")]),
247
247
+
ui.stack([], [
248
248
+
html.h3([attr.class("text-2xl underline")], [
249
249
+
element.text("Want to learn"),
250
250
+
]),
251
251
+
html.ul([attr.class("list-disc pl-8")], [
252
252
+
html.li([], [element.text("⚡ Zig")]),
253
253
+
html.li([], [element.text("♻️ Kotlin")]),
254
254
+
]),
214
255
]),
215
215
-
]),
216
216
-
],
217
217
-
),
218
218
-
]),
219
219
-
// html.p([], [
220
220
-
// element.text("As of this coming September, I will be studying a BSc in Computer Games Programming @ "),
221
221
-
// common.link("Staffs", "https://staffs.ac.uk/")
222
222
-
// ])
223
223
-
])
256
256
+
],
257
257
+
),
258
258
+
]),
259
259
+
// html.p([], [
260
260
+
// element.text("As of this coming September, I will be studying a BSc in Computer Games Programming @ "),
261
261
+
// common.link("Staffs", "https://staffs.ac.uk/")
262
262
+
// ])
263
263
+
],
264
264
+
)
224
265
}
225
266
226
267
fn view_projects(model: Model) -> Element(Msg) {
227
227
-
let project_style = style.project(model.dark_mode)
228
268
let projects =
229
269
model.projects
230
270
|> list.map(fn(project: projects.Project(Msg)) {
231
271
ui.stack(
232
232
-
[attribute.id("project-" <> project.id), attribute.style(project_style)],
233
272
[
234
234
-
cluster.of(html.div, [attribute.style(style.project_bar)], [
235
235
-
html.img([attribute.src(project.img), attribute.style(style.icon)]),
236
236
-
html.h1([], [common.link(project.title, "projects/" <> project.id)]),
273
273
+
attr.id("project-" <> project.id),
274
274
+
attr.class(
275
275
+
"drop-shadow-md text-xl rounded-xl p-4 mb-4 bg-gray-200 dark:bg-neutral-800 dark:text-neutral-200",
276
276
+
),
277
277
+
],
278
278
+
[
279
279
+
cluster.of(html.div, [attr.class("flex items-center gap-4 pb-1.5")], [
280
280
+
html.img([
281
281
+
attr.src(project.img),
282
282
+
attr.class("rounded-xl max-w-16 max-h-16"),
283
283
+
]),
284
284
+
html.h1([attr.class("text-2xl")], [
285
285
+
common.link(project.title, "projects/" <> project.id),
286
286
+
]),
237
287
cluster.of(
238
288
html.div,
239
239
-
[attribute.style(style.project_bar)],
289
289
+
[attr.class("flex items-center gap-2")],
240
290
project.links
241
291
|> list.map(fn(link) {
242
242
-
html.a([attribute.href(link.url), attribute.alt(link.title)], [
292
292
+
html.a([attr.href(link.url), attr.alt(link.title)], [
243
293
html.img([
244
244
-
attribute.src(link.img),
245
245
-
attribute.style(style.icon),
294
294
+
attr.src(link.img),
295
295
+
attr.class("rounded-xl max-w-14 max-h-14"),
246
296
]),
247
297
])
248
298
}),
···
256
306
}
257
307
258
308
fn view_project(model: Model, id: String) -> Element(Msg) {
259
259
-
let project_style = style.project(model.dark_mode)
260
309
let project =
261
310
model.projects
262
311
|> list.find(fn(project) { project.id == id })
263
263
-
html.div([attribute.style(project_style)], case project {
264
264
-
Ok(project) -> [
265
265
-
cluster.of(html.div, [attribute.style(style.project_bar)], [
266
266
-
html.img([attribute.src(project.img), attribute.style(style.icon)]),
267
267
-
html.h1([], [element.text(project.title)]),
268
268
-
]),
269
269
-
html.p([], [project.summary]),
270
270
-
html.h2([], [element.text("More information will be added eventually..")]),
271
271
-
]
272
272
-
Error(_) -> [
273
273
-
html.h1([attribute.style([#("text-align", "center")])], [
274
274
-
element.text("Invalid project!"),
275
275
-
]),
276
276
-
]
277
277
-
})
312
312
+
html.div(
313
313
+
[
314
314
+
attr.class(
315
315
+
"drop-shadow-md text-xl rounded-xl p-4 mb-4 bg-gray-200 dark:bg-neutral-800 dark:text-neutral-200",
316
316
+
),
317
317
+
],
318
318
+
case project {
319
319
+
Ok(project) -> [
320
320
+
cluster.of(html.div, [attr.class("flex items-center gap-4 pb-1.5")], [
321
321
+
html.img([
322
322
+
attr.src(project.img),
323
323
+
attr.class("rounded-xl max-w-16 max-h-16"),
324
324
+
]),
325
325
+
html.h1([attr.class("text-2xl")], [element.text(project.title)]),
326
326
+
]),
327
327
+
html.p([], [project.summary]),
328
328
+
html.h2([], [
329
329
+
element.text("More information will be added eventually.."),
330
330
+
]),
331
331
+
]
332
332
+
Error(_) -> [
333
333
+
html.h1([attr.class("text-center")], [element.text("Invalid project!")]),
334
334
+
]
335
335
+
},
336
336
+
)
278
337
}
279
338
280
339
fn view_posts(model: Model) -> Element(Msg) {
281
281
-
let post_style = style.post(model.dark_mode)
282
282
-
283
340
let posts =
284
341
model.posts
285
342
|> list.map(fn(post: posts.Post(Msg)) {
286
286
-
ui.stack([attribute.style(post_style)], [
287
287
-
cluster.of(
288
288
-
html.div,
289
289
-
[
290
290
-
attribute.style([
291
291
-
#("display", "flex"),
292
292
-
#("align-items", "center"),
293
293
-
#("gap", "1em"),
343
343
+
ui.stack(
344
344
+
[
345
345
+
attr.class(
346
346
+
"drop-shadow-md text-xl rounded-xl p-4 mb-4 bg-gray-200 dark:bg-neutral-800 dark:text-neutral-200",
347
347
+
),
348
348
+
],
349
349
+
[
350
350
+
cluster.of(html.div, [attr.class("flex items-center gap-4")], [
351
351
+
html.h1([attr.class("text-2xl")], [
352
352
+
common.link(post.title, "posts/" <> post.id),
294
353
]),
295
295
-
],
296
296
-
[
297
297
-
html.h1([], [common.link(post.title, "posts/" <> post.id)]),
298
298
-
html.p([attribute.style([#("color", "gray")])], [
354
354
+
html.p([attr.class("text-neutral-500")], [
299
355
element.text("Author: " <> post.author),
300
356
]),
301
301
-
html.p([attribute.style([#("color", "gray")])], [
357
357
+
html.p([attr.class("text-neutral-500")], [
302
358
element.text(
303
359
"Date Posted: " <> post.date_posted |> common.day_to_string,
304
360
),
305
361
]),
306
306
-
],
307
307
-
),
308
308
-
html.p([], [post.summary]),
309
309
-
])
362
362
+
]),
363
363
+
html.p([], [post.summary]),
364
364
+
],
365
365
+
)
310
366
})
311
311
-
html.div([], posts)
367
367
+
html.div([], [
368
368
+
common.warning(
369
369
+
"Quick Apology!",
370
370
+
"Due to not having a proper markdown renderer implmented, the posts currently look a bit awful as I'm too lazy to style them manually. Sorry if this makes it harder to read!",
371
371
+
),
372
372
+
..posts
373
373
+
])
312
374
}
313
375
314
376
fn view_post(model: Model, id: String) -> Element(Msg) {
315
315
-
let post_style = style.post(model.dark_mode)
316
316
-
317
377
let post =
318
378
model.posts
319
379
|> list.find(fn(post) { post.id == id })
320
320
-
html.div([attribute.style(post_style)], case post {
321
321
-
Ok(post) -> [
322
322
-
cluster.of(
323
323
-
html.div,
324
324
-
[
325
325
-
attribute.style([
326
326
-
#("display", "flex"),
327
327
-
#("align-items", "center"),
328
328
-
#("gap", "1em"),
329
329
-
]),
330
330
-
],
331
331
-
[
380
380
+
html.div(
381
381
+
[
382
382
+
attr.class(
383
383
+
"drop-shadow-md text-xl rounded-xl p-4 mb-4 bg-gray-200 dark:bg-neutral-800 dark:text-neutral-200",
384
384
+
),
385
385
+
],
386
386
+
case post {
387
387
+
Ok(post) -> [
388
388
+
cluster.of(html.div, [attr.class("flex items-center gap-4")], [
332
389
html.h1([], [element.text(post.title)]),
333
333
-
html.p([attribute.style([#("color", "gray")])], [
390
390
+
html.p([attr.class("text-neutral-500")], [
334
391
element.text("Author: " <> post.author),
335
392
]),
336
336
-
html.p([attribute.style([#("color", "gray")])], [
393
393
+
html.p([attr.class("text-neutral-500")], [
337
394
element.text(
338
395
"Date Posted: " <> post.date_posted |> common.day_to_string,
339
396
),
340
397
]),
341
341
-
],
342
342
-
),
343
343
-
html.hr([]),
344
344
-
html.div([], [post.content]),
345
345
-
]
346
346
-
Error(_) -> [
347
347
-
html.h1([attribute.style([#("text-align", "center")])], [
348
348
-
element.text("Invalid post!"),
349
349
-
]),
350
350
-
]
351
351
-
})
398
398
+
]),
399
399
+
html.hr([]),
400
400
+
html.div([], [post.content]),
401
401
+
]
402
402
+
Error(_) -> [
403
403
+
html.h1([attr.class("text-center")], [element.text("Invalid post!")]),
404
404
+
]
405
405
+
},
406
406
+
)
352
407
}
+24
-1
src/website/common.gleam
···
5
5
import lustre/element/html
6
6
7
7
pub fn link(text: String, link: String) -> element.Element(a) {
8
8
-
html.a([attr.href(link), attr.style([#("color", "#f380b1")])], [
8
8
+
html.a([attr.href(link), attr.class("text-pink-400 underline")], [
9
9
element.text(text),
10
10
])
11
11
+
}
12
12
+
13
13
+
pub fn warning(title: String, contents: String) -> element.Element(a) {
14
14
+
html.div(
15
15
+
[
16
16
+
attr.class(
17
17
+
"bg-red-300 dark:bg-red-700 rounded-xl border-2 border-red-950 mb-4",
18
18
+
),
19
19
+
],
20
20
+
[
21
21
+
html.h3(
22
22
+
[
23
23
+
attr.class(
24
24
+
"bg-red-400 dark:bg-red-800 rounded-t-xl text-2xl underline p-1 dark:text-neutral-200 border-b-2 border-red-950 ",
25
25
+
),
26
26
+
],
27
27
+
[element.text(title)],
28
28
+
),
29
29
+
html.p([attr.class("text-xl p-1 dark:text-neutral-100")], [
30
30
+
element.text(contents),
31
31
+
]),
32
32
+
],
33
33
+
)
11
34
}
12
35
13
36
pub fn day_to_string(day: Day) -> String {
-169
src/website/style.gleam
···
1
1
-
pub const page_padding: List(#(String, String)) = [
2
2
-
#("margin-left", "25vh"), #("margin-right", "25vh"),
3
3
-
]
4
4
-
5
5
-
pub fn page(dark_mode: Bool) -> List(#(String, String)) {
6
6
-
case dark_mode {
7
7
-
True -> [
8
8
-
#("font-family", "\"Inter\", sans-serif"),
9
9
-
#("font-weight", "400"),
10
10
-
#("font-style", "normal"),
11
11
-
#("min-height", "100vh"),
12
12
-
#("background-color", "#151515"),
13
13
-
#("padding", "3vh"),
14
14
-
]
15
15
-
False -> [
16
16
-
#("font-family", "\"Inter\", sans-serif"),
17
17
-
#("font-weight", "400"),
18
18
-
#("font-style", "normal"),
19
19
-
#("min-height", "100vh"),
20
20
-
#("padding", "3vh"),
21
21
-
]
22
22
-
}
23
23
-
}
24
24
-
25
25
-
pub fn navbar(dark_mode: Bool) -> List(#(String, String)) {
26
26
-
case dark_mode {
27
27
-
True -> [
28
28
-
#("display", "flex"),
29
29
-
#("background-color", "#1e1e1e"),
30
30
-
#("border-radius", "1em"),
31
31
-
#("padding", "1em"),
32
32
-
#("margin-bottom", "3vh"),
33
33
-
#("justify-conten", "center"),
34
34
-
#("align-items", "center"),
35
35
-
#("gap", "1em"),
36
36
-
#("border", "0"),
37
37
-
#("flex-grow", "1"),
38
38
-
]
39
39
-
False -> [
40
40
-
#("display", "flex"),
41
41
-
#("background-color", "#cae4e7"),
42
42
-
#("border-radius", "1em"),
43
43
-
#("padding", "1em"),
44
44
-
#("margin-bottom", "3vh"),
45
45
-
#("justify-conten", "center"),
46
46
-
#("align-items", "center"),
47
47
-
#("gap", "1em"),
48
48
-
#("border", "0"),
49
49
-
#("flex-grow", "1"),
50
50
-
]
51
51
-
}
52
52
-
}
53
53
-
54
54
-
pub fn button(dark_mode: Bool) -> List(#(String, String)) {
55
55
-
case dark_mode {
56
56
-
True -> [
57
57
-
#("background-color", "#1e1e1e"),
58
58
-
#("border-radius", "1em"),
59
59
-
#("padding", "1em"),
60
60
-
#("margin-bottom", "3vh"),
61
61
-
#("justify-conten", "center"),
62
62
-
#("align-items", "center"),
63
63
-
#("aspect-ratio", "1 / 1"),
64
64
-
#("border", "0"),
65
65
-
#("width", "6%"),
66
66
-
]
67
67
-
False -> [
68
68
-
#("background-color", "#cae4e7"),
69
69
-
#("border-radius", "1em"),
70
70
-
#("padding", "1em"),
71
71
-
#("margin-bottom", "3vh"),
72
72
-
#("justify-conten", "center"),
73
73
-
#("align-items", "center"),
74
74
-
#("aspect-ratio", "1 / 1"),
75
75
-
#("border", "0"),
76
76
-
#("width", "6%"),
77
77
-
]
78
78
-
}
79
79
-
}
80
80
-
81
81
-
pub fn navitem(dark_mode: Bool) -> List(#(String, String)) {
82
82
-
case dark_mode {
83
83
-
True -> [
84
84
-
#("text-decoration", "none"),
85
85
-
#("background-color", "#151515"),
86
86
-
#("padding", "0.75em"),
87
87
-
#("border-radius", "1em"),
88
88
-
#("color", "#dcdcdc"),
89
89
-
]
90
90
-
False -> [
91
91
-
#("text-decoration", "none"),
92
92
-
#("background-color", "#b8cfd2"),
93
93
-
#("padding", "0.75em"),
94
94
-
#("border-radius", "1em"),
95
95
-
#("color", "black"),
96
96
-
]
97
97
-
}
98
98
-
}
99
99
-
100
100
-
pub fn home(dark_mode: Bool) -> List(#(String, String)) {
101
101
-
case dark_mode {
102
102
-
True -> [
103
103
-
#("background-color", "#1e1e1e"),
104
104
-
#("border-radius", "1em"),
105
105
-
#("padding", "1em"),
106
106
-
#("margin-bottom", "1em"),
107
107
-
#("font-size", "1.25em"),
108
108
-
#("color", "#dcdcdc"),
109
109
-
]
110
110
-
False -> [
111
111
-
#("background-color", "#cae4e7"),
112
112
-
#("border-radius", "1em"),
113
113
-
#("padding", "1em"),
114
114
-
#("margin-bottom", "1em"),
115
115
-
#("font-size", "1.25em"),
116
116
-
]
117
117
-
}
118
118
-
}
119
119
-
120
120
-
pub const icon: List(#(String, String)) = [
121
121
-
#("max-width", "4em"), #("max-height", "4em"), #("border-radius", "1em"),
122
122
-
]
123
123
-
124
124
-
pub fn project(dark_mode: Bool) -> List(#(String, String)) {
125
125
-
case dark_mode {
126
126
-
True -> [
127
127
-
#("background-color", "#1e1e1e"),
128
128
-
#("border-radius", "1em"),
129
129
-
#("padding", "1em"),
130
130
-
#("margin-bottom", "1em"),
131
131
-
#("color", "#dcdcdc"),
132
132
-
]
133
133
-
False -> [
134
134
-
#("background-color", "#cae4e7"),
135
135
-
#("border-radius", "1em"),
136
136
-
#("padding", "1em"),
137
137
-
#("margin-bottom", "1em"),
138
138
-
]
139
139
-
}
140
140
-
}
141
141
-
142
142
-
pub const project_bar: List(#(String, String)) = [
143
143
-
#("display", "flex"), #("align-items", "center"), #("gap", "1em"),
144
144
-
]
145
145
-
146
146
-
pub fn post(dark_mode: Bool) -> List(#(String, String)) {
147
147
-
case dark_mode {
148
148
-
True -> [
149
149
-
#("background-color", "#1e1e1e"),
150
150
-
#("border-radius", "1em"),
151
151
-
#("padding", "1em"),
152
152
-
#("margin-bottom", "1em"),
153
153
-
#("color", "#dcdcdc"),
154
154
-
]
155
155
-
False -> [
156
156
-
#("background-color", "#cae4e7"),
157
157
-
#("border-radius", "1em"),
158
158
-
#("padding", "1em"),
159
159
-
#("margin-bottom", "1em"),
160
160
-
]
161
161
-
}
162
162
-
}
163
163
-
164
164
-
pub fn link(dark_mode: Bool) -> List(#(String, String)) {
165
165
-
case dark_mode {
166
166
-
True -> [#("text-decoration", "underline"), #("color", "#dcdcdc")]
167
167
-
False -> [#("text-decoration", "underline"), #("color", "black")]
168
168
-
}
169
169
-
}
+8
tailwind.config.js
···
1
1
+
module.exports = {
2
2
+
content: ["./index.html", "./src/**/*.{gleam,mjs}"],
3
3
+
theme: {
4
4
+
extend: {},
5
5
+
},
6
6
+
plugins: [],
7
7
+
darkMode: 'selector'
8
8
+
};