Skip to content

Commit

Permalink
update core plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
hmongouachon committed Feb 4, 2020
1 parent 22a7047 commit 140e072
Showing 1 changed file with 9 additions and 28 deletions.
37 changes: 9 additions & 28 deletions js/rgbKineticSlider.js
Expand Up @@ -58,9 +58,8 @@

// remove pixi message in console
PIXI.utils.skipHello();
// PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST;

const renderer = new PIXI.autoDetectRenderer(imgWidth,imgHeight, { // PIXI.autoDetectRenderer
const renderer = new PIXI.autoDetectRenderer(imgWidth,imgHeight, {
transparent: true,
autoResize: true,
resolution: devicePixelRatio,
Expand Down Expand Up @@ -135,14 +134,10 @@
// append render to canvas
canvas.appendChild(renderer.view);



// set dispFilter to the stage
stage.filters = [dispFilter];
// stage.scale.set(2)



// enable cursorInteractive on mainContainer
mainContainer.interactive = true;

Expand Down Expand Up @@ -216,8 +211,6 @@
render.add(function(delta) {
renderer.render(stage);
});


}


Expand Down Expand Up @@ -294,16 +287,12 @@

if(window.innerWidth < 768) {
word_wrap = window.innerWidth * 1.5;

// alert(word_wrap)
}

else {
word_wrap = window.innerWidth / 2
}

// alert(word_wrap)

// get string after :
let fontWeight_1 = options.googleFonts[0].split(":").pop();
textTitles = new PIXI.Text(options.itemsTitles[i][0], {
Expand Down Expand Up @@ -410,7 +399,6 @@
dispSprite.x = renderer.view.width / 2;
dispSprite.y = renderer.view.height / 2;


// set timeline with callbacks
timelineTransition = new TimelineMax({
onStart: function() {
Expand Down Expand Up @@ -659,22 +647,17 @@
tilt( currentIndex, kineX, kineY )
}

// make kineX and kineY return always positive value from x to 0
// if (kineX < 0 ) kineX = -kineX;
// if (kineY < 0) kineY = -kineY;

// if flag has changed
if( is_moving === true ) {
// update cursor displacement sprite positions on cursor moving
// setTimeout(function () {
dispSprite_2.x = vx;
dispSprite_2.y = vy ;

TweenMax.to(dispFilter_2.scale, 0.5, {
x: kineX * options.cursorScaleIntensity,
y: kineY * options.cursorScaleIntensity,
ease: Power4.easeOut
});
dispSprite_2.x = vx;
dispSprite_2.y = vy ;

TweenMax.to(dispFilter_2.scale, 0.5, {
x: kineX * options.cursorScaleIntensity,
y: kineY * options.cursorScaleIntensity,
ease: Power4.easeOut
});
}

// make background displacement follow mouse position on transition events
Expand Down Expand Up @@ -922,10 +905,8 @@

// interactivity
cursorInteractive();

swipe();
slideTransition(currentIndex);


// Listen for window resize events
window.addEventListener('resize', resizeTexts);
Expand Down

0 comments on commit 140e072

Please sign in to comment.