Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI obj panel #7

Merged
merged 9 commits into from
Jul 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
making good progress on implementing the tree structure
  • Loading branch information
kurtlawrence committed Jul 11, 2023
commit e5a5dc326ed1ccb9972aa3ad158f710c4699896a
61 changes: 59 additions & 2 deletions elm/Cmn.elm
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
module Cmn exposing (..)

import Html.Styled as Html
import Html.Styled.Events exposing (on)
import Css exposing (..)
import Html.Styled as Html exposing (..)
import Html.Styled.Attributes as Attr exposing (css)
import Html.Styled.Events exposing (on, onClick)
import Json.Decode
import Style
import Task


@@ -24,6 +27,60 @@ maybeFilter pred =



-- UI


type alias Popup a =
{ header : String
, body : Html.Html a
, cancelMsg : String
, onCancel : a
, okMsg : String
, onOk : a
}


popup : Popup a -> Html.Html a
popup { header, body, cancelMsg, onCancel, okMsg, onOk } =
div
[ css
[ position fixed
, zIndex (int 20)
, top (vh 50)
, left (pct 50)
, padding2 (px 20) (px 40)
, backgroundColor Style.theme.bg2
, border3 (px 5) solid Style.theme.ac2
, borderRadius (px 20)
, transform (translate2 (pct -50) (pct -50))
]
]
[ h3 [] [ text header ]
, body
, div
[ css
[ marginTop (px 20)
, displayFlex
, justifyContent end
]
]
[ Style.btnBordered
[ onClick onCancel
, css [ hover [ backgroundColor Style.theme.ac2 ] ]
]
[ text cancelMsg ]
, Style.btnBordered
[ onClick onOk
, css
[ marginLeft (px 20)
, hover [ backgroundColor Style.theme.ac2 ]
]
]
[ text okMsg ]
]
]


onEnter : msg -> Html.Attribute msg
onEnter m =
on "keydown"
Loading