-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
71 lines (61 loc) · 1.8 KB
/
script.js
File metadata and controls
71 lines (61 loc) · 1.8 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
const scroll = new LocomotiveScroll({
el: document.querySelector('#main'),
smooth: true
});
function page4Animation(){
var elemC = document.querySelector("#elem-container")
var fixed = document.querySelector("#fixed-image")
elemC.addEventListener("mouseenter",function(){
fixed.style.display ="block"
})
elemC.addEventListener("mouseleave",function(){
fixed.style.display ="none"
})
var elems = document.querySelectorAll(".elem")
elems.forEach(function(e){
e.addEventListener("mouseenter",function(){
var image = e.getAttribute("data-image")
fixed.style.backgroundImage = `url(${image})`
})
})
}
function swiperAnimation(){
var swiper = new Swiper(".mySwiper", {
slidesPerView: "auto",
centeredSlides: false,
spaceBetween: 110,
});
}
// function menuAnimatio(){
// var menu = document.querySelector("nav h3")
// var full = document.querySelector("#full-scr")
// var img = document.querySelector("nav img")
// var flag = 0
// menu.addEventListener("click", function(){
// if(flag == 0){
// full.style.top = 0
// Navimg.style.opacity = 0
// flag = 1
// }else{
// full.style.top = "-100%"
// Navimg.style.opacity = 1
// flag = 0
// }
// })
// }
// function loaderAnimation() {
// var loader = document.querySelector("#loader")
// setTimeout(function () {
// loader.style.top = "-100%"
// }, 4200)
// }
// loaderAnimation()
function loaderAnimation() {
var loader = document.querySelector("#loader");
setTimeout(function () {
loader.style.top = "-100%";
}, 4200);
}
document.addEventListener('DOMContentLoaded', loaderAnimation); // Ensure code runs after DOM is loaded
swiperAnimation()
page4Animation()