summaryrefslogtreecommitdiff
path: root/client/src/client.gleam
blob: f6856650b4725fda56d69365d88dd05afbf6ea95 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import gleam/list
import lustre
import lustre/attribute
import lustre/element/html
import lustre/ui

pub fn main() {
  let categories = ["All", "Anime", "Manga", "Light Novels"]
  let app =
    lustre.element(
      ui.cluster([], [
        html.a([attribute.href("/")], [html.text("yuna.news")]),
        html.div([], [
          html.a([attribute.href("/?search=")], [html.text("Search")]),
          html.a([attribute.href("/followings")], [html.text("Following")]),
          html.a([attribute.href("/settings")], [html.text("Settings")]),
        ]),
        html.div([], [
          html.div([], [
            html.div([], [
              html.a([attribute.href("/?period=today&before=")], [
                html.text("Today"),
              ]),
              html.a([attribute.href("/?period=yesterday&before=&after=")], [
                html.text("Yesterday"),
              ]),
            ]),
            html.div([], [
              html.a([attribute.href("/?view=GroupView")], [
                html.text("GroupView"),
              ]),
              html.a([attribute.href("/?view=ListCompactView")], [
                html.text("ListCompactView"),
              ]),
              html.a([attribute.href("/?view=ListExpandedView")], [
                html.text("ListExpandedView"),
              ]),
            ]),
          ]),
          html.div(
            [],
            categories
              |> list.map(fn(category) {
                html.a([attribute.href("/?folder=" <> category)], [
                  html.text(category),
                ])
              }),
          ),
        ]),
      ]),
    )

  let assert Ok(_) = lustre.start(app, "#app", Nil)

  Nil
}