-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtickle.js
More file actions
74 lines (54 loc) · 1.63 KB
/
tickle.js
File metadata and controls
74 lines (54 loc) · 1.63 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// var height = 5;
// var amount = 6;
// var val = 1;
// var tickle = false;
// paper.install(window);
// // Keep global references to both tools, so the HTML
// // links below can access them.
// window.onload= function(){
// paper.setup('myCanvas');
// // The amount of segment points we want to create:
// // The maximum height of the wave:
// // Create a new path and style it:
// var path = new Path({
// // 80% black:
// strokeColor: [0.8],
// strokeWidth: 10,
// strokeCap: 'square'
// });
// // Add 5 segment points to the path spread out
// // over the width of the view:
// for (var i = 0; i <= amount; i++) {
// t = new Point(i / amount*400, 1);
// console.log(new Point(i / amount*400, 1));
// path.add(t);
// }
// // Select the path, so we can see how it is constructed:
// path.selected = true;
// $('#finger')[0].onWiggle = function(){
// height += 50;
// console.log('wigglyyyy '+height);
// }
// view.onFrame = function(event) {
// // Loop through the segments of the path:
// for (var i = 0; i <= amount; i++) {
// var segment = path.segments[i];
// // A cylic value between -1 and 1
// var sinus = Math.sin(event.time * 3 + i);
// // Change the y position of the segment point:
// segment.point.y = sinus * height + 100;
// }
// // Uncomment the following line and run the script again
// // to smooth the path:
// path.smooth();
// if (tickle==true && height<50){
// // console.log('tickle is true');
// height = height + 1;
// }
// // if (amount>100)
// // val = -1;
// // if (amount == 5)
// // tickle = false;
// }
// view.draw();
// };