-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
99 lines (82 loc) · 2.8 KB
/
script.js
File metadata and controls
99 lines (82 loc) · 2.8 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
$(function () {
$(document).scroll(function () {
var $nav = $(".navConMain");
var $header = $(".header");
$nav.toggleClass('scrolled', $(this).scrollTop() > ($header.height()-100));
});
});
function reveal() {
var reveals = document.querySelectorAll(".reveal");
for (var i = 0; i < reveals.length; i++) {
var windowHeight = window.innerHeight;
var elementTop = reveals[i].getBoundingClientRect().top;
var elementVisible = 100;
if (elementTop < windowHeight - elementVisible) {
reveals[i].classList.add("active");
}
}
}
window.addEventListener("scroll", reveal);
//Future USe Code
// function logoSwitch () {
// $('.altLogo').each(function() {
// $(this).css('top',
// $('.startLogo').offset().top - $(this).closest('.row').offset().top
// );
// });
// };
// $(document).scroll(function() {logoSwitch();});
// logoSwitch();
// // Hide Button
// $(document).ready(function() {
// $("#toggle2").click(function() {
// var x = $("#toggle2").text();
// if (x == "Feedback") {
// //Stuff to do when btn is in the read more state
// $("#toggle2").text("Feedback");
// $("#text2").slideDown();
// }
// });
// });
// $(document).ready(function() {
// $("#toggle3").click(function() {
// var x = $("#toggle2").text();
// if (x == "Feedback") {
// //Stuff to do when btn is in the read more state
// $("#toggle2").text("Feedback");
// $("#text2").slideDown();
// }
// if (sidebarBox.classList.contains('active')) {
// sidebarBox.classList.remove('active');
// sidebarBtn.classList.remove('active');
// }
// });
// $('#close').click(function() {
// $("#text2").slideUp();
// });
// });
// //---NAV_BTN---//
// var sidebarBox = document.querySelector('#box');
// var sidebarBtn = document.querySelector('.clogo');
// var pageWrapper = document.querySelector('#main-content');
// sidebarBtn.addEventListener('click', function(event) {
// if (this.classList.contains('active')) {
// this.classList.remove('active');
// sidebarBox.classList.remove('active');
// } else {
// this.classList.add('active');
// sidebarBox.classList.add('active');
// }
// });
// pageWrapper.addEventListener('click', function(event) {
// if (sidebarBox.classList.contains('active')) {
// sidebarBtn.classList.remove('active');
// sidebarBox.classList.remove('active');
// }
// });
// window.addEventListener('keydown', function(event) {
// if (sidebarBox.classList.contains('active') && event.keyCode === 27) {
// sidebarBtn.classList.remove('active');
// sidebarBox.classList.remove('active');
// }
// });