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

              
                <svg viewBox="0 -10 700 400">

    <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"/>
    <circle cx="320" cy="110" r="70" fill="grey"/>
   
</svg>
              
            
!

CSS

              
                
body{
  background-color:grey;
  margin:0;
  height:5000px;
}

svg{
  overflow:visible;
  visibility:hidden;
}

              
            
!

JS

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

var base = gsap.timeline({
  paused:true,
  defaults:{ease:'none'}
})
.to('.part04, .part05', {rotation:0, svgOrigin:'320 110'})
.set('.part06', {autoAlpha:0})
.to('.part05', {rotation:180, svgOrigin:'320 110'})



var master = gsap.timeline({
   scrollTrigger: {
    trigger: "svg",
    pin:true,
    start: "top top",
    end:'+=2000px',
    scrub:'true'
  },
  defaults:{duration:1, ease:'none'}
})
.to(base, {progress:1})
.to({},{})

              
            
!
999px

Console