-
Notifications
You must be signed in to change notification settings - Fork 1
/
clickGenCol.eve
49 lines (43 loc) · 1.07 KB
/
clickGenCol.eve
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Col Gen
```
commit
[#direction isVertical:true]
```
```
search
[#spot x y col]
[#direction isVertical]
bind @browser
[#h1 text:"Col Gen isVertical: {{isVertical}}"]
[#svg viewBox: "0 0 100 100", width: "800px", children:
[#circle cx: x, cy: y, r: 2, fill: col]]
```
```
search
[#time seconds frames]
[#direction isVertical]
posmin = 5
colmin = 15
max = 95
hmax = 360
pmax = 100
xseed = if isVertical = true then seconds
else frames
yseed = if isVertical = true then frames
else seconds
randx = random[seed: xseed] * (max - posmin) + posmin
randy = random[seed: yseed] * (max - posmin) + posmin
h = round[value: random[seed: seconds] * (hmax - colmin) + colmin]
s = round[value: random[seed: frames] * (pmax - colmin) + colmin]
commit
[#spot x: randx y: randy col:"hsl({{h}}, {{s}}%, 50%)"]
```
```
search @event @session @browser
[#click element: [#svg]]
direction = [#direction isVertical]
newDirection = if isVertical = true then false
else true
commit
direction <- [isVertical:newDirection]
```