-
Notifications
You must be signed in to change notification settings - Fork 0
/
animations.js
40 lines (39 loc) · 1.19 KB
/
animations.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
var githubAnimation = lottie.loadAnimation({
container: document.getElementById('github'),
renderer: 'svg',
loop: true,
autoplay: false,
path: '/content/github.json'
});
var youtubeAnimation = lottie.loadAnimation({
container: document.getElementById('youtube'),
renderer: 'svg',
loop: true,
autoplay: false,
path: '/content/youtube.json'
});
var infoAnimation = lottie.loadAnimation({
container: document.getElementById('info'),
renderer: 'svg',
loop: true,
autoplay: false,
path: 'content/info.json'
});
document.getElementById('github').addEventListener('mouseover', function() {
githubAnimation.play();
});
document.getElementById('github').addEventListener('mouseout', function() {
githubAnimation.stop();
});
document.getElementById('youtube').addEventListener('mouseover', function() {
youtubeAnimation.play();
});
document.getElementById('youtube').addEventListener('mouseout', function() {
youtubeAnimation.stop();
});
document.getElementById('info').addEventListener('mouseover', function() {
infoAnimation.play();
});
document.getElementById('info').addEventListener('mouseout', function() {
infoAnimation.stop();
});