-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
124 lines (113 loc) · 3.65 KB
/
script.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
//Display and Not-Display function
function Displayhamburger(ele){
let element = document.getElementById(ele)
if (element.style.display == 'none')
{
element.style.display = 'block';
}
else
{
element.style.display = 'none';
}
}
function ToSection(section){
location.href = section;
}
let hambuger = document.getElementById('toggle-btn');
hambuger.onclick = function(){
Displayhamburger('toggle')
}
let cancel = document.getElementById('cancel-toggle');
cancel.onclick = function(){
Displayhamburger('toggle');
}
function AboutProject(sbutton) {
let a = 'about-button';
let b = 'project-button';
let c = 0;
let d = 0;
if (sbutton == b){
a = document.getElementById(a);
} else {
a = document.getElementById(b);
}
b = document.getElementById(sbutton);
if (a.style.backgroundColor == 'white'){
console.log(sbutton.slice(0, 5));
}
else {
a.style.color = '#330033';
a.style.backgroundColor = 'white';
b.style.color = 'white';
b.style.backgroundColor = '#330033';
if (sbutton.slice(0, 5) == 'about'){
c = document.getElementById('about');
d = document.getElementById('project');
c.style.display = 'none';
d.style.display = 'block';
}
else {
c = document.getElementById('about');
d = document.getElementById('project');
c.style.display = 'block';
d.style.display = 'none';
}
console.log(sbutton.slice(0, 5));
}
}
let aboutButton = document.getElementById("about-button");
let projectButton = document.getElementById("project-button");
aboutButton.onclick = function() {
AboutProject('project-button');
}
projectButton.onclick = function() {
AboutProject('about-button');
}
let contact = document.querySelectorAll('.cont');
for (let i = 0; i < contact.length; i++){
contact[i].onclick = function(){
let ele = document.getElementById('contact-form');
let ele_2 = document.getElementById('toggle');
ele.style.display = 'block';
ele_2.style.display = 'none';
ToSection('#contact-form');
}
}
let cancel_contact = document.getElementById('cancel_contact');
cancel_contact.onclick = function(){
Displayhamburger('contact-form');
}
let about = document.querySelectorAll('.abt');
for (let i = 0; i < about.length; i++) {
about[i].onclick = function(){
let ele = document.getElementById('about');
let ele_2 = document.getElementById('project');
ele.style.display = 'block';
ele_2.style.display = 'none';
let b = document.getElementById('about-button');
let a = document.getElementById('project-button');
b.style.color = '#330033';
b.style.backgroundColor = 'white';
a.style.color = 'white';
a.style.backgroundColor = '#330033';
}
}
let project = document.querySelectorAll('.proj');
for (let i = 0; i < project.length; i++) {
project[i].onclick = function(){
let ele = document.getElementById('project');
let ele_2 = document.getElementById('about');
ele.style.display = 'block';
ele_2.style.display = 'none';
let a = document.getElementById('about-button');
let b = document.getElementById('project-button');
b.style.color = '#330033';
b.style.backgroundColor = 'white';
a.style.color = 'white';
a.style.backgroundColor = '#330033';
}
}
// font-family: 'Anton', sans-serif;
// font-family: 'Nunito', sans-serif;
// font-family: 'Open Sans', sans-serif;
// font-family: 'Outfit', sans-serif;