starting an experiment with a layout generator
this will likely be in development for a long time, if it ever amounts to anything at allpartial-rewrite
parent
f980028d82
commit
5e931a7481
|
@ -0,0 +1,28 @@
|
|||
import Window
|
||||
|
||||
|
||||
lightLightBlue : Color
|
||||
lightLightBlue = rgba 114 159 207 0.5 -- lightBlue with alpha=0.5
|
||||
|
||||
|
||||
main : Signal Element
|
||||
main = background <~ Window.dimensions
|
||||
|
||||
|
||||
background : (Int, Int) -> Element
|
||||
background (w,h) =
|
||||
let (xMax, yMax) = (toFloat w / 2, toFloat h / 2)
|
||||
vtLine color = segment (0, -yMax) (0, yMax) |> traced (dashed color)
|
||||
htLine color = segment (-xMax, 0) (xMax, 0) |> traced (dashed color)
|
||||
vLineOffsets space = [floor (-xMax/space)..floor (xMax/space)]
|
||||
hLineOffsets space = [floor (-yMax/space)..floor (yMax/space)]
|
||||
in color lightGray <| collage w h (
|
||||
vtLine black :: htLine black ::
|
||||
(map (\x -> vtLine (if mod x 2 == 1 then lightBlue else lightLightBlue)
|
||||
|> move (toFloat x * 35, 0))
|
||||
(vLineOffsets 35)) ++
|
||||
(map (\y -> htLine (if mod y 2 == 1 then lightBlue else lightLightBlue)
|
||||
|> move (0, toFloat y * 35))
|
||||
(hLineOffsets 35))
|
||||
)
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
This might eventually become a layout generator :) . Until then, it's an
|
||||
experiment.
|
||||
|
||||
## TODO:
|
||||
- update readme with useful information (once we've gotten anywhere)
|
||||
|
Loading…
Reference in New Issue