@@ -8,73 +8,75 @@ import Color exposing (gray, black)
88
99
1010width =
11- 120
11+ 120
1212
1313
1414height =
15- 64
15+ 64
1616
1717
1818plot : Int -> ( Easing , String ) -> Form
1919plot i ( f, name ) =
20- group
21- [ rect width 1 |> filled gray
22- , rect width 1 |> filled gray |> moveY height
23- , path
24- ( List . map ( \ x -> ( x - width / 2 , f ( x / width) * height )) [ 0 .. width] )
25- |> traced ( solid black)
26- -- |> (\ls -> {ls | width = 3}),
27- , Text . fromString name |> text |> moveY ( height + 8 )
28- ]
29- |> move ( ( width + 10 ) * ( i % 6 ) |> toFloat, ( - height - 20 ) * ( i // 6 ) |> toFloat )
20+ group
21+ [ rect width 1 |> filled gray
22+ , rect width 1 |> filled gray |> moveY height
23+ , List . map
24+ ( toFloat >> ( \ x -> ( x - width / 2 , f ( x / width) * height )))
25+ ( List . range 0 ( round width))
26+ |> path
27+ |> traced ( solid black)
28+ -- |> (\ls -> {ls | width = 3}),
29+ , Text . fromString name |> text |> moveY ( height + 8 )
30+ ]
31+ |> move ( ( width + 10 ) * ( i % 6 ) |> toFloat, ( - height - 20 ) * ( i // 6 ) |> toFloat )
3032
3133
3234title =
33- Text . fromString " This is a replication of easings.net for testing purposes. You can see the plots are nearly identical."
34- |> text
35- |> move ( 200 , height + 30 )
35+ Text . fromString " This is a replication of easings.net for testing purposes. You can see the plots are nearly identical."
36+ |> text
37+ |> move ( 200 , height + 30 )
3638
3739
3840main =
39- let
40- forms =
41- title :: List . indexedMap plot easingFunctions
41+ let
42+ forms =
43+ title :: List . indexedMap plot easingFunctions
4244
43- grouped =
44- group forms |> move ( - 200 , 300 )
45- in
46- collage 1000 1000 [ grouped ] |> toHtml
45+ grouped =
46+ group forms |> move ( - 200 , 300 )
47+ in
48+ collage 1000 1000 [ grouped ] |> toHtml
4749
4850
4951easingFunctions =
50- [ ( inSine, " inSine" )
51- , ( outSine, " outSine" )
52- , ( inOutSine, " inOutSine" )
53- , ( inQuad, " inQuad" )
54- , ( outQuad, " outQuad" )
55- , ( inOutQuad, " inOutQuad" )
56- , ( inCubic, " inCubic" )
57- , ( outCubic, " outCubic" )
58- , ( inOutCubic, " inOutCubic" )
59- , ( inQuart, " inQuart" )
60- , ( outQuart, " outQuart" )
61- , ( inOutQuart, " inOutQuart" )
62- , ( inQuint, " inQuint" )
63- , ( outQuint, " outQuint" )
64- , ( inOutQuint, " inOutQuint" )
65- , ( inExpo, " inExpo" )
66- , ( outExpo, " outExpo" )
67- , ( inOutExpo, " inOutExpo" )
68- , ( inCirc, " inCirc" )
69- , ( outCirc, " outCirc" )
70- , ( inOutCirc, " inOutCirc" )
71- , ( inBack, " inBack" )
72- , ( outBack, " outBack" )
73- , ( inOutBack, " inOutBack" )
74- , ( inElastic, " inElastic" )
75- , ( outElastic, " outElastic" )
76- , ( inOutElastic, " inOutElastic" )
77- , ( inBounce, " inBounce" )
78- , ( outBounce, " outBounce" )
79- , ( inOutBounce, " inOutBounce" )
80- ]
52+ [ ( inSine, " inSine" )
53+ , ( outSine, " outSine" )
54+ , ( inOutSine, " inOutSine" )
55+ , ( inQuad, " inQuad" )
56+ , ( outQuad, " outQuad" )
57+ , ( inOutQuad, " inOutQuad" )
58+ , ( inCubic, " inCubic" )
59+ , ( outCubic, " outCubic" )
60+ , ( inOutCubic, " inOutCubic" )
61+ , ( inQuart, " inQuart" )
62+ , ( outQuart, " outQuart" )
63+ , ( inOutQuart, " inOutQuart" )
64+ , ( inQuint, " inQuint" )
65+ , ( outQuint, " outQuint" )
66+ , ( inOutQuint, " inOutQuint" )
67+ , ( inExpo, " inExpo" )
68+ , ( outExpo, " outExpo" )
69+ , ( inOutExpo, " inOutExpo" )
70+ , ( inCirc, " inCirc" )
71+ , ( outCirc, " outCirc" )
72+ , ( inOutCirc, " inOutCirc" )
73+ , ( inBack, " inBack" )
74+ , ( outBack, " outBack" )
75+ , ( inOutBack, " inOutBack" )
76+ , ( inElastic, " inElastic" )
77+ , ( outElastic, " outElastic" )
78+ , ( inOutElastic, " inOutElastic" )
79+ , ( inBounce, " inBounce" )
80+ , ( outBounce, " outBounce" )
81+ , ( inOutBounce, " inOutBounce" )
82+ ]
0 commit comments