-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
172 lines (122 loc) · 4.85 KB
/
index.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
var main = function () {
//setting up mobile menu
//$("#myMenu").css("height", window.innerHeight);
//$("#myMenu").css("width", window.innerWidth);
//setting the jumbotron text logo
if (window.innerWidth < 768){
$('#jumbotronFull').css("background-image", "url(Img/Img\background.png)");
$('#textLogo').css("width", window.innerWidth * 0.9);
$('#textLogo').attr("src", "Img/textLogoVertical.png");
} else {
$('#textLogo').css("width", window.innerWidth * 0.5);
$('#jumbotronFull').css("background-attachment", "fixed");
}
//making events square
if (window.innerWidth <768){
var bw = window.innerWidth;
$('.squareDiv').css({'height': bw + 'px'});
$('.square').css({ 'height': bw + 'px'});
$('.longHorizontal').height($('.squareDiv').height());
$('.fullsizeImg').css({ 'width': bw + 'px'});
} else {
var cw = $('.squareDiv').width();
$('.squareDiv').css({
'height': cw + 'px'
});
var cw = $('.square').width();
$('.square').css({
'height': cw + 'px'
});
//setting longHorizontal height
$('.longHorizontal').height($('.squareDiv').height());
}
$('#fullsizeDiv1').height($('#row1').height());
$('#fullsizeDiv2').height($('#row2').height());
$('#fullsizeDiv3').height($('#row3').height());
$('#fullsizeDiv4').height($('#row4').height());
//making rectDiv rectangular
//var cw = $('.rectDiv').width()*2;
//$('.rectDiv').css({
// 'height': cw + 'px'
//});
//making rectDiv same height as window
$('.rectDiv').css("height", window.innerHeight);
//setting jumbotron height
$("#jumbotronFull").css("height", window.innerHeight);
//setting when background should change
var changePoint = ($('#jumbotronFull').offset().top + $('#jumbotronFull').height() * 0.9);
$(window).on('scroll', function () {
//top of the screen
var top = Math.round($(window).scrollTop());
//if past changePoint, change the style
if (top > changePoint) {
$(".topnav").addClass('changeStyle');
$(".whiteLogo").attr("src","Img/redlogo.svg");
$('.hamburger').addClass('hChangeStyle');
// document.getElementById('logo').src = 'img/logo-big2.svg'
} else if (top < changePoint) {
$('.topnav').removeClass('changeStyle');
$(".whiteLogo").attr("src","Img/whitelogo.svg");
$('.hamburger').removeClass('hChangeStyle');
//document.getElementById('logo').src = 'img/logo-big.svg'
}
//setting up mobile menu
$("#myMenu").css("height", window.innerHeight);
$("#myMenu").css("width", window.innerWidth);
});
$(function () {
$('a[href*="#"]:not([href="#"])').click(function () {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
}
$(document).ready(main);
//opening the mobile menu
function openNav() {
document.getElementById("mySidenav").style.width = "250px";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
}
function moreInfo(title, text, href) {
$("#mTitle").text(title);
$("#mText").text(text);
document.getElementById("mySidebar").style.width = "300px";
document.getElementById("sendRequest").setAttribute("href", href);
// modal.style.display = "block";
}
function closeBar() {
document.getElementById("mySidebar").style.width = "0";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
}
// When the user clicks the button, open the modal
function openModal(head, description, paragraph, pic) {
$('#mhead').text(head);
$('#mdescription').text(description);
$('#mtext').text(paragraph);
document.getElementById("mImg").style.backgroundImage = pic;
var cw = $('.modal-content').width();
$("#myModal").fadeToggle(500);
}
// When the user clicks on <span> (x), close the modal
function closeModal() {
$("#myModal").fadeToggle(500);
}
//email script
function sendMail() {
var link = "mailto:[email protected]" + "?subject=" + escape(document.getElementById('mySubject').value) + "&body=" + escape(document.getElementById('myText').value);
window.location.href = link;
document.getElementById("myText").value = "";
document.getElementById("mySubject").value = "";
}