Pen Settings

HTML

CSS

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

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

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.

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

              
                <div></div> 
              
            
!

CSS

              
                :root {
  --eyes-color: white;
  --head-color: #1B2129;
  --color1: #98c200;
  --color2: #4d0033;
  --color4: #162947;
}

body {
  height: 100vh;
  margin: 0;
  background-color: skyblue;
  display: flex;
  justify-content: center;
  align-items: center;
}

div {
  width: 30vmin;
  height: 28vmin;
  border-radius: 40% 40% 50% 50% / 60% 60% 40% 40%;
  animation: eyes-animation 100ms infinite ease-in-out;
  animation-direction: alternate;
}

div {  
  background-image:
    /* left eye */
    radial-gradient(ellipse, var(--eyes-color) 60%, transparent 61%),
    radial-gradient(ellipse, var(--eyes-color) 60%, transparent 61%),
    radial-gradient(ellipse, var(--head-color) 60%, transparent 61%),
    radial-gradient(ellipse, var(--eyes-color) 60%, transparent 61%),
    radial-gradient(ellipse, black 60%, transparent 61%),
    /* right eye */
    radial-gradient(ellipse, var(--eyes-color) 60%, transparent 61%),
    radial-gradient(ellipse, var(--eyes-color) 60%, transparent 61%),
    radial-gradient(ellipse, var(--head-color) 60%, transparent 61%),
    radial-gradient(ellipse, var(--eyes-color) 60%, transparent 61%),
    radial-gradient(ellipse, black 60%, transparent 61%),
    /* mouth */
    radial-gradient(ellipse, var(--head-color) 60%, transparent 61%),
    radial-gradient(ellipse, #4D4355 60%, transparent 61%),
    radial-gradient(ellipse, var(--head-color) 60%, transparent 61%),
    radial-gradient(ellipse, #4D4355 60%, transparent 61%),
    /* nose */
    radial-gradient(ellipse, #4D4355 60%, transparent 61%),
    /* tongue */
    radial-gradient(ellipse, pink 60%, transparent 61%),
    /* cat head */
    radial-gradient(ellipse, #1B2129 49%, var(--head-color) 50%, var(--head-color) 51%);
  background-position: 
    /* left eye */
    32.5% 38%, 23.5% 50%, 22.5% 40%, 20% 40%, 18% 38%,
    /* right eye */
    81% 38%, 70.5% 50%, 77.5% 40%, 80% 40%, 82% 38%,
    /* mouth */
    34% 81%, 35% 83%, 67% 81%, 65% 83%,
    /* nose */
    50% 70%,
    /* tongue */
    50% 87%,
    /* cat head */
    50% 75%;
  background-size: 
    /* left eye */
    4vmin 4vmin, 3vmin 3vmin, 7vmin 7vmin, 9vmin 9vmin, 9.5vmin 9.5vmin,
    /* right eye */
    4vmin 4vmin, 3vmin 3vmin, 7vmin 7vmin, 9vmin 9vmin, 9.5vmin 9.5vmin,
    /* mouth */
    8vmin 6vmin, 8vmin 6vmin, 8vmin 6vmin, 8vmin 6vmin,
    /* nose */
    4vmin 4vmin,
    /* tongue */
    0vmin 0vmin,
    /* cat head */
    38vmin 33vmin;
  background-repeat: no-repeat;
}

div:hover {
  background-image:
    /* left eye */
    radial-gradient(ellipse, var(--eyes-color) 60%, transparent 61%),
    radial-gradient(ellipse, var(--eyes-color) 60%, transparent 61%),
    radial-gradient(ellipse, var(--head-color) 60%, transparent 61%),
    radial-gradient(ellipse, var(--eyes-color) 60%, transparent 61%),
    radial-gradient(ellipse, black 60%, transparent 61%),
    /* right eye */
    radial-gradient(ellipse, var(--eyes-color) 60%, transparent 61%),
    radial-gradient(ellipse, var(--eyes-color) 60%, transparent 61%),
    radial-gradient(ellipse, var(--head-color) 60%, transparent 61%),
    radial-gradient(ellipse, var(--eyes-color) 60%, transparent 61%),
    radial-gradient(ellipse, black 60%, transparent 61%),
    /* mouth */
    radial-gradient(ellipse, var(--head-color) 60%, transparent 61%),
    radial-gradient(ellipse, #4D4355 60%, transparent 61%),
    radial-gradient(ellipse, var(--head-color) 60%, transparent 61%),
    radial-gradient(ellipse, #4D4355 60%, transparent 61%),
    /* nose */
    radial-gradient(ellipse, #4D4355 60%, transparent 61%),
    /* tongue */
    radial-gradient(ellipse, pink 60%, transparent 61%),
    /* cat head */
    radial-gradient(ellipse, #1B2129 49%, var(--head-color) 50%, var(--head-color) 51%);
  background-position: 
    /* left eye */
    32.5% 38%, 23.5% 50%, 22.5% 40%, 20% 40%, 18% 38%,
    /* right eye */
    81% 38%, 70.5% 50%, 77.5% 40%, 80% 40%, 82% 38%,
    /* mouth */
    34% 81%, 35% 83%, 67% 81%, 65% 83%,
    /* nose */
    50% 70%,
    /* tongue */
    50% 87%,
    /* cat head */
    50% 75%;
  background-size: 
    /* left eye */
    4vmin 4vmin, 3vmin 3vmin, 7vmin 7vmin, 9vmin 9vmin, 9.5vmin 9.5vmin,
    /* right eye */
    4vmin 4vmin, 3vmin 3vmin, 7vmin 7vmin, 9vmin 9vmin, 9.5vmin 9.5vmin,
    /* mouth */
    8vmin 6vmin, 8vmin 6vmin, 8vmin 6vmin, 8vmin 6vmin,
    /* nose */
    4vmin 4vmin,
    /* tongue */
    4vmin 4vmin,
    /* cat head */
    38vmin 33vmin;
  background-repeat: no-repeat;
  
  animation: tongue-animation 100ms;
}

div:before, div:after {
  content: "";
  position: absolute;
  width: 10vmin;
  height: 10vmin;
  margin-top: -2.5vmin;
  background-color: black;
  border-radius: 100% 0% 30% 70% / 30% 0% 100% 70%;
  box-sizing: border-box;
  z-index: -1;
}

div:before {
  margin-left: -0vmin;
  transform: rotate(275deg);
  box-shadow: inset -2vmin 0 0 var(--head-color);
}

div:after {
  margin-left: 20vmin;
  transform: rotate(-5deg);
  box-shadow: inset 0 2vmin 0 var(--head-color);
}

@keyframes eyes-animation {
  to {
    background-position: 
      /* left eye */
      31.5% 38%, 23% 50%, 22.5% 40%, 20% 40%, 18% 38%,
      /* right eye */
      80% 38%, 70% 50%, 77.5% 40%, 80% 40%, 82% 38%,
      /* mouth */
      34% 81%, 35% 83%, 67% 81%, 65% 83%,
      /* nose */
      50% 70%,
      /* tongue */
      50% 90%,
      /* cat head */
      50% 75%;
  }
}

@keyframes tongue-animation {
  to {
    background-position: 
      /* left eye */
      31.5% 38%, 23% 50%, 22.5% 40%, 20% 40%, 18% 38%,
      /* right eye */
      80% 38%, 70% 50%, 77.5% 40%, 80% 40%, 82% 38%,
      /* mouth */
      34% 81%, 35% 83%, 67% 81%, 65% 83%,
      /* nose */
      50% 70%,
      /* tongue */
      50% 90%,
      /* cat head */
      50% 75%;
  }
}
              
            
!

JS

              
                /*
    Hi, I'm Michal, a front-end developer at Outbrain 😎
    
    github: https://github.com/MichalPorag
    medium: https://medium.com/@miporagi
    linkedin: https://www.linkedin.com/in/michal-porag-9522b5142/
    twitter: https://twitter.com/MichalPorag
    my tech talks: https://www.youtube.com/playlist?list=PLH7Km7lJwMqSviBIID2XUT2BBE_ZTpDWy
*/


              
            
!
999px

Console