1var ElmCode = ElmCode || {};
2ElmCode.Graphics = ElmCode.Graphics || {};
3ElmCode.Graphics.Element = function() {
4 var DLeft_0 = ["DLeft"];
5 var DRight_1 = ["DRight"];
7 var DDown_3 = ["DDown"];
10 function Absolute_12(a1) {
11 return["Absolute", a1]
13 function Relative_13(a1) {
14 return["Relative", a1]
16 var Near_14 = ["Near"];
19 function Position_17(a1) {
21 return["Position", a1, a2]
24 function PositionTL_18(a1) {
26 return["PositionTL", a1, a2]
29 function PositionTR_19(a1) {
31 return["PositionTR", a1, a2]
34 function PositionBL_20(a1) {
36 return["PositionBL", a1, a2]
39 function PositionBR_21(a1) {
41 return["PositionBR", a1, a2]
44 function Element_37(a1) {
50 return["Element", a1, a2, a3, a4, a5, a6]
57 function EText_39(a1) {
59 return["EText", a1, a2]
62 function EImage_40(a1) {
63 return["EImage", Foreign.JavaScript.castStringToJSString(a1)]
65 function EVideo_41(a1) {
68 function EFittedImage_42(a1) {
69 return["EFittedImage", a1]
71 function EFlow_43(a1) {
73 return["EFlow", a1, Foreign.JavaScript.castListToJSArray(a2)]
76 function ECollage_44(a1) {
79 return["ECollage", a1, a2, Value.groupForms(a3)]
83 var EEmpty_45 = ["EEmpty"];
84 function EContainer_46(a1) {
86 return["EContainer", a1, a2]
89 var Solid_68 = ["Solid"];
90 var Dotted_69 = ["Dotted"];
91 var Dashed_70 = ["Dashed"];
92 function Custom_71(a1) {
95 var Filled_72 = ["Filled"];
96 var Outlined_73 = ["Outlined"];
97 function CustomOutline_74(a1) {
98 return["CustomOutline", a1]
100 function Line_75(a1) {
103 function Shape_78(a1) {
104 return function(a2) {
105 return["Shape", a1, a2]
108 function Form_84(a1) {
109 return function(a2) {
110 return function(a3) {
111 return function(a4) {
112 return["Form", a1, a2, a3, a4]
117 function FLine_85(a1) {
118 return function(a2) {
119 return function(a3) {
120 return["FLine", a1, a2, a3]
124 function FShape_86(a1) {
125 return function(a2) {
126 return function(a3) {
127 return["FShape", a1, a2, a3]
131 function FImage_87(a1) {
132 return function(a2) {
133 return function(a3) {
134 return["FImage", a1, a2, Foreign.JavaScript.castStringToJSString(a3)]
138 function FElement_88(a1) {
139 return["FElement", a1]
141 var left_6 = DLeft_0;
142 var right_7 = DRight_1;
143 var down_8 = DDown_3;
145 var inward_10 = DIn_4;
146 var outward_11 = DOut_5;
147 var topLeft_22 = Position_17(Near_14)(Near_14);
148 var topRight_23 = Position_17(Far_16)(Near_14);
149 var bottomLeft_24 = Position_17(Near_14)(Far_16);
150 var bottomRight_25 = Position_17(Far_16)(Far_16);
151 var midLeft_26 = Position_17(Near_14)(Mid_15);
152 var midRight_27 = Position_17(Far_16)(Mid_15);
153 var midTop_28 = Position_17(Mid_15)(Near_14);
154 var midBottom_29 = Position_17(Mid_15)(Far_16);
155 var middle_30 = Position_17(Mid_15)(Mid_15);
156 function middleAt(a1) {
157 return function(a2) {
158 return["PositionAt", a1, a2]
161 var topLeftAt_31 = PositionTL_18;
162 var topRightAt_32 = PositionTR_19;
163 var bottomLeftAt_33 = PositionBL_20;
164 var bottomRightAt_34 = PositionBR_21;
165 var absolute_35 = Absolute_12;
166 var relative_36 = Relative_13;
167 function newElement_38(a) { return Element_37(Guid.guid())(a); }
168 var line_76 = Line_75;
169 var polygon_79 = Shape_78;
170 function sprite_96(src) {
173 return function(pos) {
174 return Form_84(0)(1)(pos)(FImage_87(w)(h)(src))
179 function toForm_97(pos) {
181 return Form_84(0)(1)(pos)(FElement_88(e))
184 function width_47(w__101) {
185 return function(Element$_ewhoc_102) {
186 return function(case7) {
190 var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4], case5 = case0[5], case6 = case0[6];
191 return function(case12) {
196 return newElement_38(case2)(w__101)(case4 * w__101 / case3)(case5)(case6);
198 var p = Value.getTextSize(w__101,case4,case8[2]);
199 return newElement_38(case2)(w__101)(p[1])(case5)(case6);
201 return newElement_38(case2)(w__101)(case4)(case5)(case6)
204 throw"Non-exhaustive pattern match in case";
205 }(Element$_ewhoc_102)
208 function height_48(h__108) {
209 return function(Element$_ewhoc_109) {
210 return function(case7) {
214 var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4], case5 = case0[5], case6 = case0[6];
215 return function(case12) {
220 return newElement_38(case2)(case3 * h__108 / case4)(h__108)(case5)(case6);
222 return newElement_38(case2)(case3)(h__108)(case5)(case6)
225 throw"Non-exhaustive pattern match in case";
226 }(Element$_ewhoc_109)
229 function size_49(w__115) {
230 return function(h__116) {
231 return function(Element$_ewhoc_117) {
232 return function(case7) {
236 var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4], case5 = case0[5], case6 = case0[6];
237 return newElement_38(case2)(w__115)(h__116)(case5)(case6)
239 throw"Non-exhaustive pattern match in case";
240 }(Element$_ewhoc_117)
244 function opacity_50(o__123) {
245 return function(Element$_ewhoc_124) {
246 return function(case7) {
250 var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4], case5 = case0[5], case6 = case0[6];
251 return newElement_38(case2)(case3)(case4)(o__123)(case6)
253 throw"Non-exhaustive pattern match in case";
254 }(Element$_ewhoc_124)
257 function color_51(c__130) {
258 return function(Element$_ewhoc_131) {
259 return function(case7) {
263 var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4], case5 = case0[5], case6 = case0[6];
264 return newElement_38(case2)(case3)(case4)(case5)(Just(c__130))
266 throw"Non-exhaustive pattern match in case";
267 }(Element$_ewhoc_131)
270 function widthOf_52(e) { return ~~e[3]; }
271 function heightOf_53(e) { return ~~e[4]; }
272 function sizeOf_54(e) { return["Tuple2", ~~e[3], ~~e[4]] }
273 function text_56(txt) {
274 var p = Value.getTextSize(-1,-1,txt);
275 return newElement_38(EText_39("left")(txt))(p[0])(p[1])(1)(Nothing)
277 function plainText(str) {
278 var txt = Value.toText(str);
279 var p = Value.getTextSize(-1,-1,txt);
280 return newElement_38(EText_39("left")(txt))(p[0])(p[1])(1)(Nothing)
283 var txt = Value.show(v);
284 var p = Value.getTextSize(-1,-1,txt);
285 return newElement_38(EText_39("left")(txt))(p[0])(p[1])(1)(Nothing)
287 function centeredText(txt) {
288 var p = Value.getTextSize(-1,-1,txt);
289 return newElement_38(EText_39("center")(txt))(p[0])(p[1])(1)(Nothing)
291 function justifiedText(txt) {
292 var p = Value.getTextSize(-1,-1,txt);
293 return newElement_38(EText_39("justify")(txt))(p[0])(p[1])(1)(Nothing)
295 function rightedText(txt) {
296 var p = Value.getTextSize(-1,-1,txt);
297 return newElement_38(EText_39("right")(txt))(p[0])(p[1])(1)(Nothing)
299 function image_57(w) {
301 return function(src) {
302 return newElement_38(EImage_40(src))(w)(h)(1)(Nothing)
306 function video_58(w) {
308 return function(src) {
309 return newElement_38(EVideo_41(src))(w)(h)(1)(Nothing)
313 function fittedImage_59(w_147) {
314 return function(h_148) {
315 return function(s_149) {
316 return newElement_38(EFittedImage_42(s_149))(w_147)(h_148)(1)(Nothing)
320 function flow_60(dir_150) {
321 return function(es_151) {
323 var w_152 = function() {
324 var ws_154 = map(widthOf_52)(es_151);
325 return function(case1) {
333 return maximum(ws_154)
336 var h_153 = function() {
337 var hs_155 = map(heightOf_53)(es_151);
338 return function(case3) {
346 return maximum(hs_155)
349 return newElement_38(EFlow_43(dir_150)(es_151))(w_152)(h_153)(1)(Nothing)
353 function above_61(e1_156) {
354 return function(e2_157) {
355 return newElement_38(EFlow_43(DDown_3)(["Cons", e1_156, ["Cons", e2_157, ["Nil"]]]))(max(widthOf_52(e1_156))(widthOf_52(e2_157)))(heightOf_53(e1_156) + heightOf_53(e2_157))(1)(Nothing)
358 function below_62(e1_158) {
359 return function(e2_159) {
360 return newElement_38(EFlow_43(DDown_3)(["Cons", e2_159, ["Cons", e1_158, ["Nil"]]]))(max(widthOf_52(e1_158))(widthOf_52(e2_159)))(heightOf_53(e1_158) + heightOf_53(e2_159))(1)(Nothing)
363 function beside_63(e1_160) {
364 return function(e2_161) {
365 return newElement_38(EFlow_43(DRight_1)(["Cons", e1_160, ["Cons", e2_161, ["Nil"]]]))(widthOf_52(e1_160) + widthOf_52(e2_161))(max(heightOf_53(e1_160))(heightOf_53(e2_161)))(1)(Nothing)
368 function layers_64(es_162) {
369 return newElement_38(EFlow_43(DOut_5)(es_162))(maximum(map(widthOf_52)(es_162)))(maximum(map(heightOf_53)(es_162)))(1)(Nothing)
371 function collage_65(w_163) {
372 return function(h_164) {
373 return function(forms_165) {
374 return newElement_38(ECollage_44(w_163)(h_164)(forms_165))(w_163)(h_164)(1)(Nothing)
378 function spacer_66(w_166) {
379 return function(h_167) {
380 return newElement_38(EEmpty_45)(w_166)(h_167)(1)(Nothing)
383 function container_67(w_169) {
384 return function(h_170) {
385 return function(pos_168) {
386 return function(e_171) {
387 return newElement_38(EContainer_46(pos_168)(e_171))(w_169)(h_170)(1)(Nothing)
392 function segment_77(p1_172) {
393 return function(p2_173) {
394 return Line_75(["Cons", p1_172, ["Cons", p2_173, ["Nil"]]])
397 function rect_80(w_174) {
398 return function(h_175) {
399 return function(pos_176) {
400 return Shape_78(["Cons", ["Tuple2", 0 - w_174 / 2, 0 - h_175 / 2], ["Cons", ["Tuple2", 0 - w_174 / 2, h_175 / 2], ["Cons", ["Tuple2", w_174 / 2, h_175 / 2], ["Cons", ["Tuple2", w_174 / 2, 0 - h_175 / 2], ["Nil"]]]]])(pos_176)
404 function oval_81(w_177) {
405 return function(h_178) {
406 return function(pos_179) {
410 function f_181(i_182) {
411 return["Tuple2", w_177 / 2 * cos(2 * (pi / n_180) * i_182), h_178 / 2 * sin(2 * (pi / n_180) * i_182)]
413 return Shape_78(map(f_181)(function() {
419 var lst = ["Cons", hi, lst]
429 function circle_82(r_183) {
430 return oval_81(2 * r_183)(2 * r_183)
432 function ngon_83(n_184) {
433 return function(r_185) {
434 return function(pos_186) {
436 var m_187 = toFloat(n_184);
438 function f_188(i_189) {
439 return["Tuple2", r_185 * cos(2 * (pi / m_187) * i_189), r_185 * sin(2 * (pi / m_187) * i_189)]
441 return Shape_78(map(f_188)(function() {
447 var lst = ["Cons", hi, lst]
457 function solid_89(clr_190) {
458 return function(ln_191) {
459 return Form_84(0)(1)(["Tuple2", 0, 0])(FLine_85(Solid_68)(clr_190)(ln_191))
462 function dotted_90(clr_192) {
463 return function(ln_193) {
464 return Form_84(0)(1)(["Tuple2", 0, 0])(FLine_85(Dotted_69)(clr_192)(ln_193))
467 function dashed_91(clr_194) {
468 return function(ln_195) {
469 return Form_84(0)(1)(["Tuple2", 0, 0])(FLine_85(Dashed_70)(clr_194)(ln_195))
472 function customLine_92(pattern_196) {
473 return function(clr_197) {
474 return function(ln_198) {
475 return Form_84(0)(1)(["Tuple2", 0, 0])(FLine_85(Custom_71(pattern_196))(clr_197)(ln_198))
479 function filled_93(clr) {
480 return function(shape) {
481 return Form_84(0)(1)(shape[2])(FShape_86(Filled_72)(clr)(shape));
484 function outlined_94(clr) {
485 return function(shape) {
486 return Form_84(0)(1)(shape[2])(FShape_86(Outlined_73)(clr)(shape));
489 function customOutline_95(pattern) {
490 return function(clr) {
491 return function(shape) {
492 return Form_84(0)(1)(shape[2])(FShape_86(["CustomOutline",pattern])(clr)(shape));
496 function textured(src) {
497 return function(shape) {
498 return Form_84(0)(1)(shape[2])(FShape_86(["Textured",src])(null)(shape));
501 function rotate_98(t_212) {
502 return function(Form$thetascaleposform_213) {
503 return function(case5) {
507 var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4];
508 return Form_84(t_212 + case1)(case2)(case3)(case4)
510 throw"Non-exhaustive pattern match in case";
511 }(Form$thetascaleposform_213)
514 function scale_99(s_218) {
515 return function(Form$thetascaleposform_219) {
516 return function(case5) {
520 var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4];
521 return Form_84(case1)(s_218 * case2)(case3)(case4)
523 throw"Non-exhaustive pattern match in case";
524 }(Form$thetascaleposform_219)
527 function move_100(x_224) {
528 return function(y_225) {
529 return function(Form$thetascaleTuple2$pxpyform_226) {
530 return function(case7) {
534 var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4];
537 var case5 = case3[1], case6 = case3[2];
538 return Form_84(case1)(case2)(["Tuple2", x_224 + case5, y_225 + case6])(case4)
542 throw"Non-exhaustive pattern match in case";
543 }(Form$thetascaleTuple2$pxpyform_226)
547 return{left:left_6, right:right_7, down:down_8, up:up_9, inward:inward_10, outward:outward_11, topLeft:topLeft_22, topRight:topRight_23, bottomLeft:bottomLeft_24, bottomRight:bottomRight_25, midLeft:midLeft_26, midRight:midRight_27, midTop:midTop_28, midBottom:midBottom_29, middle:middle_30, middleAt:middleAt, topLeftAt:topLeftAt_31, topRightAt:topRightAt_32, bottomLeftAt:bottomLeftAt_33, bottomRightAt:bottomRightAt_34, absolute:absolute_35, relative:relative_36, width:width_47, height:height_48, size:size_49, opacity:opacity_50,
548 color:color_51, widthOf:widthOf_52, heightOf:heightOf_53, sizeOf:sizeOf_54, text:text_56, plainText:plainText, centeredText:centeredText, justifiedText:justifiedText, rightedText:rightedText, image:image_57, video:video_58, fittedImage:fittedImage_59, flow:flow_60, above:above_61, below:below_62, beside:beside_63, layers:layers_64, collage:collage_65, spacer:spacer_66, container:container_67, line:line_76, segment:segment_77, polygon:polygon_79, rect:rect_80, oval:oval_81, circle:circle_82, ngon:ngon_83, solid:solid_89, dotted:dotted_90, dashed:dashed_91, customLine:customLine_92, filled:filled_93,
549 outlined:outlined_94, customOutline:customOutline_95, textured:textured, sprite:sprite_96, toForm:toForm_97, rotate:rotate_98, scale:scale_99, move:move_100}
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