-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
135 lines (126 loc) · 4.43 KB
/
main.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
var submitted = false; // This line for lesson inquiry submission form.
window.onload = function() {
if (window.location.hash == "") {
menu('home');
}
else if (window.location.hash.charAt(0) == "#") {
var navigate = window.location.hash.substr(1);
menu(navigate);
}
else {}
nonsenseLink();
};
function menu(selection) {
var menu = document.getElementsByClassName("buttonmobilewrap")[0];
var arrow;
if (selection == "activate") {
if (menu.clientHeight != 0) {
menu.style.height = "0px";
}
else {
menu.style.height = "auto";
}
return true;
}
if (selection == "about") {
selection = "home";
arrow = true;
}
menu.style.height = "0px";
var xhr = new XMLHttpRequest();
xhr.onload = function() {
a = this.responseXML;
try {
document.getElementsByTagName("content")[0].innerHTML = this.responseXML.getElementsByTagName("body")[0].childNodes[0].innerHTML;
}
catch(e) {
console.log(e); menu(selection);
}
if (this.responseXML.getElementsByTagName("body")[0].childNodes[2] != null) {
document.getElementsByTagName("content")[1].innerHTML = this.responseXML.getElementsByTagName("body")[0].childNodes[2].innerHTML;
}
else {document.getElementsByTagName("content")[1].innerHTML = "";}
if (arrow) {
let aboutBoundingClientRect = document.getElementById('about-header').getBoundingClientRect();
let menuBoundingClientRect = document.getElementsByTagName('menu')[0].getBoundingClientRect();
let padding = 15;
window.scrollTo({left: 0, top: aboutBoundingClientRect.top - menuBoundingClientRect.height - padding, behavior: 'smooth'});
arrow = false;
}
};
window.scrollTo(0, 0);
if (selection == "media") {window.scrollTo(0, 0);}
window.location.hash = selection;
xhr.open("GET", selection+".html");
xhr.responseType = "document";
xhr.send();
}
function arrow() {
if (window.innerWidth <= 835) {
window.scrollTo({left: 0, top: (window.innerHeight / 1.5), behavior: 'smooth'});
}
else {
window.scrollTo({left: 0, top: window.innerHeight, behavior: 'smooth'});
}
}
function textCounter(e, counter) {
limit = e.getAttribute("maxlength");
var countfield = document.getElementById(counter);
if (e.value.length >= limit - 15) {
countfield.innerText = "..." + (limit - e.value.length);
}
else {countfield.innerText = "";}
}
function inputDisplay(e, v) {
if (v == "piano") {
document.getElementById("piano-wrapper").style.display = "block";
document.getElementById("theoryHis-wrapper").style.display = "none";
document.getElementById("auralskills-wrapper").style.display = "none";
}
if (v == "theoryHis") {
document.getElementById("piano-wrapper").style.display = "none";
document.getElementById("theoryHis-wrapper").style.display = "block";
document.getElementById("auralskills-wrapper").style.display = "none";
}
if (v == "auralskills") {
document.getElementById("piano-wrapper").style.display = "none";
document.getElementById("theoryHis-wrapper").style.display = "none";
document.getElementById("auralskills-wrapper").style.display = "block";
}
}
function inquirySubmit() {
form = document.getElementById("gform");
text = document.getElementById("inquiry-form-text");
submit = document.getElementById("inquiry-form-submit-text");
form.style.opacity = "0";
text.style.opacity = "0";
window.scrollTo({left: 0, top: 0, behavior: 'smooth'});
form.addEventListener('transitionend', () => form.remove());
text.addEventListener('transitionend', () => text.remove());
submit.style.display = "block";
submit.style.opacity = "1";
}
function nonsenseLink()
{
var ao = "e";
var eidxf = "b";
var cy = "o";
var efsdjei = "n";
var idkje = "w";
var idffwec = "lt";
var easi = "s";
var edbidoe = "@";
var la = "ma";
var iosq = "al";
var ohd = "nd";
var dgls = ".";
var difjwof = "q";
var mzjn = "a";
var yfed = "c";
var ks = "i";
var goeh = "u";
var yhlkg = "x";
var jhf = "r";
document.getElementsByClassName("nonsenseLink")[0].href = la+ks+idffwec+cy+":"+ks+efsdjei+difjwof+goeh+ks+jhf+ks+ao+easi+edbidoe+iosq+ao+yhlkg+idkje+ks+ohd+easi+cy+jhf+dgls+yfed+mzjn;
document.getElementsByClassName("nonsenseLink")[0].innerText = ks+efsdjei+difjwof+goeh+ks+jhf+ks+ao+easi+edbidoe+iosq+ao+yhlkg+idkje+ks+ohd+easi+cy+jhf+dgls+yfed+mzjn;
}