-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
61 lines (35 loc) 路 1.07 KB
/
Copy pathindex.js
File metadata and controls
61 lines (35 loc) 路 1.07 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
// btns get
const run_btn = document.querySelector('.run_btn');
// gradient get
const gradient_line = document.querySelector(".intelligence_gradient_container > span");
// main heading get
const main_heading = document.querySelector(".intelligence_main-heading > h2");
// note text get
const note = document.querySelector(".note");
window.onload = () => {
// callback function
showText();
// initial trigger value
let trigger = true;
// click event for RUN BTN
run_btn.addEventListener("click",(event)=>{
if(trigger){
gradient_line.style.backgroundSize = "100% 20%";
event.target.innerText = "Bye!!";
trigger = false;
}else{
gradient_line.style.backgroundSize = "100% 0%";
event.target.innerText = "Click Me";
trigger = true;
setTimeout(()=>{
gradient_line.style.backgroundSize = "0% 0%";
},1000);
}
})
};
// function excute
const showText = () =>{
main_heading.classList.add("showText");
note.classList.add("showText");
run_btn.classList.add("showText");
}