Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="loader">
    <div class="scissor">
        <div>
            <svg>
                <use xlink:href="#scissorBase">
            </svg>
        </div>
        <div>
            <svg>
                <use xlink:href="#scissorBaseFlip">
            </svg>
        </div>
    </div>
    <div class="paper">
        <div></div>
    </div>
</div>
        
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
    <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 40" id="scissorBase" fill="currentColor">
        <path d="M26,0 C27.1045695,0 28,0.8954305 28,2 L28,25 L27.960112,24.9351895 C27.9865447,25.2866651 28,25.6417612 28,26 C28,33.7319865 21.7319865,40 14,40 C6.2680135,40 0,33.7319865 0,26 C0,18.2680135 6.2680135,12 14,12 C16.550378,12 19.9414765,12.6819568 22.0008915,13.8734665 L22,2 C22,0.8954305 22.8954305,0 24,0 L26,0 Z M14,16 C8.4771525,16 4,20.4771525 4,26 C4,31.5228475 8.4771525,36 14,36 C19.5228475,36 24,31.5228475 24,26 C24,20.4771525 19.5228475,16 14,16 Z"></path>
    </symbol>
    <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 40" id="scissorBaseFlip" fill="currentColor">
        <path d="M2,0 C0.8954305,0 0,0.8954305 0,2 L0,25 L0.0398880483,24.9351895 C0.0134552846,25.2866651 0,25.6417612 0,26 C0,33.7319865 6.2680135,40 14,40 C21.7319865,40 28,33.7319865 28,26 C28,18.2680135 21.7319865,12 14,12 C11.449622,12 8.05852354,12.6819568 5.99910852,13.8734665 L6,2 C6,0.8954305 5.1045695,0 4,0 L2,0 Z M14,16 C19.5228475,16 24,20.4771525 24,26 C24,31.5228475 19.5228475,36 14,36 C8.4771525,36 4,31.5228475 4,26 C4,20.4771525 8.4771525,16 14,16 Z"></path>
    </symbol>
</svg>

<!-- twitter / dribbble -->
<a href="https://greensock.com" target="_blank"><img class="gsap-3-logo" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/gsap-3-logo.svg"></a>
<a class="dribbble" href="https://dribbble.com/shots/8159743-Paper-Cut" target="_blank"><img src="https://dribbble.com/assets/logo-small-2x-9fe74d2ad7b25fba0f50168523c15fda4c35534f9ea0b1011179275383035439.png" alt=""></a>
<a class="twitter" target="_blank" href="https://twitter.com/aaroniker_me"><svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72"><path d="M67.812 16.141a26.246 26.246 0 0 1-7.519 2.06 13.134 13.134 0 0 0 5.756-7.244 26.127 26.127 0 0 1-8.313 3.176A13.075 13.075 0 0 0 48.182 10c-7.229 0-13.092 5.861-13.092 13.093 0 1.026.118 2.021.338 2.981-10.885-.548-20.528-5.757-26.987-13.679a13.048 13.048 0 0 0-1.771 6.581c0 4.542 2.312 8.551 5.824 10.898a13.048 13.048 0 0 1-5.93-1.638c-.002.055-.002.11-.002.162 0 6.345 4.513 11.638 10.504 12.84a13.177 13.177 0 0 1-3.449.457c-.846 0-1.667-.078-2.465-.231 1.667 5.2 6.499 8.986 12.23 9.09a26.276 26.276 0 0 1-16.26 5.606A26.21 26.21 0 0 1 4 55.976a37.036 37.036 0 0 0 20.067 5.882c24.083 0 37.251-19.949 37.251-37.249 0-.566-.014-1.134-.039-1.694a26.597 26.597 0 0 0 6.533-6.774z"></path></svg></a>
            
          
!
            
              .loader {
    --blade: #fff;
    --shape: #16171C;
    --dot: #fff;
    --paper: #EEF0FD;
    width: 360px;
    height: 100px;
    position: relative;
    .scissor {
        --o: 32;
        left: -26px;
        top: -60px;
        width: 50px;
        height: 84px;
        z-index: 1;
        position: absolute;
        transform-origin: 25px 46px;
        & > div {
            top: 0;
            height: 84px;
            position: absolute;
            display: flex;
            align-items: flex-end;
            &:before,
            &:after {
                content: '';
                position: absolute;
            }
            &:before {
                width: 4px;
                height: 46px;
                top: 0;
                background: var(--blade);
            }
            &:after {
                width: 2px;
                height: 2px;
                top: 45px;
                z-index: 2;
                border-radius: 1px;
                background: var(--dot);
            }
            svg {
                display: block;
                position: relative;
                z-index: 1;
                width: 28px;
                height: 40px;
                color: var(--shape);
            }
            &:nth-child(1) {
                left: 0;
                transform-origin: 25px 46px;
                transform: rotate(calc(var(--o) * 1deg));
                &:before {
                    right: 1px;
                    border-radius: 4px 0 0 0;
                }
                &:after {
                    right: 2px;
                }
            }
            &:nth-child(2) {
                right: 0;
                transform-origin: 3px 46px;
                transform: rotate(calc(var(--o) * -1deg));
                &:before {
                    left: 1px;
                    border-radius: 0 4px 0 0;
                }
                &:after {
                    left: 2px;
                }
            }
        }
    }
    span {
        display: block;
        position: absolute;
        border-radius: 50%;
        background: var(--paper);
    }
    .paper {
        --before-top-y: 50;
        --before-bottom-x: 0;
        --before-middle-y: 50;
        position: absolute;
        left: 50%;
        top: 50%;
        margin: -26px 0 0 -38px;
        width: 56px;
        height: 56px;
        transform: rotateZ(-28deg);
        &:before {
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            background: var(--paper);
            -webkit-clip-path: polygon(0 calc(var(--before-top-y) * 1%), calc(var(--before-bottom-x) * 1%) 100%, 100% calc(var(--before-middle-y) * 1%));
            clip-path: polygon(0 calc(var(--before-top-y) * 1%), calc(var(--before-bottom-x) * 1%) 100%, 100% calc(var(--before-middle-y) * 1%));
        }
        div {
            --cut-before-o: 1;
            --cut-before-x: 0;
            --cut-before-y: 0;
            --cut-before-r: 0;
            --cut-before-b: 0;
            --cut-after-o: 0;
            --cut-after-x: 0;
            --cut-after-y: 0;
            --cut-after-r: 0;
            --cut-after-b: 0;
            &:before,
            &:after {
                --c: 0%;
                content: '';
                position: absolute;
                left: 0;
                right: 0;
                top: 0;
                bottom: 49%;
                background: var(--paper);
                -webkit-clip-path: polygon(var(--c) 0, 0 100%, 100% 100%);
                clip-path: polygon(var(--c) 0, 0 100%, 100% 100%);
            }
            &:before {
                opacity: var(--cut-before-o);
                transform: translate(calc(var(--cut-before-x) * 1px), calc(var(--cut-before-y) * 1px)) rotate(calc(var(--cut-before-r) * 1deg));
                filter: blur(calc(var(--cut-before-b) * 1px));
            }
            &:after {
                --c: 100%;
                opacity: var(--cut-after-o);
                transform: translate(calc(var(--cut-after-x) * 1px), calc(var(--cut-after-y) * 1px)) rotate(calc(var(--cut-after-r) * 1deg));
                filter: blur(calc(var(--cut-after-b) * 1px));
            }
        }
    }
}

html {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

* {
    box-sizing: inherit;
    &:before,
    &:after {
        box-sizing: inherit;
    }
}

// Center & dribbble
body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background: #275EFE;
    .gsap-3-logo {
        width: 88px;
        position: fixed;
        bottom: 12px;
        right: 152px;
    }
    .dribbble {
        position: fixed;
        display: block;
        right: 20px;
        bottom: 20px;
        img {
            display: block;
            width: 76px;
        }
    }
    .twitter {
        position: fixed;
        display: block;
        right: 112px;
        bottom: 14px;
        svg {
            width: 24px;
            height: 24px;
            fill: white;
        }
    }
}
            
          
!
            
              const $ = (s, o = document) => o.querySelector(s);

let loader = $('.loader'),
    scissor = $('.scissor', loader),
    paper = $('.paper', loader),
    cut = $('div', paper);

gsap.registerPlugin(MotionPathPlugin);
gsap.registerPlugin(Physics2DPlugin);

gsap.to(scissor, {
    repeat: -1,
    duration: 1.42,
    ease: 'linear',
    motionPath: {
        path: 'M43.9810017,95.4108211 C111.962705,125.226874 238.51326,0 303.357347,0 C368.201433,0 383.889518,65.5947682 315.907815,95.4108211 C247.926112,125.226874 121.040326,0 56.53147,0 C-7.97738609,0 -24.0007016,65.5947682 43.9810017,95.4108211 Z',
        autoRotate: 90
    }
});

gsap.to(scissor, {
    repeat: -1,
    repeatDelay: .165,
    duration: .19,
    yoyo: true,
    ease: 'power2.in',
    '--o': 0
});

gsap.to(paper, {
    duration: .71,
    rotate: 28,
    yoyo: true,
    repeat: -1,
    ease: 'power1.in',
    yoyoEase: 'power1.in',
    motionPath: {
        path: [{
            x: 10,
            y: -10
        }, {
            x: 20,
            y: 0
        }]
    }
});

gsap.timeline({
    repeat: -1,
    defaults: {
        duration: .52,
        delay: .19
    }
}).to(paper, {
    '--before-top-y': 50,
    '--before-bottom-x': 100,
    '--before-middle-y': 0,
    onComplete() {
        gsap.set(paper, {
            '--before-middle-y': 50
        });
    }
}).to(paper, {
    '--before-top-y': 0,
    '--before-bottom-x': 0,
    '--before-middle-y': 50,
    onComplete() {
        gsap.set(paper, {
            '--before-top-y': 50
        });
    }
});

gsap.timeline({
    repeat: -1,
    defaults: {
        duration: .56,
        delay: .15,
        ease: 'back.out(1.5)'
    }
}).to(cut, {
    '--cut-before-y': -60,
    '--cut-before-r': -30,
    '--cut-before-x': -24,
    onStart() {
        particles(3, 200, 32, -70, -30);
    }
}).to(cut, {
    '--cut-after-y': -60,
    '--cut-after-r': 30,
    '--cut-after-x': 24,
    onStart() {
        particles(3, 156, 32, 210, 250);
    }
});

gsap.timeline({
    repeat: -1,
    defaults: {
        duration: .4,
        delay: .31
    }
}).to(cut, {
    '--cut-before-o': 0,
    '--cut-before-b': 6,
    '--cut-after-o': 0,
    onComplete() {
        gsap.set(cut, {
            '--cut-after-o': 1
        });
    }
}).to(cut, {
    '--cut-before-o': 0,
    '--cut-after-b': 6,
    '--cut-after-o': 0,
    onComplete() {
        gsap.set(cut, {
            '--cut-before-o': 1
        });
    }
});

function particles(quantity, x, y, minAngle, maxAngle) {
    let minSize = 2,
        maxSize = 3;
    for(let i = quantity - 1; i >= 0; i--) {
        let angle = minAngle + Math.random() * (maxAngle - minAngle),
            size = minSize + Math.random() * (maxSize - minSize),
            velocity = 80 + Math.random() * (120 - 80),
            dot = document.createElement('span');
        dot.className = 'dot';
        loader.appendChild(dot);
        gsap.set(dot, {
            opacity: 1,
            x: x,
            y: y,
            width: size,
            height: size
        });
        gsap.timeline({
            onComplete() {
                dot.remove();
            }
        }).to(dot, .6, {
            physics2D: {
                angle: angle,
                velocity: velocity,
                gravity: 100
            }
        }).to(dot, .45, {
            opacity: 0
        }, .15);
    }
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console