-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhomepage.js
61 lines (61 loc) · 2.48 KB
/
homepage.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
function const_view(planet){
const planet_text = document.getElementByCLass("planet_div_text");
planet_text[planet].style.opacity="100%";
}
function const_disappear(planet){
const planet_text = document.getELementByClass("planet_div_text");
planet_text[planet].style.opacity="0%"
}
function view(num){
if(num == 1){
document.getElementById("planet_1_div_text").style.animation="fade 2s ease-out 0.5s";
setTimeout(const_view(num),2000);
}else if(num == 2){
document.getElementById("planet_2_div_text").style.animation="fade 2s ease-out 0.5s";
setTimeout(const_view(num),2000);
}else if(num == 3){
document.getElementById("planet_3_div_text").style.animation="fade 2s ease-out 0.5s";
setTimeout(const_view(num),2000);
}else if(num == 4){
document.getElementById("planet_4_div_text").style.animation="fade 2s ease-out 0.5s";
setTimeout(const_view(num),2000);
}
}
function disappear(num){
if(num == 1){
document.getElementById("planet_1_div_text").style.animation="fade 2s ease-out 0.5s reverse";
setTimeout(const_disappear(num),2000);
}else if(num == 2){
document.getElementById("planet_2_div_text").style.animation="fade 2s ease-out 0.5s reverse";
setTimeout(const_disappear(num),2000);
}else if(num == 3){
document.getElementById("planet_3_div_text").style.animation="fade 2s ease-out 0.5s reverse";
setTimeout(const_disappear(num),2000);
}else if(num == 4){
document.getElementById("planet_4_div_text").style.animation="fade 2s ease-out 0.5s reverse";
setTimeout(const_disappear(num),2000);
}
}
const planet_text = document.getElementsByClassName("planet_div_text");
function const_view(planet){
planet_text[planet].style.opacity="100%";
}
for(let i=0;i<planet_text.length;i++){
setTimeout(const_view,4000,i);
}
const observer = new IntersectionObserver((enteries) => {
setInterval(
enteries.forEach((entry) => {
console.log(entry);
if(entry.isIntersecting){
entry.target.classList.add('show');
} else {
entry.target.classList.remove('show');
}
}),2000);
});
const hiddenSection = document.querySelectorAll('.iHidden');
hiddenSection.forEach((el) => observer.observe(el));
function loginPage(){
document.querySelectorAll('.section').style.display="none";
}