-
Notifications
You must be signed in to change notification settings - Fork 2
/
footer.php
executable file
·381 lines (336 loc) · 11.4 KB
/
footer.php
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<?php
/**
* The template for displaying the footer
*
* Contains the closing of the "off-canvas-wrap" div and all content after.
*
* @package FoundationPress
* @since FoundationPress 1.0.0
*/
?>
</section>
<div id="footer-container">
<footer id="footer">
<?php do_action( 'foundationpress_before_footer' ); ?>
<?php dynamic_sidebar( 'footer-widgets' ); ?>
<?php do_action( 'foundationpress_after_footer' ); ?>
</footer>
</div>
<div id="copyright-container">
<footer id="copyright" <?php if( get_theme_mod('social-copyright') != '' ) { ?>class="has-social"<?php } ?>>
<?php if( get_theme_mod('social-copyright') != '') { ?><div class="small-12 large-9"><?php } ?>
<?php if( get_theme_mod('copyright')): ?>
<p>© <?php echo date('Y'); ?> <?php echo get_theme_mod('copyright','default'); ?></p>
<?php else: ?>
<p>© <?php echo date('Y'); ?> <?php bloginfo('name'); ?></p>
<?php endif; ?>
<?php if( get_theme_mod('social-copyright') != '' ) { ?></div><div class="small-12 large-3"><?php echo do_shortcode('[bs_social_urls]');?></div><?php } ?>
</footer>
</div>
<div id="back-top">
<a href="#" title="Back to top"><i class="fa fa-chevron-up"></i></a>
</div>
<?php do_action( 'foundationpress_layout_end' ); ?>
<?php if ( ! get_theme_mod( 'wpt_mobile_menu_layout' ) || get_theme_mod( 'wpt_mobile_menu_layout' ) == 'offcanvas' ) : ?>
</div><!-- Close off-canvas wrapper inner -->
</div><!-- Close off-canvas wrapper -->
</div><!-- Close off-canvas content wrapper -->
<?php endif; ?>
<?php wp_footer(); ?>
<script type="text/javascript">
var windowWidth;
var headerHeight;
var topScrollOffset;
var windowWidth = jQuery(window).width();
var headerHeight = jQuery('#masthead').height();
if(windowWidth > 640) {
var topScrollOffset = '112';
} else {
var topScrollOffset = '0';
}
jQuery(document).ready(function($) {
// Show/Hide Search Form
$('button.search-toggle').click(function() {
$('nav.top-bar.has-search .menu-search-wrapper form#searchform').toggleClass('show');
});
// $('input[type="checkbox"]').click(function() {
// var inputID = $(this).attr('id');
// $('label[for="' + inputID + '"]').toggleClass('checked');
// });
$('ul.project-filters li.projects a').click(function() {
$('#projects-list').addClass('show-filters');
$('body').addClass('filters-open');
$('input#impact-all').click();
return false;
});
$('.close-project-filters a').click(function() {
$('#projects-list.show-filters').removeClass('show-filters');
$('body').removeClass('filters-open');
return false;
});
$heightOnLoad = $('#home-hero-wrapper').height();
// console.log($heightOnLoad);
$(window).resize(function() {
$('body.mobile #home-hero-wrapper').css({'min-height':$heightOnLoad});
});
});
jQuery(document).ready(function($) {
$('#preloader img').delay(10).show();
$('.home #video-iframe-1').delay(500).load(function() {
// Site Preloader
$('#preloader').addClass('loaded')
// $('#preloader img').fadeIn('fast');
// $('#preloader .spinner').addClass('loaded');
// $('#preloader img').addClass('loaded');
$('#preloader.loaded').delay(250).fadeOut(1000, function() {
$(this).hide();
});
});
$(window).imagesLoaded(function() {
// Site Preloader
$('#preloader').addClass('loaded')
// $('#preloader img').fadeIn('fast');
// $('#preloader .spinner').addClass('loaded');
// $('#preloader img').addClass('loaded');
$('#preloader.loaded').delay(250).fadeOut(1000, function() {
$(this).hide();
});
});
// Back to top script
$('#back-top').hide();
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 800) {
$('#back-top').fadeIn();
} else {
$('#back-top').fadeOut();
}
});
if($('body').hasClass('mobile')) {
// do nothing
} else {
$('#back-top a').click(function () {
$('body,html').animate({ scrollTop: '0px' }, 'slow');
return false;
});
}
});
// Float Labels
function floatLabel(inputType) {
$(inputType).each(function(){
var $this = $(this);
$this.focus(function(){
$this.closest('li.gfield').find('label').attr("data-attr","active");
});
$this.blur(function(){
if($this.val() === '' || $this.val() === 'blank'){
$this.closest('li.gfield').find('label').attr("data-attr","");
}
});
});
}
floatLabel(".floatLabel input");
floatLabel(".floatLabel textarea");
});
// Masonry Layout for Portfolio, Blog Posts, and Events
(function ($) {
var $container = $('.bs-isotope');
$container.imagesLoaded(function() {
$container.isotope({
itemSelector: '.bs-isotope-item',
layoutMode: 'masonry'
});
$container.isotope('layout').isotope();
});
$(window).trigger('resize');
}(jQuery));
// Lazy Load with Isotope/Masonry Layout
$('.lazy-isotope-wrapper').each(function(){
var $isotope = $('.lazy-isotope', this);
$isotope.isotope({
itemSelector: '.bs-isotope-item',
layoutMode: 'masonry'
});
$isotope[0].addEventListener('load', (function(){
var runs;
var update = function(){
$isotope.isotope('layout');
runs = false;
};
return function(){
if(!runs){
runs = true;
setTimeout(update, 33);
}
};
}()), true);
});
// Isotope Filters for Portfolio
jQuery(document).ready(function($) {
// cache container
var $container = $('.portfolio-container');
// filter items when filter link is clicked
$('#filters a').click(function(){
var selector = $(this).attr('data-filter');
$container.isotope({ filter: selector });
$('#filters a.active').not(this).removeClass('active');
$(this).addClass('active');
return false;
});
$('.title-bar .menu-icon').click(function() {
$('body').toggleClass('off-canvas-open');
});
jQuery('.portfolio-filter-toggle a').click(function() {
$('#filters').slideToggle('fast');
return false;
});
});
// initiating the isotope page
jQuery(window).load(function($) {
// Store # parameter and add "." before hash
var hashID = "." + window.location.hash.substring(1);
// the current version of isotope, the hack works in v2 also
var $container = jQuery('.portfolio-container');
$container.imagesLoaded(function(){
$container.isotope({
itemSelector: ".single-portfolio-item",
filter: hashID, // the variable filter hack
});
jQuery('#filters a.active').removeClass('active');
jQuery('#filters a[data-filter="' + hashID + '"]').addClass('active');
});
});
jQuery(function($) {
// Scroll to hash on click
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
console.log(target);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top - topScrollOffset
}, 1000);
return false;
}
}
});
});
<?php if( get_theme_mod( 'sticky-header' ) != '') { ?>
// Sticky Header Classie script
function init() {
window.addEventListener('scroll', function(e){
var distanceY = window.pageYOffset || document.documentElement.scrollTop,
stickPrep = jQuery('#masthead').height() + 35,
header = document.querySelector("body");
if (distanceY > stickPrep) {
classie.add(header,"sticky-prep");
} else {
if (classie.has(header,"sticky-prep")) {
classie.remove(header,"sticky-prep");
}
}
});
window.addEventListener('scroll', function(e){
var distanceY = window.pageYOffset || document.documentElement.scrollTop,
stickOn = jQuery('#masthead').height() + jQuery('.top-bar-bottom').height(),
header = document.querySelector("body");
if (distanceY > stickOn) {
classie.add(header,"sticky-header");
} else {
if (classie.has(header,"sticky-header")) {
classie.remove(header,"sticky-header");
}
}
});
}
window.onload = init();
<?php } ?>
$('.bs-carousel').slick({
dots: false,
infinite: false,
speed: 300,
slidesToShow: 3,
slidesToScroll: 1,
arrows: true,
prevArrow: '<button aria-hidden="true" role="presentation" type="button" class="slick-prev"><img src="<?php echo get_stylesheet_directory_uri(); ?>/assets/img/prev-arrow.svg" alt="Previous Arrow" width="20" /></button>',
nextArrow: '<button aria-hidden="true" role="presentation" type="button" class="slick-next"><img src="<?php echo get_stylesheet_directory_uri(); ?>/assets/img/next-arrow.svg" alt="Next Arrow" width="20" /></button>',
responsive: [{
breakpoint: 1024,
settings: {
slidesToShow: 2,
slidesToScroll: 1,
infinite: true,
}
},{
breakpoint: 600,
settings: {
slidesToShow: 2,
slidesToScroll: 1
}
},{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}]
});
$('.portfolio-gallery').slick({
dots: true,
infinite: true,
speed: 300,
slidesToShow: 1,
slidesToScroll: 1,
arrows: false
});
;( function( $ ) {
$( '.swipebox' ).swipebox( {
useCSS : true, // false will force the use of jQuery for animations
useSVG : true, // false to force the use of png for buttons
initialIndexOnArray : 0, // which image index to init when a array is passed
hideCloseButtonOnMobile : false, // true will hide the close button on mobile devices
removeBarsOnMobile : true, // false will show top bar on mobile devices
hideBarsDelay : 3000000, // delay before hiding bars on desktop
videoMaxWidth : 1140, // videos max width
beforeOpen: function() {}, // called before opening
afterOpen: null, // called after opening
afterClose: function() {}, // called after closing
loopAtEnd: false // true will return to the first image after the last image is reached
} );
} )( jQuery );
jQuery(function($) {
// Scroll to hash on click
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
console.log(target);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('.top-bar-right .menu li.active').removeClass('active');
$(this).addClass('active');
$('html, body').animate({
// scrollTop: target.offset().top - topScrollOffset
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
//Light header switch Waypoint script
shrinkOn = jQuery('#masthead').height() * 2;
// var sharewaypoint = new Waypoint({
// element: document.getElementById('toggle-reverse'),
// handler: function(direction) {
// jQuery('#masthead').toggleClass('reverse-header');
// jQuery('.down-arrow').removeClass('animated');
// },
// offset: shrinkOn
// });
</script>
<?php do_action( 'foundationpress_before_closing_body' ); ?>
<script id="__bs_script__">//<![CDATA[document.write("<script async src='http://HOST:3000/browser-sync/browser-sync-client.2.12.3.js'><\/script>".replace("HOST", location.hostname));
//]]></script>
</body>
</html>