/** * v1.3 - Copyright 2017 Madden Media - All rights reserved. * * A set of parallax design functionality. */ !function(a){"use strict";a.fn.parallaxBG=function(b){var c=a(window).height(),d=0,e=a(window).scrollTop(),f=0,g=0,h=a.extend({adjustX:0,adjustY:0,bgXOffset:0,bgYOffset:0,bgXPosition:"100%",bgYPosition:"100%"},b);return this.each(function(){var b=a(this);a(window).scroll(function(){var i=h.bgXAdjust,j=b.css("backgroundPosition").split(" ");parseInt(j[0]);if(e=a(window).scrollTop(),f=b.offset().top,g=b.outerHeight(),e=e+c)){var l=0==h.adjustX?h.bgXPosition:Math.round((f-e)*h.adjustX)+0+h.bgXOffset+"px",m=0==h.adjustY?h.bgYPosition:Math.round((f-e)*h.adjustY)+0+h.bgYOffset+"px";b.css("background-position",l+" "+m)}})})},a.fn.zoomBG=function(b){var c=a(window).height(),d=0,e=a(window).scrollTop(),f=0,g=0,h=a.extend({zoomOut:0,zoomIn:0,zoomRate:1,zoomOn:"Y",bgSizeX:"auto",bgSizeY:"auto"},b);return this.each(function(){var b=a(this),i="X"==h.zoomOn?0:1;a(window).scroll(function(){var j=h.zoomRate,k=b.css("backgroundSize").split(" "),l=parseInt(Number(k[i].replace("%","")));e=a(window).scrollTop(),f=b.offset().top,g=b.outerHeight(),e=e+c||m>=h.zoomIn||m<=h.zoomOut)){var n="X"==h.zoomOn?m+"% "+h.bgSizeY:h.bgSizeX+" "+m+"%";b.css("background-size",n)}})})},a.fn.parallaxLockElement=function(b){var c=!1,d=a.extend({parentEl:"",offsetTop:0,additionalCSS:void 0,onLock:void 0,onRelease:void 0},b);return this.each(function(){var b=a(this),e=a(d.parentEl);a(window).scroll(function(){var f=parseInt(e.offset().top-a(window).scrollTop()-d.offsetTop),g=e.offset().top+e.outerHeight(),i=(parseInt(b.outerHeight()),e.offset().top+e.outerHeight()-(b.offset().top+b.outerHeight()));f<=0?g+i<=a(window).scrollTop()+a(window).innerHeight()?c&&(c=!1,b.css({position:"absolute",top:"inherit",bottom:i+"px"}),"function"==typeof d.onRelease&&d.onRelease(this)):(b.css({position:"fixed",top:d.offsetTop+"px",bottom:"auto"}),"function"==typeof d.onLock&&d.onLock(this),c=!0):(b.css({position:"relative",top:"auto"}),"function"==typeof d.onRelease&&d.onRelease(this),c=!1),void 0!=d.additionalCSS&&b.css(d.additionalCSS)})})},a.fn.parallaxAnimateElement=function(b){var c=new Array,d=0,e=0,f=!1,g=a.extend({frames:1,elementClass:"floatingElement",elementFrameClassRoot:"frame",startOffset:null,endOffset:null,showWhenCentered:!1,centerOffsetAnimationRange:null,lock:!1,parentEl:"",offsetTop:0,additionalCSS:void 0,onLock:void 0,onRelease:void 0},b);g.lock?a(this).parallaxLockElement({parentEl:g.parentEl,offsetTop:g.offsetTop,additionalCSS:g.additionalCSS,onLock:g.onLock,onRelease:g.onRelease}):f=!0;var h=parseInt(a(this).parent().height());if(g.showWhenCentered)null==g.centerOffsetAnimationRange?g.centerOffsetAnimationRange=1:g.centerOffsetAnimationRange.indexOf("%")!=-1?g.centerOffsetAnimationRange=parseInt(g.centerOffsetAnimationRange)/100:g.centerOffsetAnimationRange=1;else{if(null!=g.startOffset)if(g.startOffset.indexOf("%")!=-1){var i=parseInt(g.startOffset)/100;d=Math.floor(h*i)}else{var i=parseInt(g.startOffset);d=i}if(null!=g.endOffset)if(g.endOffset.indexOf("%")!=-1){var i=parseInt(g.endOffset)/100;e=Math.floor(h-h*i)}else{var i=parseInt(g.endOffset);e=i}0==d&&0==e||(h=h-e-d);for(var j=h/g.frames,k=1;k<=g.frames;k++)c.push(Math.floor(d+j*k));f&&void 0!=g.additionalCSS&&a(this).css(g.additionalCSS)}return this.each(function(){var b=a(this),d=c.length,e=g.showWhenCentered?a(this).height()*g.centerOffsetAnimationRange:a(this).height();a(window).scroll(function(){var f=b.offset().top,h=!(f+b.outerHeight()<=a(window).scrollTop()||f>=a(window).scrollTop()+a(window).height());if(h){if(g.showWhenCentered){var i=parseInt(b.offset().top-a(window).scrollTop()),j=parseInt(i+e/2),k=parseInt(a(window).innerHeight()/2),l=parseInt(j-e),m=parseInt(j+e);if(k=l&&k<=m){var n=Math.max(0,Math.min(1,1-(l+(j-k))/j));d=Math.ceil(g.frames*n)}else d=g.frames}else for(var o=parseInt(b.parent().offset().top-a(window).scrollTop()),p=o*-1+e/2,q=0;q";t.append(a)}},unFixBGImagesForIPads=function(e){e=void 0===e?".chapterImage":e,getIsLarge()&&getIsIPad()&&$(e).css("background-attachment","scroll")},getLazyLoadPluginObject=function(){return _lazyLoadObject},getCurrentChapter=function(){return _onChapter},getVisibleViewport=function(e){return e?window.innerHeight-_stickyTopBarHeight+"px":parseInt(window.innerHeight-_stickyTopBarHeight)},getViewportOffset=function(e,t){return t?jQuery(e).offset().top-jQuery(window).scrollTop()-_stickyTopBarHeight+"px":parseInt(jQuery(e).offset().top-jQuery(window).scrollTop()-_stickyTopBarHeight)},getItemInViewport=function(e){var t=jQuery(e).offset().top;return!(t+jQuery(e).outerHeight()<=jQuery(window).scrollTop()||t>=jQuery(window).scrollTop()+jQuery(window).height())},getItemInViewportCenter=function(e,t){var r=jQuery(e).offset().top,o=jQuery(window).height()/2;return t=t||0,!(r>=jQuery(window).scrollTop()+o+t||r<=jQuery(window).scrollTop()+o-t)},getStickyTopBarHeight=function(){return _stickyTopBarHeight},getIsSmall=function(){return _isSmall},getIsMedium=function(){return _isMedium},getIsLarge=function(){return _isLarge},getIsMobile=function(){return"undefined"!=typeof console&&console.log("%c NOTICE getIsMobile()) deprecated - use getIsSmall()","background:orange; color:black"),_isSmall},getIsTablet=function(){return"undefined"!=typeof console&&console.log("%c NOTICE getIsTablet()) deprecated - use getIsMedium()","background:orange; color:black"),_isMedium},getDoParallax=function(){return"undefined"!=typeof console&&console.log("%c NOTICE getDoParallax()) deprecated - use getIsLarge()","background:orange; color:black"),_isLarge},getIsDesktop=function(){return!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},getIsIPad=function(){return navigator.userAgent.match(/iPad;.*CPU.*OS/i)},getIsNewerIPad=function(){return!!getIsIPad()&&1!=window.devicePixelRatio},getIsResponsive=function(){return IS_RESPONSIVE},adjustLayoutAfterResize=function(){initChapterTops(!0)},adjustChapterLinksArtHeight=function(e,t){jQuery(e).css("height",jQuery(t).outerHeight())},adjustSizeToParentAndViewport=function(e,t){jQuery(e).css("height",getVisibleViewport(!0)),jQuery(e).css("width",jQuery(t).width())},adjustSizeHeightToParent=function(e,t){var r=jQuery(t).height();jQuery(e).css("height",r+"px")},equalizeElementHeightsToTallest=function(e){for(var t=0,r=0;r=_chapterTops[o]){t=o+1;break}return-1!=t&&adjustChapterLinks(t),t}},adjustChapterLinks=function(e){jQuery(_chapterLinkEl).each(function(){jQuery(this).attr("href")!="#"+e?"function"==typeof _setChapterLinkCallback&&_setChapterLinkCallback(this,!1):("function"==typeof _setChapterLinkCallback&&_setChapterLinkCallback(this,!0),_onChapter=e)})},adjustMultiSizedImages=function(){"undefined"!=typeof console&&console.log("%c NOTICE adjustMultiSizedImages()) deprecated - lazy load is automatically managed","background:orange; color:black")},toTop=function(){jQuery("html, body").animate({scrollTop:0},600)},runTopMenuControl=function(){getIsSmall()?toggleMobileMenu(_mobileMenuEl,_topAndMobileMenuControl):toTop()},toggleMobileMenu=function(e,t){getIsSmall()&&(jQuery(e).toggle("fast"),jQuery(t).toggle("fast"))},goToChapter=function(e){var t=jQuery(_chapterElPrefix+e).offset().top-_stickyTopBarHeight+1,r=e<_onChapter?_onChapter-e:e-_onChapter,o=Math.floor(1e3/(_chapterTops.length-(_chapterTops.length-r)));jQuery("html, body").animate({scrollTop:t},o,function(){adjustChapterLinks(e),"function"==typeof _chapterSetCompleteCallback&&_chapterSetCompleteCallback(e)}),_onChapter=e},animateOverflowContent=function(e,t,r,o,a){if(a==_onChapter){var n=jQuery(e).css("background-position").split(" "),i=isNaN(t)?t:t+parseInt(n[0])+"px",l=isNaN(r)?r:r+parseInt(n[1])+"px";jQuery(e).css({"background-position":i+" "+l})}window.setTimeout(function(){animateOverflowContent(e,t,r,o,a)},o)},cycleImages=function(e,t){var r=jQuery(e+" .active"),o=0 Available for Lodging Guests Only", style: "sections", imgPath: "c2_side-img_ceremonyvenues.jpg", payload: [ { subhead: "", listings: [ { name: "KeyThe Captain Wohlt Inn", path: "https://www.captainwohltinn.com/" }, { name: "Fernweh Distilling Co. & The Loft at Fernweh Distilling Co.", path: "https://www.fernwehdistilling.com/top.aspx" }, { name: "Hermann Hill Weddings", path: "http://hermannmoweddings.com/" }, { name: "Inn at Hermannhof", path: "https://www.innathermannhof.com/" }, { name: "St. Martin's Church Museum", path: "https://www.facebook.com/stmartinschurchmuseum/" }, { name: "Stone Hill Winery", path: "https://stonehillwinery.com/event-venue-in-hermann-mo/" }, { name: "Shrine of Our Lady of Sorrows", path: "https://www.facebook.com/ShrineofOurLadyofSorrows/" }, { name: "The Rotunda", path: "https://www.facebook.com/rotundahermann/" }, { name: "KeyVinchester Inn", path: "https://www.vinchesterinn.com/the-north-star" }, ] } ] }, receptionVenues: { title: "Reception Venues", content: "Key Available for Lodging Guests Only", style: "sections", imgPath: "c2_side-img_receptionvenues.jpg", payload: [ { subhead: "", listings: [ { name: "1906 Firehouse", path: "https://www.hermannareachamber.com/" }, { name: "Hermann Wurst Haus", path: "https://www.hermannwursthaus.com/catering/" }, { name: "4th Street Pizza", path: "http://fourthstreetpizza.com/" }, { name: "Concert Hall and Barrel Tavern", path: "http://concerthallandbarrel.com/" }, { name: "KeyThe Captain Wohlt Inn", path: "https://www.captainwohltinn.com/" }, { name: "Fernweh Distilling Co. & The Loft at Fernweh Distilling Co.", path: "https://www.fernwehdistilling.com/top.aspx" }, { name: "Hermann 1837 Bar", path: "https://hermanncrownhotel.com/hermann-1837-cellar-bar/" }, { name: "Hermann Fraternal Order of Eagles", path: "https://www.facebook.com/HermannEaglesAuxiliary1328/" }, { name: "Hermann Hill Weddings", path: "http://hermannmoweddings.com/" } ] }, { subhead: "", listings: [ { name: "Hermann VFW", path: "https://www.facebook.com/people/Hermann-VFW-Post-4182/100064839395205/" }, { name: "Inn at Hermannhof", path: "https://www.innathermannhof.com/Weddings" }, { name: "Loose Caboose Saloon", path: "http://facebook.com/hermannloosecaboose" }, { name: "Stone Hill Winery", path: "https://stonehillwinery.com/event-venue-in-hermann-mo/" }, { name: "The Rotunda", path: "https://www.facebook.com/rotundahermann/" }, { name: "Tin Mill Restaurant Celebration Hall", path: "https://www.innathermannhof.com/Weddings" }, { name: "Valentine Hall", path: "http://www.valentinehall.org/" }, { name: "KeyVinchester Inn", path: "http://vinchesterinn.com/the-north-star" }, { name: "Vintage Restaurant at Stone Hill Winery", path: "https://stonehillwinery.com/event-venue-in-hermann-mo/" }, { name: "White House Hotel", path: "https://www.thewhitehousehotel1868.com/" }, ] } ] }, rehearsalVenues: { title: "Rehearsal Venues", content: "Key Available for Lodging Guests Only", style: "sections", imgPath: "c2_side-img_rehearsalvenues.jpg", payload: [ { subhead: "", listings: [ { name: "1906 Firehouse", path: "https://www.hermannareachamber.com/" }, { name: "4th Street Pizza", path: "http://fourthstreetpizza.com/" }, { name: "Concert Hall and Barrel Tavern", path: "http://concerthallandbarrel.com/" }, { name: "KeyThe Captain Wohlt Inn", path: "https://www.captainwohltinn.com/" }, { name: "Fernweh Distilling Co. & The Loft at Fernweh Distilling Co.", path: "https://www.fernwehdistilling.com/top.aspx" }, { name: "Hermann 1837 Bar", path: "https://hermanncrownhotel.com/hermann-1837-cellar-bar/" }, { name: "Hermann Fraternal Order of Eagles", path: "https://www.facebook.com/HermannEaglesAuxiliary1328/" }, { name: "Hermann Hill Weddings", path: "http://hermannmoweddings.com/" }, { name: "Hermann VFW", path: "https://www.facebook.com/people/Hermann-VFW-Post-4182/100064839395205/" }, { name: "Hermann Wurst Haus", path: "https://www.hermannwursthaus.com/catering/" }, ] }, { subhead: "", listings: [ { name: "Inn at Hermannhof", path: "https://www.innathermannhof.com/Weddings" }, { name: "Loose Caboose Saloon", path: "http://facebook.com/hermannloosecaboose" }, { name: "Stone Hill Winery", path: "https://stonehillwinery.com/event-venue-in-hermann-mo/" }, { name: "The Piano Bar", path: "https://www.pianobarhermann.com/general-6" }, { name: "The Rotunda", path: "https://www.facebook.com/rotundahermann/" }, { name: "Tin Mill Restaurant Celebration Hall", path: "https://www.innathermannhof.com/Weddings" }, { name: "Valentine Hall", path: "http://www.valentinehall.org/" }, { name: "KeyVinchester Inn", path: "http://vinchesterinn.com/the-north-star" }, { name: "Vintage Restaurant at Stone Hill Winery", path: "https://stonehillwinery.com/event-venue-in-hermann-mo/" }, { name: "White House Hotel", path: "https://www.thewhitehousehotel1868.com/" }, ] } ] }, catering: { title: "Eats & Treats", content: "", style: "sections", imgPath: "c2_side-img_eats.jpg", payload: [ { subhead: "Catering", listings: [ { name: "Hermann Wurst Haus", path: "https://www.hermannwursthaus.com/catering/" } ] }, { subhead: "Cakes & Desserts", listings: [ { name: "Sugar & Spice Laura’s Delights II", path: "http://sugarnspicebakery.com/" }, { name: "Sugar Momma’s", path: "http://sugarmommashermannmo.com/" } ] } ] }, photographers: { title: "Flowers & Photos", content: "", style: "sections", imgPath: "c2_side-img_photogs.jpg", payload: [ { subhead: "Flowers", listings: [ { name: "Terraflora Botanicals & Gifts", path: "https://www.terraflorahermannmo.com/" } ] }, { subhead: "Photos", listings: [ { name: "Chrysa Snow Photography", path: "https://www.chrysasnowphotography.com/" }, { name: "Camera Creations Photography & Design Studio", path: "https://www.camera-creations.com/" } ] } ] }, salons: { title: "Salons & Shaves", content: "", style: "sections", imgPath: "c2_side-img_salons.jpg", payload: [ { subhead: "Salons", listings: [ { name: "Head Hunter Salon", path: "https://head-hunter-salon.business.site/" }, { name: "Joella’s Beauty Bar", path: "http://www.joellasbeautybar.com/" }, { name: "Tanglez", path: "https://www.facebook.com/tanglezsalonllc" }, { name: "Sarah B Airbrush Artistry", path: "https://www.instagram.com/sarahb_airbrush/" }, ] }, { subhead: "Shaves", listings: [ { name: "The Bearded Nail", path: "https://www.facebook.com/people/The-bearded-nail-barbershop/100066580657970/" }, { name: "The Scarlet Razor", path: "https://www.facebook.com/ScarletRazor/" } ] } ] }, spas: { title: "Spas", content: "", style: "default", imgPath: "c2_side-img_spa.jpg", payload: [ { name: "Eden Spa", path: "http://edenspahermann.com/" }, { name: "Hermann Hill Spa", path: "https://www.hermannhill.com/spa.html" }, { name: "Kneading Oasis", path: "http://facebook.com/kneadingoasis" }, { name: "Massage for Your Health", path: "http://massageforyourhealth.com/" } ] }, otherServices: { title: "Other Services", content: "", style: "sections", imgPath: "c2_side-img_otherservices.jpg", payload: [ { subhead: "Services", listings: [ { name: "HogsHead Cigar Bar", path: "https://www.hogsheadcigars.com/mobile-cigar-bar-for-events" }, { name: "Hermann Visitor Information Center", path: "https://www.facebook.com/hermannamtrakstation/" } ] }, { subhead: "Officiants", listings: [ { name: "Adrian Sigrist", path: "tel:573-777-0253" }, { name: "Justin Doherty", path: "tel:417-207-8959" }, { name: "Patrick Dell", path: "tel:314-249-6030" }, ] } ] }, transportation: { title: "Transportation", content: "", style: "sections", imgPath: "c2_side-img_transportation.jpg", payload: [ { subhead: "", listings: [ { name: "Amtrak Missouri River Runner", path: "http://amtrak.com/" }, { name: "Hermann Crown Suites Taxi & Van Service", path: "http://hermanncrownhotel.com/transportation" }, { name: "Hermann Trolley", path: "http://hermanntrolley.com/" }, { name: "Lyft You Up Rides", path: "http://facebook.com/HermannRides" }, ] } ] } } function constructModal(data) { var modal = ''; return modal; } //////////////////////////////////// // EVENT FUNCTIONS //////////////////////////////////// // // Called on document ready // contentOnReady = function () { // set the window width _winWidth = jQuery(window).width(); // Add Photog URLs var photogLinks = $('.photogs a'); var photogPaths = [ 'https://ivoryandbliss.com/', 'http://orangeanchorphotography.com/', 'https://sarahsunstromphotography.com/', 'http://unposedphotography.com/' ]; photogLinks.each(function(index, element) { $(element).attr('href', photogPaths[index]); }); // Recommended Reads links buildRelatedLinks([ { "title": "A Photographer’s Take on Butte County", "link": "https://www.explorebuttecounty.com/stories/picture-perfect" }, { "title": "Camping on Lake Oroville", "link": "https://www.explorebuttecounty.com/activities/camping-on-lake-oroville" }, { "title": "Outdoor Adventure Guide", "link": "https://www.explorebuttecounty.com/personas/outdoor-adventurer" } ]); // ipad pro will use large size, but needs backgrounds set to scroll, not fixed unFixBGImagesForIPads(); customAdjustLayout(true); // ipad pro will use large size, but needs backgrounds set to scroll, not fixed unFixBGImagesForIPads(); // add the complete class to the loader jQuery('#loading').addClass('complete'); // Manage Hamburger State $('.hamburger').click(function() { $(this).toggleClass('isActive'); $('.header > ul').toggleClass('isActive'); $('.header > ul').hasClass('isActive') ? $('.header > ul').css('width', 'auto') : setTimeout(function() { $('.header > ul').css('width', 0); }, 700); }); // Manage modules // $.fancybox.defaults.hideScrollbar = false; $('.listingCard').on('click', function() { var key = $(this).data('key'); var modalData = cardData[key]; var modal = constructModal(modalData); $.fancybox.open(modal); }); // Accordion Toggle $('.toggle').click(function(e) { e.preventDefault(); var $this = $(this); if ($this.next().hasClass('show')) { $this.next().removeClass('show'); $this.next().slideUp(350); } else { $this.parent().parent().find('li .inner').removeClass('show'); $this.parent().parent().find('li .inner').slideUp(350); $this.next().toggleClass('show'); $this.next().slideToggle(350); } }); // Smooth Scrolling // Select all links with hashes $('a[*|href^="#"]') // Remove links that don't actually link to anything .click(function(event) { // On-page links console.log("HIT") if ( location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname ) { // Figure out element to scroll to var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); // Does a scroll target exist? if (target.length) { // Only prevent default if animation is actually gonna happen event.preventDefault(); $('html, body').animate({ scrollTop: target.offset().top - 50 }, 1000, function() { // Callback after animation // Must change focus! var $target = $(target); $target.focus(); if ($target.is(":focus")) { // Checking if the target was focused return false; } else { $target.attr('tabindex','-1'); // Adding tabindex for elements not focusable $target.focus(); // Set focus again }; }); } } }); } // // Called on document scroll // contentOnScroll = function () { } // // Called on a touch move on mobile // contentOnTouchMove = function () { } // // Called on document resize // contentOnResize = function () { customAdjustLayout(); } ////////////////////////////////// // CUSTOM FUNCTIONS ///////////////////////////////// // // Adjust this specific layout after a load or resize event // // isLoad: Is this being called by a load or resize event? // customAdjustLayout = function (isLoad) { var localNotJustTouchScroll = isLoad; // is it really a resize? if (jQuery(window).width() != _winWidth) { // yes localNotJustTouchScroll = true; _winWidth = jQuery(window).width(); } if (localNotJustTouchScroll) { } }