/** * 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 lastScrollTop) { // Scroll Down $('.top').removeClass('nav-down'); } else { // Scroll Up if (st + $(window).height() < $(document).height()) { $('.top').addClass('nav-down'); } } lastScrollTop = st; } } mapStart() function mapStart() { if (!getIsSmall()) { //The map mapboxgl.accessToken = 'pk.eyJ1Ijoia2Jpc2hvcG1hZGRlbiIsImEiOiJja2U4cXRjMHEwbmpkMnFwaTFxbmd3eTJqIn0.jVL8C0NQs2Rv5eOFvIVCXA'; map = new mapboxgl.Map({ container: 'map', style: 'mapbox://styles/mapbox/streets-v11', center: [-104.399581, 41.106410], zoom: 8, bearing: 0, pitch: 40, }); var geojson = { type: 'FeatureCollection', features: [{ type: 'Feature', geometry: { type: 'Point', coordinates: [-104.904526, 41.002646] }, properties: { title: 'Terry Bison Ranch Resort' } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-104.066269, 41.193513] }, properties: { title: 'Pine Bluffs Distilling', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-104.066269, 41.193513] }, properties: { title: 'Pine Bluffs Distilling', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-104.856909, 41.118712] }, properties: { title: 'Little America Hotel and Resort', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-104.814636, 41.131718] }, properties: { title: 'Cheyenne Street Railway Trolley', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-104.814152, 41.132009] }, properties: { title: 'Accomplice Beer Company', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-104.814646, 41.131718] }, properties: { title: 'Cheyenne Depot Museum', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-104.817891, 41.132120] }, properties: { title: 'Wyoming’s Rib and Chop House', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-104.834062, 41.157941] }, properties: { title: 'Cheyenne Frontier Days Old West Museum', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-104.821408, 41.133934] }, properties: { title: 'Black Tooth Brewing Co', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-104.902675, 41.543106] }, properties: { title: 'The Quebec 01 Missile Alert Facility', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-104.816925, 41.133408] }, properties: { title: 'The Metropolitan Downtown', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-105.083260, 41.162267] }, properties: { title: 'Bunkhouse Bar & Grill', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-105.227970, 41.169468] }, properties: { title: 'Curt Gowdy State Park', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-105.375039, 41.1585732] }, properties: { title: 'Vedauwoo', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-105.436246, 41.236950] }, properties: { title: 'Abraham Lincoln Memorial Monument', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-105.586312, 41.314600] }, properties: { title: 'Mad Carpenter Inn', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.012155, 41.297256] }, properties: { title: 'Vee Bar Guest Ranch', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-105.595373, 41.310345] }, properties: { title: 'Altitude Chophouse & Brewery', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-105.593445, 41.315099] }, properties: { title: 'Laramie Mural Project', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-105.583186, 41.314112] }, properties: { title: 'University of Wyoming Geology Museum', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-105.610513, 41.311609] }, properties: { title: 'Wyoming Territorial Prison Historic Site', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-105.595644, 41.311344] }, properties: { title: 'Cask: 307', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.138805, 41.297753] }, properties: { title: 'Mountain View Historic Hotel & Cafe', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.250887, 41.250136] }, properties: { title: 'Medicine Bow National Forest', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.325391, 41.334973] }, properties: { title: 'Lake Marie', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.508917, 41.321310] }, properties: { title: 'Ryan Park', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.606058, 41.330789] }, properties: { title: 'Brush Creek Ranch', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.778900, 41.216451] }, properties: { title: 'Cottonwood Cabins', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.597902, 41.150017] }, properties: { title: 'Platt’s Rustic Mountain Lodge', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.982661, 41.155554] }, properties: { title: 'Ghost Town of Battle', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.789215, 41.203996] }, properties: { title: 'Grand Encampment Museum', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.790997, 41.207800] }, properties: { title: 'The DiVide', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.801292, 41.452940] }, properties: { title: 'Saratoga Hot Springs Resort', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.807520, 41.454573] }, properties: { title: 'Hotel Wolf', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.802833, 41.450265] }, properties: { title: 'Hobo Hot Springs', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.801292, 41.452940] }, properties: { title: 'Snowy Mountain Brewery', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.806588, 41.455930] }, properties: { title: 'Firewater Public House', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-106.807520, 41.454573] }, properties: { title: 'Hotel Wolf Restaurant', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-107.228669, 41.789553] }, properties: { title: 'Rawlins', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-107.245185, 41.787079] }, properties: { title: 'Downtown Rawlins/walking tours', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-107.238319, 41.788178] }, properties: { title: 'Shogunz Pizzeria & Bar', } }, { type: 'Feature', geometry: { type: 'Point', coordinates: [-107.243036, 41.793654] }, properties: { title: 'The Wyoming Frontier Prison', } }] }; // add markers to map geojson.features.forEach(function (marker) { // make a marker for each feature and add to the map new mapboxgl.Marker({ color: "#655146" }) .setLngLat(marker.geometry.coordinates) .setPopup(new mapboxgl.Popup({ offset: 25 }) // add popups .setHTML('

' + marker.properties.title + '

')) .addTo(map); }); var popup = new mapboxgl.Popup({ offset: 25 }); $(".col a, .mapboxgl-marker").on("mouseover", function () { var marker if ($(this).is('a')) { marker = geojson.features[$('.col a').index(this)] } else { marker = geojson.features[$(this).index() - 1] } popup.setHTML('

' + marker.properties.title + '

') .setLngLat(marker.geometry.coordinates) .addTo(map); $('.col a').index(this) }).mouseleave(function () { popup.remove() }) } // listener for tabs to change content and move map location $("button").on("click", function (e) { var theClass = $(this).attr("class") e.preventDefault() map.flyTo(chapters[theClass]); $(".active").removeClass("active") $("#" + theClass).addClass("active") $(this).addClass("active") }) } let chapters = { 'day1': { container: 'map', bearing: 0, duration: 3000, center: [-104.399581, 41.106410], zoom: 8, pitch: 40, essential: true // this animation is considered essential with respect to prefers-reduced-motion }, 'day2': { container: 'map', bearing: 0, duration: 3000, center: [-104.837754, 41.280034], zoom: 10, pitch: 40, essential: true }, 'day3': { container: 'map', bearing: 0, duration: 3000, center: [-105.500088, 41.244136], zoom: 8.5, speed: 0.6, pitch: 40, essential: true }, 'day4': { container: 'map', bearing: 0, duration: 3000, center: [-105.860088, 41.34136], zoom: 9, speed: 0.6, pitch: 40, essential: true }, 'day5': { container: 'map', bearing: 0, duration: 3000, center: [-106.497902, 41.250017], zoom: 9.5, speed: 0.6, pitch: 40, essential: true }, 'day6': { container: 'map', bearing: 0, duration: 3000, center: [-106.869822, 41.320156], zoom: 9, speed: 0.6, pitch: 40, essential: true }, 'day7': { container: 'map', bearing: 0, duration: 3000, center: [-107.228669, 41.789553], zoom: 13, speed: 0.6, pitch: 40, essential: true }, 'day8': { container: 'map', bearing: 0, duration: 3000, center: [-107.243036, 41.793654], zoom: 14, speed: 0.6, pitch: 40, essential: true } // 'example': { // container: 'map', // bearing: 90, // center: [-0.12416858, 51.50779757], // zoom: 14.3, // pitch: 20, // essential: true // } }; if (getIsSmall()) { $('.card img').each(function () { $(this).attr("data-lazy", $(this).data('mobile')) }) $(".header").on("click", function (e) { if ($(this).hasClass("active")) { $(".active").removeClass("active") } else { var theClass = $(this).attr("data-day") e.preventDefault() $(".active").removeClass("active") $("#" + theClass).addClass("active") $(this).addClass("active") $([document.documentElement, document.body]).animate({ scrollTop: $("[data-day='day1']").offset().top }, 1000); } }) } $('.slick').slick({ lazyLoad: 'ondemand', slidesToShow: 1, slidesToScroll: 1, dots: true, infinite: true, speed: 500, fade: true, cssEase: 'linear', autoplay: true, autoplaySpeed: 4000, }); $(window).resize(function () { if (!getIsSmall() && size === "small" ){ mapStart() } }); // ipad pro will use large size, but needs backgrounds set to scroll, not fixed unFixBGImagesForIPads(); customAdjustLayout(true); // add the complete class to the loader $("#loading").addClass("complete"); } // // 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) { // resize footer links to be equal height of the tallest one equalizeElementHeightsToTallest($(".linkTitleWrapper")); var localNotJustTouchScroll = isLoad; // is it really a resize? if ($(window).width() != _winWidth) { // yes localNotJustTouchScroll = true; _winWidth = $(window).width(); } if (localNotJustTouchScroll) { } } !function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};(e=function(){var e=0;return function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'',nextArrow:'',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('