cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-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.

            
              

div {
  --zipper-x: 13;
}

div:before {
  background-image: 
    /* inside zipper loop */
    radial-gradient(circle closest-corner at calc(var(--zipper-x) * 1px) 29px , #af342c, #af342c 2px, transparent 2px, transparent),
    /* outside zipper loop */
    radial-gradient(circle closest-corner at calc(var(--zipper-x) * 1px) 29px , #491033, #491033 4px, transparent 4px, transparent), 
    /* pocket flap above zipper */
    linear-gradient(to bottom, transparent 10px, transparent 15px, #491033 5px, #491033 18px, transparent 18px, transparent 100px), 
    /* main zipper rectangle */
    linear-gradient(to right, #af342c calc(calc(var(--zipper-x) * 1px) - 3px), transparent calc(calc(var(--zipper-x) * 1px) - 3px), calc(calc(var(--zipper-x) * 1px) + 3px), #af342c calc(calc(var(--zipper-x) * 1px) + 3px)), 
    linear-gradient(to bottom, #af342c 8px, #af342c 16px, #491033 8px, #491033 30px, #af342c 20px, #af342c 72px, #af342c 10px, #af342c 57px, #af342c 5%);
  
  
  height: 75px;
  width: 118px;
  margin-left: 22px;
  margin-top: 58px;
  border: 4px solid #491033;
  border-radius: 11px;
  box-shadow: 0 4px 0 0 #c1382e, inset 0px 4px 1px 0 #c03527;
  content: '||';
  color: transparent;
  font-family: Comic Sans MS;
  font-weight: bold;
  z-index: 1;
  text-shadow: rgb(0, 0, 0) -2px -86px 0px;
  font-size: 14px;
}

div:after {
  margin-left: 67px;
  margin-top: -30px;
  background: #cca16a;
  width:26px;
  height:26px;
  border: 3px solid #491033;
  border-radius: 3px;
  transform: rotate(45deg);
  content: '';
}

div:before, 
div:after {
  display: block;
  position: absolute;
}

div {
  width: 170px;
  height: 180px;
  padding-top: 80px;
  background-color: #d84736;
  box-shadow: 
    inset 0 6px 0 2px #e64a3e, 
    0 6px 2px -2px #1a858b, 
    0 -93px 0 -81px #25aaa7, 
    0 -93px 0 -77px #3b1045, 
    0 -93px 0 -72px #d84736, 
    0 -93px 0 -68px #3b1045;
  background-image: linear-gradient(to right, #c1382e 230px, transparent 231px);
  background-position: center 254px;
  background-size: 305px 6px;
  background-repeat: repeat-x; 
  border: 5px solid #410c38;
  border-radius: 85px 85px 44px 44px;
}



body {
  text-align: center;
  background: #25aaa7;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}
            
          
!
            
              var div = document.querySelector('div');
var x = parseFloat(getComputedStyle(div).getPropertyValue('--zipper-x'));
var toTheRight = true;

function moveZipper() {
  x = x + (toTheRight ? .5 : -.5);
  div.style.setProperty('--zipper-x', x);
  if (x >= 110 || x <= 10) {
    toTheRight = !toTheRight; //change direction
    setTimeout(function() {
      requestAnimationFrame(moveZipper);
    }, 3000);
  } else {
    requestAnimationFrame(moveZipper);
  }
}
moveZipper();


//Alternate Code would look like
/*

  'radial-gradient(circle closest-corner at ' + x + 'px 29px , #af342c, #af342c 2px, transparent 2px, transparent), 
    radial-gradient(circle closest-corner at ' + x + 'px 29px , #491033, #491033 4px, transparent 4px, transparent), 
    linear-gradient(to bottom, transparent 10px, transparent 15px, #491033 5px, #491033 18px, transparent 18px, transparent 100px), 
    linear-gradient(to right, #af342c ' + (x - 3) + 'px, transparent ' + (x - 3) + 'px, ' + (x + 3) + 'px, #af342c ' + (x + 3) + 'px, 
    linear-gradient(to bottom, #af342c 8px, #af342c 16px, #491033 8px, #491033 30px, #af342c 20px, #af342c 72px, #af342c 10px, #af342c 57px, #af342c 5%)';

*/
            
          
!
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