Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                
<section class="section01">
<svg viewBox="0 0 500 320">
  
  <text class="title" text-anchor="middle">
    <tspan y="50" x="120">How the economy is  </tspan>
    <tspan y="65" x="120">being boosted in times</tspan>
    <tspan y="80" x="120">of Corona</tspan>
  </text>

  <g class=" legende textCorona">
    <g class="info">
      <rect x="240" y="120" style="fill:#5a5a5a;" />
      <text>
        <tspan x="255" y="130">by an autograph</tspan>
        <tspan x="255" y="145">on checks</tspan>
      </text>
    </g>
    <g class="info">
      <rect x="240" y="160" style="fill:#757575;" />
      <text>
        <tspan x="255" y="170">by the profit </tspan>
        <tspan x="255" y="185">of hedge funds</tspan>
      </text>
    </g>
    <g class="info">
      <rect x="240" y="200" style="fill:green;" />
      <text>
        <tspan x="255" y="210">by the fact that we all need</tspan>
        <tspan x="255" y="225">summer clothes one size larger</tspan>
      </text>
    </g>
  </g>
  
<g transform="translate(-200 85)">
  <circle cx="320" cy="110" r="100" fill="green"/>
  <path class="part part01" d="M320 10c55.192.001 100 44.809 100 100s-44.808 99.999-100 100V10z" fill="#757575"/>
    <path class="part part02" d="M320 10c55.192.001 100 44.809 100 100s-44.808 99.999-100 100V10z" fill="#5a5a5a"/>
  <path class="green"  d="M320 10v200c-55.192 0-100-44.808-100-100S264.808 10 320 10z" fill="green"/>
  </g>
</svg>
  
</section>

<section class="section02">

  <svg viewBox="0 0 500 320">

    <text class="title" text-anchor="middle">
      <tspan y="50" x="120">In which people</tspan>
      <tspan y="65" x="120">of all colors</tspan>
      <tspan y="80" x="120">are the same</tspan>
    </text>
    
    <g class=" legende textColors">
      <g class="info">
      <rect x="240" y="120" style="fill:#5a5a5a;" />
      <text>
        <tspan x="255" y="130">in their value</tspan>
      </text>
      </g>
      <g class="info">
      <rect x="240" y="160" style="fill:#757575;" />
      <text>
        <tspan x="255" y="170">in their dignity</tspan>
      </text>
      </g>
      <g class="info">
      <rect x="240" y="200" style="fill:green;" />
      <text>
        <tspan x="255" y="210">in their chances</tspan>
      </text>
      </g>
    </g>

    <g transform="translate(-200 85)">
      <circle cx="320" cy="110" r="100" fill="green"/>
      <path class="part part03a" d="M320 10c55.192.001 100 44.809 100 100s-44.808 99.999-100 100V10z" fill="#5a5a5a"/>
      <path class="part part03b" d="M320 10c55.192.001 100 44.809 100 100s-44.808 99.999-100 100V10z" fill="#757575"/>
      <path class="part03c"  d="M320 10v200c-55.192 0-100-44.808-100-100S264.808 10 320 10z" fill="green"/>
    </g>

  </svg>
</section>

<section class="section03">

  <svg viewBox="0 0 500 320">

    <text class="title" text-anchor="middle">
      <tspan y="50" x="120">What you become</tspan>
      <tspan y="65" x="120">when you are</tspan>
      <tspan y="80" x="120">a lying so-and-so</tspan>
    </text>

    <g class=" legende textLying">
      <g class="info">
      <rect x="240" y="120" style="fill:#5a5a5a;" />
      <text>
        <tspan x="255" y="130">a president</tspan>
      </text>
      </g>
    </g>
    
    <g transform="translate(-200 85)">
      <circle cx="320" cy="110" r="100" fill="green"/>
      <path class="part part04" d="M320 10c55.192.001 100 44.809 100 100s-44.808 99.999-100 100V10z" fill="#5a5a5a"/>
      <path class="part part05" d="M320 10c55.192.001 100 44.809 100 100s-44.808 99.999-100 100V10z" fill="#5a5a5a"/>
      <path class="green part06"  d="M320 10v200c-55.192 0-100-44.808-100-100S264.808 10 320 10z" fill="green"/>
    </g>

  </svg>
</section>

<section></section>

<p class="green">powered by GSAP scrollTrigger</p>
              
            
!

CSS

              
                
body{
  background-color:grey;
  margin:0;
}
.green{
  position: fixed;
  top: 0;
  right: 0;
  font-family: sans-serif;
  color: #0c3c0c;
  font-weight: 600;
  padding: 5px;
  font-size: 14px;
  
}

section{
  position:relative;
  width:100%;
  height:100vh;
  background-color:grey;
  overflow: hidden;
}
section:nth-of-type(even){
  background-color:#6f6f6f;
}
svg{
  height: 90vh;
  overflow:visible;
}
.title{
  font-weight: bolder;
  font-size: 12px;
  font-family: sans-serif;
  fill: #464646;
}
text{
  font-weight: bolder;
  font-size: 12px;
  font-family: sans-serif;
  fill: #464646;
}
rect{
  width:10px;
  height:10px;
}
.info{
  visibility:hidden;
}
              
            
!

JS

              
                
gsap.set('.part', {rotation:-180, svgOrigin:'320 110'})


gsap.timeline({
  scrollTrigger: {
    trigger: ".section01",
    pin: true, 
    start: "top top", 
    end: "+=1000", 
    scrub: 0.5, 
  }
})
.to('.part01', {rotation:-150, svgOrigin:'320 110', duration:6, ease:'power2.inOut'})
.to('.part02', {rotation:-170, svgOrigin:'320 110', duration:6, ease:'power2.inOut'},0)
.to('.textCorona .info', {autoAlpha:1, duration:0.5, stagger:0.5}, '+=2')
.to({}, {duration:6})


gsap.timeline({
  scrollTrigger: {
    trigger: ".section02",
    pin: true, 
    start: "top top", 
    end: "+=1000", 
    scrub: 0.5, 
  }
})
.to('.part03a, .part03b', {rotation:-0, svgOrigin:'320 110', duration:6, ease:'power2.in'})
.set('.part03c', {autoAlpha:0})
.to('.part03a', {rotation:180, svgOrigin:'320 110', duration:6, ease:'power2.out'})
.to('.textColors .info', {autoAlpha:1, duration:0.5, stagger:0.5}, '+=2')
.to({}, {duration:6})


gsap.timeline({
  scrollTrigger: {
    trigger: ".section03",
    pin: true, 
    start: "top top", 
    end: "+=1000", 
    scrub: 0.5,
  }
})
.to('.part04, .part05', {rotation:-0, svgOrigin:'320 110', duration:10, ease:'power2.in'})
.set('.part06', {autoAlpha:0})
.to('.part05', {rotation:180, svgOrigin:'320 110', duration:6, ease:'power2.out'})
.to('.textLying .info', {autoAlpha:1, duration:0.5, stagger:0.5}, '+=2')
.to({}, {duration:6})


// order: onEnter onLeave onEnterBack onLeaveBack
//toggleActions: "restart reset restart reset",


              
            
!
999px

Console