/*! * Twenty Twenty JS. * https://github.com/zurb/twentytwenty * * Copyright 2018 zurb * Released under the ISC License * https://github.com/zurb/twentytwenty/blob/master/LICENSE.md */ !function(t){t.fn.twentytwenty=function(e){e=t.extend({default_offset_pct:.5,orientation:"horizontal",move_on_hover:!1},e);return this.each(function(){var n=e.default_offset_pct,i=t(this),s=e.orientation,a="vertical"===s?"down":"left",o="vertical"===s?"up":"right",d=Boolean(e.move_on_hover),f=i.find("img:first"),w=i.find("img:last"),c=i.find(".twentytwenty-handle"),r=i.find(".twentytwenty-overlay");t(this).hasClass("twentytwenty-container")||(i.wrap("
"),i.append(""),f=i.find("img:first"),w=i.find("img:last"),i.append(""),(c=i.find(".twentytwenty-handle")).append(""),c.append(""),i.addClass("twentytwenty-container"),f.addClass("twentytwenty-before"),w.addClass("twentytwenty-after"),(r=i.find(".twentytwenty-overlay")).append(""),r.append(""));var l=function(t){var e,n,a,o=(e=t,n=f.width(),a=f.height(),{w:n+"px",h:a+"px",cw:e*n+"px",ch:e*a+"px"});c.css("vertical"===s?"top":"left","vertical"===s?o.ch:o.cw),function(t){"vertical"===s?f.css("clip","rect(0,"+t.w+","+t.ch+",0)"):f.css("clip","rect(0,"+t.cw+","+t.h+",0)"),i.css("height",t.h)}(o)};t(window).on("resize.twentytwenty",function(t){l(n)});var v=0,y=0;c.on("movestart",function(t){(t.distX>t.distY&&t.distX<-t.distY||t.distX