Skip to content

Commit

Permalink
style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zazedd committed May 21, 2023
1 parent 4417ca5 commit 1893453
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 66 deletions.
58 changes: 30 additions & 28 deletions src/Admin.elm
Original file line number Diff line number Diff line change
Expand Up @@ -128,37 +128,39 @@ tableUsers users =

admin : Model -> Html Msg
admin model =
div [ class "admin-content" ]
div []
[ sidebar model
, p [ id "admintitle" ]
[ text "Admin dashboard" ]
, div
[ class "admin-content" ]
[ div
[ style "display" "flex"
, style "justify-content" "center"
, style "align-items"
"center"
, style
"width"
"100%"
, style "margin" "15px"
]
[ p [ style "margin" "0" ] [ text "Admins can change or delete users" ]
, button [ class "btn btn-primary", onClick DownloadPdf, style "margin-left" "10px" ] [ text "Export Pdf" ]
]
, table [ class "table" ]
[ thead [ style "margin-bottom" "100px" ]
[ tr []
[ th [ class "table-dark" ] [ text "Id" ]
, th [ class "table-dark" ] [ text "Username" ]
, th [ class "table-dark" ] [ text "Email" ]
, th [ class "table-dark" ] [ text "Role" ]
, th [ class "table-dark" ] [ text "Update" ]
, th [ class "table-dark" ] [ text "Delete" ]
, div [ class "admin-content" ]
[ p [ id "admintitle" ]
[ text "Admin dashboard" ]
, div
[ class "admin-content" ]
[ div
[ style "display" "flex"
, style "justify-content" "center"
, style "align-items"
"center"
, style
"width"
"100%"
, style "margin" "15px"
]
[ p [ style "margin" "0" ] [ text "Admins can change or delete users" ]
, button [ class "btn btn-primary", onClick DownloadPdf, style "margin-left" "10px" ] [ text "Export Pdf" ]
]
, table [ class "table" ]
[ thead [ style "margin-bottom" "100px" ]
[ tr []
[ th [ class "table-dark" ] [ text "Id" ]
, th [ class "table-dark" ] [ text "Username" ]
, th [ class "table-dark" ] [ text "Email" ]
, th [ class "table-dark" ] [ text "Role" ]
, th [ class "table-dark" ] [ text "Update" ]
, th [ class "table-dark" ] [ text "Delete" ]
]
]
, tbody [] (tableUsers model.dashboardUsers)
]
, tbody [] (tableUsers model.dashboardUsers)
]
]
]
66 changes: 37 additions & 29 deletions src/Dashboard.elm
Original file line number Diff line number Diff line change
Expand Up @@ -56,36 +56,44 @@ playlists =

dashboard : Model -> Html Msg
dashboard model =
div []
[ sidebar model
, p [ id "admintitle" ]
[ text "Admin dashboard" ]
, div
[ class "admin-content" ]
[ div
[ style "display" "flex"
, style "justify-content" "center"
, style "align-items"
"center"
, style
"width"
"100%"
, style "margin" "15px"
]
[ p [ style "margin" "0" ] [ text "This are your playlists" ]
]
, table [ class "table" ]
[ thead [ style "margin-bottom" "100px" ]
[ tr []
[ -- th [ class "table-dark" ] [ text "Id" ]
th [ class "table-dark" ] [ text "Name" ]
, th [ class "table-dark" ] [ text "Url" ]
div [] [
sidebar model
, div [ class "dashboard-content" ] (
case model.user of
Nothing -> [
div [ class "center-content" ] [ text "Please login first!" ] ]

Just _ -> [
p [ id "admintitle" ]
[ text "Dashboard" ]
, div
[ class "admin-content" ]
[ div
[ style "display" "flex"
, style "justify-content" "center"
, style "align-items"
"center"
, style
"width"
"100%"
, style "margin" "15px"
]
[ p [ style "margin" "0" ] [ text "These are your playlists" ]
]
, table [ class "table" ]
[ thead [ style "margin-bottom" "100px" ]
[ tr []
[ -- th [ class "table-dark" ] [ text "Id" ]
th [ class "table-dark" ] [ text "Name" ]
, th [ class "table-dark" ] [ text "Url" ]

-- , th [ class "table-dark" ] [ text "User Id" ]
, th [ class "table-dark" ] [ text "Delete" ]
-- , th [ class "table-dark" ] [ text "User Id" ]
, th [ class "table-dark" ] [ text "Delete" ]
]
]
, tbody [] (playlists model.playlistsStored)
]
, tbody [] (playlists model.playlistsStored)
]
]
]
])
]

4 changes: 2 additions & 2 deletions src/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ init flags url key =
, user = flags.user
, dashboardUsers = []
, token = flags.token
, mood = -1
, genre = ""
, mood = 5
, genre = "Rock"
, divvis = visibleController ()
, playlist = Nothing
, tracks = Nothing
Expand Down
5 changes: 3 additions & 2 deletions src/Mood.elm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ moodSelector model =
, step "1"
, id "emotionalRange"
, disabled (not model.divvis.visible1)
, value "3"
, onInput
(\v ->
MoodUpdate
Expand Down Expand Up @@ -140,6 +139,8 @@ playlistShow model =
div []
[ text "No playlist name"
]

, Html.hr [ ] []
, div [ class "playlist-scroll" ]
(List.indexedMap
(\index track ->
Expand All @@ -160,7 +161,7 @@ playlistShow model =
]
]
]
, Html.hr [] []
, Html.hr [ class "divider" ] []
]
)
track.image
Expand Down
38 changes: 33 additions & 5 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,26 @@ body {
align-items: center;
}

.sidebar:hover ~ .main-content {
filter: blur(5px);
}

.admin-content {
background-color: #111;
padding: 20px;
height: 100vh;
display: flex;
filter: blur(0);
transition: filter 0.5s ease;
flex-direction: column;
justify-content: center;
align-items: center;
}

.sidebar:hover ~ .admin-content {
filter: blur(5px);
}

table {
border-spacing: 10px;
}
Expand All @@ -173,10 +184,6 @@ table {
margin-left: 40px;
}

.dashboard:hover ~ .main-content {
filter: blur(5px);
}

#title {
font-family: "Unbounded";
margin-top: 10px;
Expand Down Expand Up @@ -248,6 +255,27 @@ table {
text-align: right;
}

.dashboard-content {
background-color: #111;
margin-left: 3%;
padding: 20px;
height: 100vh;
filter: blur(0);
transition: filter 0.5s ease;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.sidebar:hover ~ .dashboard-content {
filter: blur(5px);
}

#pls-login {
margin: auto;
}

.track-space {
margin-left: 20px;
display: grid;
Expand All @@ -273,7 +301,7 @@ table {
#playlist-header {
display: flex;
align-items: left;
margin-bottom: 40px;
margin-bottom: 20px;
margin-left: 20px;
white-space: nowrap;
margin-top: 15px;
Expand Down

0 comments on commit 1893453

Please sign in to comment.