var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opens = _____WB$wombat$assign$function_____("opens"); (function($){ $.fn.twentytwenty = function(options) { var options = $.extend({ default_offset_pct: 0.5, orientation: 'horizontal', before_label: 'Before', after_label: 'After', no_overlay: false, move_slider_on_hover: false, move_with_handle_only: true, click_to_move: false }, options); return this.each(function() { var sliderPct = options.default_offset_pct; var container = $(this); var sliderOrientation = options.orientation; var beforeDirection = (sliderOrientation === 'vertical') ? 'down' : 'left'; var afterDirection = (sliderOrientation === 'vertical') ? 'up' : 'right'; container.wrap("
"); if(!options.no_overlay) { container.append("
"); var overlay = container.find(".twentytwenty-overlay"); overlay.append("
"); overlay.append("
"); } var beforeImg = container.find("img:first"); var afterImg = container.find("img:last"); container.append("
"); var slider = container.find(".twentytwenty-handle"); slider.append(""); slider.append(""); container.addClass("twentytwenty-container"); beforeImg.addClass("twentytwenty-before"); afterImg.addClass("twentytwenty-after"); var calcOffset = function(dimensionPct) { var w = beforeImg.width(); var h = beforeImg.height(); return { w: w+"px", h: h+"px", cw: (dimensionPct*w)+"px", ch: (dimensionPct*h)+"px" }; }; var adjustContainer = function(offset) { if (sliderOrientation === 'vertical') { beforeImg.css("clip", "rect(0,"+offset.w+","+offset.ch+",0)"); afterImg.css("clip", "rect("+offset.ch+","+offset.w+","+offset.h+",0)"); } else { beforeImg.css("clip", "rect(0,"+offset.cw+","+offset.h+",0)"); afterImg.css("clip", "rect(0,"+offset.w+","+offset.h+","+offset.cw+")"); } container.css("height", offset.h); }; var adjustSlider = function(pct) { var offset = calcOffset(pct); slider.css((sliderOrientation==="vertical") ? "top" : "left", (sliderOrientation==="vertical") ? offset.ch : offset.cw); adjustContainer(offset); }; // Return the number specified or the min/max number if it outside the range given. var minMaxNumber = function(num, min, max) { return Math.max(min, Math.min(max, num)); }; // Calculate the slider percentage based on the position. var getSliderPercentage = function(positionX, positionY) { var sliderPercentage = (sliderOrientation === 'vertical') ? (positionY-offsetY)/imgHeight : (positionX-offsetX)/imgWidth; return minMaxNumber(sliderPercentage, 0, 1); }; $(window).on("resize.twentytwenty", function(e) { adjustSlider(sliderPct); }); var offsetX = 0; var offsetY = 0; var imgWidth = 0; var imgHeight = 0; var onMoveStart = function(e) { if (((e.distX > e.distY && e.distX < -e.distY) || (e.distX < e.distY && e.distX > -e.distY)) && sliderOrientation !== 'vertical') { e.preventDefault(); } else if (((e.distX < e.distY && e.distX < -e.distY) || (e.distX > e.distY && e.distX > -e.distY)) && sliderOrientation === 'vertical') { e.preventDefault(); } container.addClass("active"); offsetX = container.offset().left; offsetY = container.offset().top; imgWidth = beforeImg.width(); imgHeight = beforeImg.height(); }; var onMove = function(e) { if (container.hasClass("active")) { sliderPct = getSliderPercentage(e.pageX, e.pageY); adjustSlider(sliderPct); } }; var onMoveEnd = function() { container.removeClass("active"); }; var moveTarget = options.move_with_handle_only ? slider : container; moveTarget.on("movestart",onMoveStart); moveTarget.on("move",onMove); moveTarget.on("moveend",onMoveEnd); if (options.move_slider_on_hover) { container.on("mouseenter", onMoveStart); container.on("mousemove", onMove); container.on("mouseleave", onMoveEnd); } slider.on("touchmove", function(e) { e.preventDefault(); }); container.find("img").on("mousedown", function(event) { event.preventDefault(); }); if (options.click_to_move) { container.on('click', function(e) { offsetX = container.offset().left; offsetY = container.offset().top; imgWidth = beforeImg.width(); imgHeight = beforeImg.height(); sliderPct = getSliderPercentage(e.pageX, e.pageY); adjustSlider(sliderPct); }); } $(window).trigger("resize.twentytwenty"); }); }; })(jQuery); } /* FILE ARCHIVED ON 07:03:01 Feb 02, 2024 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 12:45:19 Nov 18, 2025. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ /* playback timings (ms): captures_list: 1.938 (2) exclusion.robots: 0.08 (2) exclusion.robots.policy: 0.048 (2) esindex: 0.03 (2) cdx.remote: 168.84 (2) LoadShardBlock: 438.408 (6) PetaboxLoader3.datanode: 288.607 (8) load_resource: 181.246 (2) PetaboxLoader3.resolve: 295.788 (3) */