-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
120 lines (94 loc) · 2.47 KB
/
script.js
File metadata and controls
120 lines (94 loc) · 2.47 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
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
let menu = document.querySelector("#menu-icon");
let navbar = document.querySelector(".navbar");
menu.onclick = () => {
navbar.classList.toggle("active");
};
window.onscroll = () => {
navbar.classList.remove("active");
};
// Scroll Reveal
const sr = ScrollReveal({
origin: "top",
distance: "40px",
duration: 2000,
reset: true,
});
sr.reveal(
`.home-text, .home-img,
.about-img, .about-text,
.box, .s-box,
.btn, .connect-text,
.contact-box`,
{
interval: 200,
}
);
function toggleMenu() {
const navLinks = document.getElementById("navLinks");
navLinks.classList.toggle("active");
}
// Auto Typing Words
const span = document.querySelector("span");
const wordsList = ["Learn", "Grow", "Empower", "Succeed"];
function autoType(wordsList, element) {
let wordIndex = 0;
let characterIndex = 0;
let skipUpdate = 0;
let reverseType = false;
const intervalId = setInterval(() => {
if (skipUpdate) {
skipUpdate--;
return;
}
if (!reverseType) {
skipUpdate = 2;
element.innerText =
element.innerText + wordsList[wordIndex][characterIndex];
characterIndex++;
} else {
element.innerText = element.innerText.slice(
0,
element.innerText.length - 1
);
characterIndex--;
}
if (characterIndex === wordsList[wordIndex].length) {
skipUpdate = 6;
reverseType = true;
}
if (element.innerText.length === 0 && reverseType) {
reverseType = false;
wordIndex++;
}
if (wordIndex === wordsList.length) {
wordIndex = 0;
}
}, 100);
}
autoType(wordsList, span);
// Web Protection - Email Concealing
function CreateMail() {
var x = "TeachAndteach&gmail*c_o_m";
var y = "mai";
var z = "lto";
var s = "?subject=Customer Enquiry";
// Replace symbols in x to form the correct email
x = x.replace("&", "@");
x = x.replace("*", ".");
x = x.replace(/_/g, ""); // "TeachAndteach@gmail.com"
document.getElementById("mail").innerHTML =x;
}
CreateMail();
function OpenContact() {
var x = "TeachAndteach&gmail*c_o_m";
var y = "mai";
var z = "lto";
var s = "?subject=Customer Enquiry";
// Replace symbols in x to form the correct email
x = x.replace("&", "@");
x = x.replace("*", ".");
x = x.replace(/_/g, ""); // "TeachAndteach@gmail.com"
var b = y+z+x+s;
var gmailLink = `https://mail.google.com/mail/?view=cm&fs=1&to=${x}&su=${encodeURIComponent(s)}`;
window.location =gmailLink;
}