From 4dfe6d7457eceece2c15eae883a6e00a4f56bc89 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Thu, 5 Mar 2020 02:12:36 -0500 Subject: complete rewrite --- js/init.js | 137 ------------------------------------------------------------- 1 file changed, 137 deletions(-) delete mode 100644 js/init.js (limited to 'js/init.js') diff --git a/js/init.js b/js/init.js deleted file mode 100644 index 6739cf9..0000000 --- a/js/init.js +++ /dev/null @@ -1,137 +0,0 @@ -/*----------------------------------------------------------------------------------- -/* -/* Init JS -/* ------------------------------------------------------------------------------------*/ - - jQuery(document).ready(function($) { - -/*----------------------------------------------------*/ -/* FitText Settings ------------------------------------------------------- */ - - setTimeout(function() { - $('h1.responsive-headline').fitText(1, { minFontSize: '40px', maxFontSize: '90px' }); - }, 100); - - -/*----------------------------------------------------*/ -/* Smooth Scrolling ------------------------------------------------------- */ - - $('.smoothscroll').on('click',function (e) { - e.preventDefault(); - - var target = this.hash, - $target = $(target); - - $('html, body').stop().animate({ - 'scrollTop': $target.offset().top - }, 800, 'swing', function () { - window.location.hash = target; - }); - }); - - -/*----------------------------------------------------*/ -/* Highlight the current section in the navigation bar -------------------------------------------------------*/ - - var sections = $("section"); - var navigation_links = $("#nav-wrap a"); - - sections.waypoint({ - - handler: function(event, direction) { - - var active_section; - - active_section = $(this); - if (direction === "up") active_section = active_section.prev(); - - var active_link = $('#nav-wrap a[href="#' + active_section.attr("id") + '"]'); - - navigation_links.parent().removeClass("current"); - active_link.parent().addClass("current"); - - }, - offset: '35%' - - }); - - -/*----------------------------------------------------*/ -/* Make sure that #header-background-image height is -/* equal to the browser height. ------------------------------------------------------- */ - - $('header').css({ 'height': $(window).height() }); - $(window).on('resize', function() { - - $('header').css({ 'height': $(window).height() }); - $('body').css({ 'width': $(window).width() }) - }); - - -/*----------------------------------------------------*/ -/* Fade In/Out Primary Navigation -------------------------------------------------------*/ - - $(window).on('scroll', function() { - - var h = $('header').height(); - var y = $(window).scrollTop(); - var nav = $('#nav-wrap'); - - if ( (y > h*.20) && (y < h) && ($(window).outerWidth() > 768 ) ) { - nav.fadeOut('fast'); - } - else { - if (y < h*.20) { - nav.removeClass('opaque').fadeIn('fast'); - } - else { - nav.addClass('opaque').fadeIn('fast'); - } - } - - }); - - -/*----------------------------------------------------*/ -/* Modal Popup -------------------------------------------------------*/ - - $('.item-wrap a').magnificPopup({ - - type:'inline', - fixedContentPos: false, - removalDelay: 200, - showCloseBtn: false, - mainClass: 'mfp-fade' - - }); - - $(document).on('click', '.popup-modal-dismiss', function (e) { - e.preventDefault(); - $.magnificPopup.close(); - }); - - -/*----------------------------------------------------*/ -/* Flexslider -/*----------------------------------------------------*/ - $('.flexslider').flexslider({ - namespace: "flex-", - controlsContainer: ".flex-container", - animation: 'slide', - controlNav: true, - directionNav: false, - smoothHeight: true, - slideshowSpeed: 7000, - animationSpeed: 600, - randomize: false, - }); - -}); - -- cgit 1.4.1