cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              .saucer
 .bottom
 .cockpit
  .kodos
   .eye
   .mouth
   .ear
   .tentacle
            
          
!
            
              $g: #ccc;
$t: rgba(255,255,255,0);
$p: #59476b;
$lb: #c4e0e5;
$gr: #95a60b;
$y: #f7ec9a;
$b: #222;
$w: #fff;
$o: #eeae17;

body{
  display:flex;
  width:100%;
  height:100vh;
  justify-content:center;
  align-items:center;
  background:$b;
  &:before, &:after{
    content:'';
    position:absolute;
    top:0;
    left:0;
    width:200%;
    height:100%;
    background:radial-gradient(circle at center, darken($w, 30%), darken($w, 30%) 2%, $t 2%, $t 50%), radial-gradient(circle at center, darken($w, 30%), darken($w, 30%) 2%, $t 2%, $t 50%), $t;
    background-size:150px 200px, 200px 150px, 100%;
    animation:stars 20s linear infinite;
    @keyframes stars{
      from{
        transform:translateX(0);
      }
      to{
        transform:translateX(-50%);
      }
    }
  }
  &:after{
    animation:stars 15s linear infinite;
    height:105%;
    opacity:0.25;
    top:-5%;
  }

  .saucer{
    width:300px;
    height:50px;
    background:$g;
    border-radius:100%;
    position:relative;
    animation:flying 7s ease-in-out infinite;
    z-index:1;
    @keyframes flying{
      0%{
        transform:translateX(0) translateY(0) rotate(0) translateZ(20px);
      }
      20%{
        transform:translateX(20px) translateY(0) rotate(5deg) translateZ(20px);
      }
      40%{
        transform:translateX(-20px) translateY(0) rotate(-5deg) translateZ(20px);
      }
      60%{
        transform:translateX(0) translateY(-20px) rotate(0);
      }
      80%{
        transform:translateX(0) translateY(20px) rotate(5deg) translateZ(20px);
      }
      100%{
        transform:translateX(0) translateY(0) rotate(0) translateZ(20px);
      }
    }
    .bottom{
      position:absolute;
      z-index:-2;
      width:60%;
      left:50%;
      transform:translateX(-50%);
      height:50px;
      bottom:-50px;
      background:darken($lb, 40%);
      border-radius:0 0 100% 100% / 0 0 150% 150%;
      overflow:hidden;
      &:before{
        content:'';
        position:absolute;
        width:10px;
        height:10px;
        background:$o;
        left:calc(50% - 5px);
        bottom:5px;
        border-radius:100%;
        box-shadow:40px 0 0 $o, -40px 0 0 $o, 80px 0 0 $o, -80px 0 0 $o;
        animation:blinking 1s linear infinite;
        @keyframes blinking{
          0%{
            box-shadow:40px -5px 0 $o, -40px -5px 0 $o, 80px 0 0 $o, -80px 0 0 $o
          }
          25%{
            box-shadow:40px -5px 0 $t, -40px -5px 0 $o, 80px 0 0 $o, -80px 0 0 $o
          }
          50%{
            box-shadow:40px -5px 0 $o, -40px -5px 0 $t, 80px 0 0 $o, -80px 0 0 $o;
            background:$o;
          }
          75%{
            box-shadow:40px -5px 0 $o, -40px -5px 0 $o, 80px 0 0 $o, -80px 0 0 $o;
            background:$t;
          }
          100%{
            box-shadow:40px -5px 0 $o, -40px -5px 0 $o, 80px 0 0 $o, -80px 0 0 $o;
            background:$o;
          }
        }
      }
    }
    .cockpit{
      position:absolute;
      width:50%;
      height:200px;
      top:-162px;
      left:50%;
      transform:translateX(-50%);
      border-radius:100% 100% 100% 100% / 75% 75% 13% 13%;
      z-index:3;
      overflow:hidden;
      &:before{
        content:'';
        position:absolute;
        width:100%;
        height:100%;
        left:0;
        top:0;
        border-radius:100% 100% 100% 100% / 75% 75% 13% 13%;
        background:$lb;
        z-index:3;
        opacity:0.35;
        box-shadow:inset 5px 5px 0 0 $lb, inset -5px 10px 0 0 $w;
      }
      .kodos{
        width:90px;
        height:180px;
        background:$gr;
        position:absolute;
        left:calc(50% - 45px);
        bottom:-20px;
        border-radius:100% 160% 100% 100% / 100% 100% 205% 205%;
        &:before{
          content:'';
          position:absolute;
          left:40px;
          top:5px;
          width:14px;
          height:5px;
          background:darken($gr, 10%);
          border-radius:100%;
        }
        .tentacle{
          width:40px;
          height:80px;
          position:absolute;
          border-radius:100% 100% 0 0;
          box-shadow:-20px 10px 0 $gr;
          bottom:-10px;
          right:-55px;
          transform-origin:50% 100%;
          animation: tentacling 1.5s ease-in-out infinite alternate;
          @keyframes tentacling{
            from{
            
              transform:scaleY(1.05) rotate(0deg);
            }
            to{
              transform:scaleY(1) rotate(2.5deg);
            }
          }
          &:before{
              content:'';
              width:40px;
              height:80px;
              position:absolute;
              border-radius:100% 100% 0 0;
              box-shadow:20px 10px 0 $gr;
              bottom:10px;
              left:-165px;
              animation: tentacling 3s ease-in-out infinite alternate;
              animation-delay:-1s;
          }
          
        }
        .eye{
          width:60px;
          height:50px;
          background:$y;
          border-radius:100%;
          right:0px;
          position:absolute;
          top:20px;
          overflow:hidden;
          box-shadow:0 10px $gr, 1px 12px 1px -1px darken($gr, 10%), 1px 18px 1px -1px $gr, 3px 19px 2px -2px darken($gr, 10%);
          &:before{
            content:'';
            position:absolute;
            height:30px;
            width:8px;
            border-radius:100%;
            background:$b;
            left:calc(50% - 4px);
            bottom:-5px;
            animation:looking 7.5s ease-in-out infinite;
            @keyframes looking{
              0%{
                transform:translateY(0) translateX(0);
              }
              10%{
                transform:translateY(5px) translateX(10px);
              }
              30%{
                transform:translateY(-10px) translateX(0);
              }
              60%{
                transform:translateY(-10px) translateX(0);
              }
              80%{
                transform:translateY(-10px) translateX(20px);
              }
              100%{
                transform:translateY(0) translateX(0);
              }
            }
          }
        }
        .ear{
          position:absolute;
          width:20px;
          height:50px;
          left:-10px;
          top:30px;
          background:$gr;
          border-radius:0 100% 0 100% / 0 100% 0 30%;
          box-shadow:-1px 1px 0 0 darken($gr, 10%), -1px -1px 0 0 darken($gr, 10%);
          transform:rotate(-10deg);
        }
        .mouth{
          width:60px;
          height:30px;
          background:$b;
          position:absolute;
          bottom:40px;
          border-radius:100% 0 30% 100% / 50% 0 120% 150%;
          right:5px;
          box-shadow:17.5px -20px 0 -10px $gr;
          overflow:hidden;
          &:before{
            content:'';
            position:absolute;
            bottom:-10px;
            height:30px;
            width:7.5px;
            background:$b;
            border-radius:100%;
            left:50%;
            margin-left:5px;
            transform:translateX(-50%);
            box-shadow:-4px 5px 0 $w, -10px 5px 0 $b, -14px 10px 0 $w, 4px 5px 0 $w, 10px 5px 0 $b, 14px 10px 0 $w;
          }
        }
      }
    }
    &:before{
      content:'';
      position:absolute;
      left:0;
      top:0;
      width:100%;
      height:100%;
      border-radius:100%;
      background:$g;
      left:50%;
      top:50%;
      transform:translateX(-50%) translateY(-50%);
      box-shadow:inset 0 0 0 15px $g, inset 60px 0 0 12.5px $g, inset -60px 0 0 12.5px $g, inset 0 0 0 40px $p;
      
    }
    &:after{
      content:'';
      position:absolute;
      width:100%;
      height:50px;
      z-index:-5;
      background:repeating-linear-gradient(to right, darken($g, 10%), darken($g, 5%) 2px, darken($g, 5%) 2px, darken($g, 5%) 8px);
      animation:spin 5s linear infinite;
      @keyframes spin{
        from{
          background-position:0 0;
        }
        to{
          background-position:300px 0;
        }
      }
      border-radius:0 0 100% 100%;
      bottom:-25px;
      z-index:-2;
    }
    
  }
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console