Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div id="loader">
		<div class="grey"></div>
		<div class="white"></div>
		<div class="text-wrap">
			<div class="text">M<span>.</span></div>
		</div>
	</div>

	<header>
		<div class="menu"></div>
		<div class="logo">MADE</div>
		<div class="basket">Basket <span>2</span></div>
	</header>

	<section id="slider">

		<div id="canvas-holder">
			<canvas id="slider-canvas"></canvas>
			<div class="thumbs">
				<div><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/123024/j104-1.jpg"></div>
				<div><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/123024/j104-2.jpg"></div>
				<div><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/123024/j104-3.jpg"></div>
				<div><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/123024/j104-4.jpg"></div>
			</div>
      <button class="expand">
				<span>
					<span class="grid">
						<span class="layer layer--primary">
							<span></span><span></span>
						</span>
						<span class="layer layer--secondary">
							<span></span><span></span>
						</span>
					</span>
					<span class="square"></span>
				</span>
			</button>
		</div>

		<article>

			<div class="slide-count">
				<span class="index">
					<span class="next"></span>
					<span class="current">01</span>
				</span>
				<span class="line"></span>
				<span class="total">01</span>
			</div>

			<h1 class="slide-title">
				<span class="code">
					<span class="current">J110</span>
					<span class="next"></span>
				</span>
				Chair
			</h1>

			<div class="description">
				<p class="next"></p>
				<p class="current">With the comfort of a lounge chair and the functionality of a dining chair, HAY’s reproduction of Poul M. Voulter’s J110 offers equal measures of strong aesthetics and practicality. Long rods at the back and curved armrests create an inviting expression. Made in lacquered solid beech and available in a variety of colours.</p>
			</div>
			
			<a href="#" class="btn">Find a Dealer</a>

			<div class="dots"></div>

			<div class="slide-nav">
				<button data-direction="prev" disabled><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72 32.023201"><defs id="defs6"><clipPath id="clipPath18" clipPathUnits="userSpaceOnUse"><path id="path16" d="M 0,24.017 H 54 V 0 H 0 Z" /></clipPath></defs><g transform="matrix(1.3333333,0,0,-1.3333333,0,32.0232)" id="g10"><g id="g12"><g clip-path="url(#clipPath18)" id="g14"><g transform="translate(53,12.0086)" id="g20"><path id="path22" d="m 0,0 c 0,0.267 -0.11,0.522 -0.293,0.714 l -9.899,9.999 c -0.391,0.395 -1.024,0.394 -1.414,0 -0.391,-0.394 -0.391,-1.034 0,-1.428 L -3.413,1.01 H -51 c -0.552,0 -1,-0.452 -1,-1.01 0,-0.558 0.448,-1.01 1,-1.01 h 47.586 l -8.192,-8.275 c -0.391,-0.394 -0.39,-1.034 0,-1.428 0.391,-0.394 1.024,-0.394 1.414,0 l 9.899,9.999 C -0.106,-0.525 -0.003,-0.265 0,0" /></g><g transform="translate(53,12.0086)" id="g24"><path id="path26" d="m 0,0 c 0,0.267 -0.11,0.522 -0.293,0.714 l -9.899,9.999 c -0.391,0.395 -1.024,0.394 -1.414,0 -0.391,-0.394 -0.391,-1.034 0,-1.428 L -3.413,1.01 H -51 c -0.552,0 -1,-0.452 -1,-1.01 0,-0.558 0.448,-1.01 1,-1.01 h 47.586 l -8.192,-8.275 c -0.391,-0.394 -0.39,-1.034 0,-1.428 0.391,-0.394 1.024,-0.394 1.414,0 l 9.899,9.999 C -0.106,-0.525 -0.003,-0.265 0,0 Z" /></g></g></g></g></svg></button>
				<button data-direction="next"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72 32.023201"><defs id="defs6"><clipPath id="clipPath18" clipPathUnits="userSpaceOnUse"><path id="path16" d="M 0,24.017 H 54 V 0 H 0 Z" /></clipPath></defs><g transform="matrix(1.3333333,0,0,-1.3333333,0,32.0232)" id="g10"><g id="g12"><g clip-path="url(#clipPath18)" id="g14"><g transform="translate(53,12.0086)" id="g20"><path id="path22" d="m 0,0 c 0,0.267 -0.11,0.522 -0.293,0.714 l -9.899,9.999 c -0.391,0.395 -1.024,0.394 -1.414,0 -0.391,-0.394 -0.391,-1.034 0,-1.428 L -3.413,1.01 H -51 c -0.552,0 -1,-0.452 -1,-1.01 0,-0.558 0.448,-1.01 1,-1.01 h 47.586 l -8.192,-8.275 c -0.391,-0.394 -0.39,-1.034 0,-1.428 0.391,-0.394 1.024,-0.394 1.414,0 l 9.899,9.999 C -0.106,-0.525 -0.003,-0.265 0,0" /></g><g transform="translate(53,12.0086)" id="g24"><path id="path26" d="m 0,0 c 0,0.267 -0.11,0.522 -0.293,0.714 l -9.899,9.999 c -0.391,0.395 -1.024,0.394 -1.414,0 -0.391,-0.394 -0.391,-1.034 0,-1.428 L -3.413,1.01 H -51 c -0.552,0 -1,-0.452 -1,-1.01 0,-0.558 0.448,-1.01 1,-1.01 h 47.586 l -8.192,-8.275 c -0.391,-0.394 -0.39,-1.034 0,-1.428 0.391,-0.394 1.024,-0.394 1.414,0 l 9.899,9.999 C -0.106,-0.525 -0.003,-0.265 0,0 Z" /></g></g></g></g></svg></button>
			</div>

		</article>

		<div class="category">Seating</div>

	</section>
              
            
!

CSS

              
                @font-face {
    font-family: 'para';
    src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/123024/para_supreme_light_fine-webfont.woff2') format('woff2'),
         url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/123024/para_supreme_light_fine-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'begum';
    src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/123024/begum-regular-webfont.woff2') format('woff2'),
         url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/123024/begum-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'tt-commons';
    src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/123024/ttcommons-bold-webfont.woff2') format('woff2'),
         url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/123024/ttcommons-bold-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

* {
    box-sizing: border-box;
}

p {
    margin: 0;
}

body {
    background-color: #161516;
    margin: 0;
  
}

#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;

    .grey, .white {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .grey {
        z-index: 2;
        background-color: #1b191b;
    }

    .white {
        z-index: 1;
        background-color: white;
    }

    .text-wrap {
        overflow: hidden;
    }

    .text-wrap {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
        font-family: 'tt-commons';
        color: white;
        font-size: 70px;
        z-index: 3;

        span {
            display: inline-block;
        }
    }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1500px;
    height: 70px;
    padding: 0 25px;
    margin: 0 auto 15px;
    position: relative;

    .menu {
        position: relative;
        padding-left: 1.25em;
        height: 18px;

        &:before {
            content: "";
            position: absolute;
            top: 0.25em;
            left: 0;
            width: 1.5em;
            height: 0.125em;
            border-top: 0.375em double #c9c8c9;
            border-bottom: 0.125em solid #c9c8c9;
        }
    }

    .logo {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
        font-family: 'tt-commons';
        font-size: 30px;
        color: white;
    }

    .basket {
        font-family: 'tt-commons';
        font-size: 13px;
        color: white;
        text-transform: uppercase;

        span {
            color: #7b7a7b;
            margin-left: 3px;
        }
    }
}

#canvas-holder {
    position: relative;
    width: 100%;
    padding-top: 100%;
    margin: 0 auto;
    overflow: hidden;

    @media screen and (min-width: 800px) {
        width: 50%;
        padding-top: 50%;
    }

    @media screen and (min-width: 1100px) {
        width: 60%;
        padding-top: 60%;
        margin-right: 50px;
    }
  
    &:hover {

        .expand {
            transform: scale(1.1);

            > span {
                transform: scale(0.9);
            }
        }
    }
}

#slider-canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    cursor: pointer !important;
}

.expand {
    display: block;
    width: 50px;
    height: 50px;
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: white;
    border-radius: 100%;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.4);
    padding: 0;
    z-index: 3;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    outline: none;
    pointer-events: none;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;

    > span {
        display: block;
        width: 20px;
        height: 20px;
        margin: 0 auto;
        position: relative;
        overflow: hidden;
        transition: transform 0.2s ease-in-out;

        > span {
            display: block;
            width: 20px;
            height: 20px;
        }

        .square {
            transform: translateY(-100%);
            border: solid 2px #333;
            opacity: 0;
        }
    }

    .layer {
        width: 100%;
        position: absolute;
        left: 0;
        height: 9px;

        > span {
            position: absolute;
            display: block;
            width: 9px;
            height: 100%;
            box-sizing: border-box;
            border: solid 2px #333;

            &:first-child {
                left: 0;
            }

            &:nth-child(2) {
                right: 0;
            }
        }

        &.layer--primary {
            top: 0;
        }
        
        &.layer--secondary {
            bottom: 0;
        }
    }
}

.thumbs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    flex-wrap: wrap;

    > div {
        position: absolute;
        width: 47%;
        height: 0;
        overflow: hidden;

        &:nth-child(1) {
            top: 0;
            left: 0;
        }

        &:nth-child(2) {
            top: 0;
            right: 0;
        }

        &:nth-child(3) {
            top: 53%;
            left: 0;
        }

        &:nth-child(4) {
            top: 53%;
            right: 0;
        }

        img {
            display: block;
            width: 100%;
            transform: scale(1.4);
        }
    }
}

#slider {
    display: flex;
    flex-direction: column;
    padding: 0 30px;
    position: relative;
    max-width: 1500px;
    margin: 0 auto 40px;

    @media screen and (min-width: 1100px) {
        flex-direction: row;
        padding: 0 70px 0 40px;
    }

    article {
        position: relative;
        width: 100%;
        color: #FFF;
        z-index: 2;
        max-width: 500px;
        margin: 0 auto;

        @media screen and (min-width: 1100px) {
            width: calc(40% - 50px);
            max-width: none;
        }

        .slide-count {
            margin-top: 70px;
            font-family: 'tt-commons';
            font-size: 14px;
            overflow: hidden;

            .index {
                display: inline-block;
                position: relative;
                line-height: 24px;
                width: 16px;
                height: 24px;

                > span {
                    display: block;
                    height: 100%;
                }

                .next {
                    position: absolute;
                    top: -100%;
                    left: 0;
                }
            }

            .line {
                display: inline-block;
                width: 30px;
                height: 1px;
                background-color: white;
                vertical-align: middle;
                margin: 0 7px;
            }
        }

        .slide-title {
            font-family: 'para';
            font-size: 70px;
            font-weight: 400;
            margin: 30px 0 30px 125px;
            letter-spacing: -3px;
            padding-left: 12px;
            line-height: 80px;
            position: relative;

            @media screen and (min-width: 700px) {
                font-size: 110px;
                line-height: 120px;
                margin: 60px 0 60px 220px;
            }

            @media screen and (min-width: 1100px) {
                font-size: 110px;
                line-height: 120px;
                margin-left: 50px;
            }

            .code {
                display: block;
                position: absolute;
                right: 100%;
                height: 100%;
                padding: 0 6px;
                overflow: hidden;

                &:before {
                    content: '';
                    display: block;
                    position: absolute;
                    bottom: 0;
                    left: -10px;
                    width: 108%;
                    height: 40%;
                    background-color: #343234;
                    z-index: -1;
                }

                > span {
                    position: absolute;
                    top: 0;
                    right: 6px;
                    display: inline-block;
                    height: 100%;
                }

                .next {
                    position: absolute;
                    top: -100%;
                }
            }
        }

        .description {
            position: relative;
            font-size: 12px;
            line-height: 20px;
            width: 100%;
            max-width: 380px;
            height: 160px;
            font-family: 'begum';

            @media screen and (min-width: 1100px) {
                height: 100px;
            }

            > p {
                position: absolute;
                top: 0;
                left: 0;
            }
        }

        .btn {
            margin-top: 50px;
            display: inline-block;
            position: relative;
            font-family: 'tt-commons';
            font-size: 13px;
            color: white;
            text-transform: uppercase;
            text-decoration: none;

            &:after {
                content: '';
                display: block;
                width: 100%;
                height: 1px;
                position: absolute;
                bottom: -8px;
                background-color: #434143;
            }
        }
    }

    .slide-nav {
        position: absolute;
        z-index: 5;
        top: 20px;
        right: 30px;
        transform: rotate(-90deg);

        @media screen and (min-width: 1100px) {
            top: 50%;
            right: -50px;
            transform: translateY(-50%);
        }

        button {
            display: block;
            position: relative;
            appearance: none;
            -webkit-appearance: none;
            width: 40px;
            height: 40px;
            border-radius: 100%;
            border: 1px solid #434143;
            padding: 0;
            background-color: transparent;
            outline: 0;
            transition: border-color 0.3s ease-in-out;

            &:disabled {
                opacity: 0.2;
            }

            &:hover:not(:disabled) {
                border-color: #9e969e;
                cursor: pointer;
            }

            &:first-child {
                margin-bottom: 10px;
            }

            svg {
                position: absolute;
                top: 50%;
                left: 50%;
                display: block;
                width: 16px;
                height: 7px;
                fill: #9e969e;
            }

            &[data-direction="prev"] svg {
                transform: translate(-50%,-50%) rotate(-90deg);
            }

            &[data-direction="next"] svg {
                transform: translate(-50%,-50%) rotate(90deg);
            }
        }
    }

    .dots {
        position: absolute;
        bottom: 25px;
        left: 0;

        > span {
            display: inline-block;
            width: 6px;
            height: 6px;
            border-radius: 100%;
            background-color: #313131;
            margin: 0 7px 0 0;
            overflow: hidden;

            &:before {
                content: '';
                display: block;
                width: 100%;
                height: 100%;
                background-color: white;
                opacity: 0;
                transition: 0.8s opacity ease-in-out;
            }

            &.active:before {
                opacity: 1;
            }
        }
    }

    .category {
        position: absolute;
        bottom: 45px;
        right: -5px;
        font-family: 'tt-commons';
        font-size: 16px;
        text-transform: uppercase;
        color: white;
        transform: rotate(-90deg);
    }
}
              
            
!

JS

              
                class Loader {

    constructor() {

        this.container = document.querySelector('#loader');
        this.grey = this.container.querySelector('.grey');
        this.white = this.container.querySelector('.white');
        this.textWrap = this.container.querySelector('.text-wrap');
        this.text = this.container.querySelector('.text');
        this.dot = this.text.querySelector('span');
        this.animateDot();

    }

    animateDot() {

        this.dotTween = TweenMax.fromTo( this.dot, 0.5, {
            y: 0
        }, {
            y: -10,
            ease: 'Power0.easeOut',
            yoyo: true,
            yoyoEase: 'Bounce.easeOut',
            repeat: -1,
            repeatDelay: 0.3
        })

    }

    hide() {

        let tl = new TimelineMax({
            delay: 0.5,
            onComplete: () => {
                this.dotTween.kill();
                this.container.style.display = 'none';
            }
        });

        tl.to( this.text, 0.8, {
            y: 100,
            ease: 'Expo.easeIn'
        }, 0 )

        .to( this.grey, 1, {
            yPercent: 100,
            ease: 'Expo.easeOut'
        }, 0.8 )

        .to( this.white, 1, {
            yPercent: 100,
            ease: 'Expo.easeOut'
        }, 1 )
      
      .fromTo( '#slider-canvas', 1, {
            scale: 1.1
        }, {
            scale: 1,
            ease: 'Expo.easeOut'
        }, 1)

    }

}

class Slider {

    constructor( canvas, loader ) {

        this.canvas = canvas;
        this.loader = loader;

        this.setOptions();
        this.createApp();
        this.loadImages();

    }

    setOptions() {

        PIXI.utils.skipHello(); // turn off console branding
        PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.LINEAR;
        PIXI.settings.PRECISION_FRAGMENT = PIXI.PRECISION.HIGH;

        this.canvasWidth = this.canvas.clientWidth;
        this.canvasHeight = this.canvas.clientHeight;
        this.dpr = window.devicePixelRatio && window.devicePixelRatio >= 2 ? 2 : 1;
        this.thumbsVisible = false;
        this.animating = false;

        this.dom = {
            titleNext: document.querySelector('.slide-title .next'),
            titleCurrent: document.querySelector('.slide-title .current'),
            descriptionNext: document.querySelector('.description .next'),
            descriptionCurrent: document.querySelector('.description .current'),
            countNext: document.querySelector('.slide-count .next'),
            countCurrent: document.querySelector('.slide-count .current')
        }

        this.slideData = {
            0: {
                image: 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/123024/j110.jpg',
                title: 'J110',
                description: `With the comfort of a lounge chair and the functionality of a dining chair, HAY’s reproduction of Poul M. Voulter’s J110 offers equal measures of strong aesthetics and practicality. Long rods at the back and curved armrests create an inviting expression. Made in lacquered solid beech and available in a variety of colours.`
            },
            1: {
                image: 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/123024/j104.jpg',
                title: 'J104',
                description: `Jørgen Bækmark’s J104 chair was designed as a cross between a dining chair and an easy chair, HAY’s reproduction of this classic is crafted in solid beech with a variety of soaped or lacquered finishes.`
            },
            2: {
                image: 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/123024/j42.jpg',
                title: 'J42',
                description: `HAY’s reproduction of Børge Mogensen’s classic J42 chair clearly reflects his design philosophy. Precise proportions with simple horizontal and vertical lines are used to construct a curved spindled backrest and angular armrests. With a broad plywood seat and frame in solid oak or beech, the design has a timeless quality that is built to provide lasting comfort.`
            }
        }

    }

    createApp() {

        this.app = new PIXI.Application( this.canvasWidth, this.canvasHeight, {
            view: this.canvas,
            width: this.canvasWidth,
            height: this.canvasHeight,
            transparent: true,
            resolution: this.dpr,
            autoResize: true
        });

    }

    loadImages() {

        Object.keys( this.slideData ).forEach( key => {
            PIXI.loader.add( key, this.slideData[key].image );
        });

        PIXI.loader.load( ( l, images ) => {

            this.images = images;
            this.createSlider();
            this.loader.hide();

        });

    }

    createSlider() {

        this.slider = new PIXI.Container();
        this.slider.width = this.app.screen.width;
        this.slider.height = this.app.screen.height;
        this.app.stage.addChild( this.slider );

        this.clipRect = new PIXI.Rectangle( 0, 0, this.app.screen.width, this.app.screen.height );
        this.slider.filterArea = this.clipRect;

        this.app.stage.interactive = true;
        this.app.stage.on( 'pointerdown', () => {
            this.thumbsVisible ? this.hideThumbs() : this.showThumbs();
        });

        this.addSlides();
        this.createDisplacementFilter();
        this.buttonEvents();

    }

    addSlides() {

        this.slides = {
            activeIndex: 0,
            count: 0
        }

        let i = 0;

        Object.keys( this.images ).forEach( key => {

            let slide = new PIXI.Sprite( this.images[key].texture );
            slide.width = this.app.screen.width;
            slide.height = this.app.screen.height;
            slide.y = i === 0 ? 0 : -this.app.screen.height;

            this.slides[ i ] = slide;
            this.slider.addChild( slide );

            i++;
            this.slides.count++;
            
        });

        document.querySelector( '.slide-count .total' ).textContent = `0${this.slides.count}`;
        document.querySelector( '.slide-title .code' ).style.width = this.dom.titleCurrent.scrollWidth + 6 + 'px';

        for( let i = 0; i < this.slides.count; i++ ) {
            document.querySelector( '.dots' ).innerHTML += '<span></span>';
        }

        document.querySelector( '.dots > span:nth-child(1)' ).classList.add('active');

    }

    nextSlide() {

        if( this.nextBtn.getAttribute( 'disabled' ) || this.thumbsVisible || this.animating ) return false;

        this.prevBtn.removeAttribute( 'disabled' );

        if( this.slides.activeIndex + 2 >= this.slides.count ) {
            this.nextBtn.setAttribute( 'disabled', 'disabled' );
        }

        let nextSlideData = this.slideData[ this.slides.activeIndex + 1];
        this.dom.titleNext.textContent = nextSlideData.title;
        this.dom.descriptionNext.textContent = nextSlideData.description;
        this.dom.countNext.textContent = '0' + ( this.slides.activeIndex + 2 );

        this.updateDot( true );

        let tl = new TimelineMax({
            onStart: () => {
                this.animating = true;
            },
            onComplete: () => {
                this.slides.activeIndex++;
                this.resetText();
                this.animating = false;
            }
        });

        tl.to( this.slides[ this.slides.activeIndex ], 2, {
            y: this.app.screen.height,
            ease: 'Expo.easeInOut'
        }, 0 )

        .fromTo( this.slides[ this.slides.activeIndex + 1 ], 2, {
            y: -this.app.screen.height
        }, {
            y: 0,
            ease: 'Expo.easeInOut'
        }, 0 )

        .to( this.dispFilter.scale, 1, {
            x: 10,
            y: 10,
            ease: 'Power2.easeInOut'
        }, 0 )

        .to( this.dispFilter.scale, 1, {
            x: 0,
            y: 0,
            ease: 'Power2.easeInOut'
        }, 1 )

        .set( '.slide-count .next', { top: '-100%' }, 0 )

        .fromTo( ['.slide-count .current', '.slide-count .next'], 2, {
            yPercent: 0
        }, {
            yPercent: 100,
            ease: 'Expo.easeInOut'
        }, 0 )

        .set( '.slide-title .next', { top: '-100%' }, 0 )

        .fromTo( ['.slide-title .current', '.slide-title .next'], 2, {
            yPercent: 0
        }, {
            yPercent: 100,
            ease: 'Expo.easeInOut'
        }, 0 )

        .to( '.slide-title .code', 2, {
            width: this.dom.titleNext.scrollWidth + 6,
            ease: 'Expo.easeInOut'
        }, 0 )

        .fromTo( '.description .current', 2, {
            y: 0,
            autoAlpha: 1,
        }, {
            y: 40,
            autoAlpha: 0,
            ease: 'Expo.easeInOut'
        }, 0 )

        .fromTo( '.description .next', 2, {
            y: -40,
            autoAlpha: 0,
        }, {
            y: 0,
            autoAlpha: 1,
            ease: 'Expo.easeInOut'
        }, 0 )

    }

    prevSlide() {

        if( this.prevBtn.getAttribute( 'disabled' ) || this.thumbsVisible || this.animating ) return false;

        this.nextBtn.removeAttribute( 'disabled' );

        if( this.slides.activeIndex - 2 < 0 ) {
            this.prevBtn.setAttribute( 'disabled', 'disabled' );
        }

        let nextSlideData = this.slideData[ this.slides.activeIndex - 1];
        this.dom.titleNext.textContent = nextSlideData.title;
        this.dom.descriptionNext.textContent = nextSlideData.description;
        this.dom.countNext.textContent = '0' + ( this.slides.activeIndex );

        this.updateDot( false );

        let tl = new TimelineMax({
            onStart: () => {
                this.animating = true;
            },
            onComplete: () => {
                this.slides.activeIndex--;
                this.resetText();
                this.animating = false;
            }
        });

        tl.to( this.slides[ this.slides.activeIndex ], 2, {
            y: -this.app.screen.height,
            ease: 'Expo.easeInOut'
        }, 0 )

        .fromTo( this.slides[ this.slides.activeIndex - 1 ], 2, {
            y: this.app.screen.height
        }, {
            y: 0,
            ease: 'Expo.easeInOut'
        }, 0 )

        .to( this.dispFilter.scale, 1, {
            x: 10,
            y: 10,
            ease: 'Power2.easeInOut'
        }, 0 )

        .to( this.dispFilter.scale, 1, {
            x: 0,
            y: 0,
            ease: 'Power2.easeInOut'
        }, 1 )

        .set( '.slide-count .next', { top: '100%' }, 0 )

        .fromTo( ['.slide-count .current', '.slide-count .next'], 2, {
            yPercent: 0
        }, {
            yPercent: -100,
            ease: 'Expo.easeInOut'
        }, 0 )

        .set( '.slide-title .next', { top: '100%' }, 0 )

        .fromTo( ['.slide-title .current', '.slide-title .next'], 2, {
            yPercent: 0
        }, {
            yPercent: -100,
            ease: 'Expo.easeInOut'
        }, 0 )

        .to( '.slide-title .code', 2, {
            width: this.dom.titleNext.scrollWidth + 6,
            ease: 'Expo.easeInOut'
        }, 0 )

        .fromTo( '.description .current', 2, {
            y: 0,
            autoAlpha: 1,
        }, {
            y: -40,
            autoAlpha: 0,
            ease: 'Expo.easeInOut'
        }, 0 )

        .fromTo( '.description .next', 2, {
            y: 40,
            autoAlpha: 0,
        }, {
            y: 0,
            autoAlpha: 1,
            ease: 'Expo.easeInOut'
        }, 0 )
        
    }

    resetText() {

        this.dom.titleCurrent.textContent = this.dom.titleNext.textContent;
        this.dom.titleCurrent.removeAttribute('style');
        this.dom.titleNext.textContent = '';
        this.dom.titleNext.removeAttribute('style');

        this.dom.descriptionCurrent.textContent = this.dom.descriptionNext.textContent;
        this.dom.descriptionCurrent.removeAttribute('style');
        this.dom.descriptionNext.textContent = '';
        this.dom.descriptionNext.removeAttribute('style');

        this.dom.countCurrent.textContent = this.dom.countNext.textContent;
        this.dom.countCurrent.removeAttribute('style');
        this.dom.countNext.textContent = '';
        this.dom.countNext.removeAttribute('style');

    }

    createDisplacementFilter() {

        this.dispSprite = PIXI.Sprite.fromImage('https://s3-us-west-2.amazonaws.com/s.cdpn.io/123024/disp5.jpg');
        this.dispSprite.texture.baseTexture.wrapMode = PIXI.WRAP_MODES.REPEAT;
        this.dispSprite.skew.x = 1;
        this.dispSprite.skew.y = -1;
        this.dispSprite.position.y = 380;
        this.dispSprite.scale.y = 1.8;
        this.dispSprite.scale.x = 1.8;
        this.app.stage.addChild( this.dispSprite );

        this.dispFilter = new PIXI.filters.DisplacementFilter( this.dispSprite, 0 );

        this.slider.filters = [ this.dispFilter ];

    }

    buttonEvents() {

        this.prevBtn = document.querySelector('.slide-nav [data-direction="prev"]');
        this.nextBtn = document.querySelector('.slide-nav [data-direction="next"]');
        this.prevBtn.addEventListener( 'click', this.prevSlide.bind( this ) );
        this.nextBtn.addEventListener( 'click', this.nextSlide.bind( this ) );
      
      document.onkeydown = (e) => {
        e = e || window.event;
        if (e.keyCode == 38) {
            this.prevSlide.call( this );
        }
        else if (e.keyCode == 40) {
            this.nextSlide.call( this );
        }
      }

    }

    showThumbs() {

        this.thumbsVisible = true;
        this.canvas.classList.add('thumbs-visible');

        this.thumbsTl = new TimelineMax();

        this.thumbsTl
        
            .fromTo( this.clipRect, 3, {
                y: 0
            }, {
                y: this.app.screen.height + 50,
                ease: 'Expo.easeInOut'
            }, 0 )

            .fromTo( this.dispFilter.scale, 2, {
                x: 0,
                y: 0
            }, {
                x: 10,
                y: 10,
                ease: 'Expo.easeInOut'
            }, 0 )

            .fromTo( this.dispSprite, 3, {
                y: this.app.screen.height
            }, {
                y: 0,
                ease: 'Power2.easeInOut'
            }, 0.5)

            .staggerFromTo( '.thumbs > div', 3, {
                height: 0
            }, {
                height: '47%',
                ease: 'Expo.easeInOut'
            }, 0.1, 0.2 )

            .staggerFromTo( '.thumbs > div img', 3, {
                scale: 1.4
            }, {
                scale: 1,
                ease: 'Expo.easeInOut'
            }, 0.1, 0.2 )
      
            .to( '.expand .square', 2, {
                autoAlpha: 1,
                ease: 'Expo.easeInOut'
            }, 1)

            .to( '.expand .grid', 2, {
                autoAlpha: 0,
                ease: 'Expo.easeInOut'
            }, 1)

    }

    hideThumbs() {

        this.thumbsVisible = false;
        this.canvas.classList.remove('thumbs-visible');

        this.thumbsTl.reverse();

    }

    updateDot( right ) {

        let newActive = right ? this.slides.activeIndex + 2 : this.slides.activeIndex;
        document.querySelector('.dots > span.active').classList.remove('active');
        document.querySelector(`.dots > span:nth-child(${newActive})`).classList.add('active');

    }

}

let loader = new Loader();
let slider = new Slider( document.getElementById('slider-canvas'), loader )


              
            
!
999px

Console