-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.js
28 lines (24 loc) · 1.01 KB
/
scripts.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
const tutelImg = document.getElementById("tutelImg");
const tutelFrame = document.getElementById("tutelFrame");
const soundOnBtn = document.getElementById("soundOnBtn");
const soundIcon = document.getElementById("soundIcon");
fetch('https://api.giphy.com/v1/gifs/search?api_key=0ANoPGmxervsKE4FhYQGH7iPPlKc7xlL&q=turtle', {mode: 'cors'})
.then(function(response) {
return response.json();
})
.then(function(response) {
tutelImg.src = response.data[Math.floor(Math.random() * response.data.length)].images.original.url;
console.log(response);
});
function playMusic(){
const tutelSong = document.createElement("IFRAME");
tutelSong.width = "560";
tutelSong.height = "315";
tutelSong.src = "https://www.youtube.com/embed/b4t49LpC30I?controls=0&start=3&autoplay=1";
tutelSong.allow = "autoplay";
tutelSong.hidden = true;
document.querySelector("body").appendChild(tutelSong);
soundOnBtn.hidden = true;
soundIcon.hidden = false;
console.log("tuteeel")
};