-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
156 lines (135 loc) · 5.62 KB
/
app.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
var cursor = {
delay: 8,
_x: 0,
_y: 0,
endX: (window.innerWidth / 2),
endY: (window.innerHeight / 2),
cursorVisible: true,
cursorEnlarged: false,
$dot: document.querySelector('.cursor-dot'),
$outline: document.querySelector('.cursor-dot-outline'),
init: function() {
this.dotSize = this.$dot.offsetWidth;
this.outlineSize = this.$outline.offsetWidth;
this.setupEventListeners();
this.animateDotOutline();
},
setupEventListeners: function() {
var self = this;
document.querySelectorAll('a').forEach(function(el) {
el.addEventListener('mouseover', function() {
self.cursorEnlarged = true;
self.toggleCursorSize();
});
el.addEventListener('mouseout', function() {
self.cursorEnlarged = false;
self.toggleCursorSize();
});
});
document.addEventListener('mousedown', function() {
self.cursorEnlarged = true;
self.toggleCursorSize();
});
document.addEventListener('mouseup', function() {
self.cursorEnlarged = false;
self.toggleCursorSize();
});
document.addEventListener('mousemove', function(e) {
self.cursorVisible = true;
self.toggleCursorVisibility();
self.endX = e.pageX;
self.endY = e.pageY;
self.$dot.style.top = self.endY + 'px';
self.$dot.style.left = self.endX + 'px';
});
},
animateDotOutline: function() {
var self = this;
self._x += (self.endX - self._x) / self.delay;
self._y += (self.endY - self._y) / self.delay;
self.$outline.style.top = self._y + 'px';
self.$outline.style.left = self._x + 'px';
requestAnimationFrame(this.animateDotOutline.bind(self));
},
toggleCursorSize: function() {
var self = this;
if (self.cursorEnlarged) {
self.$dot.style.transform = 'translate(-50%, -50%) scale(0.75)';
self.$outline.style.transform = 'translate(-50%, -50%) scale(1.5)';
} else {
self.$dot.style.transform = 'translate(-50%, -50%) scale(1)';
self.$outline.style.transform = 'translate(-50%, -50%) scale(1)';
}
},
toggleCursorVisibility: function() {
var self = this;
if (self.cursorVisible) {
self.$dot.style.opacity = 1;
self.$outline.style.opacity = 1;
} else {
self.$dot.style.opacity = 0;
self.$outline.style.opacity = 0;
}
}
}
cursor.init();
function modeChange(n){
let slider = document.querySelectorAll("#tickBox");
let bg= document.querySelector("body")
let card= document.querySelectorAll(".card")
if (slider[n].checked) {
document.querySelector(":root").style.setProperty('--primary', "#e1684d");
document.querySelector(":root").style.setProperty('--mouse', "#4071f4");
document.querySelector(":root").style.setProperty('--secondary', "#e1684d35");
document.querySelector(":root").style.setProperty('--text', "#fff");
document.querySelector(":root").style.setProperty('--primDark', "#ae3e25");
document.querySelector(":root").style.setProperty('--whitebg', "#232323");
document.querySelector(":root").style.setProperty('--transparent', "rgba(0, 0, 0, 0.15)");
bg.style.backgroundColor="var(--blackBg)";
document.querySelector(".formBox img").src="./assets/contact_Dark.svg"
card.forEach(i => {
i.style.backgroundColor="#232323"
});
}else{
document.querySelector(":root").style.setProperty('--primary', "#4071f4");
document.querySelector(":root").style.setProperty('--mouse', "#e1684d");
document.querySelector(":root").style.setProperty('--secondary', "#4071f435");
document.querySelector(":root").style.setProperty('--text', "#000");
document.querySelector(":root").style.setProperty('--primDark', "#3156bc");
document.querySelector(":root").style.setProperty('--whitebg', "rgb(235, 235, 235)");
document.querySelector(":root").style.setProperty('--transparent', "rgba(255, 255, 255, 0.15)");
bg.style.backgroundColor="var(--tertiary)";
document.querySelector(".formBox img").src="./assets/contact.svg"
card.forEach(i => {
i.style.backgroundColor="#fff"
});
}
}
let certiCont= document.querySelectorAll(".flip-container")
for (let index=3; index<certiCont.length; index++){
certiCont[index].style.display="none";
}
function more(){
let button= document.querySelector(".button")
if(certiCont[4].style.display=="none"){
for (let index=3; index<certiCont.length; index++){
certiCont[index].style.display="flex";
}
button.innerHTML="<span></span><span></span>SEE LESS<i class='material-symbols-outlined'>keyboard_double_arrow_up</i>";
}else{
for (let index=3; index<certiCont.length; index++){
certiCont[index].style.display="none";
}
button.innerHTML="<span></span><span></span>SEE ALL<i class='material-symbols-outlined'>keyboard_double_arrow_down</i>";
}
}
function blurEmail(email){
if (!(email.value.includes("@") && email.value.includes("."))) {
document.querySelector("#emailLabel").classList.add('labelUp')
email.classList.add("invalid")
}
}
function toggleMenu() {
const navLinks = document.getElementById('nav-links');
navLinks.classList.toggle('active');
}