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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <svg version="1.1"  xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 600 368">
  <defs>
    <mask id="chipMask">
      <rect width="100%" height="100%" fill="#fff"/>
      <path fill="none" stroke="#000" stroke-width="3" d="M98,133c0,0,4.3,0,7.2,0c2.8,0,3.8,2,3.8,4s-1,6-4,6H89 M109,176.2c0,0,3.5-2.7,3.5-8.7c0-4-4-10-9-10 s-15,0-15,0 M103.5,143.5V156 M136.8,133c0,0-7.3-0.5-7.1,5c0.1,2.6,1.8,5.5,6.3,5.5c5.3-0.1,14.9-0.5,14.9-0.5 M150.4,157.5 c0,0-10.1,0-15.1,0s-9.1,6-9.1,10c0,6,3.5,8.7,3.5,8.7 M135.3,143.5V156"/>
    </mask>
    
    <mask id="cardMask">
      <rect rx="20" ry="20" fill="#fff" width="600" height="368"/>
    </mask>
    
    <mask id="coilMask">
      <polygon fill="#fff" points="0,0 353,0 353,370 0,370"/>
    </mask>
    
    <mask id="curlMask">
      <polygon points="210,427 140,255 224,418" fill="#fff"/>
    </mask>
    
    <mask id="stepMask">
      <use href="#tred3" />      
      <use href="#tred2" />
      <use href="#tred1" />
    </mask>
    
    <g id="steps">
      <polygon id="tred4" class="step4" fill="#f9bb4b" points="689,-131 905,130 1095,130 875,-131"/>
      <polygon class="step4" fill="#271b13" points="689,-131 689,14 785,131 905,130"/>

      <polygon id="tred3" class="step3" fill="#f9bb4b" points="503,14 806,385 996,385 689,14"/>
      <polygon class="step3" fill="#271b13" points="503,14 503,159 686,386 806,385"/>

      <polygon id="tred2" class="step2" fill="#f9bb4b" points="316,159 532,420 722,420 503,159"/>
      <polygon class="step2" fill="#271b13" points="316,159 316,304 412,421 532,420"/>

      <polygon id="tred1" class="step1" fill="#f9bb4b" points="130,304 346,565 536,565 316,304"/>
      <polygon class="step1" fill="#271b13" points="130,304 130,449 226,567 346,565"/>
    </g>
        
    
    <clipPath id="txtBoxes">    
      <rect class="txtBox" x="40" y="37" width="90" height="35" />
      <rect class="txtBox" x="40" y="300" width="195" height="35" />
      <rect class="txtBox" x="470" y="290" width="80" height="35" />      
    </clipPath>

  </defs>
  
  
  
  <g mask="url(#cardMask)">
    
    <rect class="bg" fill="#424d9b" width="100%" height="100%"/>    
    <image class="scratches" width="125" href="https://assets.codepen.io/721952/scratches2.png" />
       
    <g id="steps">
      <polygon class="step4" id="tred4" fill="#f9bb4b" points="689,-131 905,130 1095,130 875,-131"/>
      <polygon class="step4" fill="#271b13" points="689,-131 689,14 785,131 905,130"/>

      <polygon class="step3" id="tred3" fill="#f9bb4b" points="503,14 806,385 996,385 689,14"/>
      <polygon class="step3" fill="#271b13" points="503,14 503,159 686,386 806,385"/>

      <polygon class="step2" id="tred2" fill="#f9bb4b" points="316,159 532,420 722,420 503,159"/>
      <polygon class="step2" fill="#271b13" points="316,159 316,304 412,421 532,420"/>

      <polygon class="step1" id="tred1" fill="#f9bb4b" points="130,304 346,565 536,565 316,304"/>
      <polygon class="step1" fill="#271b13" points="130,304 130,449 226,567 346,565"/>
    </g>

    <path mask="url(#curlMask)" class="curl" fill="#271b13" d="M210.2,363.5l-16.5-25.1c25.3-16.6,40.9-37.4,46.6-61.8c6.1-26.3-1-50.1-8-65.5l27.3-12.5 C282.1,247.9,280.9,317,210.2,363.5z"/>
    
    <g mask="url(#stepMask)">
      <path mask="url(#curlMask)" class="curl" fill="#3e7773" d="M210.2,363.5l-16.5-25.1c25.3-16.6,40.9-37.4,46.6-61.8c6.1-26.3-1-50.1-8-65.5l27.3-12.5 C282.1,247.9,280.9,317,210.2,363.5z"/>
      <ellipse id="orbShadow" fill="#271b13" cx="423" cy="202" rx="48" ry="23"/>      
    </g>    

    <g id="orb">
      <circle fill="#f9503e" cx="423" cy="46" r="51"/>  
      <path id="star" fill="#fff" d="M452.3,5.1c3-3,6.1-9.1,6.1-9.1s0.8,3.8,4.5,7.6c6.1,6.1,9.1,6.1,9.1,6.1s-3,1.5-7.6,6.1s-6.1,9.1-6.1,9.1 s-2.3-5.3-6.1-9.1s-8.3-5.3-8.3-5.3S449.3,8.1,452.3,5.1z"/>
    </g>
    
    <path id="coil" mask="url(#coilMask)" fill="none" stroke="#fff" stroke-width="2" stroke-dasharray="6 2 4 2.5 4 3 3.5 3" d="M125.6,0.3c27.9,62.2,139.9,57.2,135.9-35.8c-3-69.1-107.7-113.5-180-102 c-107,17-190,156.1-133,253s197.9,106.5,289,51c87-53,161.3-193.1,75-348s-253.6-162.6-378-80c-128,85-221.1,300.5-105,498 s546,269,725-60"/>

    <polygon id="triangle" fill="#424d9b" points="533,163 577.5,187.5 577.5,135 "/>
    
    <g id="logo">
      <circle class="logoPt" fill="#fff" cx="503" cy="67" r="25"/>
      <circle class="logoPt" fill="none" stroke="#fff" stroke-width="4.5" cx="533" cy="67" r="22.5"/>
    </g>        
    
    <g fill="#fff" stroke-linecap="round">
      <g clip-path="url(#txtBoxes)">
        <text x="45" y="60" font-size="26">Debit</text>
        <text x="45" y="320" font-size="21">Dianne Palmer</text>
        <text x="470" y="320" font-size="26">07/29</text>    
      </g>
      <path fill="none" stroke="#fff" stroke-width="2.4" d="M42.5,146.5c2,2,2,6.3,0,8.2 M57,163.7c5.1-5.9,5.1-19.8,0-26.3 M52.1,160.7c4.4-4.5,4.9-15.2,0-20.2
     M47.8,157.2c2.9-3,2.9-10,0-13.2"/>
      <rect mask="url(#chipMask)" rx="5" ry="5" x="89" y="125" width="61" height="50.2"/>
    </g>
  </g>
  
</svg>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&display=swap');

html, body {
  width:100%;
  height:100%;
  background:#f3ede2;
  overflow:hidden;
  font-family: 'Montserrat', sans-serif;
}

svg {
  opacity:0;
  position:absolute;
  width:80%;
  max-height:95%;
  left:10%;
  top:50%;
  transform:translateY(-50%);
}
              
            
!

JS

              
                const tl = gsap.timeline()
  .set('svg', {opacity:1})
  .set('.scratches', {rotation:100, x:60, y:-25})
  .set('#star', {scale:0, transformOrigin:'50% 50%'})
  .from('#cardMask rect', {scale:0, rotation:-20, duration:2, transformOrigin:'50% 50%', ease:'expo.inOut'}, 0)
  .fromTo('#triangle', {transformOrigin:'-510px -280px', rotate:24}, {rotate:0, duration:2, ease:'expo.inOut'}, 0.5)
  .to('#coilMask polygon', {attr:{points:'0,0 550,0 600,370 0,370'}, duration:2, ease:'expo.inOut'}, 0.5)
  .from('#coil', {attr:{'stroke-dashoffset':-28}, ease:'none', duration:1, repeat:-1}, 0.5)
  .to('.step2', {skewY:-6, duration:2, ease:'none', repeat:-1}, 0.7)
  .fromTo('.step1', {skewY:-6}, {skewY:-9, y:15, duration:2, ease:'none', repeat:-1}, 0.7)
  .to('.step1, .step2, .step3, .step4', {x:-186, y:145, duration:2, ease:'none', repeat:-1}, 0.7)
  .fromTo('#orb', {y:-40},{y:160, ease:'circ.in', repeat:-1, yoyo:true, duration:1}, 0)
  .fromTo('#orbShadow', {scale:0.4, y:-10, transformOrigin:'50% 50%'},{scale:1.1, y:50, ease:'circ.in', repeat:-1, yoyo:true, duration:1, onRepeat:()=>{
    gsap.to('#star', {scale:1, repeat:1, yoyo:true, yoyoEase:true, duration:0.25, ease:'power4'})
    gsap.fromTo('#star', {rotate:20},{rotate:-99, duration:0.5, ease:'none'})    
  }}, 0)  
  .from('.logoPt', {x:(i)=>[18,-10][i], duration:1.2, ease:'expo.inOut'}, 0.9)
  .from('svg text', {x:-40, duration:1.1, ease:'expo.inOut', stagger:0.2}, 1)
  .from('.txtBox', {scaleX:0, transformOrigin:'100% 0', duration:1.1, ease:'expo.inOut', stagger:0.2}, 1)
  .from('#curlMask polygon', {attr:{points:'232,481 140,255 360,140'}, repeat:-1, yoyo:true, repeatDelay:0.8, duration:1, ease:'sine.inOut'}, 2)
  .to('#triangle', {rotate:()=>gsap.utils.random(2.5,4.5), duration:2, repeat:-1, yoyo:true, repeatRefresh:true, ease:'sine.inOut'}, 2.5)


window.onclick =()=> tl.play(0);
              
            
!
999px

Console