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

              
                .page
    .page_overlay
        %div{:style => 'position: fixed; z-index: -99; width: 2320px; height: 180%; left: -300px;top: -38%;'}
            <iframe frameborder="0" height="100%" width="100%" src="https://youtube.com/embed/G_Q6I7nj23A?start=300&autoplay=1&controls=0&showinfo=0&autohide=1&mute=1"></iframe>
    .page_header
        .page_header__logo.trigger
            %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/cehrnobylLogo.png'}
        .page_header__menu.trigger
            %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/chernmenu.png'}
    .page_slider
        .page_slider__slide
            .slide
                .slide_left
                    .image
                        .image_burn 
                        .image_original
                            %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/chernimage2.png'}
                        .image_burnline
                        .image_ash
                        .image_ashOuter
                        
                .slide_right
                    .slide_right__text
                        %h2 Slide title
                        %p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure.
                        %button.trigger next
        .page_slider__slide
            .slide.alt
                .slide_left
                    .image
                        .image_burn 
                        .image_original
                            %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/cimage11.png'}
                        .image_burnline
                        .image_ash
                        .image_ashOuter
                        
                .slide_right
                    .slide_right__text
                        %h2 Slide title
                        %p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure.
                        %button.trigger next
        .page_slider__slide
            .slide
                .slide_left
                    .image
                        .image_burn 
                        .image_original
                            %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/chernImage1.png'}
                        .image_burnline
                        .image_ash
                        .image_ashOuter
                        
                .slide_right
                    .slide_right__text
                        %h2 Slide title
                        %p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure.
                        %button.trigger next
        .page_slider__slide
            .slide.alt
                .slide_left
                    .image
                        .image_burn 
                        .image_original
                            %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/chernimage2.png'}
                        .image_burnline
                        .image_ash
                        .image_ashOuter
                        
                .slide_right
                    .slide_right__text
                        %h2 Slide title
                        %p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure.
                        %button.trigger next
        .page_slider__slide
            .slide
                .slide_left
                    .image
                        .image_burn 
                        .image_original
                            %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/cimage11.png'}
                        .image_burnline
                        .image_ash
                        .image_ashOuter
                        
                .slide_right
                    .slide_right__text
                        %h2 Next
                        %p In 1986 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure.
                        %button.trigger next
        .page_slider__slide
            .slide.alt
                .slide_left
                    .image
                        .image_burn 
                        .image_original
                            %img{:src => 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/chernImage1.png'}
                        .image_burnline
                        .image_ash
                        
                .slide_right
                    .slide_right__text
                        %h2 The reactor explodes
                        %p In 1986 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure.
                        %button.trigger next
    .page_sliderprogress
        .page_sliderprogress__point.active
            .point
            .text
                %h3 September 3rd 1986
                %h4 1:30am
        .page_sliderprogress__point
            .point
            .text
                %h3 September 3rd 1986
                %h4 1:30am
        .page_sliderprogress__point
            .point
            .text
                %h3 September 3rd 1986
                %h4 1:30am
        .page_sliderprogress__point
            .point
            .text
                %h3 September 3rd 1986
                %h4 1:30am
        .page_sliderprogress__point
            .point
            .text
                %h3 September 3rd 1986
                %h4 1:30am
        .page_sliderprogress__point
            .point
            .text
                %h3 September 3rd 1986
                %h4 1:30am
        
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Oswald:300,400,500,600&display=swap');

$orange: #f7912f;

body {
    font-family: 'Oswald', sans-serif;
    background: black;
    margin: 0;
    padding: 0;
    height: 100vh;
    background-size: cover !important;
    overflow: hidden;

    .page {

        &_overlay {
            background: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/chernobylTexture.png');
            position: fixed;
            z-index: 10;
            pointer-events: none;
            mix-blend-mode: difference;
            width: 100%;
            opacity: 0.7;
            height: 100%;
        }
        iframe {
            opacity: 0.2;
            //mix-blend-mode: linear-dodge;
        }

        &_slider {
            position: absolute;
            width: 1100px;
            height: 300px;
            left: 0;
            right: 0;
            margin: auto;
            top: 50%;
            //transform: translateY(-50%);
            transform: translateY(calc(-50% - 40px)) translateX(-40px);
            &__slide {
                position: absolute;
                width: 100%;
                //display: none;

                &.alt {

                }

                &.active {
                    //display: block;
                    & .slide {
                        transform: scale(1);
                        transition: transform 1s;
                        &_left {

                        }
                    }
                }

                & .slide {
                    position: absolute;
                    width: 100%;
                    transition: transform 0s;
                    transform: scale(0);

                    &.alt {
                        & .slide_left{
                            float: right;
                        }
                        & .slide_right {
                            left: 0;
                            
                            button {
                                float: right;
    margin-right: 65px;
                            }

                            h2 {
                                text-align: right;
                                margin-right: 80px;

                                &:before {
                                    left: auto;
                                    right: -32px;
                                }
                            }

                        }
                    }

                    &_left {
                        width: 70%;
                        float: left;
                        height: 300px;
                        //transition: transform 2s;
                        //background: red;

                    }

                    &_right {
                        float: right;
                        width: calc(50% - 56px);
                        position: absolute;
                        right: 0;
                        height: 100%;
                        text-transform: uppercase;

                        h2 {
                            margin: 0;
                            color: $orange;
                            font-weight: 700;
                            margin-left: 78px;
                            font-size: 14px;

                            position: relative;
                            left: 0;
                            opacity: 1;
                            transition: all 0.6s 0.2s;

                            &::before {
                                width: 20px;
                                height: 1px;
                                background: $orange;
                                content: '';
                                display: block;
                                position: absolute;
                                left: -26px;
                                top: 50%;
                                transform: translateY(-50%);
                            }
                        }

                        p {
                            color: white;

                            font-weight: 800;
                            font-size: 17px;

                            position: relative;
                            left: 0;
                            opacity: 1;
                            transition: all 0.6s 0.1s;
                        }

                        button {
                            position: relative;
                            margin-left: 78px;
                            left: 0;
                            font-family: 'Oswald', sans-serif;
                            text-transform: uppercase;
                            border-radius: 100px;
                            padding: 10px 40px;
                            font-weight: 700;
                            margin-top: 6px;
                            cursor: pointer;
                            background: transparent;
                            color: $orange;
                            border: 2px solid $orange;
                            opacity: 1;
                            transition: left 0.6s 0s, background .2s;
                            outline: none;

                            &:hover {
                                background: #5d1a1a;
                                //color: white;
                            }
                        }

                        &__text {
                            position: absolute;
                            top: 50%;
                            transform: translateY(calc(-50% + 50px));



                            &.out {
                                h2 {
                                    left: 50px;
                                    opacity: 0;
                                }

                                p {
                                    left: 50px;
                                    opacity: 0;
                                }

                                button {
                                    left: 50px;
                                    opacity: 0;
                                }
                            }
                        }
                    }
                }
            }
        }
        &_header {
            padding: 50px;

            &__logo {
                float: left;
            }

            &__menu {
                float: right;

                img {
                    //width: 40px;
                }
            }
        }

        &_sliderprogress {
            position: absolute;
            right: 70px;
            height: 205px;
            width: 0;
            top: 50%;
            transform: translateY(-50%);



            &__point {
                color: white;
                height: 40px;

                &.active {

                    & .point {
                        opacity: 1;
                        border-color: $orange;

                        &:after {
                            display: block;
                            width: 4px;
                            height: 4px;
                            content: '';
                            background: $orange;
                            position: absolute;
                            left: 0;
                            right: 0;
                            margin: auto;
                            top: 50%;
                            border-radius: 10px;
                            transform: translateY(-50%);
                        }

                        &:before {
                            display: block;
                            width: 20px;
                            height: 1px;
                            content: '';
                            background: white;
                            position: absolute;
                            left: -30px;
                            margin: auto;
                            top: 50%;
                            transform: translateY(-50%);
                        }
                    }

                    & .text {
                        opacity: 1;
                    }

                }

                & .point {
                    width: 10px;
                    height: 10px;
                    border: 2px solid white;
                    opacity: 0.13;
                    border-radius: 100%;
                    position: absolute;


                }

                & .text {
                    position: absolute;
                    width: 140px;
                    text-transform: uppercase;
                    transform: translateY(-4px) translateX(calc(-100% - 20px));
                    opacity: 0;

                    h3 {
                        font-size: 14px;
                        margin: 0;
                    }

                    h4 {
                        font-size: 12px;
                        margin: 0;
                        color: $orange;
                    }
                }
            }
        }
    }
}

$maskWidth: 770px;
$height: 430px;
$frames: 50;
$totalTransitionTime: 1.3s;
$offset: -300px;

.image {
    height: $height;
    overflow: hidden;
    position: relative;
    transform: scale(1);
    transition: all 4s;

    &.burn {
        
        transform: scale(1) translateX(-170px);

        & .image_burn {
            animation: burn $totalTransitionTime forwards steps($frames, end);
        }


        & .image_burnline {
            animation: burn $totalTransitionTime forwards steps($frames, end);
        }

        & .image_ash,
        & .image_ashOuter{
            animation: ash 2s infinite steps(66, end);
        }
    }


    div {
        position: absolute;
        width: $maskWidth;
        height: $height;
        background-size: auto 100%;
        background-position: 0 0;
        img {
            width: 700px;
            transform: scale(0.9)
        }
    }

    &_burn {
        background: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/burnStrip.jpg');

        //animation: burn $totalTransitionTime infinite steps($frames, end);
    }

    &_original {
        mix-blend-mode: darken;  
    }

    &_burnline {
        mix-blend-mode: lighten;
        background: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/burnlineStrip.jpg');
        //animation: burn $totalTransitionTime infinite steps($frames, end);
    }

    &_ash {
        background: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/ashInnerStrip.jpg');

        //animation: ash 2s infinite steps(66, end);
        mix-blend-mode: screen;
    }

    &_ashOuter {
        background: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/ashOuterStrip.jpg');
        //mix-blend-mode: exclusion;
        //animation: ash 2s infinite steps(66, end);
        mix-blend-mode: difference;
    }
}

@keyframes burn {
    0% {
        backgound-position: 0 0;
    }

    100% {
        background-position: -38145px 0;
    }
}

@keyframes ash {
    0% {
        backgound-position: 0 0;
    }

    100% {
        background-position: -50190px 0;
    }
}
              
            
!

JS

              
                /* -------------------------------------------------

Dynamic cursor

--------------------------------------------------- */

const cursorSettings = {
    'class' : 'dynamicCursor',
    'size' : '18',
    'expandedSize' : '40',
    'expandSpeed' : 0.4,
    'background' : 'rgba(161, 142, 218, 0.25)',
    'opacity' : '1',
    'transitionTime' : '1.4s',
    'transitionEase' : 'cubic-bezier(0.075, 0.820, 0.165, 1.000)',
    'borderWidth' : '0',
    'borderColor' : 'black',
    'iconSize': '11px',
    'iconColor': 'white',
    'triggerElements': {
        'trigger' : {
            'className' : 'trigger',
            'icon' : '<i class="fa fa-plus"></i>'
        },
        'trigger2' : {
            'className' : 'slider_inner',
            'icon' : '<i class="fa fa-arrows-h"></i>'
        }
    }
}


function dynamicCursor(options) {

    document.write('<link rel="stylesheet" href="https://maxcdn.icons8.com/fonts/line-awesome/1.1/css/line-awesome-font-awesome.min.css">');

    var hold;
    cursor = document.createElement('div');
    let cursorIcon = document.createElement('div');

    cursorIcon.classList.add('cursorIcon');
    cursorIcon.style.position = 'absolute';
    cursorIcon.style.fontFamily = 'Raleway';
    cursorIcon.style.textTransform = 'uppercase';
    cursorIcon.style.fontWeight = '800';
    cursorIcon.style.textAlign = 'center'
    cursorIcon.style.top = '50%';
    cursorIcon.style.width = '100%';
    cursorIcon.style.transform = 'translateY(-50%)';
    cursorIcon.style.color = options.iconColor;
    cursorIcon.style.fontSize = options.iconSize;
    cursorIcon.style.opacity = 0;
    cursorIcon.style.transition = `opacity ${options.expandSpeed}s`;

    cursor.classList.add(options.class);
    cursor.style.boxSizing = 'border-box';
    cursor.style.width = `${options.size}px`;
    cursor.style.height = `${options.size}px`;
    cursor.style.borderRadius = `${options.expandedSize}px`;
    cursor.style.opacity = 0;

    cursor.style.pointerEvents = 'none';
    cursor.style.zIndex = 999;
    cursor.style.transition = `transform ${options.transitionTime} ${options.transitionEase}, width ${options.expandSpeed}s .2s, height ${options.expandSpeed}s .2s, opacity 1s .2s`;
    cursor.style.border = `${options.borderWidth}px solid ${options.borderColor}`;
    cursor.style.position = 'fixed';
    cursor.style.background = options.background;

    cursor.appendChild(cursorIcon);
    document.body.appendChild(cursor);

    setTimeout(function() {
        cursor.style.opacity = options.opacity;
    }, 500)

    var idle;

    document.onmousemove = e => {
        console.log('test')
        x = e.pageX;
        y = e.pageY;
        
        $('.slide_left').css('transform', `translateX(-${x/40}px) translateY(-${y / 40}px)`)
        $('.slide_right').css('transform', `translateX(-${x/20}px) translateY(-${y / 20}px)`)

        cursor.style.opacity = options.opacity;
        clearInterval(idle)

        idle = setTimeout(function() {
            cursor.style.opacity = 0;
        }, 4000)

        cursor.style.top = '0';
        cursor.style.left = '0';
        cursor.style.transform = `translateX(calc(${x}px - 50%)) translateY(calc(${y}px - 50%))`;
    }

    for(i in options.triggerElements) {

        let trigger = $(`.${options.triggerElements[i].className}`);

        console.log(trigger);


        let icon = options.triggerElements[i].icon;

        if(!trigger) {
            console.warn('You dont have any triggers');
        } else {
            trigger.each(function(el){

                console.log()
                trigger[el].style.cursor = 'default';
                trigger[el].addEventListener('mouseover', () => {
                    console.log('over')
                    cursor.style.width = `${options.expandedSize}px`;
                    cursor.style.height = `${options.expandedSize}px`;
                    cursorIcon.innerHTML = icon;
                    cursorIcon.style.opacity = 1;


                    console.log($(this))


                })

                trigger[el].addEventListener('mouseout', () => {
                    cursor.style.width = `${options.size}px`;
                    cursor.style.height = `${options.size}px`;
                    cursorIcon.style.opacity = 0;
                })
            })

        }
    }
}

dynamicCursor(cursorSettings);


 $(window).on('load', function () {
    setTimeout(function(){
    $('.page_slider__slide:nth-of-type(1)').addClass('active')
}, 2000)
 });

$('button').click(function(){
   let parent = $(this).parent() 
   let slide = $(this).parent().parent().parent().parent(); //Should use closest();
   let image = $(this).parent().parent().prev().find('.image');
    
    $('.page_sliderprogress__point.active').removeClass('active').next().addClass('active')
    //image.remove();
    //image.addClass('burn')
    
    setTimeout(function(){
        image.addClass('burn')
    }, 100)
    
    setTimeout(function(){
        $('.active img').hide();
        
    }, 1380)
     setTimeout(function(){
        slide.removeClass('active')
        
    }, 2100)
    
    setTimeout(function(){
       slide.next().addClass('active');
        
    }, 2400)
     
    
    parent.addClass('out');
    
    
    
})
              
            
!
999px

Console