-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsvg.js
56 lines (43 loc) · 1.28 KB
/
svg.js
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
// Snap.svg library to render SVG on Welcome page
let svg = Snap("#welcomePage svg");
let bodyBird = svg.circle(200, 150, 95);
bodyBird.attr({
stroke: "black",
strokeWidth: 5,
fill: "yellow"
});
let eyeBird = svg.circle(255, 125, 35);
eyeBird.attr({
stroke: "black",
strokeWidth: 5,
fill: "white"
});
let eyeBirdIn = svg.circle(275, 125, 15);
let pinionBird = svg.ellipse(120, 160, 55, 35);
pinionBird.attr({
stroke: "black",
strokeWidth: 5,
fill: "grey"
});
/* Animations */
function eyeBirdInAnimateEyeDown() {
eyeBirdIn.animate({cx: 270, cy: 135}, 500, eyeBirdInAnimateBig);
}
function eyeBirdInAnimateBig() {
eyeBirdIn.animate({transform: "skew(1.3, 1.3)"}, 500, pinionBirdAnimateUp);
}
function pinionBirdAnimateUp() {
pinionBird.animate({transform: "rotate(30 120 160)"}, 500, pinionBirdAnimateDown);
}
function pinionBirdAnimateDown() {
pinionBird.animate({transform: "rotate(-30 120 160)"}, 500, pinionBirdAnimate);
}
function pinionBirdAnimate() {
pinionBird.animate({transform: "rotate(0 120 160)"}, 500, eyeBirdInAnimateSmall);
}
function eyeBirdInAnimateSmall() {
eyeBirdIn.animate({transform: "skew(1, 1)"}, 500, eyeBirdInAnimateEyeUp);
}
function eyeBirdInAnimateEyeUp() {
eyeBirdIn.animate({cx: 275, cy: 125}, 500);
}