Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains generic things to be used in *View.hs
and *ViewInternal.hs files. If you wanna add stuff really specific
to the game and that is used among various *View.hs files, put it
in hs
This module is the base for other View modules, meaning almost all other *View* modules depend on this module. |
Synopsis
- newtype Styled a = Styled (Writer (Set MisoString) a)
- emitTopLevelStyle :: MisoString -> Styled ()
- renderStyledView :: Styled (View a) -> View a
- data AnimationData = AnimationData {}
- animationData :: MisoString -> MisoString -> MisoString -> AnimationData
- animDataToStyle :: AnimationData -> Attribute a
- textMainColor :: MisoString
- textRawStyle :: [(MisoString, MisoString)]
- textStyle :: Map MisoString MisoString
- data Position
- flexColumnStyle :: Map MisoString MisoString
- flexLineStyle :: Map MisoString MisoString
- imgCell :: MisoString -> View a
- imgCellwh :: MisoString -> Int -> Int -> Maybe Position -> View a
- keyframes :: MisoString -> MisoString -> [(Int, String)] -> MisoString -> MisoString
- keyframed :: ([Attribute a] -> View a) -> MisoString -> AnimationData -> Styled (View a)
- fade :: ([Attribute a] -> View a) -> Maybe Nat -> Nat -> Fade -> Styled (View a)
- textFrames :: MisoString -> (Int, MisoString, Bool) -> (Int, MisoString, Bool) -> MisoString
- grow :: MisoString -> (Int, Int) -> (Int, Int) -> MisoString
- wobblev :: MisoString -> Bool -> Int -> Int -> MisoString
- noDrag :: Attribute a
- marginhv :: Int -> Int -> Map MisoString MisoString
- margintrbl :: Int -> Int -> Int -> Int -> Map MisoString MisoString
- marginifyhv :: Int -> Int -> View a -> View a
- px :: Int -> MisoString
- rgba :: Int -> Int -> Int -> MisoString
- stytextz :: Int -> MisoString -> View a
- stytextzhv :: Int -> MisoString -> Int -> Int -> View a
- stytextztrbl :: Int -> MisoString -> Int -> Int -> Int -> Int -> View a
- tilezprb :: Int -> Position -> Int -> Int -> Map MisoString MisoString
- zplt :: Int -> Position -> Int -> Int -> Map MisoString MisoString
- pltwh :: Position -> Int -> Int -> Int -> Int -> Map MisoString MisoString
- zpltwh :: Int -> Position -> Int -> Int -> Int -> Int -> Map MisoString MisoString
- zprb :: Int -> Position -> Int -> Int -> Map MisoString MisoString
- zprbwh :: Int -> Position -> Int -> Int -> Int -> Int -> Map MisoString MisoString
- zpwh :: Int -> Position -> Int -> Int -> Map MisoString MisoString
Documentation
Styled (Writer (Set MisoString) a) |
Instances
Monad Styled # | |
Functor Styled # | |
Applicative Styled # | |
MonadWriter (Set MisoString) Styled # | |
Defined in ViewInternal writer :: (a, Set MisoString) -> Styled a # tell :: Set MisoString -> Styled () # listen :: Styled a -> Styled (a, Set MisoString) # pass :: Styled (a, Set MisoString -> Set MisoString) -> Styled a # |
emitTopLevelStyle :: MisoString -> Styled () #
renderStyledView :: Styled (View a) -> View a #
data AnimationData #
Data for creating a CSS animation
:: MisoString | The animation's name |
-> MisoString | The animation's duration |
-> MisoString | The animation's timing function |
-> AnimationData |
Creates an AnimationData
requiring the minimal fields
animDataToStyle :: AnimationData -> Attribute a #
textRawStyle :: [(MisoString, MisoString)] #
imgCell :: MisoString -> View a #
imgCellwh :: MisoString -> Int -> Int -> Maybe Position -> View a #
An image with the given width and height, in pixels
keyframes :: MisoString -> MisoString -> [(Int, String)] -> MisoString -> MisoString #
:: ([Attribute a] -> View a) | How to build the element |
-> MisoString | The keyframes, for example built with |
-> AnimationData | How to display the animation |
-> Styled (View a) |
:: ([Attribute a] -> View a) | How to build the element |
-> Maybe Nat | The delay at which the animation starts, in seconds. |
-> Nat | The duration, in seconds |
-> Fade | |
-> Styled (View a) |
fade builder delay duration fade
builds a view that fades
for duration
seconds after delay
.
textFrames :: MisoString -> (Int, MisoString, Bool) -> (Int, MisoString, Bool) -> MisoString #
grow :: MisoString -> (Int, Int) -> (Int, Int) -> MisoString #
Animation to transition the size and the opacity (from opaque to transparent)
:: MisoString | |
-> Bool | Whether to wobble up or down |
-> Int | The maximum x variation |
-> Int | The maximum y variation |
-> MisoString |
Vertical wobbling
marginhv :: Int -> Int -> Map MisoString MisoString #
A style specifing the horizontal margin (left and right) and vertical | margin (top and bottom). Both sizes are in pixels
margintrbl :: Int -> Int -> Int -> Int -> Map MisoString MisoString #
A style specifing the top, right, bottom, and left margins. | All sizes are in pixels
marginifyhv :: Int -> Int -> View a -> View a #
Surrounds an element with a div specifying the left and right margin | and the top and bottom margin. All sizes are in pixels.
px :: Int -> MisoString #
px i = ms i <> "px"
stytextz :: Int -> MisoString -> View a #
Styled text, specifying the z-index and the text
stytextzhv :: Int -> MisoString -> Int -> Int -> View a #
Styled text, specifying the z-index, the text, the left and right margin | (in pixels) and the top and bottom margin (in pixels)
stytextztrbl :: Int -> MisoString -> Int -> Int -> Int -> Int -> View a #
Styled text, specifying the z-index, the text, the left and right margin | (in pixels) and the top and bottom margin (in pixels)
tilezprb :: Int -> Position -> Int -> Int -> Map MisoString MisoString #
A style specifying the z-index, the position,
| the right margin (in cells), and the bottom margin (in pixels) of a tile
| i.e. of a rectangle of size cellPixelSize
.
zplt :: Int -> Position -> Int -> Int -> Map MisoString MisoString #
A style specifying the z-index, the position, | the left margin (in pixels), and the top margin (in pixels)
pltwh :: Position -> Int -> Int -> Int -> Int -> Map MisoString MisoString #
A style specifying the position, the top margin, | the left margin, the width, and the height. All sizes are in pixels
zpltwh :: Int -> Position -> Int -> Int -> Int -> Int -> Map MisoString MisoString #
A style specifying the z-index, the position, the left margin, | the top margin, the width, and the height. All sizes are in pixels
zprb :: Int -> Position -> Int -> Int -> Map MisoString MisoString #
A style specifying the z-index, the position, the right margin, | the bottom margin. All sizes are in pixels
zprbwh :: Int -> Position -> Int -> Int -> Int -> Int -> Map MisoString MisoString #
A style specifying the z-index, the position, the right margin, | the bottom margin, the width, and the height. All sizes are in pixels
zpwh :: Int -> Position -> Int -> Int -> Map MisoString MisoString #
A style specifying the z-index, the position, the width (in pixels), and | the height (in pixels)