Skip to content

Commit 76840cc

Browse files
committed
wip
1 parent 860e6c8 commit 76840cc

File tree

16 files changed

+687
-32
lines changed

16 files changed

+687
-32
lines changed

.golangci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ linters:
2626
- gomnd
2727
- ifshort
2828
- interfacer
29+
- interfacebloat
2930
- ireturn
3031
- lll
3132
- maligned

frontend/courses/courses.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@
2222
{ "id": "dot", "title": "Red Dot" },
2323
{ "id": "lines", "title": "Lines" },
2424
{ "id": "squares", "title": "Squares" },
25-
{ "id": "rainbow", "title": "Rainbow" }
25+
{ "id": "rainbow", "title": "Rainbow" },
26+
{ "id": "fill", "title": "Stroke and Fill" },
27+
{ "id": "linestyle", "title": "Line Styles" },
28+
{ "id": "text", "title": "Text" },
29+
{ "id": "poly", "title": "Polygon and Polyline" },
30+
{ "id": "ellipse", "title": "Ellipse" },
31+
{ "id": "curve", "title": "Curve" }
2632
]
2733
},
2834
{
@@ -31,6 +37,7 @@
3137
"emoji": "🤹‍♀️",
3238
"units": [
3339
{ "id": "movingdot", "title": "Moving Red Dot" },
40+
{ "id": "bounce", "title": "Bounce" },
3441
{ "id": "juggle", "title": "Juggle" },
3542
{ "id": "splashtrig", "title": "Splash of Trig" },
3643
{ "id": "draw", "title": "Draw" }
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
background := "hsl(0deg 0% 0% / 10%)"
2+
x := 10
3+
y := 50
4+
s := 1
5+
width 1
6+
fill background
7+
stroke "red"
8+
9+
on animate
10+
clear background
11+
move x y
12+
circle 10
13+
x = x + s
14+
if x < 10 or x > 90
15+
s = -s
16+
end
17+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print "todo"
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
bg := "hsl(210deg 5% 15%)"
2+
clear bg
3+
4+
labels := ["radiusX" "radiusY" "roation°" "start°" "end°"]
5+
vals := [15 25 45 90 360]
6+
cnt := len vals
7+
8+
fontfamily "arial"
9+
textsize 3.5
10+
cur := 1
11+
draw_table
12+
draw_ellipse
13+
14+
on key k:string
15+
if k == "ArrowLeft"
16+
cur = (cur + cnt - 1) % cnt
17+
else if k == "ArrowRight"
18+
cur = (cur + 1) % cnt
19+
else if k == "ArrowUp"
20+
vals[cur] = vals[cur] + 1
21+
else if k == "ArrowDown"
22+
vals[cur] = vals[cur] - 1
23+
end
24+
clear bg
25+
draw_ellipse
26+
draw_table
27+
end
28+
29+
func draw_ellipse
30+
width 0.5
31+
stroke "red"
32+
fill "white"
33+
ellipse 50 50 vals[0] vals[1] vals[2] vals[3] vals[4]
34+
35+
end
36+
37+
func draw_table
38+
fill "none"
39+
stroke "black"
40+
width 0.2
41+
for i := range (len labels)
42+
draw_table_column i labels[i] vals[i]
43+
end
44+
stroke "red"
45+
width 0.7
46+
draw_table_column cur "" -1
47+
end
48+
49+
func draw_table_column i:num label:string val:num
50+
x := i * 18 + 8
51+
w := 18
52+
move x-3 9
53+
rect w 16
54+
if label == ""
55+
return // rectangle only
56+
end
57+
move x-3 18
58+
line x+15 18
59+
move x 20
60+
text label
61+
move x 13
62+
text (sprintf "%2.0f" val)
63+
end
64+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
width 2
2+
3+
move 10 65
4+
color "red"
5+
circle 7
6+
move 3 40
7+
rect 14 14
8+
move 3 35
9+
line 17 35
10+
11+
move 30 65
12+
stroke "blue"
13+
circle 7
14+
move 23 40
15+
rect 14 14
16+
move 23 35
17+
line 37 35
18+
19+
move 50 65
20+
color "green"
21+
fill "orange"
22+
circle 7
23+
move 43 40
24+
rect 14 14
25+
move 43 35
26+
line 57 35
27+
28+
move 70 65
29+
stroke "deeppink"
30+
fill "cyan"
31+
circle 7
32+
move 63 40
33+
rect 14 14
34+
move 63 35
35+
line 77 35
36+
37+
move 90 65
38+
stroke "violet"
39+
fill "none"
40+
circle 7
41+
move 83 40
42+
rect 14 14
43+
move 83 35
44+
line 97 35
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
width 3
2+
linecap "round"
3+
move 5 80
4+
line 95 80
5+
6+
linecap "butt"
7+
move 5 70
8+
line 95 70
9+
10+
linecap "square"
11+
move 5 60
12+
line 95 60
13+
14+
width 1
15+
move 5 30
16+
dash 5 3 1 3
17+
line 95 30
18+
19+
dash
20+
move 5 20
21+
line 95 20
22+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
width 1
2+
stroke "red"
3+
fill "gold"
4+
poly [10 20] [50 50] [20 10] [10 20]
5+
6+
fill "none"
7+
poly [10 80] [30 60] [50 80] [70 60] [90 80]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
move 10 80
2+
text "Hello"
3+
4+
move 10 60
5+
textsize 10
6+
text "all 🖖"
7+
8+
move 10 40
9+
fontfamily "Luminari, fantasy"
10+
text "Cheriolas!"
11+
12+
move 10 35
13+
font "italic max(2rem, 2vh) \"Comic Sans MS\", cursive"
14+
text "(Cheering Charm)"

0 commit comments

Comments
 (0)