cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              .avenger.avenger--shield
  .avenger__icon

            
          
!
            
              createClipPath(points)
  percs = ()
  unshift(points, (0))
  for point in points
    if length(point) > 1
      push(percs, ((point[0] * 1%) (point[1] * 1%)))
    else
      push(percs, point)
  shift(percs)
  clip-path polygon(unquote(join(',',percs)))

*
  box-sizing border-box

body
  align-items center
  background #111
  display flex
  flex-direction column
  min-height 100vh
  justify-content center


.avenger
  height 300px
  width 300px
  display flex
  align-items center
  justify-content center
  background red
  border-radius 100%
  transition background .5s

  &__icon
    height 200px
    width 200px
    transition clip-path .5s

  &--fist
    background #875094
    .avenger__icon
      background #a2cd48
      createClipPath((85 90) (75 55) (89 42) (89 24) (82 22) (80 9) (70 7) (68 10) (66 6) (56 5) (53 8) (51 4) (38 5) (36 9) (34 7) (25 8) (23 12) (17 17) (16 41) (26 54) (20 90))

  &--hammer
    background rgb(160, 15, 32)
    .avenger__icon
      background rgb(220, 234, 234)
      createClipPath((45 95) (55 95) (55 40) (60 40) (62.5 42.5) (85 42.5) (85 7.5) (62.5 7.5) (60 5) (40 5) (37.5 7.5) (15 7.5) (15 42.5) (37.5 42.5) (40 40) (45 40) (45 95) (45 95) (45 95) (45 95) (45 95))

  &--shield
    background rgb(30, 82, 133)
    .avenger__icon
      background white
      createClipPath((79 96) (79 96) (68 62) (68 62) (98 40) (98 40) (61 40) (61 40) (50 5) (50 5) (39 40) (39 40) (2 40) (2 40) (32 62) (32 62) (21 96) (21 96) (50 75) (50 75) (50 75))

  &--helmet
    background #aa0505
    .avenger__icon
      background #fbca03
      createClipPath((60 95) (70 75) (72.5 65) (80 60) (80 35) (75 32.5) (74 25) (70 15) (65 10) (50 5) (35 10) (30 15) (26 25) (25 32.5) (20 35) (20 60) (27.5 65) (30 75) (40 95) (40 95) (40 95))

            
          
!
            
              const avenger = document.querySelector('.avenger')
const classes = ['shield', 'hammer', 'fist', 'helmet']
const duration = 1000

let index = 0
const loop = () => {
  index++
  if (index > classes.length - 1) index = 0
  avenger.className = `avenger avenger--${classes[index]}`
  setTimeout(loop, duration)
}

setTimeout(loop, duration)
            
          
!
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.
Loading ..................

Console