Update Koneko integration
34
resources/public/vendor/rs-plugin/revolution-addons/distortion/css/distortion.css
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link http://www.themepunch.com/
|
||||
* @copyright 2018 ThemePunch
|
||||
*/
|
||||
|
||||
.rev_slider > ul > li[data-liquideffect] > img,
|
||||
.tp-revslider-slidesli[data-liquideffect] .tp-bgimg,
|
||||
.tp-revslider-slidesli[data-liquideffect] .slot {
|
||||
|
||||
display: none !important;
|
||||
|
||||
}
|
||||
|
||||
.tp-revslider-slidesli[data-liquideffect] .slotholder canvas {
|
||||
|
||||
position: absolute;
|
||||
display: block;
|
||||
|
||||
}
|
||||
|
||||
.tp-revslider-slidesli.liquid-force-visible,
|
||||
.tp-revslider-slidesli.liquid-force-visible .slotholder {
|
||||
|
||||
visibility: visible !important;
|
||||
opacity: 1 !important;
|
||||
|
||||
}
|
||||
|
||||
.tp-revslider-slidesli.liquid-force-visible {
|
||||
|
||||
z-index: 99 !important;
|
||||
|
||||
}
|
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/bwmap1.jpg
vendored
Normal file
After Width: | Height: | Size: 247 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/bwmap2.jpg
vendored
Normal file
After Width: | Height: | Size: 212 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/clouds_large.jpg
vendored
Normal file
After Width: | Height: | Size: 194 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/clouds_small.jpg
vendored
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/crystalize_large.jpg
vendored
Normal file
After Width: | Height: | Size: 84 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/crystalize_small.jpg
vendored
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/fibers_large.jpg
vendored
Normal file
After Width: | Height: | Size: 260 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/fibers_small.jpg
vendored
Normal file
After Width: | Height: | Size: 75 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/glitch3.jpg
vendored
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/glitch_large.jpg
vendored
Normal file
After Width: | Height: | Size: 119 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/glitch_small.jpg
vendored
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/maze_large.jpg
vendored
Normal file
After Width: | Height: | Size: 275 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/maze_small.jpg
vendored
Normal file
After Width: | Height: | Size: 149 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/pointilize_large.jpg
vendored
Normal file
After Width: | Height: | Size: 135 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/pointilize_small.jpg
vendored
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/rings_large.jpg
vendored
Normal file
After Width: | Height: | Size: 61 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/rings_small.jpg
vendored
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/ripple_large.jpg
vendored
Normal file
After Width: | Height: | Size: 103 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/ripple_small.jpg
vendored
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/spiral_large.jpg
vendored
Normal file
After Width: | Height: | Size: 247 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/spiral_small.jpg
vendored
Normal file
After Width: | Height: | Size: 121 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/swirl_large.jpg
vendored
Normal file
After Width: | Height: | Size: 212 KiB |
BIN
resources/public/vendor/rs-plugin/revolution-addons/distortion/images/swirl_small.jpg
vendored
Normal file
After Width: | Height: | Size: 121 KiB |
21
resources/public/vendor/rs-plugin/revolution-addons/distortion/js/pixi.min.js
vendored
Normal file
691
resources/public/vendor/rs-plugin/revolution-addons/distortion/js/revolution.addon.distortion.js
vendored
Normal file
@ -0,0 +1,691 @@
|
||||
/**
|
||||
* @author ThemePunch <info@themepunch.com>
|
||||
* @link https://www.themepunch.com/
|
||||
* @copyright 2018 ThemePunch
|
||||
*/
|
||||
(function() {
|
||||
|
||||
var $,
|
||||
touch = 'ontouchend' in document;
|
||||
|
||||
window.RsLiquideffectAddOn = function(_$, slider) {
|
||||
|
||||
if(!_$ || !slider || typeof PIXI === 'undefined') return;
|
||||
|
||||
$ = _$;
|
||||
$.event.special.rsLiquidEffectDestroyed = {remove: function(evt) {evt.handler();}};
|
||||
|
||||
var effects = slider.find('li[data-liquideffect]').each(function() {
|
||||
|
||||
var url,
|
||||
$this = $(this),
|
||||
settings = JSON.parse($this.attr('data-liquideffect'));
|
||||
|
||||
if(!settings) return;
|
||||
|
||||
var sprite,
|
||||
img = $this.children('img'),
|
||||
base = slider[0].opt.jsFileLocation || '';
|
||||
|
||||
if(base) base = base.split('/revslider');
|
||||
base = base.length === 2 ? base[0] : '';
|
||||
|
||||
if(!/all|smart/.test(slider[0].opt.lazyType)) slider[0].opt.lazyType = 'smart';
|
||||
if(!img.attr('data-lazyload')) {
|
||||
|
||||
sprite = img.attr('src');
|
||||
img.attr('data-lazyload', sprite);
|
||||
img.attr('src', base.replace('/extensions', '') + '/revslider/admin/assets/images/dummy.png');
|
||||
|
||||
}
|
||||
else {
|
||||
sprite = img.attr('data-lazyload');
|
||||
}
|
||||
|
||||
if(!sprite) {
|
||||
|
||||
sprite = $this.find('.slotholder').contents().filter(function() {return this.nodeType === 8;});
|
||||
if(sprite.length) {
|
||||
|
||||
url = sprite[0].nodeValue;
|
||||
sprite = false;
|
||||
|
||||
if(url) {
|
||||
|
||||
url = url.split('data-lazyload="');
|
||||
if(url.length === 2) {
|
||||
|
||||
url = url[1].split('"');
|
||||
if(url.length > 1) sprite = url[0];
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
url = url.split('src="');
|
||||
if(url.length === 2) {
|
||||
|
||||
url = url[1].split('"');
|
||||
if(url.length > 1) sprite = url[0];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
sprite = false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(sprite) {
|
||||
|
||||
var easing;
|
||||
settings.sprite = sprite;
|
||||
if(touch && settings.mobile) settings.interactive = false;
|
||||
|
||||
var easing = settings.easing.split('.');
|
||||
settings.easing = punchgs[easing[0]][easing[1]];
|
||||
|
||||
var trans = settings.transcross ? 'crossfade' : 'fade';
|
||||
$this.attr({
|
||||
|
||||
'data-transition': trans,
|
||||
'data-masterspeed': settings.transtime,
|
||||
'data-easein': settings.easing,
|
||||
'data-easeout': settings.easing
|
||||
|
||||
}).removeAttr('data-kenburns').data({liquideffectsettings: settings, liquideffectorig: jQuery.extend({}, settings)});
|
||||
|
||||
if(settings.interactive) {
|
||||
easing = settings.intereasing.split('.');
|
||||
settings.intereasing = punchgs[easing[0]][easing[1]];
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
$this.removeData('liquideffect').removeAttr('data-liquideffect');
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
effects = slider.find('li[data-liquideffect]');
|
||||
if(effects.length) return new LiquidEffect(slider, effects);
|
||||
else return false;
|
||||
|
||||
};
|
||||
|
||||
function LiquidEffect(slider, effects) {
|
||||
|
||||
this.slider = slider;
|
||||
this.effects = effects;
|
||||
this.firstrun = true;
|
||||
|
||||
slider.one('revolution.slide.onloaded', this.onLoaded.bind(this))
|
||||
.one('rsLiquidEffectDestroyed', this.destroy.bind(this));
|
||||
|
||||
}
|
||||
|
||||
LiquidEffect.prototype = {
|
||||
|
||||
onLoaded: function() {
|
||||
|
||||
this.slider.on('revolution.slide.onbeforeswap', this.beforeChange.bind(this))
|
||||
.on('revolution.slide.onchange', this.onChange.bind(this));
|
||||
|
||||
},
|
||||
|
||||
onChange: function(e, data) {
|
||||
|
||||
if(!this.ranOnce) {
|
||||
|
||||
this.beforeChange(false, {nextslide: data.currentslide});
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
var canvas = data.prevslide.removeClass('liquid-force-visible').data('liquideffectcanvas');
|
||||
if(canvas) {
|
||||
|
||||
canvas.ticker.stop();
|
||||
canvas.tweenOut = null;
|
||||
|
||||
}
|
||||
|
||||
canvas = data.currentslide.data('liquideffectcanvas');
|
||||
if(canvas && !canvas.started) canvas.animateIn();
|
||||
|
||||
},
|
||||
|
||||
beforeChange: function(e, data) {
|
||||
|
||||
this.ranOnce = true;
|
||||
|
||||
var canvas,
|
||||
slides = [];
|
||||
|
||||
if(!this.effectsCreated) {
|
||||
|
||||
this.effectsCreated = true;
|
||||
this.effects.each(function() {
|
||||
|
||||
var $this = $(this),
|
||||
sizes = $this.data('liquideffectsettings').imagesize.split('|');
|
||||
|
||||
if(sizes.length === 2) {
|
||||
|
||||
$this.data('liquideffectcanvas', new LiquidCanvas($this, parseInt(sizes[0], 10), parseInt(sizes[1], 10)));
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
slides[slides.length] = this;
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function loadImage($this, slide) {
|
||||
|
||||
var img = new Image(),
|
||||
bgImg = slide.find('.tp-bgimg');
|
||||
|
||||
img.crossOrigin = 'Anonymous';
|
||||
img.src = bgImg.css('background-image').slice(4, -1).replace(/"/g, '');
|
||||
img.onload = function() {
|
||||
|
||||
var canvas = new LiquidCanvas(slide, parseInt(img.naturalWidth, 10), parseInt(img.naturalHeight, 10));
|
||||
slide.data('liquideffectcanvas', canvas);
|
||||
|
||||
$this.imgCount++;
|
||||
if($this.imgCount === slides.length) $this.run(data);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
if(!slides.length) {
|
||||
|
||||
this.run(data);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
this.imgCount = 0;
|
||||
for(var i = 0; i < slides.length; i++) loadImage(this, $(slides[i]));
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
run: function(data) {
|
||||
|
||||
var canvas;
|
||||
if(!this.firstrun) {
|
||||
|
||||
if(data.currentslide) {
|
||||
canvas = data.currentslide.data('liquideffectcanvas');
|
||||
if(canvas) canvas.animateOut(data.nextslide);
|
||||
}
|
||||
|
||||
canvas = data.nextslide.data('liquideffectcanvas');
|
||||
if(canvas) {
|
||||
|
||||
data.nextslide.addClass('liquid-force-visible');
|
||||
if(canvas.settings.transcross) canvas.animateIn();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
canvas = data.nextslide.data('liquideffectcanvas');
|
||||
if(canvas) canvas.animateIn(true);
|
||||
this.firstrun = false;
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
|
||||
if(this.slider) this.slider.off('revolution.slide.onloaded revolution.slide.onbeforeswap revolution.slide.onafterswap');
|
||||
if(this.effects) this.effects.each(function() {jQuery(this).removeData('liquideffectcanvas liquideffectsettings liquideffectorig');});
|
||||
for(var prop in this) if(this.hasOwnProperty(prop)) delete this[prop];
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function LiquidCanvas(slide, w, h) {
|
||||
|
||||
this.w = w;
|
||||
this.h = h;
|
||||
this.slide = slide;
|
||||
this.settings = slide.data('liquideffectsettings');
|
||||
this.orig = slide.data('liquideffectorig');
|
||||
|
||||
this.displacement = new PIXI.Sprite.fromImage(this.settings.image, true);
|
||||
this.displacement.texture.baseTexture.wrapMode = PIXI.WRAP_MODES.REPEAT;
|
||||
this.displacement.scale.x = 2;
|
||||
this.displacement.scale.y = 2;
|
||||
this.displacement.anchor.set(0.5);
|
||||
this.displacement.x = w / 2;
|
||||
this.displacement.y = h / 2;
|
||||
|
||||
var sprite = this.settings.sprite,
|
||||
texture = new PIXI.Texture.fromImage(sprite, true),
|
||||
container = new PIXI.Container();
|
||||
|
||||
this.img = new PIXI.Sprite(texture);
|
||||
this.img.anchor.set(0.5);
|
||||
this.img.x = w / 2;
|
||||
this.img.y = h / 2;
|
||||
container.addChild(this.img);
|
||||
|
||||
this.filter = new PIXI.filters.DisplacementFilter(this.displacement);
|
||||
this.filter.autoFit = true;
|
||||
|
||||
this.stage = new PIXI.Container();
|
||||
this.stage.addChild(container);
|
||||
this.stage.addChild(this.displacement);
|
||||
this.stage.filters = [this.filter];
|
||||
this.stage.interactive = true;
|
||||
|
||||
this.renderer = new PIXI.autoDetectRenderer(w, h, {transparent: true});
|
||||
var style = this.renderer.view.style;
|
||||
style.objectFit = 'cover';
|
||||
style.width = '100%';
|
||||
style.height = '100%';
|
||||
style.top = '50%';
|
||||
style.left = '50%';
|
||||
style.transform = 'translate( -50%, -50% ) scale(1.2)';
|
||||
slide.find('.slotholder').append(this.renderer.view);
|
||||
|
||||
if(this.settings.autoplay) {
|
||||
this.filter.scale.x = this.settings.scalex;
|
||||
this.filter.scale.y = this.settings.scaley;
|
||||
}
|
||||
else {
|
||||
this.filter.scale.x = 0;
|
||||
this.filter.scale.y = 0;
|
||||
}
|
||||
|
||||
if(this.settings.interactive) {
|
||||
|
||||
container.interactive = true;
|
||||
if(this.settings.event === 'mousedown') {
|
||||
|
||||
container.buttonMode = true;
|
||||
container.pointerdown = this.onClick.bind(this);
|
||||
container.pointerup = container.pointerout = this.onReturn.bind(this);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
container.pointerover = this.onMouseEnter.bind(this);
|
||||
container.pointermove = this.onMouseMove.bind(this);
|
||||
container.pointerout = this.onMouseLeave.bind(this);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
this.renderer.view.style.pointerEvents = 'none';
|
||||
|
||||
}
|
||||
|
||||
this.supressEvents = true;
|
||||
this.started = false;
|
||||
this.ticker = new PIXI.ticker.Ticker();
|
||||
this.ticker.add(this.tick.bind(this));
|
||||
|
||||
}
|
||||
|
||||
LiquidCanvas.prototype = {
|
||||
|
||||
tick: function(delta) {
|
||||
|
||||
if(this.settings.autoplay) {
|
||||
|
||||
if(this.settings.speedx) this.displacement.x += this.settings.speedx * delta;
|
||||
if(this.settings.speedy) this.displacement.y += this.settings.speedy;
|
||||
if(this.settings.rotationx) this.displacement.rotation.x += this.settings.rotationx;
|
||||
if(this.settings.rotationy) this.displacement.rotation.y += this.settings.rotationy;
|
||||
if(this.settings.rotation) this.displacement.rotation += this.settings.rotation * Math.PI / 180;
|
||||
|
||||
}
|
||||
|
||||
this.renderer.render(this.stage);
|
||||
|
||||
},
|
||||
|
||||
onClick: function() {
|
||||
|
||||
if(this.supressEvents) return;
|
||||
|
||||
var $this = this,
|
||||
time = this.settings.intertime * 0.001;
|
||||
|
||||
if(this.settings.interscalex || this.settings.interscaley) {
|
||||
|
||||
var obj = {ease: this.settings.intereasing,overwrite: 'all'};
|
||||
|
||||
if(this.settings.interscalex) obj.x = this.orig.scalex + this.settings.interscalex;
|
||||
if(this.settings.interscaley) obj.y = this.orig.scaley + this.settings.interscaley;
|
||||
|
||||
punchgs.TweenLite.to(this.filter.scale, time, obj);
|
||||
|
||||
}
|
||||
|
||||
punchgs.TweenLite.to(this.settings, time, {
|
||||
|
||||
speedx: this.orig.speedx + this.settings.interspeedx,
|
||||
speedy: this.orig.speedy + this.settings.interspeedy,
|
||||
rotation: this.orig.rotation + this.settings.interotation,
|
||||
ease: this.settings.intereasing,
|
||||
overwrite: 'all',
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
onReturn: function() {
|
||||
|
||||
if(this.supressEvents) return;
|
||||
var time = this.settings.intertime * 0.001;
|
||||
|
||||
punchgs.TweenLite.to(this.filter.scale, time, {
|
||||
|
||||
x: this.orig.scalex,
|
||||
y: this.orig.scaley,
|
||||
ease: this.settings.intereasing,
|
||||
overwrite: 'all'
|
||||
|
||||
});
|
||||
|
||||
punchgs.TweenLite.to(this.settings, time, {
|
||||
|
||||
speedx: this.orig.speedx,
|
||||
speedy: this.orig.speedy,
|
||||
rotation: this.orig.rotation,
|
||||
ease: this.settings.intereasing,
|
||||
overwrite: 'all',
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
onMouseMove: function(e) {
|
||||
|
||||
if(this.supressEvents) return;
|
||||
if(!this.entered) {
|
||||
|
||||
this.onMouseEnter(e);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
var complete,
|
||||
$this = this,
|
||||
x = e.data.global.x,
|
||||
y = e.data.global.y,
|
||||
distX = x - this.x,
|
||||
distY = y - this.y,
|
||||
t = Date.now(),
|
||||
distT = t - this.t,
|
||||
v = Math.sqrt(distX * distX + distY * distY) / distT,
|
||||
time = this.settings.intertime * 0.001;
|
||||
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.t = t;
|
||||
|
||||
if(this.settings.interscalex || this.settings.interscaley) {
|
||||
|
||||
var obj = {ease: this.settings.intereasing, overwrite: 'all', onComplete: this.onReturn.bind(this)};
|
||||
|
||||
if(this.settings.interscalex) obj.x = this.settings.interscalex * v;
|
||||
if(this.settings.interscaley) obj.y = this.settings.interscaley * v;
|
||||
|
||||
complete = true;
|
||||
punchgs.TweenLite.to(this.filter.scale, time, obj);
|
||||
|
||||
}
|
||||
|
||||
var obj2 = {
|
||||
|
||||
speedx: this.orig.speedx + this.settings.interspeedx,
|
||||
speedy: this.orig.speedy + this.settings.interspeedy,
|
||||
rotation: this.orig.rotation + this.settings.interotation,
|
||||
ease: this.settings.intereasing,
|
||||
overwrite: 'all',
|
||||
|
||||
};
|
||||
|
||||
if(!complete) obj2.onComplete = this.onReturn.bind(this);
|
||||
punchgs.TweenLite.to(this.settings, time, obj2);
|
||||
|
||||
},
|
||||
|
||||
onMouseEnter: function(e) {
|
||||
|
||||
if(this.supressEvents) return;
|
||||
|
||||
this.entered = true;
|
||||
this.x = e.data.global.x;
|
||||
this.y = e.data.global.y;
|
||||
this.t = Date.now();
|
||||
|
||||
},
|
||||
|
||||
onMouseLeave: function() {
|
||||
|
||||
this.entered = false;
|
||||
|
||||
},
|
||||
|
||||
eventsReady: function() {
|
||||
|
||||
this.supressEvents = false;
|
||||
|
||||
},
|
||||
|
||||
onComplete: function() {
|
||||
|
||||
var canvas = this.nextslide.data('liquideffectcanvas');
|
||||
if(canvas && !canvas.started) canvas.animateIn();
|
||||
this.nextslide = false;
|
||||
|
||||
},
|
||||
|
||||
onUpdateIn: function() {
|
||||
|
||||
if(this.tweenIn) {
|
||||
|
||||
this.displacement.rotation += this.tweenIn.progress() * 0.02;
|
||||
this.displacement.scale.set(this.tweenIn.progress() * 3);
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onUpdateOut: function() {
|
||||
|
||||
if(this.tweenOut) {
|
||||
|
||||
this.displacement.rotation += this.tweenOut.progress() * 0.02;
|
||||
this.displacement.scale.set(this.tweenOut.progress() * 3);
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
transitionIn: function() {
|
||||
|
||||
var transTime = this.settings.transtime * 0.001;
|
||||
var obj1 = {
|
||||
|
||||
x: this.orig.scalex,
|
||||
y: this.orig.scaley,
|
||||
ease: this.settings.easing,
|
||||
overwrite: 'all',
|
||||
delay: this.del
|
||||
|
||||
};
|
||||
|
||||
var obj2 = {
|
||||
|
||||
speedx: this.orig.speedx,
|
||||
speedy: this.orig.speedy,
|
||||
rotationx: this.orig.rotationx,
|
||||
rotationy: this.orig.rotationy,
|
||||
rotation: this.orig.rotation,
|
||||
ease: this.settings.easing,
|
||||
overwrite: 'all',
|
||||
delay: this.del
|
||||
|
||||
};
|
||||
|
||||
if(this.interactive && this.event === 'mousedown') obj1.onComplete = this.eventsReady.bind(this);
|
||||
else this.supressEvents = false;
|
||||
|
||||
if(this.settings.transpower) obj2.onUpdate = this.onUpdateIn.bind(this);
|
||||
punchgs.TweenLite.to(this.filter.scale, transTime, obj1);
|
||||
|
||||
this.tweenIn = punchgs.TweenLite.to(this.settings, transTime, obj2);
|
||||
punchgs.TweenLite.to(this.renderer.view, transTime * 0.5, {opacity: 1, ease: this.settings.easing, overwrite: 'all', delay: this.del});
|
||||
|
||||
this.ticker.start();
|
||||
|
||||
},
|
||||
|
||||
animateIn: function(first) {
|
||||
|
||||
this.reset();
|
||||
this.started = true;
|
||||
this.del = this.settings.transcross || first ? (this.settings.transtime * 0.001) * 0.5 : 0;
|
||||
this.timer = setTimeout(this.transitionIn.bind(this), this.del);
|
||||
|
||||
},
|
||||
|
||||
animateOut: function(nextslide) {
|
||||
|
||||
clearTimeout(this.timer);
|
||||
|
||||
this.tweenIn = null;
|
||||
this.supressEvents = true;
|
||||
this.started = false;
|
||||
|
||||
var transTime = this.settings.transtime * 0.001;
|
||||
var obj = {
|
||||
|
||||
speedx: this.orig.speedx + this.settings.transpeedx,
|
||||
speedy: this.orig.speedy + this.settings.transpeedy,
|
||||
rotationx: this.orig.rotationx + this.settings.transrotx,
|
||||
rotationy: this.orig.rotationy + this.settings.transroty,
|
||||
rotation: this.orig.rotation + this.settings.transrot,
|
||||
ease: this.settings.easing,
|
||||
overwrite: 'all',
|
||||
|
||||
};
|
||||
|
||||
if(this.settings.transcross && nextslide) {
|
||||
|
||||
this.nextslide = nextslide;
|
||||
obj.onComplete = this.onComplete.bind(this);
|
||||
|
||||
}
|
||||
|
||||
if(this.settings.transpower) obj.onUpdate = this.onUpdateOut.bind(this);
|
||||
punchgs.TweenLite.to(this.filter.scale, transTime, {
|
||||
|
||||
x: this.orig.scalex + this.settings.transitionx,
|
||||
y: this.orig.scaley + this.settings.transitiony,
|
||||
ease: this.settings.easing,
|
||||
overwrite: 'all'
|
||||
|
||||
});
|
||||
|
||||
this.tweenOut = punchgs.TweenLite.to(this.settings, transTime, obj);
|
||||
punchgs.TweenLite.to(this.renderer.view, transTime, {opacity: 0, ease: this.settings.easing, delay: transTime * 0.5});
|
||||
|
||||
},
|
||||
|
||||
reset: function(kill) {
|
||||
|
||||
this.tweenIn = null;
|
||||
this.tweenOut = null;
|
||||
this.ticker.stop();
|
||||
clearTimeout(this.timer);
|
||||
|
||||
punchgs.TweenLite.killTweensOf(this.filter.scale);
|
||||
punchgs.TweenLite.killTweensOf(this.settings);
|
||||
punchgs.TweenLite.killTweensOf(this.renderer.view);
|
||||
|
||||
if(kill) return;
|
||||
if(this.settings.power) {
|
||||
this.displacement.rotation = 0;
|
||||
this.displacement.scale.set(1);
|
||||
}
|
||||
|
||||
this.displacement.x = this.w / 2;
|
||||
this.displacement.y = this.h / 2;
|
||||
this.displacement.rotation.x = 0;
|
||||
this.displacement.rotation.y = 0;
|
||||
this.displacement.rotation = 0;
|
||||
this.settings.speedx = this.orig.speedx + this.settings.transpeedx;
|
||||
this.settings.speedy = this.orig.speedy + this.settings.transpeedy;
|
||||
this.settings.rotationx = this.orig.rotationx + this.settings.transrotx;
|
||||
this.settings.rotationy = this.orig.rotationy + this.settings.transroty;
|
||||
this.filter.scale.x = this.orig.scalex + this.settings.transitionx;
|
||||
this.filter.scale.y = this.orig.scaley + this.settings.transitiony;
|
||||
this.renderer.view.style.opacity = 0;
|
||||
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
|
||||
if(this.ticker) {
|
||||
|
||||
this.reset(true);
|
||||
this.container.pointerdown = null;
|
||||
this.container.pointerup = null;
|
||||
this.container.pointerover = null;
|
||||
this.container.pointerout = null;
|
||||
this.container.touchstart = null;
|
||||
this.container.touchend = null;
|
||||
|
||||
}
|
||||
|
||||
if(this.renderer) this.slide.remove(this.renderer.view);
|
||||
for(var prop in this) if(this.hasOwnProperty(prop)) delete this[prop];
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,25 @@
|
||||
/*
|
||||
2018 ThemePunch
|
||||
*/
|
||||
(function(){function l(a,b){this.slider=a;this.effects=b;this.firstrun=!0;a.one("revolution.slide.onloaded",this.onLoaded.bind(this)).one("rsLiquidEffectDestroyed",this.destroy.bind(this))}function k(a,b,c){this.w=b;this.h=c;this.slide=a;this.settings=a.data("liquideffectsettings");this.orig=a.data("liquideffectorig");this.displacement=new PIXI.Sprite.fromImage(this.settings.image,!0);this.displacement.texture.baseTexture.wrapMode=PIXI.WRAP_MODES.REPEAT;this.displacement.scale.x=2;this.displacement.scale.y=
|
||||
2;this.displacement.anchor.set(.5);this.displacement.x=b/2;this.displacement.y=c/2;var g=new PIXI.Texture.fromImage(this.settings.sprite,!0),d=new PIXI.Container;this.img=new PIXI.Sprite(g);this.img.anchor.set(.5);this.img.x=b/2;this.img.y=c/2;d.addChild(this.img);this.filter=new PIXI.filters.DisplacementFilter(this.displacement);this.filter.autoFit=!0;this.stage=new PIXI.Container;this.stage.addChild(d);this.stage.addChild(this.displacement);this.stage.filters=[this.filter];this.stage.interactive=
|
||||
!0;this.renderer=new PIXI.autoDetectRenderer(b,c,{transparent:!0});b=this.renderer.view.style;b.objectFit="cover";b.width="100%";b.height="100%";b.top="50%";b.left="50%";b.transform="translate( -50%, -50% ) scale(1.2)";a.find(".slotholder").append(this.renderer.view);this.settings.autoplay?(this.filter.scale.x=this.settings.scalex,this.filter.scale.y=this.settings.scaley):(this.filter.scale.x=0,this.filter.scale.y=0);this.settings.interactive?(d.interactive=!0,"mousedown"===this.settings.event?(d.buttonMode=
|
||||
!0,d.pointerdown=this.onClick.bind(this),d.pointerup=d.pointerout=this.onReturn.bind(this)):(d.pointerover=this.onMouseEnter.bind(this),d.pointermove=this.onMouseMove.bind(this),d.pointerout=this.onMouseLeave.bind(this))):this.renderer.view.style.pointerEvents="none";this.supressEvents=!0;this.started=!1;this.ticker=new PIXI.ticker.Ticker;this.ticker.add(this.tick.bind(this))}var h,m="ontouchend"in document;window.RsLiquideffectAddOn=function(a,b){if(a&&b&&"undefined"!==typeof PIXI){h=a;h.event.special.rsLiquidEffectDestroyed=
|
||||
{remove:function(a){a.handler()}};var c=b.find("li[data-liquideffect]").each(function(){var a=h(this),d=JSON.parse(a.attr("data-liquideffect"));if(d){var e=a.children("img");var c=b[0].opt.jsFileLocation||"";c&&(c=c.split("/revslider"));c=2===c.length?c[0]:"";/all|smart/.test(b[0].opt.lazyType)||(b[0].opt.lazyType="smart");if(e.attr("data-lazyload"))var f=e.attr("data-lazyload");else f=e.attr("src"),e.attr("data-lazyload",f),e.attr("src",c.replace("/extensions","")+"/revslider/admin/assets/images/dummy.png");
|
||||
f||(f=a.find(".slotholder").contents().filter(function(){return 8===this.nodeType}),f.length?(e=f[0].nodeValue,f=!1,e&&(e=e.split('data-lazyload="'),2===e.length?(e=e[1].split('"'),1<e.length&&(f=e[0])):(e=e.split('src="'),2===e.length&&(e=e[1].split('"'),1<e.length&&(f=e[0]))))):f=!1);f?(d.sprite=f,m&&d.mobile&&(d.interactive=!1),f=d.easing.split("."),d.easing=punchgs[f[0]][f[1]],a.attr({"data-transition":d.transcross?"crossfade":"fade","data-masterspeed":d.transtime,"data-easein":d.easing,"data-easeout":d.easing}).removeAttr("data-kenburns").data({liquideffectsettings:d,
|
||||
liquideffectorig:jQuery.extend({},d)}),d.interactive&&(f=d.intereasing.split("."),d.intereasing=punchgs[f[0]][f[1]])):a.removeData("liquideffect").removeAttr("data-liquideffect")}});c=b.find("li[data-liquideffect]");return c.length?new l(b,c):!1}};l.prototype={onLoaded:function(){this.slider.on("revolution.slide.onbeforeswap",this.beforeChange.bind(this)).on("revolution.slide.onchange",this.onChange.bind(this))},onChange:function(a,b){if(this.ranOnce){var c=b.prevslide.removeClass("liquid-force-visible").data("liquideffectcanvas");
|
||||
c&&(c.ticker.stop(),c.tweenOut=null);(c=b.currentslide.data("liquideffectcanvas"))&&!c.started&&c.animateIn()}else this.beforeChange(!1,{nextslide:b.currentslide})},beforeChange:function(a,b){function c(a,c){var d=new Image,e=c.find(".tp-bgimg");d.crossOrigin="Anonymous";d.src=e.css("background-image").slice(4,-1).replace(/"/g,"");d.onload=function(){var e=new k(c,parseInt(d.naturalWidth,10),parseInt(d.naturalHeight,10));c.data("liquideffectcanvas",e);a.imgCount++;a.imgCount===g.length&&a.run(b)}}
|
||||
this.ranOnce=!0;var g=[];this.effectsCreated||(this.effectsCreated=!0,this.effects.each(function(){var a=h(this),b=a.data("liquideffectsettings").imagesize.split("|");2===b.length?a.data("liquideffectcanvas",new k(a,parseInt(b[0],10),parseInt(b[1],10))):g[g.length]=this}));if(g.length)for(var d=this.imgCount=0;d<g.length;d++)c(this,h(g[d]));else this.run(b)},run:function(a){var b;if(this.firstrun)(b=a.nextslide.data("liquideffectcanvas"))&&b.animateIn(!0),this.firstrun=!1;else if(a.currentslide&&
|
||||
(b=a.currentslide.data("liquideffectcanvas"))&&b.animateOut(a.nextslide),b=a.nextslide.data("liquideffectcanvas"))a.nextslide.addClass("liquid-force-visible"),b.settings.transcross&&b.animateIn()},destroy:function(){this.slider&&this.slider.off("revolution.slide.onloaded revolution.slide.onbeforeswap revolution.slide.onafterswap");this.effects&&this.effects.each(function(){jQuery(this).removeData("liquideffectcanvas liquideffectsettings liquideffectorig")});for(var a in this)this.hasOwnProperty(a)&&
|
||||
delete this[a]}};k.prototype={tick:function(a){this.settings.autoplay&&(this.settings.speedx&&(this.displacement.x+=this.settings.speedx*a),this.settings.speedy&&(this.displacement.y+=this.settings.speedy),this.settings.rotationx&&(this.displacement.rotation.x+=this.settings.rotationx),this.settings.rotationy&&(this.displacement.rotation.y+=this.settings.rotationy),this.settings.rotation&&(this.displacement.rotation+=this.settings.rotation*Math.PI/180));this.renderer.render(this.stage)},onClick:function(){if(!this.supressEvents){var a=
|
||||
.001*this.settings.intertime;if(this.settings.interscalex||this.settings.interscaley){var b={ease:this.settings.intereasing,overwrite:"all"};this.settings.interscalex&&(b.x=this.orig.scalex+this.settings.interscalex);this.settings.interscaley&&(b.y=this.orig.scaley+this.settings.interscaley);punchgs.TweenLite.to(this.filter.scale,a,b)}punchgs.TweenLite.to(this.settings,a,{speedx:this.orig.speedx+this.settings.interspeedx,speedy:this.orig.speedy+this.settings.interspeedy,rotation:this.orig.rotation+
|
||||
this.settings.interotation,ease:this.settings.intereasing,overwrite:"all"})}},onReturn:function(){if(!this.supressEvents){var a=.001*this.settings.intertime;punchgs.TweenLite.to(this.filter.scale,a,{x:this.orig.scalex,y:this.orig.scaley,ease:this.settings.intereasing,overwrite:"all"});punchgs.TweenLite.to(this.settings,a,{speedx:this.orig.speedx,speedy:this.orig.speedy,rotation:this.orig.rotation,ease:this.settings.intereasing,overwrite:"all"})}},onMouseMove:function(a){if(!this.supressEvents)if(this.entered){var b=
|
||||
a.data.global.x;a=a.data.global.y;var c=b-this.x,g=a-this.y,d=Date.now();g=Math.sqrt(c*c+g*g)/(d-this.t);c=.001*this.settings.intertime;this.x=b;this.y=a;this.t=d;if(this.settings.interscalex||this.settings.interscaley){b={ease:this.settings.intereasing,overwrite:"all",onComplete:this.onReturn.bind(this)};this.settings.interscalex&&(b.x=this.settings.interscalex*g);this.settings.interscaley&&(b.y=this.settings.interscaley*g);var e=!0;punchgs.TweenLite.to(this.filter.scale,c,b)}b={speedx:this.orig.speedx+
|
||||
this.settings.interspeedx,speedy:this.orig.speedy+this.settings.interspeedy,rotation:this.orig.rotation+this.settings.interotation,ease:this.settings.intereasing,overwrite:"all"};e||(b.onComplete=this.onReturn.bind(this));punchgs.TweenLite.to(this.settings,c,b)}else this.onMouseEnter(a)},onMouseEnter:function(a){this.supressEvents||(this.entered=!0,this.x=a.data.global.x,this.y=a.data.global.y,this.t=Date.now())},onMouseLeave:function(){this.entered=!1},eventsReady:function(){this.supressEvents=!1},
|
||||
onComplete:function(){var a=this.nextslide.data("liquideffectcanvas");a&&!a.started&&a.animateIn();this.nextslide=!1},onUpdateIn:function(){this.tweenIn&&(this.displacement.rotation+=.02*this.tweenIn.progress(),this.displacement.scale.set(3*this.tweenIn.progress()))},onUpdateOut:function(){this.tweenOut&&(this.displacement.rotation+=.02*this.tweenOut.progress(),this.displacement.scale.set(3*this.tweenOut.progress()))},transitionIn:function(){var a=.001*this.settings.transtime,b={x:this.orig.scalex,
|
||||
y:this.orig.scaley,ease:this.settings.easing,overwrite:"all",delay:this.del},c={speedx:this.orig.speedx,speedy:this.orig.speedy,rotationx:this.orig.rotationx,rotationy:this.orig.rotationy,rotation:this.orig.rotation,ease:this.settings.easing,overwrite:"all",delay:this.del};this.interactive&&"mousedown"===this.event?b.onComplete=this.eventsReady.bind(this):this.supressEvents=!1;this.settings.transpower&&(c.onUpdate=this.onUpdateIn.bind(this));punchgs.TweenLite.to(this.filter.scale,a,b);this.tweenIn=
|
||||
punchgs.TweenLite.to(this.settings,a,c);punchgs.TweenLite.to(this.renderer.view,.5*a,{opacity:1,ease:this.settings.easing,overwrite:"all",delay:this.del});this.ticker.start()},animateIn:function(a){this.reset();this.started=!0;this.del=this.settings.transcross||a?5E-4*this.settings.transtime:0;this.timer=setTimeout(this.transitionIn.bind(this),this.del)},animateOut:function(a){clearTimeout(this.timer);this.tweenIn=null;this.supressEvents=!0;this.started=!1;var b=.001*this.settings.transtime,c={speedx:this.orig.speedx+
|
||||
this.settings.transpeedx,speedy:this.orig.speedy+this.settings.transpeedy,rotationx:this.orig.rotationx+this.settings.transrotx,rotationy:this.orig.rotationy+this.settings.transroty,rotation:this.orig.rotation+this.settings.transrot,ease:this.settings.easing,overwrite:"all"};this.settings.transcross&&a&&(this.nextslide=a,c.onComplete=this.onComplete.bind(this));this.settings.transpower&&(c.onUpdate=this.onUpdateOut.bind(this));punchgs.TweenLite.to(this.filter.scale,b,{x:this.orig.scalex+this.settings.transitionx,
|
||||
y:this.orig.scaley+this.settings.transitiony,ease:this.settings.easing,overwrite:"all"});this.tweenOut=punchgs.TweenLite.to(this.settings,b,c);punchgs.TweenLite.to(this.renderer.view,b,{opacity:0,ease:this.settings.easing,delay:.5*b})},reset:function(a){this.tweenOut=this.tweenIn=null;this.ticker.stop();clearTimeout(this.timer);punchgs.TweenLite.killTweensOf(this.filter.scale);punchgs.TweenLite.killTweensOf(this.settings);punchgs.TweenLite.killTweensOf(this.renderer.view);a||(this.settings.power&&
|
||||
(this.displacement.rotation=0,this.displacement.scale.set(1)),this.displacement.x=this.w/2,this.displacement.y=this.h/2,this.displacement.rotation.x=0,this.displacement.rotation.y=0,this.displacement.rotation=0,this.settings.speedx=this.orig.speedx+this.settings.transpeedx,this.settings.speedy=this.orig.speedy+this.settings.transpeedy,this.settings.rotationx=this.orig.rotationx+this.settings.transrotx,this.settings.rotationy=this.orig.rotationy+this.settings.transroty,this.filter.scale.x=this.orig.scalex+
|
||||
this.settings.transitionx,this.filter.scale.y=this.orig.scaley+this.settings.transitiony,this.renderer.view.style.opacity=0)},destroy:function(){this.ticker&&(this.reset(!0),this.container.pointerdown=null,this.container.pointerup=null,this.container.pointerover=null,this.container.pointerout=null,this.container.touchstart=null,this.container.touchend=null);this.renderer&&this.slide.remove(this.renderer.view);for(var a in this)this.hasOwnProperty(a)&&delete this[a]}}})();
|