3 (left,right,down,up,inward,outward
4 ,topLeft,topRight,bottomLeft,bottomRight
5 ,midLeft,midRight,midTop,midBottom
6 ,middle,absolute,relative
7 ,topLeftAt,topRightAt,bottomLeftAt,bottomRightAt
8 ,width,height,size,widthOf,heightOf,sizeOf
10 ,text,image,fittedImage,video
11 ,flow,above,below,beside,layers
12 ,collage,spacer,container
14 ,polygon,ngon,rect,oval,circle
15 ,solid,dotted,dashed,customLine
16 ,filled,outlined,customOutline,textured
23data Direction = DLeft | DRight | DUp | DDown | DIn | DOut
32data Pos1 = Absolute Int | Relative Float
33data Pos2 = Near | Mid | Far
37 | PositionAt Pos1 Pos1
38 | PositionTL Pos1 Pos1
39 | PositionTR Pos1 Pos1
40 | PositionBL Pos1 Pos1
41 | PositionBR Pos1 Pos1
43topLeft = Position Near Near
44topRight = Position Far Near
45bottomLeft = Position Near Far
46bottomRight = Position Far Far
48midLeft = Position Near Mid
49midRight = Position Far Mid
50midTop = Position Mid Near
51midBottom = Position Mid Far
53middle = Position Mid Mid
57topRightAt = PositionTR
58bottomLeftAt = PositionBL
59bottomRightAt = PositionBR
64data Element = Element Int BasicElement Int Int Float (Maybe Color) (Just String)
67basicNewElement e w h = Element 0 e w h 1 Nothing Nothing
74 | EFlow Direction [Element]
75 | ECollage Int Int [Form]
77 | EContainer Position Element
79width w' (Element _ e w h o c l) =
81 { EText _ -> newElement e w' h o c l
82 ; EImage _ -> newElement e w' h o c l
83 ; EVideo _ -> newElement e w' h o c l
84 ; _ -> newElement e w' h o c l }
85height h' (Element _ e w h o c l) =
87 { EText _ -> newElement e w h' o c l
88 ; EImage _ -> newElement e w h' o c l
89 ; EVideo _ -> newElement e w h' o c l
90 ; _ -> newElement e w h' o c l }
91size w' h' (Element _ e w h o c l) = newElement e w' h' o c l
92opacity o' (Element _ e w h o c l) = newElement e w h o' c l
93color c' (Element _ e w h o c l) = newElement e w h o (Just c') l
94link l' (Element _ e w h o c l) = newElement e w h o c (Just l')
96widthOf (Element _ _ w _ _ _ _) = w
97heightOf (Element _ _ _ h _ _ _) = h
98sizeOf (Element _ _ w h _ _ _) = (w,h)
102text t = basicNewElement (EText t) n1 n1
103image w h s = basicNewElement (EImage s) w h
104video w h s = basicNewElement (EVideo s) w h
105fittedImage w h s = basicNewElement (EFittedImage s) w h
108 let { w = let ws = map widthOf es in
109 case dir of { DLeft -> sum ws
112 ; h = let hs = map heightOf es in
113 case dir of { DDown -> sum hs
116 } in basicNewElement (EFlow dir es) w h
120 (EFlow DDown [e1,e2])
121 (max (widthOf e1) (widthOf e2))
122 (heightOf e1 + heightOf e2) 1 Nothing Nothing
125 basicNewElement (EFlow DDown [e2,e1])
126 (max (widthOf e1) (widthOf e2))
127 (heightOf e1 + heightOf e2)
130 basicNewElement (EFlow DRight [e1,e2])
131 (widthOf e1 + widthOf e2)
132 (max (heightOf e1) (heightOf e2))
135 basicNewElement (EFlow DIn es)
136 (maximum (map widthOf es))
137 (maximum (map heightOf es))
139collage w h forms = basicNewElement (ECollage w h forms) w h
141spacer w h = basicNewElement EEmpty w h
144 basicNewElement (EContainer pos e) w h
148data LineStyle = Solid | Dotted | Dashed | Custom [Int]
149data ShapeStyle = Filled | Outlined | CustomOutline [Int] | Textured String
151data Line = Line [(Float,Float)]
154segment p1 p2 = Line [p1,p2]
156data Shape = Shape [(Float,Float)] (Float,Float)
159rect w h pos = Shape [(0-w/2,0-h/2),(0-w/2,h/2),(w/2,h/2),(w/2,0-h/2)] pos
162 let f i = ( w/2 * cos (2*pi/n * i), h/2 * sin (2*pi/n * i)) in
163 Shape (map f [0..n-1]) pos
164circle r = oval (2*r) (2*r)
167 let f i = ( r * cos (2*pi/m * i), r * sin (2*pi/m * i)) in
168 Shape (map f [0..n-1]) pos
170data Form = Form Float Float (Float,Float) BasicForm
173 = FLine LineStyle Color Line
174 | FShape ShapeStyle Color Shape
175 | FImage Int Int String
178solid clr ln = Form 0 1 (0,0) (FLine Solid clr ln)
179dotted clr ln = Form 0 1 (0,0) (FLine Dotted clr ln)
180dashed clr ln = Form 0 1 (0,0) (FLine Dashed clr ln)
181customLine pattern clr ln =
182 Form 0 1 (0,0) (FLine (Custom pattern) clr ln)
184filled clr (Shape ps pos) = Form 0 1 pos (FShape Filled clr (Shape ps pos))
185outlined clr (Shape ps pos) = Form 0 1 pos (FShape Outlined clr (Shape ps pos))
186customOutline pattern clr (Shape ps pos) =
187 Form 0 1 pos (FShape (CustomOutline pattern) clr (Shape ps pos))
188textured src (Shape ps pos) = Form 0 1 pos (FShape (Textured src) black (Shape ps pos))
190sprite w h pos src = Form 0 1 pos (FImage w h src)
191toForm pos e = Form 0 1 pos (FElement e)
193rotate t (Form theta scale pos form) = Form (t+theta) scale pos form
194scale s (Form theta scale pos form) = Form theta (s*scale) pos form
195move x y (Form theta scale (px,py) form) = Form theta scale (x+px,y+py) form
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list