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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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 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.

HTML

              
                <div class="tabs">
  <!-- TAB 1 -->
  <input type="radio" name="tab" id="tab-01" checked />
  <label for="tab-01">
    <svg>
      <use xlink:href="#icon-01" class="icon" />
      <use xlink:href="#icon-01" class="icon" />
      <use xlink:href="#icon-01" class="icon" />
      <use xlink:href="#icon-01" class="icon" />
      <use xlink:href="#icon-01" class="icon" />
    </svg>
  </label>
  <!-- TAB 2 -->
  <input type="radio" name="tab" id="tab-02" />
  <label for="tab-02">
    <svg>
      <use xlink:href="#icon-02" class="icon" />
      <use xlink:href="#icon-02" class="icon" />
      <use xlink:href="#icon-02" class="icon" />
      <use xlink:href="#icon-02" class="icon" />
      <use xlink:href="#icon-02" class="icon" />
    </svg>
  </label>
  <!-- TAB 3 -->
  <input type="radio" name="tab" id="tab-03" />
  <label for="tab-03">
    <svg>
      <use xlink:href="#icon-03" class="icon" />
      <use xlink:href="#icon-03" class="icon" />
      <use xlink:href="#icon-03" class="icon" />
      <use xlink:href="#icon-03" class="icon" />
      <use xlink:href="#icon-03" class="icon" />
    </svg>
  </label>
  <!-- TAB 4 -->
  <input type="radio" name="tab" id="tab-04" />
  <label for="tab-04">
    <svg>
      <use xlink:href="#icon-04" class="icon" />
      <use xlink:href="#icon-04" class="icon" />
      <use xlink:href="#icon-04" class="icon" />
      <use xlink:href="#icon-04" class="icon" />
      <use xlink:href="#icon-04" class="icon" />
    </svg>
  </label>
</div>


<!-- SVG -->
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
  <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" id="icon-01">
    <path d="M9.82,1.5A11.13,11.13,0,0,0,1.5,12.33a11.08,11.08,0,0,0,11,11.17,11.08,11.08,0,0,0,11-11.17A11.16,11.16,0,0,0,16.33,1.86V12.33a3.9,3.9,0,1,1-.08-.78"/>
  </symbol>
  <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" id="icon-02">
    <path d="M18.16,23.5h2.16a3.19,3.19,0,0,0,3.18-3.18V4.68A3.19,3.19,0,0,0,20.32,1.5H8.81l0,4.19A3.15,3.15,0,1,1,5.69,8.83H1.5V20.32A3.19,3.19,0,0,0,4.68,23.5h8.83s-.49-5.76,4.75-8.38" />
  </symbol>
  <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" id="icon-03">
    <path d="M14.6,5.13V4.68A3.19,3.19,0,0,0,11.42,1.5H4.68A3.19,3.19,0,0,0,1.5,4.68V20.32A3.19,3.19,0,0,0,4.68,23.5H20.32a3.19,3.19,0,0,0,3.18-3.18V12.53a3.19,3.19,0,0,0-3.18-3.17H6.77" />
  </symbol>
  <symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" id="icon-04">
    <path d="M4,23.5a11,11,0,0,1,17,0" />
    <path d="M15.66,10.5a3.16,3.16,0,0,1-6.32,0H3.5a9,9,0,1,1,2.87,6.59" />
  </symbol>
</svg>

<!--- ## DRIBBBLE + TWITTER ############# -->
<div class="socials">
  <a class="dribbble" href="https://dribbble.com/shots/9436307-Tabbar-animation-CodePen" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" fill="white" d="M16 0C7.16703 0 0 7.16703 0 16C0 24.833 7.16703 32 16 32C24.8156 32 32 24.833 32 16C32 7.16703 24.8156 0 16 0ZM26.5683 7.37527C28.4772 9.70065 29.6226 12.6681 29.6573 15.8785C29.2061 15.7918 24.6941 14.872 20.1475 15.4447C20.0434 15.2191 19.9566 14.9761 19.8525 14.7332C19.5748 14.0738 19.2625 13.397 18.9501 12.7549C23.9826 10.7072 26.2733 7.75705 26.5683 7.37527ZM16 2.36009C19.4707 2.36009 22.6464 3.66161 25.0586 5.7961C24.8156 6.14317 22.7505 8.90239 17.8915 10.7245C15.6529 6.61171 13.1714 3.24512 12.7896 2.72451C13.8134 2.48156 14.8894 2.36009 16 2.36009ZM10.1866 3.64425C10.551 4.13015 12.9805 7.5141 15.2538 11.5401C8.86768 13.2408 3.22777 13.2061 2.62039 13.2061C3.50542 8.9718 6.36876 5.44902 10.1866 3.64425ZM2.32538 16.0174C2.32538 15.8785 2.32538 15.7397 2.32538 15.6009C2.9154 15.6182 9.54447 15.705 16.3644 13.6573C16.7636 14.4208 17.128 15.2017 17.4751 15.9826C17.3015 16.0347 17.1106 16.0868 16.9371 16.1388C9.89154 18.4121 6.14317 24.6247 5.8308 25.1453C3.6616 22.7332 2.32538 19.5228 2.32538 16.0174ZM16 29.6746C12.8416 29.6746 9.92625 28.5987 7.61822 26.7939C7.86117 26.2907 10.6377 20.9458 18.3427 18.256C18.3774 18.2386 18.3948 18.2386 18.4295 18.2213C20.3557 23.2017 21.1367 27.3839 21.3449 28.5813C19.6963 29.2928 17.8915 29.6746 16 29.6746ZM23.6182 27.3319C23.4794 26.4989 22.7505 22.5076 20.9631 17.5965C25.2495 16.9197 28.9978 18.0304 29.4664 18.1866C28.8764 21.987 26.6898 25.2668 23.6182 27.3319Z" fill="#EA4C89"></path></svg></a>
  <a class="twitter" href="https://twitter.com/MilanRaring" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 72 72"><path fill="white" d="M67.812 16.141a26.246 26.246 0 0 1-7.519 2.06 13.134 13.134 0 0 0 5.756-7.244 26.127 26.127 0 0 1-8.313 3.176A13.075 13.075 0 0 0 48.182 10c-7.229 0-13.092 5.861-13.092 13.093 0 1.026.118 2.021.338 2.981-10.885-.548-20.528-5.757-26.987-13.679a13.048 13.048 0 0 0-1.771 6.581c0 4.542 2.312 8.551 5.824 10.898a13.048 13.048 0 0 1-5.93-1.638c-.002.055-.002.11-.002.162 0 6.345 4.513 11.638 10.504 12.84a13.177 13.177 0 0 1-3.449.457c-.846 0-1.667-.078-2.465-.231 1.667 5.2 6.499 8.986 12.23 9.09a26.276 26.276 0 0 1-16.26 5.606A26.21 26.21 0 0 1 4 55.976a37.036 37.036 0 0 0 20.067 5.882c24.083 0 37.251-19.949 37.251-37.249 0-.566-.014-1.134-.039-1.694a26.597 26.597 0 0 0 6.533-6.774z"></path></svg></a>
</div>  
              
            
!

CSS

              
                .tabs {
  --background: #FFFFFF;
  --text-color: #414856;
  --color-01: #FFB400;
  --color-02: #FF5100;
  --color-03: #9901F8;
  --width: 300px;    
  --height: 75px;
  --border-radius: var(--height);     
  background: var(--background);
  width: var(--width);
  height: var(--height);
  padding: 0;
  position: relative;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px rgba(#414856, 0.05);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 15px;
  box-sizing: border-box;
  label {
    width: 25px;
    height: 25px;
    cursor: pointer;
    position: relative;
    &::before {
      content: "";
      position: absolute;
      width: 100%;
      height: 100%;
      background: var(--color-01);
      border-radius: 50%;
      opacity: var(--opacity, 0);
      transform: scale(0);
    }
    svg {
      width: 100%;
      height: 100%;
      .icon {
        fill: none;
        stroke: var(--text-color);
        stroke-dashoffset: 98;
        stroke-width: 2px;
        stroke-linecap: round;
        stroke-linejoin: round;
        @for $icon from 2 through 5 {
          $colors: none, var(--color-01), var(--color-02), var(--color-03), var(--color-01);
          &:nth-child(#{$icon}) {
            opacity: 0;
            stroke: nth($colors, $icon);
            animation-delay: .1s*$icon !important;
          }
        }
      }
    }
  }
  input {
    display: none;
    &:checked {
      + label {
        &::before {
          animation: click-animation .4s ease forwards;
        }
        svg {
          .icon {
            &:first-child {
              animation: stroke-animation-first .5s linear forwards .5s;
            }
            @for $icon from 2 through 4 {
              &:nth-child(#{$icon}) {
                animation: stroke-animation .5s linear;
              }
            }
            &:last-child {
              animation: stroke-animation-last .5s linear forwards;
            }
          }
        }
      }
    }
  }
}
@keyframes stroke-animation-first {
  0% {
    opacity: 1;
    stroke-dashoffset: 98;
    stroke-dasharray: 98 0;
  }
  100% {
    opacity: 0;
    stroke-dashoffset: 0;
    stroke-dasharray: 0 98;
  }
}
@keyframes stroke-animation {
  0% {
    opacity: 1;
    stroke-dashoffset: 98;
    stroke-dasharray: 0 98 0 0;
  }
  15% {
    stroke-dasharray: 0 98 18 0;
  }
  100% {
    opacity: 1;
    stroke-dashoffset: 0;
    stroke-dasharray: 0 98 18 0;
  }
}
@keyframes stroke-animation-last {
  0% {
    opacity: 1;
    stroke-dashoffset: 98;
    stroke-dasharray: 98 98 18 0;
  }
  15% {
    stroke-dasharray: 116 98 18 0;
  }
  100% {
    opacity: 1;
    stroke-dashoffset: 0;
    stroke-dasharray: 116 98 18 0;
  }
}
@keyframes click-animation {
  50% {
    transform: scale(4);
    opacity: .1;
  }
}

//--- ## BASIC #############
body {
  background: #1B1A23;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .socials {
    position: fixed;
    display: block;
    left: 20px;
    bottom: 20px;
    > a {
      display: block;
      width: 30px;
      opacity: .2;
      transform: scale(var(--scale, .8));
      transition: transform .3s cubic-bezier(0.38,-0.12, 0.24, 1.91);
      &:hover {
        --scale: 1;
      }
    }
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console