Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                doctype html

html
    head
  
        //style
        link(rel='stylesheet' href='https://fonts.googleapis.com/icon?family=Material+Icons')
        link(rel='stylesheet', href='assets/css/style.css')
    
    #container


        
        .title Meet Mia,

        .sub-title 
            div Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam,
            div eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. 
            div Enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit.
            div Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam,

        .layer(data-depth='0.15')
            .back
                .slider
                    img(src='https://res.cloudinary.com/oscartbeamish/image/upload/v1537055791/girl5_igrt7v.jpg')
        .layer(data-depth='0.225')
            .mid.left
                .slider
                    img(src='https://res.cloudinary.com/oscartbeamish/image/upload/v1537055797/girl2_dvxxw2.jpg')
            .mid.right
                .slider
                    img(src='https://res.cloudinary.com/oscartbeamish/image/upload/v1537055789/girl4_sg5dri.jpg')
        .layer(data-depth='0.325')
            .front.left
                .slider
                    img(src='https://res.cloudinary.com/oscartbeamish/image/upload/v1537055799/girl_gw1fxd.jpg')
            .front.right
                .slider
                    img(src='https://res.cloudinary.com/oscartbeamish/image/upload/v1537055797/girl3_s5cm32.jpg')
            .front.back.small-black
            
        #menu.small-white
            - for (var i = 0; i < 3; i++)
                div
            
        .logo portfolio concept
        
        .name parallax practice
        
        .photography photography by Bruce Dixon

        .back-button 
            .icon Back
                i.material-icons keyboard_backspace
        
    #pre-loader
        .pre-loader
            .pre-logo portfolio concept

    .custom-mouse
        .cursor#cursor

        
    script(src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js') 
    
    script(src='https://code.jquery.com/ui/1.12.0/jquery-ui.js') 
    
    script(src='https://cdnjs.cloudflare.com/ajax/libs/gsap/1.20.3/TweenMax.min.js')
    
    script(src='https://cdnjs.cloudflare.com/ajax/libs/animejs/1.0.0/anime.js') 
   
    script(src='https://cdnjs.cloudflare.com/ajax/libs/parallax/1.1.1/jquery.parallax.min.js')
    
    script(src='assets/js/script.js')

              
            
!

CSS

              
                //otb
//colours
$transparent: rgba(255,
255,
255,
0);

$color-light-grey: #e0dfe1;
$color-light-grey-A: #f0f0f0;
$color-grey: #9f9e9f;
$color-dark-grey: #222222;
$color-blue: #0190ec;
$color-light-blue: #6295ca;
$color-dark-blue: #13274c;
$color-red: #d1253b;

$color-black: #000;
$color-white: #fff;

$color-primary: #a3225c;
$color-secondary: #e2e2e2;

$dribbble-color: #e5508a;

// mixins
@mixin clearfix {
    &:after {
        content: "";
        display: table;
        clear: both;
    }
}

@mixin center {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
}

@mixin absolute {
    position: absolute;
    left: 0;
    right: 0;
}

@mixin transform($transforms) {
    -moz-transform: $transforms;
    -o-transform: $transforms;
    -ms-transform: $transforms;
    -webkit-transform: $transforms;
    transform: $transforms;
}

@mixin rotate ($deg) {
    @include transform(rotate(#{$deg}deg));
}

@mixin blur {

    &:after {
        content: '';
        position: absolute;
        z-index: -1;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: inherit;
        filter: blur(55px);
    }
}

@import url('https://fonts.googleapis.com/css?family=Space+Mono|Oswald|Playfair+Display|Nunito:300|Lora|Nunito+Sans|Poppins:400,500,600,700|ZCOOL+XiaoWei');

//container
// sizes
$c-width: 1425px;
$c-height: 800px;

//menu
$m-size: 28px;

//otb logo
$otb-size: 40px;

$color-container: #292927;

//margin
$margin: 1.5rem;
$v-margin: 35px;
$h-margin: 55px;

$s-margin: 80px;

//opacity
$opacity: 0.85;

//menu item size
$itemSize: 40px;

$hover-transition: .5s;

.circle {
    position: absolute;
    width: 50px;
    height: 50px;
    top: 50%;
    left: 50%;
    margin: -50px 0 0 -50px;
    background: rgba(#292927, .7);
    border-radius: 50%;
    z-index: 1;
    cursor: none;
}

// html {
// 	cursor: none;
// }

body {
    background: #fff;
    overflow: hidden;
}

.backgrounds {
    @include center;
    width: $c-width;
    height: $c-height;
    overflow: hidden;
}

#container {
    @include center;
    padding: 0;
    width: $c-width;
    height: $c-height;
    overflow: hidden;
    background: $color-container;
    color: $color-white;
    cursor: none;

   // text can't be highlighted
	* {
		cursor: none !important;
		-webkit-touch-callout: none;
		/* iOS Safari */
		-webkit-user-select: none;
		/* Safari */
		-khtml-user-select: none;
		/* Konqueror HTML */
		-moz-user-select: none;
		/* Firefox */
		-ms-user-select: none;
		/* Internet Explorer/Edge */
		user-select: none;
		/* Non-prefixed version, currently
									  supported by Chrome and Opera */
	}

	// images arn't draggable
	img {
		user-drag: none;
		user-select: none;
		-moz-user-select: none;
		-webkit-user-drag: none;
		-webkit-user-select: none;
		-ms-user-select: none;
    }

    &.hide {

        $hide-transition: 0s cubic-bezier(0.215, 0.61, 0.355, 1) 1s;;

        .layer {

            > div {

                .slider {
                    height: 0% !important;
                    transition: $hide-transition;
                }

                
                
            }
        }

        .logo,
        .photography, {
            width: 0;
            transition: $hide-transition;
        }

        .name {
            &:after {
                width: 100%;
                transition: $hide-transition;
            }
        }

        .back-button {
            width: 0;
            transition: $hide-transition;
            
        }

        #menu {
            
            div {
                width: 0;
                transition: $hide-transition;
            }

        }

        .title {
            width: 0;
            transition: $hide-transition;
        }

        .sub-title {
            
            div {
                opacity: 0;
                transition: $hide-transition;
            }
        }
        
    }

    $image-transition: 2.6s;
    $text-transition: 2.75s cubic-bezier(0.445, 0.05, 0.55, 0.95);
    $title-transition: 2.6s cubic-bezier(0.445, 0.05, 0.55, 0.95);
    $sub-transition: 1s cubic-bezier(0.445, 0.05, 0.55, 0.95);
    $menu-transition: 1s;

    &.reveal {

        .layer {

            > div {

                .slider {
                    transition: $image-transition 1.9s;
                }
                
            }

            .front {
                z-index: 1;
    
                &.left {

                    .slider {
                        height: 240px !important;
                    }
                    
                }
    
                &.right {
                    .slider {
                        height: 160px !important;
                    }
                }
            }
    
            .mid {
                z-index: 2;
                
                &.left {
                    .slider {
                        height: 160px !important;
                    }
                }
    
                &.right {
                    .slider {
                        height: 270px !important;
                    }
                }
            }
    
            .back {

                .slider {
                    height: 530px !important;
                }
                
            }

            .mid {

                &.left {
                    .slider {
                        transition: $image-transition 2.8s;
                    }
                }

                &.right {
                    .slider {
                        transition: $image-transition 3.2s;
                    }
                }
            }

            .front {

                &.left {
                    .slider {
                        transition: $image-transition 3.6s;
                    }
                }

                &.right {
                    .slider {
                        transition: $image-transition 2.4s;
                    }
                }
            }
        }

        .logo {
            width: 150px;
            transition: $text-transition 3s;
        }

        .photography {
            width: 150px;
            transition: $text-transition 3.5s;
        }

        .name {
            
            &:after {
                width: 0;
                transition: $text-transition 3.5s;
            }
        }

        .back-button {
            width: 65px;
            transition: $text-transition 3.5s;
        }

        #menu {
            
            div {
                width: 100%;

                &:nth-child(1) {
                    transition: $menu-transition 3s;
                }
                &:nth-child(2) {
                    transition: $menu-transition 3.5s;
                }
                &:nth-child(3) {
                    transition: $menu-transition 4s;
                }
            }
        }

        .title {
            width: 350px;
            transition: $title-transition;
        }

        .sub-title {
            
            div {
                opacity: 1;
                transition: $sub-transition 3s;

                &:nth-child(2) {
                    transition: $sub-transition 3.5s;
                }

                &:nth-child(3) {
                    transition: $sub-transition 4s;
                }

                &:nth-child(4) {
                    transition: $sub-transition 4.5s;
                }
            }
        }
    }

    .title {
        position: absolute;
        top: 20%;
        left: 9.4%;
        width: 350px;
        height: 66px;
        font-family: 'ZCOOL XiaoWei', serif;
        font-size: 60px;
        font-weight: 400;
        color: $color-white;
        overflow: hidden;
        white-space: nowrap;

    }
    
    .sub-title {
        position: absolute;
        top: 34%;
        left: 9.8%;
        width: 200px;
        height: 500px;
        font-family: 'ZCOOL XiaoWei', serif;
        line-height: 1.4;
        font-weight: 400;
        font-size: 12px;
        color: rgba($color-white, .9);

        div {
            position: relative;
            margin-bottom: 11px;
        }
    }

    .layer {
        position: absolute !important;
        top: 113px !important;
        left: 150px !important;
        z-index: -1;

        &:nth-child(1) {
            top: 0 !important;
            left: 0 !important;
        }
        
        .hover {
            
            &:hover {
                border: 3px 3px 50px 3px solid rgba($color-white, .9)
            }
        }

        > div {
            position: absolute;
            z-index: -1;

            .slider {
                @include absolute;
                margin: auto;
                overflow: hidden;
                
            }

            img {
                // position: absolute;
                width: 100%;
                top: 0;
                left: 0;
                right: 0;
                margin: auto;
            }
        }

        .front {
            z-index: 1;

            &.left {
                top: 43%;
                left: 20%;
                width: 200px;
                height: 240px;
                
                .slider {
                    width: 200px;
                    height: 240px;
                }
                
                img {
                    top: -30%;
                    width: 200px;
                }
            }

            &.right {
                top: 52%;
                right: 23%;
                width: 160px;
                height: 160px;

                .slider {
                    width: 160px;
                    height: 160px;
                }
                
                img {
                    top: -18%;
                    width: 160px;
                }
            }

            &.back {
                @include absolute;
                margin: auto;
                top: 3%;
                width: 450px;
                height: 530px;
                overflow: hidden;
                z-index: 3;
            }
        }

        .mid {
            z-index: 2;
            
            &.left {
                top: 27%;
                left: 18%;
                width: 160px;
                height: 160px;

                .slider {
                    width: 160px;
                    height: 160px;
                }

                img {
                    width: 160px;
                }
            }

            &.right {
                top: 24%;
                right: 20%;
                width: 240px;
                height: 270px;

                .slider {
                    width: 240px;
                    height: 270px;
                }

                img {
                    top: -10%;
                    width: 240px;
                }
            }
        }

        .back {
            @include absolute;
            margin: auto;
            top: 3%;
            width: 450px;
            height: 530px;
            overflow: hidden;
            z-index: 3;

            .slider {
                width: 450px;
                height: 530px;
            }

            img {
                top: -2%;
            }
        }
    }

    .logo {
        position: absolute;
        top: $v-margin;
        left: $h-margin;
        width: 150px;
        overflow: hidden;
        font-family: 'ZCOOL XiaoWei', serif;
        font-size: 17px;
        white-space: nowrap;

        &:after {
            content: '';
            position: absolute;
            bottom: -10%;
            width: 110%;
            left: -5%;
            height: 1px;
            // background: rgba($color-white, .8);
        }
    }

    .name {
        @include rotate(270);
        position: absolute;
        top: 43.5%;
        left: -0.5%;
        width: 150px;
        height: 30px;
        color: rgba($color-white, .65);
        font-family: 'ZCOOL XiaoWei', serif;
        font-size: 8px;
        letter-spacing: 1.5px;
        overflow: hidden;
        // text-transform: uppercase;
        font-weight: 400;
        white-space: nowrap;
        transition: $hover-transition;
        z-index: -1;

        &:hover {
            color: rgba($color-white, 1);
            transition: $hover-transition;
        }

        &:after {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 0%;
            height: 100%;
            background: $color-container;
            z-index: 1;
        }
    }

    .photography {
        position: absolute;
        bottom: $v-margin;
        left: $h-margin;
        width: 150px;
        font-family: 'ZCOOL XiaoWei', serif;
        font-size: 8px;
        // text-transform: uppercase;
        letter-spacing: 1.5px;
        color: rgba($color-white, .6);
        white-space: nowrap;
        overflow: hidden;
        transition: $hover-transition;

        &:hover {
            color: rgba($color-white, 1);
            transition: $hover-transition;
        }
    }

    .intro,
    .sub-intro {
        position: absolute;
        right: 6%;
        width: 160px;
        font-family: 'Lora', serif;
        font-weight: 300;
        font-size: 10px;
        letter-spacing: .5px;
        
    }

    .intro {
        bottom: 25%;
        color: $color-white;
    }

    .sub-intro {
        bottom: 15%;
        color: rgba($color-white, .3);
    }

    $back-height: 20px;

    .back-button {
        position: absolute;
        bottom: 35px;
        right:  80px;
        width: 65px;
        height: $back-height;
        line-height: 1.78;
        font-family: 'ZCOOL XiaoWei', serif;
        text-align: right;
        font-size: 11px;
        font-weight: 400;
        color: rgba($color-white, .8);
        transition: $hover-transition;
        letter-spacing: 2px;
        overflow: hidden;

        .icon {
            position: absolute;
            top: 0;
            right: 0;
            width: 65px;
            height: 100%;

            i {
                position: absolute;
                top: 0px;
                right: 40px;
                width: $back-height;
                height: $back-height + 3px;
                text-align: center;
                line-height: $back-height;
                color: rgba($color-white, .7);
                font-size: 20px;
                font-weight: 100;
                // font-family: 'Material-icons';
                transition: $hover-transition;
        
            }
        }

        &:hover {
            color: rgba($color-white, 1);
            transition: $hover-transition;

            i {
                color: rgba($color-white, 1);
                transition: $hover-transition;
            }
        }
    }

    #menu {
        position: absolute;
        top: 40px;
        right: 65px;
        width: 40px;
        height: 40px;
        z-index: 10;
        
        div {
            position: absolute;
            top: 0;
            right: 0;
            width: 100%;
            height: 2px;
            background: rgba($color-white, .8);
            transition: .4s;

            &:nth-child(2) {
                top: 6px;
            }

            &:nth-child(3) {
                top: 12px;
            }
        }

        &:hover {

            div {
                background: rgba($color-white, 1);
                transition: .4s;
            }
        }
    }
}
$loader-transition: 1s cubic-bezier(0.445, 0.05, 0.55, 0.95);
#pre-loader {
    @include center;
    width: $c-width;
    height: $c-height;
    overflow: hidden;
    cursor: none;
    z-index: -1;
    
    &._1,
    &._2 {

        .pre-loader {
            transition: $loader-transition;
        }
        
    }

    &._1 {
        z-index: 100;
        .pre-loader {
            height: 100%;
            transition: $loader-transition + .6;
        }
    }

    &._2 {
        z-index: -1;
        transition: z-index 0s 1s;
        

        .pre-loader {
            top: auto;
            bottom: 0;
            height: 0;
            

            .pre-logo {
                top: auto;
                bottom: 325px;
            }
        }
    } 

    .pre-loader {
        @include absolute;
        top: 0;
        width: 100%;
        height: 0;
        background: darken($color-container, 6%);
        overflow: hidden;

        $logo-height: 150px;

        .pre-logo {
            @include absolute;
            margin: auto;
            top: 325px;
            width: 30%;
            height: $logo-height;
            line-height: 1.1;
            font-family: 'ZCOOL XiaoWei', serif;
            font-size: 60px;
            font-weight: 400;
            text-align: center;
            color: $color-white;
            
            &:after {
                display: none;
            }
        }
    }
}


//	pixel to rem converter
@function rem($pixel) {
	@return $pixel / 16+rem;
}
.custom-mouse {
	pointer-events: none;
	z-index: 50;

	.cursor {
		position: fixed;
		top: rem(-7);
		left: rem(-7);
		width: rem(13);
		height: rem(13);
		opacity: 0;
		z-index: 50;

		&.active::before {
			opacity: .5;
        }
        
        &.hidden::before {
			opacity: 0 !important;
		}

		&:before {
			content: '';
			border-radius: 50%;
			position: absolute;
			top: -80%;
			left: -85%;
			width: 230%;
			height: 230%;
			border: solid rgba($color-white, .8) 1px;
			background: none;
            opacity: 1;
            transition: 0.15s cubic-bezier(0.785, 0.135, 0.15, 0.86);
			// transition: 2s cubic-bezier(0.785, 0.135, 0.15, 0.86);
        }
        
        &.small::before {
			top: -20% !important;
			left: -20% !important;
			width: 60% !important;
            height: 60% !important;
            transition: 0.15s cubic-bezier(0.785, 0.135, 0.15, 0.86);
        }
        
        &.small-black::before {
			top: 0;
			left: 0;
			width: 0;
			height: 0;
			background: none;
			transition: 0.2s cubic-bezier(0.785, 0.135, 0.15, 0.86);
			border: solid $color-black 3px;
		}

		&.img-hover::before {
			top: -81%;
			left: -90%;
			width: 230%;
			height: 230%;
			background: none;
			transition: 0.15s cubic-bezier(0.785, 0.135, 0.15, 0.86);
			border: solid $color-black 1px;
			opacity: .5;
		}

		&.img-hover-white::before {
			border: solid $color-white 1px;
		}

		&.small-white::before {
			top: 0;
			left: 0;
			width: 0;
			height: 0;
			background: none;
			transition: 0.2s cubic-bezier(0.785, 0.135, 0.15, 0.86);
			border: solid $color-white 3px;
		}

		&.hidden::before {
			opacity: 0 !important;
			transition: 0.5s cubic-bezier(0.785, 0.135, 0.15, 0.86);
		}
    }
}

              
            
!

JS

              
                // declare vars
var $images = document.getElementsByTagName('figure'),
    // ids
    $preLoader = document.getElementById('pre-loader'),
    $container = document.getElementById('container'),
    $cursor = document.getElementById('cursor'),
    $menu = document.getElementById('menu'),
    // classes
    $hoverSmallBlack = document.getElementsByClassName('small-black'),
    $hoverSmallWhite = document.getElementsByClassName('small-white'),
    // functions
    hoverSmallBlack,
    hoverSmallWhite,
    customClick,
    navHover;

// 
(customClick = function () {
    $container.addEventListener('mousedown', function () {

        $cursor.classList.add('active');
    });
    $container.addEventListener('mouseup', function () {

        $cursor.classList.remove('active');
    });
})();

(hoverSmallWhite = function () {

    for (var i = 0; i < $hoverSmallWhite.length; i++) {

        var item = $hoverSmallWhite[i];

        item.addEventListener("mouseover", function () {
            $cursor.classList.add('small');
            console.log($hoverSmallWhite[i]);
        }, false);

        item.addEventListener("mouseout", function () {
            $cursor.classList.remove('small');

        }, false);
    }
})();

(hoverSmallBlack = function () {

    for (var i = 0; i < $hoverSmallBlack.length; i++) {

        var item = $hoverSmallBlack[i];

        item.addEventListener("mouseover", function () {
            $cursor.classList.add('small-black');
            console.log($hoverSmallBlack[i]);
        }, false);

        item.addEventListener("mouseout", function () {
            $cursor.classList.remove('small-black');

        }, false);
    }
})();



var counter = 0,
    preLoader = function () {

    if (counter < 1) {
        $preLoader.classList.add('_1');
        $container.classList.add('hide');
        // subTextFadeIn();
        console.log('1');
    }
    if (counter == 1) {
        $preLoader.classList.add('_2');
        console.log('2');
    }

    if (counter == 2) {
        $preLoader.classList.remove('_1');
        $preLoader.classList.remove('_2');
        $container.classList.add('reveal');
        console.log('3');
        counter = -1;
    }

    counter++;

    console.log(counter);


 }

// preloader effect on click functions
$menu.addEventListener('click', function () {
    preLoader()
});

$preLoader.addEventListener('click', function () {
    preLoader()
});

$container.addEventListener('click', function () {
    preLoader()
});


// hide mouse for dribbble
document.body.onkeyup = function (e) {

    if (e.keyCode == 32) {
        preLoader();

    }

    if(e.keyCode > 33){
    	$cursor.classList.add('hidden')
    }
}


//when page ready
$(document).ready(function () {

    //load parallax
    $('#container').parallax();

});


// custom cursor
class MouseCursor {
    constructor() {
        this.container = document.querySelector('#container');

        const cursor = document.querySelector('.cursor');

        TweenLite.to(cursor, {
            autoAlpha: 0,
        });
    }

    moveMousePos(e) {
        const mousePosX = e.clientX;
        const mousePosY = e.clientY;
        const cursor = document.querySelector('.cursor');

        if (e.target.classList.contains('c-magnetic')) return;

        TweenLite.to(cursor, 0.5, {
            x: mousePosX,
            y: mousePosY,
            ease: Power4.easeOut,
        });
    }

    enterMouse() {
        const cursor = document.querySelector('.cursor');

        TweenLite.to(cursor, 1, {
            autoAlpha: 1,
            ease: Power4.easeIn,
        });
    }

    handleMousePos() {

        const $container = document.getElementById('container');

        $container.addEventListener('mouseenter', this.enterMouse);
        $container.addEventListener('mousemove', this.moveMousePos, false);
    }

    render() {
        this.handleMousePos();
    }
}

class MagneticCursor {
    constructor() {
        this.cursor = document.querySelector('.cursor');
        this.pos = {
            x: 0,
            y: 0
        };
    }

    moveCursor(e, link, force) {
        var rect = link.getBoundingClientRect();
        var relX = e.containerX - rect.left;
        var relY = e.containerY - rect.top;
        this.pos.x = rect.left + rect.width / 2 + (relX - rect.width / 2) / force;
        this.pos.y = rect.top + rect.height / 2 + (relY - rect.height / 2) / force;

        TweenMax.to(this.cursor, 0.3, {
            x: this.pos.x,
            y: this.pos.y
        });
    }

}

const mouseCursor = new MouseCursor();

mouseCursor.render();
              
            
!
999px

Console