Adding category filtering, style tweaks.
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
b5ccef5679
commit
2edd612119
|
@ -11,6 +11,10 @@
|
||||||
body {
|
body {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.app-headings {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
.background {
|
.background {
|
||||||
background-color: none;
|
background-color: none;
|
||||||
}
|
}
|
||||||
|
@ -25,6 +29,18 @@ i.fas, i.fab {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Categories */
|
||||||
|
|
||||||
|
.category-tile {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.category-tile:hover {
|
||||||
|
color: var(--white);
|
||||||
|
background-color: var(--light-blue);
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Cards */
|
/* Cards */
|
||||||
|
|
||||||
.app-category {
|
.app-category {
|
||||||
|
@ -107,9 +123,11 @@ i.fas, i.fab {
|
||||||
/* Navbar */
|
/* Navbar */
|
||||||
.navbar-text {
|
.navbar-text {
|
||||||
color: var(--dark-blue);
|
color: var(--dark-blue);
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar {
|
.navbar {
|
||||||
|
margin: auto;
|
||||||
background-color: var(--light-pink);
|
background-color: var(--light-pink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,7 @@ type Category
|
||||||
| Utilities
|
| Utilities
|
||||||
| Development
|
| Development
|
||||||
| Graveyard
|
| Graveyard
|
||||||
|
| All
|
||||||
|
|
||||||
|
|
||||||
categories : Enum Category
|
categories : Enum Category
|
||||||
|
@ -76,6 +77,7 @@ categories =
|
||||||
[ ( "Apps", Apps )
|
[ ( "Apps", Apps )
|
||||||
, ( "Utilities", Utilities )
|
, ( "Utilities", Utilities )
|
||||||
, ( "Development", Development )
|
, ( "Development", Development )
|
||||||
|
, ("All", All)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,6 +123,9 @@ filterAppsCategory : List App -> Maybe Category -> List App
|
||||||
filterAppsCategory apps category =
|
filterAppsCategory apps category =
|
||||||
case category of
|
case category of
|
||||||
Just c ->
|
Just c ->
|
||||||
|
if c == All then
|
||||||
|
apps
|
||||||
|
else
|
||||||
List.filter (\app ->
|
List.filter (\app ->
|
||||||
app.category == categories.toString c
|
app.category == categories.toString c
|
||||||
) apps
|
) apps
|
||||||
|
@ -304,9 +309,9 @@ viewApp app =
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
viewCategories : (String, Category) -> Html msg
|
viewCategories : (String, Category) -> Html Msg
|
||||||
viewCategories category =
|
viewCategories category =
|
||||||
div [] [text (Tuple.first category)]
|
div [ class "category-tile", onClick (FilterCategory (Tuple.first category)) ] [text (Tuple.first category)]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -331,7 +336,8 @@ viewApps model =
|
||||||
Success ->
|
Success ->
|
||||||
div [ class "row justify-content-center" ]
|
div [ class "row justify-content-center" ]
|
||||||
[ div [ class "col-md-3" ] [
|
[ div [ class "col-md-3" ] [
|
||||||
div [] (List.map viewCategories categories.list)
|
h2 [ class "app-headings" ] [text "Categories"]
|
||||||
|
, div [] (List.map viewCategories categories.list)
|
||||||
]
|
]
|
||||||
, div [ class "col-md-6" ]
|
, div [ class "col-md-6" ]
|
||||||
[ div [ class "row" ]
|
[ div [ class "row" ]
|
||||||
|
@ -353,6 +359,7 @@ viewApps model =
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
, h2 [ class "app-headings" ] [ text "Apps" ]
|
||||||
, div [ class "row" ]
|
, div [ class "row" ]
|
||||||
(List.map viewApp
|
(List.map viewApp
|
||||||
(model.results
|
(model.results
|
||||||
|
|
|
@ -71,7 +71,7 @@ view { page, toMsg } model =
|
||||||
[ div [ class "background" ]
|
[ div [ class "background" ]
|
||||||
[ nav
|
[ nav
|
||||||
[ class "navbar navbar-expand-lg sticky-top font-weight-bold" ]
|
[ class "navbar navbar-expand-lg sticky-top font-weight-bold" ]
|
||||||
[ a [ class "navbar-brand navbar-text", href (Route.toString Route.Top) ]
|
[ a [ class "navbar-text", href (Route.toString Route.Top) ]
|
||||||
[ img
|
[ img
|
||||||
[ src "/logo-2.png"
|
[ src "/logo-2.png"
|
||||||
, class "d-inline-block align-top mr-2"
|
, class "d-inline-block align-top mr-2"
|
||||||
|
|
Loading…
Reference in New Issue