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="droid">

  <div class="droid-head">
    <div class="droid-head__eye"></div>
    <div class="droid-head__eye--small"></div>
    <div class="droid-head__eye--tiny"></div>
  </div>
  <div class="droid-neck"></div>

  <div class="droid-body">
    <div class="droid-body__panel--left"></div>
    <div class="droid-body__panel--left-rotate"></div>
    <div class="droid-body__panel-decor"></div>
    <div class="droid-body__panel--center">
    </div>
    <div class="droid-body__panel--center-rotate"></div>
    <div class="droid-body__panel--right"></div>
    <div class="droid-body__panel--right-rotate"></div>
  </div>

</div>
            
          
!
            
              @import "compass/css3";

$white: #fff;
$black: #000;
$grey: #e3e3e3;
$orange: #df8d5d;
$silver: #8e8e9c;

*, *:before, *:after {
    box-sizing: border-box;
}

body {
    background: $black;
}

@keyframes roll {
    
    0% {
        transform: rotate(0);
        left: 50%;
    }

    33% {
        transform: rotate(800deg);
        left: 220%;
    }

    66% {
        transform: rotate(-800deg);
        left: -120%;
    }

    100% {
        transform: rotate(0deg);
        left: 50%;
    }
}


@keyframes blink {
        0% {
            background: $black;
        }

        25%, 35% {
            background: #86c9fd;
        }

        50%, 60% {
        
            background: $black;
    
        }

        80% {
            background: #86c9fd;
        }

        100% {
            background: $black;
        }
}

@keyframes head-bob {

    0% {
        transform: rotate(0);
        right: 0;
        left: 50%;
    }

    33% {
        transform: rotate(8deg);
        right: -25px;
        left: 230%;
    }

    66% {
        transform: rotate(-8deg);
        right: -25px;
         left: -130%;
    }

    100% {
        transform: rotate(0);
        right: 0;
        left: 50%;
    }

}

@keyframes neck-bob {

    0% {
        transform: rotate(0);
        left: 50%;
    }

    33% {
        transform: rotate(8deg);
        left: 228%;
    }

    66% {
        transform: rotate(-8deg);
         left: -128%;
    }

    100% {
        transform: rotate(0);
        left: 50%;
    }

}

.droid {
    width: 400px;
    position: relative;
    top: 50%;
    margin: 25% auto 0;
    transform: translateY(-50%);
}

.droid-head {
    height: 120px;
    width: 220px;
    border-bottom: 8px solid $silver;
    border-radius: 220px 220px 0 0;
    position: relative;
    z-index: 3;
    left: 50%;
    margin-left: -110px;
    background: $white;
    overflow: hidden;
    animation: head-bob 15s ease-in-out infinite;

    &:before {
        content: "";
        display: block;
        height: 10px;
        width: 100%;
        border: 1px solid $black;
        position: absolute;
        top: 25px;
        background: $orange;
    }

    &:after {
        content: "";
        display: block;
        height: 15px;
        width: 100%;
        border: 1px solid $black;
        position: absolute;
        top: 5px;
        background: $silver;
    }

    &__eye {
        height: 50px;
        width: 50px;
        border-radius: 50%;
        border: 3px solid lighten($black, 50%);
        position: relative;
        top: 25%;
        z-index: 10;
        margin:  0 auto;
        background: $black;
        background: radial-gradient(circle at 10px 10px, #414141, #000);
        box-shadow: 0 0 0 4px $white,
            0 0 0 5px $black,
            0 0 0 10px $white;

        &--small {
            height: 30px;
            width: 30px;
            border-radius: 50%;
            border: 4px solid $silver;
            position: absolute;
            right: 40px;
            bottom: 15px;
            margin:  0 auto;
            background: $black;
            background: radial-gradient(circle at 5px 5px, #414141, #000);
            box-shadow: 0 0 0 3px $white,
                0 0 0 6px $black;

                &:before {
                    content: "";
                    display: block;
                    height: 57px;
                    width: 83px;
                    border: 1px solid $black;
                    border-top-right-radius: 25%;
                    position: relative;
                    top: -15px;
                    left: -44px;
                }
        }

        &--tiny {
            height: 15px;
            width: 15px;
            border-radius: 50%;
            position: relative;
            top: 34%;
            margin:  0 auto;
            background: $black;
            box-shadow: 0 0 0 1px $silver,
                0 0 0 2px $black;
            animation: blink 3s ease-in-out infinite;
            z-index: 11;

                &:before {
                    content: "";
                    display: block;
                    height: 20px;
                    width: 250px;
                    position: absolute;
                    left: -112.5px;
                    bottom: -10px;
                    background: repeating-linear-gradient(
                      to right,
                      transparent,
                      transparent 10px,
                      $orange 10px,
                      $orange 20px,
                      transparent 10px,
                      transparent 40px,
                      $orange 10px,
                      $orange 80px,
                      transparent 20px,
                      transparent 200px
                    );
             }
        }
    }

}

.droid-neck {
    border-top: 15px solid $white;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 5px solid transparentize($black, 0.80);
    width: 220px;
    position: relative;
    z-index: 2;
    left: 50%;
    margin-left: -110px;
    margin-bottom: -20px;
    animation: neck-bob 15s ease-in-out infinite;

}

.droid-body {
    height: 385px;
    width: 385px;
    border-radius: 50%;
    position: relative;
    left: 50%;
    margin-left: -192.5px;
    background:  $white;
    overflow: hidden;
    z-index: 1;
   animation: roll 15s ease-in-out infinite;

    &:before {
        content: "";
        display: block;
        width: 1px;
        height: 385px;
        position: relative;
        margin: 0 auto;
        background: $black;
    }

    &:after {
        content: "";
        display: block;
        width: 385px;
        height: 1px;
        position: relative;
        top: -85%;
        margin: 0 auto;
        background: $black;
    }

    &__panel {
        position: absolute;
        height: 240px;
        width: 240px;
        border-radius: 50%;
        border: 35px solid $orange;
        box-shadow: 0 0 0 1px $black,
            inset 0 0 0 1px $black;
        z-index: 5;

        &-decor {
                height: 35%;
                width: 35%;
                border: 1px solid $black;
                border-radius: 50%;
                position: relative;
                top: -67%;
                margin: 0 auto;
                background: repeating-linear-gradient(
                      to bottom right,
                      $white,
                      $white 25px,
                      $black 25px,
                      $black 26px,
                      $silver 26px,
                      $silver 55px,
                      $black 55px,
                      $black 56px
                  )
            }

        &--center {
            @extend .droid-body__panel;
            top: 50%;
            left: 50%;
            margin-top: -120px;
            margin-left: -120px;

        }

        &--center-rotate {
            @extend .droid-body__panel;
            top: 50%;
            left: 50%;
            margin-top: -120px;
            margin-left: -120px;
            transform: rotate(90deg);
            background: none;
            border-color: transparent;
            box-shadow: none;
        }

        &--left {
            @extend .droid-body__panel;
            top: 50%;
            left: -20%;
            margin-top: -120px;
            margin-left: -120px;
        }

        &--left-rotate {
            @extend .droid-body__panel;
            top: 50%;
            left: -20%;
            margin-top: -120px;
            margin-left: -120px;
            transform: rotate(90deg);
            background: none;
            border-color: transparent;
            box-shadow: none;
        }

        &--right {
            @extend .droid-body__panel;
            top: 50%;
            right: -52%;
            margin-top: -120px;
            margin-left: -120px;

        }

        &--right-rotate {
            @extend .droid-body__panel;
            top: 50%;
            right: -52%;
            margin-top: -120px;
            margin-left: -120px;
            transform: rotate(90deg);
            background: none;
            border-color: transparent;
            box-shadow: none;
        }

        &:before {
            content: "";
            display: block;
            height: 40px;
            width: 35px;
            border: 1px solid $black;
            border-top: none;
            position: relative;
            margin: 0 auto;
            background: $orange;
            transform: perspective(50px) rotateX(-25deg);
        }

        &:after {
            content: "";
            display: block;
            height: 40px;
            width: 35px;
            border: 1px solid $black;
            border-bottom: none;
            position: relative;
            top: 46%;
            margin: 11px auto;
            background: $orange;
            transform: perspective(50px) rotateX(25deg);
        }
    }
}
            
          
!
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