-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
76 lines (64 loc) · 1.89 KB
/
Copy pathscript.js
File metadata and controls
76 lines (64 loc) · 1.89 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
75
76
// glimps
let thumbnail = document.getElementsByClassName("thumbnail");
let activeImages = document.getElementsByClassName("active");
for (var i = 0; i < thumbnail.length; i++) {
thumbnail[i].addEventListener("mouseover", function () {
document.getElementById("featured").src = this.src;
});
}
let buttonRight = document.getElementById("slideRight");
let buttonLeft = document.getElementById("slideLeft");
buttonLeft.addEventListener("click", function () {
document.getElementById("slider").scrollLeft -= 80;
});
buttonRight.addEventListener("click", function () {
document.getElementById("slider").scrollLeft += 80;
});
// Quotes
const api = "https://api.quotable.io/random";
const quote = document.getElementById("quote1");
const author = document.getElementById("author1");
const btn = document.getElementById("btn1");
btn.addEventListener("click", getQuote);
function getQuote() {
fetch(api)
.then((res) => res.json())
.then((data) => {
quote.innerHTML = `"${data.content}"`;
author.innerHTML = `- ${data.author}`;
});
}
getQuote();
// slider
var swiper = new Swiper('.swiper-container', {
effect: 'coverflow',
grabCursor: true,
centeredSlides: true,
slidesPerView: 'auto',
coverflowEffect: {
rotate: 30,
stretch: 0,
depth: 200,
modifier: 1,
slideShadows: true,
},
pagination: {
el: '.swiper-pagination',
},
});
// bot visible
const gotobtn = document.getElementById("gotobtn");
const closebtn = document.getElementById("gotobtn1");
const botclass = document.getElementById("class");
function visible() {
botclass.style.display = "block";
gotobtn.style.display = "none";
closebtn.style.display = "block";
}
function invisible() {
botclass.style.display = "none";
gotobtn.style.display = "block";
closebtn.style.display = "none";
}
gotobtn.addEventListener('click', visible);
closebtn.addEventListener('click', invisible);