From bb66ea0132e85918894629b59e1a5ebffd000122 Mon Sep 17 00:00:00 2001 From: lasse Date: Fri, 8 May 2015 21:02:21 +0200 Subject: [PATCH] prevent logo from merge --- web/img/white_PZI_logo.svg | 70 ++++++++++++++++++++ web/js/mainScripts_single.js | 122 +++++++++++++++++++++++++++++++++++ 2 files changed, 192 insertions(+) create mode 100644 web/img/white_PZI_logo.svg create mode 100644 web/js/mainScripts_single.js diff --git a/web/img/white_PZI_logo.svg b/web/img/white_PZI_logo.svg new file mode 100644 index 0000000..3355c46 --- /dev/null +++ b/web/img/white_PZI_logo.svg @@ -0,0 +1,70 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/web/js/mainScripts_single.js b/web/js/mainScripts_single.js new file mode 100644 index 0000000..4c51a09 --- /dev/null +++ b/web/js/mainScripts_single.js @@ -0,0 +1,122 @@ +// DEFINE GLOBAL VARIABLES + +var hashOptions; +hashOptions = window.location.hash.replace('#filters', '') +var is_chrome = /chrome/i.test( navigator.userAgent ); +var slideLock = false; +var isMobile = { + Android: function() { + return navigator.userAgent.match(/Android/i); + }, + BlackBerry: function() { + return navigator.userAgent.match(/BlackBerry/i); + }, + iOS: function() { + return navigator.userAgent.match(/iPhone|iPad|iPod/i); + }, + Opera: function() { + return navigator.userAgent.match(/Opera Mini/i); + }, + Windows: function() { + return navigator.userAgent.match(/IEMobile/i); + }, + any: function() { + return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); + } +}; + +// DEFINE FUNCTIONS + +function windowHeightDivs(){ + if(!isMobile.any()){ + $("#logoWrap").css({"margin-top":$(window).height()-$("#logoWrap").outerHeight()-10+"px"}) + } + $(".zwartArea").css({ + "min-height": $(window).height()+"px" + }) +} + + +function stickyElements(){ + $('#filter').fixedsticky(); +} + + +function sidebarOff(){ + if($(window).width()>768){ + $(".closeSidebar").css('display','none') + $("#sidebarInner").slideDown(0) + } else { + if(slideLock == false){ + $("#sidebarInner").slideUp(0) + } + $(".closeSidebar").css('display','block') + } +} + +function ifSticky(){ + if (!$("#filter").hasClass('fixedsticky-on')){ + if($(document).scrollTop()>$('#zwartIntro').height()-1){ + if(is_chrome){$('#filter').css({'position':'fixed'})} + if($(window).width()<768){ + $(".closeSidebar").css('display','block') + if(slideLock == false){ + // $("#sidebarInner").slideDown(0) + } + }else{ + $("#sidebarInner").slideDown(200) + } + } else{ + if(is_chrome){$('#filter').css({'position':''})} + if($(window).width()<768){ + $(".closeSidebar").css('display','none') + if(slideLock == false){ + $("#sidebarInner").slideUp(0) + } + }else{ + $("#sidebarInner").slideUp(200) + } + } + } + +} + +$(".closeSidebar").click(function(){ + $("#sidebarInner").slideToggle() + if(slideLock == false){ + slideLock = true + $(".closeSidebar").html('') + }else{ + slideLock = false + $(".closeSidebar").html('') + } +}); + +function toggleDescInner(){ + $("#sideBarDescInnerToggle").on('click', function(){ + $("#sideBarDescInner").slideToggle() + }) +} + +$('#filter').hover(function(){ + $('.hoverBack').text("Return to index page"); +}, function() { + $('.hoverBack').text("PZI: Master Media Design & Communication"); +}); + + +// RUN THE FUNCTIONS + +windowHeightDivs() +stickyElements() +toggleDescInner() +sidebarOff() + +document.onscroll = function() { + ifSticky() +}; + +$( window ).resize(function() { + windowHeightDivs() + sidebarOff() +})