-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
115 lines (86 loc) · 2.83 KB
/
script.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
console.log("Circle cirlcle nothing to see here!");
fetch("https://api.github.com/users/kemikal/repos")
.then(function(response) {
return response.json();
})
.then(function(json) {
console.log("github API", json);
var githubrepos = document.getElementById("githubrepos");
for (i=0; i<json.length; i++) {
githubrepos.insertAdjacentHTML("beforeend", "<a href='"+ json[i].html_url +"' target='_blank'><div class='githubrepo'>" + json[i].name + "</div></a>")
}
});
var planet1 = document.getElementById("planet1");
var planet2 = document.getElementById("planet2");
var planet3 = document.getElementById("planet3");
var planet4 = document.getElementById("planet4");
var planet5 = document.getElementById("planet5");
var sat = document.getElementById("sat");
planet1.addEventListener("click", function() {
var planetSound = new Pizzicato.Sound('./sound/planet1.wav', function() {
var delay = new Pizzicato.Effects.Delay({
feedback: 0.6,
time: 0.4,
mix: 0.5
});
planetSound.addEffect(delay);
planetSound.play();
});
});
planet2.addEventListener("click", function() {
var planetSound = new Pizzicato.Sound('./sound/planet2.wav', function() {
var delay = new Pizzicato.Effects.Delay({
feedback: 0.6,
time: 0.4,
mix: 0.5
});
planetSound.addEffect(delay);
planetSound.play();
});
});
planet3.addEventListener("click", function() {
var planetSound = new Pizzicato.Sound('./sound/planet3.wav', function() {
var delay = new Pizzicato.Effects.Delay({
feedback: 0.6,
time: 0.4,
mix: 0.5
});
planetSound.addEffect(delay);
planetSound.play();
});
});
planet4.addEventListener("click", function() {
var planetSound = new Pizzicato.Sound('./sound/planet4.wav', function() {
var delay = new Pizzicato.Effects.Delay({
feedback: 0.6,
time: 0.4,
mix: 0.5
});
planetSound.addEffect(delay);
planetSound.play();
});
});
planet5.addEventListener("click", function() {
var planetSound = new Pizzicato.Sound('./sound/planet5.wav', function() {
var delay = new Pizzicato.Effects.Delay({
feedback: 0.6,
time: 0.4,
mix: 0.5
});
planetSound.addEffect(delay);
planetSound.play();
});
});
sat.addEventListener("click", function() {
document.getElementById("satelite").setAttribute('src', '/img/sat.png');
var sawtoothWave = new Pizzicato.Sound({
source: 'wave',
options: {
type: 'triangle',
frequency: 140,
volume: 0
}
});
console.log("Sound on");
sawtoothWave.play();
});