app

Safe Haskell None
Language Haskell2010

ViewInternal

Description

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

Documentation

newtype Styled a #

Constructors

Styled (Writer (Set MisoString) a)  
Instances
Monad Styled #  
Instance details

Defined in ViewInternal

Methods

(>>=) :: Styled a -> (a -> Styled b) -> Styled b #

(>>) :: Styled a -> Styled b -> Styled b #

return :: a -> Styled a #

fail :: String -> Styled a #

Functor Styled #  
Instance details

Defined in ViewInternal

Methods

fmap :: (a -> b) -> Styled a -> Styled b #

(<$) :: a -> Styled b -> Styled a #

Applicative Styled #  
Instance details

Defined in ViewInternal

Methods

pure :: a -> Styled a #

(<*>) :: Styled (a -> b) -> Styled a -> Styled b #

liftA2 :: (a -> b -> c) -> Styled a -> Styled b -> Styled c #

(*>) :: Styled a -> Styled b -> Styled b #

(<*) :: Styled a -> Styled b -> Styled a #

MonadWriter (Set MisoString) Styled #  
Instance details

Defined in ViewInternal

Methods

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 #

animationData #

Arguments

:: MisoString

The animation's name

-> MisoString

The animation's duration

-> MisoString

The animation's timing function

-> AnimationData  

Creates an AnimationData requiring the minimal fields

data Position #

Constructors

Absolute  
Relative  
Instances
Show Position #  
Instance details

Defined in ViewInternal

Methods

showsPrec :: Int -> Position -> ShowS #

show :: Position -> String #

showList :: [Position] -> ShowS #

imgCellwh :: MisoString -> Int -> Int -> Maybe Position -> View a #

An image with the given width and height, in pixels

keyframed #

Arguments

:: ([Attribute a] -> View a)

How to build the element

-> MisoString

The keyframes, for example built with keyframes

-> AnimationData

How to display the animation

-> Styled (View a)  

fade #

Arguments

:: ([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

Whether it's a fadein (True), or a fadeout (False)

-> Styled (View a)  

fade builder delay duration fade builds a view that fades for duration seconds after delay.

grow :: MisoString -> (Int, Int) -> (Int, Int) -> MisoString #

Animation to transition the size and the opacity (from opaque to transparent)

wobblev #

Arguments

:: 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"

rgba :: Int -> Int -> Int -> MisoString #

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)