-
Notifications
You must be signed in to change notification settings - Fork 0
/
project.js
64 lines (63 loc) · 2.13 KB
/
project.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
62
63
64
var tablinks = document.getElementsByClassName("tab-links");
var tabcontents = document.getElementsByClassName("tab-contents");
function opentab(tabname){
for(tablink of tablinks){
tablink.classList.remove("active-link");
}
for(tabcontent of tabcontents){
tabcontent.classList.remove("active-tab");
}
event.currentTarget.classList.add("active-link");
document.getElementById(tabname).classList.add("active-tab");
}
const scriptURL = 'https://script.google.com/macros/s/AKfycbzmBXcF3cWny2gBzHo8qI97M-FaYWQJbAjif7otcS3oBuDdlT0DfD-pVPmiw9xT5ne-/exec'
const form = document.forms['submit-to-google-sheet']
const msg = document.getElementById("Msg")
form.addEventListener('submit', e => {
e.preventDefault()
fetch(scriptURL, { method: 'POST', body: new FormData(form)})
.then(response => {
msg.innerHTML = "Your response has been recorded successfully"
setTimeout(function(){
msg.innerHTML=""
},5000)
form.reset()
})
.catch(error => console.error('Error!', error.message))
})
const gear = document.getElementById("gear");
const body = document.querySelector("body");
const me = document.querySelector(".me");
const ph = document.querySelector(".ph")
const about = document.getElementById("about")
function style(){
if(body.style.backgroundColor="rgb(14, 17, 51)"){
body.style.backgroundColor="white"
me.style.color="black";
ph.style.color="black";
about.style.color="black"
gear.style.transform="rotate(120deg)";
}
}
function style2(){
if(body.style.backgroundColor="white"){
body.style.backgroundColor="rgb(14, 17, 51)"
me.style.color="white";
ph.style.color="white";
about.style.color="white";
gear.style.transform="rotate(240deg)";
}
}
gear.addEventListener("click",()=>{
style();
})
gear.addEventListener("dblclick",()=>{
style2();
})
var sidemenu = document.getElementById("sidemenu");
function openmenu(){
sidemenu.style.right = "0px";
}
function closemenu(){
sidemenu.style.right = "-200px";
}