Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/just-cameron/TuringTest.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107/* ========================================================================== jQuery plugin settings and other scripts ========================================================================== */
$(document).ready(function() { // Sticky footer var bumpIt = function() { $("body").css("margin-bottom", $(".page__footer").outerHeight(true)); }, didResize = false;
bumpIt();
$(window).resize(function() { didResize = true; }); setInterval(function() { if (didResize) { didResize = false; bumpIt(); } }, 250);
// FitVids init $("#main").fitVids();
// Sticky sidebar var stickySideBar = function() { var show = $(".author__urls-wrapper button").length === 0 ? $(window).width() > 1024 // width should match $large Sass variable : !$(".author__urls-wrapper button").is(":visible"); if (show) { // fix $(".sidebar").addClass("sticky"); } else { // unfix $(".sidebar").removeClass("sticky"); } };
stickySideBar();
$(window).resize(function() { stickySideBar(); });
// Follow menu drop down $(".author__urls-wrapper button").on("click", function() { $(".author__urls").toggleClass("is--visible"); $(".author__urls-wrapper button").toggleClass("open"); });
// Search toggle $(".search__toggle").on("click", function() { $(".search-content").toggleClass("is--visible"); $(".initial-content").toggleClass("is--hidden"); // set focus on input setTimeout(function() { $(".search-content input").focus(); }, 400); });
// init smooth scroll $("a").smoothScroll({ offset: -20 });
// add lightbox class to all image links $( "a[href$='.jpg'],a[href$='.jpeg'],a[href$='.JPG'],a[href$='.png'],a[href$='.gif']" ).addClass("image-popup");
// Magnific-Popup options $(".image-popup").magnificPopup({ // disableOn: function() { // if( $(window).width() < 500 ) { // return false; // } // return true; // }, type: "image", tLoading: "Loading image #%curr%...", gallery: { enabled: true, navigateByImgClick: true, preload: [0, 1] // Will preload 0 - before current, and 1 after the current image }, image: { tError: '<a href="%url%">Image #%curr%</a> could not be loaded.' }, removalDelay: 500, // Delay in milliseconds before popup is removed // Class that is added to body when popup is open. // make it unique to apply your CSS animations just to this exact popup mainClass: "mfp-zoom-in", callbacks: { beforeOpen: function() { // just a hack that adds mfp-anim class to markup this.st.image.markup = this.st.image.markup.replace( "mfp-figure", "mfp-figure mfp-with-anim" ); } }, closeOnContentClick: true, midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source. });});