@hackage Shpadoinkle-html0.2.0.0
A typed, template generated Html DSL, and helpers.
Categories
License
BSD-3-Clause
Maintainer
fresheyeball@protonmail.com
Links
Versions
Installation
Dependencies (15)
- Shpadoinkle >=0.1 && <0.2
- base >=4.12.0 && <4.16
- bytestring
- compactable
- containers >=0.6.0 && <0.7
- ghcjs-base Show all…
Dependents (4)
@hackage/Shpadoinkle-examples, @hackage/Shpadoinkle-disembodied, @hackage/Shpadoinkle-widgets, @hackage/Shpadoinkle-developer-tools
Shpadoinkle Html
This module provides named functions for generating Html, and other browser utilities.
For example, instead of writing:
view = h "div" [ ("class", PText "foo") ]
[ h "span" [] [ text "hi there" ] ]
You can write:
view = div "foo" [ span_ [ "hi there" ] ]
which is a bit nicer, and eleminates the risk of typeos in tag names. It also
provies some nice IsString instances for ergonomics.
Keyboard
This module provides pattern synonyms for common key codes. For example:
div [ onKeyup $ \case
Enter -> fireLazors
UpArrow -> jump
DownArrow -> crouch
LeftArrow -> move -1
RightArrow -> move 1
]
which is a bit nicer, and harder to get wrong than using magic int's to identify keys.
Browser utilities
We provide high-level APIs to lower-level browser APIs. Including:
- Local Storage
I know it's just one right now. But this is the place to contribute more. Such as:
- Scroll Position
- XHR Requests
- Visibility API
- Notifications
- ect...