Some preliminary rejiggin'

This commit is contained in:
3wc 2023-03-28 01:49:55 -04:00
parent 338da444d8
commit f7ffc49b76
5 changed files with 314 additions and 260 deletions

View File

@ -16,6 +16,7 @@
"elm/url": "1.0.0",
"elm-community/json-extra": "4.3.0",
"elm-community/string-extra": "4.0.1",
"fapian/elm-html-aria": "1.4.0",
"pablohirafuji/elm-markdown": "2.0.5"
},
"indirect": {

480
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -30,6 +30,6 @@
"npm-run-all": "4.1.5"
},
"dependencies": {
"elm-format": "^0.8.5"
"elm-format": "^0.8.6"
}
}

View File

@ -29,7 +29,20 @@ i.fas, i.fab {
}
/* Categories */
/* Filtering */
#filter {
position: fixed;
left: 0;
}
#filter > div {
margin-bottom: 1rem;
}
#filter h3 {
font-size: 18px;
}
.category-tile {
cursor: pointer;
@ -100,31 +113,6 @@ i.fas, i.fab {
}
/* Search bar*/
.search-bar-container {
margin: 2em;
display: flex;
flex-flow: row wrap;
align-items: center;
}
.search-bar-input, .search-dropdown {
margin: 0.5em;
height: calc(1.5em + .75rem + 2px);
background-color: var(--white);
border: 1px solid var(--dark-pink);
border-radius: .5rem;
}
.search-bar-input {
width: 30rem;
}
.search-dropdown {
width: 10rem;
}
/* Navbar */
.navbar-text {
color: var(--dark-blue);
@ -146,3 +134,9 @@ i.fas, i.fab {
.card-body p {
}
}
@media (max-width: 768px) {
#filter {
width: 100%;
position: relative;
}

View File

@ -1,8 +1,9 @@
module Pages.Top exposing (Model, Msg, Params, page)
import Enum exposing (Enum)
import Html exposing (Html, a, button, div, h2, h5, i, img, li, p, span, text, ul, form, label, select, option, input)
import Html exposing (Html, a, button, div, h2, h3, h5, i, img, li, p, span, text, ul, form, label, select, option, input)
import Html.Attributes exposing (alt, class, href, src, style, id, for, value)
import Html.Attributes.Aria exposing (ariaLabel)
import Html.Events exposing (onClick, onInput)
import Http
import Json.Decode as Decode
@ -335,28 +336,34 @@ viewApps model =
Success ->
div [ class "row justify-content-center" ]
[ div [ class "col-md-3" ] [
h2 [ class "app-headings" ] [text "Categories"]
, div [] (List.map viewCategories categories.list)
[ div [ class "col-md-3", id "filter" ] [
h2 [ class "app-headings" ] [text "Filter"]
, form [] [
div [] [
h3 [] [text "Categories"]
, div [] (List.map viewCategories categories.list)
]
, div [] [
h3 [] [text "Search"]
, input [ ariaLabel "search", id "text", onInput FilterText ] []
]
, div [] [
h3 [] [text "Status"]
, select [ class "search-dropdown", id "level", onInput FilterScore ] [
option [ ] [ text "any" ]
, option [ value "5" ] [ text "5 (production)" ]
, option [ value "4" ] [ text "4 (beta)" ]
, option [ value "3" ] [ text "3 (alpha)" ]
, option [ value "2" ] [ text "2 (pre-alpha)" ]
, option [ value "1" ] [ text "1 (work-in-progress)" ]
]
]
]
, div [ class "col-md-6" ]
]
, div [ class "col-md-6 offset-md-3" ]
[ div [ class "row" ]
[ div [ class "col-sm-12" ] [
div [] [
form [ class "search-bar-container" ] [
label [ for "text" ] [ text "Search" ]
, input [ class "search-bar-input", id "text", onInput FilterText ] []
, label [ for "level" ] [ text " and show only items that have at least " ]
, select [ class "search-dropdown", id "level", onInput FilterScore ] [
option [ ] [ text "any" ]
, option [ value "5" ] [ text "5 (production)" ]
, option [ value "4" ] [ text "4 (beta)" ]
, option [ value "3" ] [ text "3 (alpha)" ]
, option [ value "2" ] [ text "2 (pre-alpha)" ]
, option [ value "1" ] [ text "1 (work-in-progress)" ]
]
, text "builds "
]
]
]
]