mirror of
https://github.com/mdgriffith/elm-ui.git
synced 2024-10-26 09:56:12 +03:00
Compare commits
3 Commits
449c536994
...
df1b3d004b
Author | SHA1 | Date | |
---|---|---|---|
|
df1b3d004b | ||
|
81c67b5ed4 | ||
|
e8299d5fe6 |
@ -1,14 +1,11 @@
|
||||
module Internal.Model2 exposing (..)
|
||||
|
||||
import Animator
|
||||
import Browser.Dom
|
||||
import Color
|
||||
import Html
|
||||
import Html.Attributes as Attr
|
||||
import Html.Events as Events
|
||||
import Html.Keyed
|
||||
import Html.Lazy
|
||||
import Internal.BitEncodings as Bits
|
||||
import Internal.BitField as BitField exposing (BitField)
|
||||
import Internal.Bits.Analyze as AnalyzeBits
|
||||
import Internal.Bits.Inheritance as Inheritance
|
||||
@ -722,7 +719,12 @@ link details =
|
||||
, additionalInheritance = BitField.none
|
||||
, attrs =
|
||||
[ Attr.href details.url
|
||||
, Attr.rel "noopener noreferrer"
|
||||
, case details.download of
|
||||
Nothing ->
|
||||
Attr.rel "noopener noreferrer"
|
||||
|
||||
Just _ ->
|
||||
Attr.class ""
|
||||
, case details.download of
|
||||
Nothing ->
|
||||
if details.newTab then
|
||||
|
@ -726,6 +726,9 @@ linkNewTab uri =
|
||||
|
||||
|
||||
{-| A link to download a file.
|
||||
|
||||
**Note** This will not work for cross-origin requests unless the server sends the appropriate headers.
|
||||
|
||||
-}
|
||||
download : String -> Attribute msg
|
||||
download uri =
|
||||
|
@ -318,39 +318,18 @@ toAttr trigger incomingCss =
|
||||
|
||||
transitionWithTrigger : Trigger -> Duration -> List Animated -> Attribute msg
|
||||
transitionWithTrigger trigger dur attrs =
|
||||
Animator.css
|
||||
(Animator.Timeline.init []
|
||||
|> Animator.Timeline.to dur attrs
|
||||
|> Animator.Timeline.update (Time.millisToPosix 1)
|
||||
)
|
||||
(\animated ->
|
||||
( animated, [] )
|
||||
)
|
||||
Animator.transition dur attrs
|
||||
|> Animator.toCss
|
||||
|> toAttr trigger
|
||||
|
||||
|
||||
addPsuedoClass : String -> Animator.Css -> Animator.Css
|
||||
addPsuedoClass psuedo css =
|
||||
{ css
|
||||
| hash = css.hash ++ psuedo
|
||||
}
|
||||
|
||||
|
||||
{-| -}
|
||||
transition : Duration -> List Animated -> Attribute msg
|
||||
transition dur attrs =
|
||||
let
|
||||
css =
|
||||
Animator.css
|
||||
(Animator.Timeline.init []
|
||||
|> Animator.Timeline.to dur attrs
|
||||
|> Animator.Timeline.update (Time.millisToPosix 1)
|
||||
)
|
||||
(\animated ->
|
||||
( animated, [] )
|
||||
)
|
||||
in
|
||||
Two.styleList css.props
|
||||
Animator.transition dur attrs
|
||||
|> Animator.toCss
|
||||
|> .props
|
||||
|> Two.styleList
|
||||
|
||||
|
||||
{-| -}
|
||||
|
@ -48,14 +48,15 @@ view model =
|
||||
|
||||
-- , Ui.background (Ui.rgba 255 0 255 1)
|
||||
]
|
||||
[ Theme.h1 "Text"
|
||||
[ Ui.el [ Ui.download "https://picsum.photos/200/300" ]
|
||||
(Theme.h1 "Text")
|
||||
, Ui.Input.text
|
||||
[ Ui.border 2
|
||||
, Ui.borderColor (Ui.rgba 0 0 0 1)
|
||||
, Ui.rounded 10
|
||||
|
||||
-- , Ui.height Ui.fill
|
||||
, Ui.background (Ui.rgba 255 0 255 1)
|
||||
, Ui.background (Ui.rgba 255 230 255 1)
|
||||
]
|
||||
{ onChange = TextUpdated
|
||||
, text = model.text
|
||||
@ -63,5 +64,37 @@ view model =
|
||||
, label =
|
||||
Ui.Input.labelHidden "Type something here..."
|
||||
}
|
||||
, Ui.Input.multiline
|
||||
[ Ui.border 2
|
||||
, Ui.borderColor (Ui.rgba 0 0 0 1)
|
||||
, Ui.rounded 10
|
||||
|
||||
-- , Ui.height Ui.fill
|
||||
, Ui.background (Ui.rgba 255 230 255 1)
|
||||
]
|
||||
{ onChange = TextUpdated
|
||||
, text = model.text
|
||||
, placeholder = Just "Type something here..."
|
||||
, spellcheck = False
|
||||
, label =
|
||||
Ui.Input.labelHidden "Type something here..."
|
||||
}
|
||||
, Ui.Input.multiline
|
||||
[ Ui.border 2
|
||||
, Ui.borderColor (Ui.rgba 0 0 0 1)
|
||||
, Ui.rounded 10
|
||||
, Ui.heightMax 70
|
||||
, Ui.scrollable
|
||||
|
||||
-- , Ui.height Ui.fill
|
||||
, Ui.background (Ui.rgba 255 230 255 1)
|
||||
]
|
||||
{ onChange = TextUpdated
|
||||
, text = model.text
|
||||
, placeholder = Just "Type something here..."
|
||||
, spellcheck = False
|
||||
, label =
|
||||
Ui.Input.labelHidden "Type something here..."
|
||||
}
|
||||
]
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user