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 xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1408 800" fill="none" stroke="#000" stroke-width="5">
  <defs>
    <mask id="m1" fill="#fff">
      <ellipse cx="686" cy="403" rx="195" ry="164"/>
    </mask>
    
    <mask id="m2" fill="#fff">
      <rect id="frame" width="1390" height="780" x="9" y="9"/>
    </mask>

    <filter id="f1">
      <feTurbulence baseFrequency="0.6" seed="1"/>
      <feDisplacementMap in="SourceGraphic" scale="7"/>
    </filter>
    
    <filter id="f2">
      <feTurbulence baseFrequency="0.5" seed="1"/>
      <feDisplacementMap in="SourceGraphic" scale="3"/>
    </filter>
  </defs>
  
  <g class="cone" mask="url(#m2)" filter="url(#f1)">
    <ellipse cx="686" cy="319" rx="959" ry="713"/>
    <ellipse cx="686" cy="308" rx="880" ry="670"/>
    <ellipse cx="686" cy="296" rx="812" ry="629"/>
    <ellipse cx="686" cy="284" rx="751" ry="584"/>
    <ellipse cx="686" cy="269" rx="692" ry="540"/>
    <ellipse cx="686" cy="256" rx="632" ry="499"/>
    <ellipse cx="686" cy="257" rx="574" ry="455"/>
    <ellipse cx="686" cy="256" rx="520" ry="412"/>
    <ellipse cx="686" cy="264" rx="470" ry="369"/>
    <ellipse cx="686" cy="277" rx="418" ry="331"/>
    <ellipse cx="686" cy="294" rx="365" ry="292"/>
    <ellipse cx="686" cy="318" rx="318" ry="253"/>
    <ellipse cx="686" cy="345" rx="272" ry="223"/>
    <ellipse cx="686" cy="377" rx="234" ry="190"/>
    <ellipse cx="686" cy="403" rx="195" ry="164"/>  
    <g class="masked" mask="url(#m1)">
      <ellipse cx="686" cy="428" rx="165" ry="135"/>
      <ellipse cx="686" cy="464" rx="141" ry="114"/>
      <ellipse cx="686" cy="493" rx="114" ry="93"/>
      <ellipse cx="686" cy="527" rx="96" ry="78"/>
      <ellipse cx="686" cy="554" rx="80" ry="63"/>
      <ellipse cx="686" cy="571" rx="58" ry="40"/>
      <ellipse cx="686" cy="588" rx="35" ry="24"/>
    </g>
    <path stroke-width="3" stroke-linecap="round" d="M629.32,789.5c0,0,17.38-212,34.28-227 M628.32,555.5c-28.18,7-91.82,204-95.82,237 M610.5,548.42 c-54-6.92-146.94,133.08-184.47,241.08 M599.66,542c-85.67-22.15-175.65,49.82-283.19,250.5 M599.91,542.39 C452.5,477.5,359.5,581.5,187.1,789.5 M594.23,539.62C394.5,430.5,264.5,567.5,39.25,792.5 M595.5,539.5c-211-165-461,30-585.95,132  M600.07,542.57C429.5,393.5,235.5,422.5,9.55,553.5 M601.91,543.19C418.5,357.5,220.5,371.5,9.55,455.51 M588.18,529.69 C448.5,366.5,233.5,307.5,9.5,369.5 M596.23,537.69C461.5,343.5,218.5,253.5,9.55,297.46 M607.66,546.69 C529.5,409.5,323.5,213.5,9.5,223.5 M610.5,547.5c-62-131-258-369-601-397 M611.5,549.5c-62-178-311-434-602-468.23 M618.44,552.5 c-62.06-167-250.94-465-599.94-545 M626.38,555.5c-57.88-189-209.88-424-425.42-548 M632.92,557.5c-20.42-93-120.42-360-331.53-550  M640.86,558.5c-27.36-163-159.36-424-266.31-551 M647.46,560.5c-12.96-82-55.96-291-211.53-553 M655.06,561.5 c-25.56-174-74.56-372-163.03-554 M661,562.5c-15.5-180-65.5-389-114.85-555 M671.54,563.5c0,0-30.04-367-77.3-556 M679.8,563.5 l-37.94-556 M731.98,789.5c0,0-13.38-213-30.28-228 M833.8,792.5c-4-33-51.3-224-99.82-236 M942.27,791.5 c-37.53-108-120.77-253-182.47-242.08 M1067.84,792.5C949.5,594.5,863.5,514.5,771.64,542 M1200.2,789.5 c-173.7-220-281.4-312-428.81-247.11 M1362.05,792.5c-225.25-225-385.25-362-584.99-252.88 M1401.75,681.5 c-163.25-143-419.95-303-621.95-145 M1403.75,562.5c-258.25-159-461.95-169-632.53-19.93 M1401.75,465.51 C1178.5,363.5,952.8,357.5,769.39,543.19 M1401.8,379.5c-255.3-86-478.36-18.62-618.68,150.19 M1400.75,299.46 C1165.5,242.5,909.8,344.5,778.07,532.69 M1401.8,223.5c-340.3-25-560,186-638.16,323.19 M1400.5,147.5 c-363,14-577.69,269-639.7,400 M1401.5,73.5c-319,25-584.7,297-640.7,476 M1352.8,7.5c-349,80-537.87,379-599.94,546 M1170.34,7.5 c-215.54,124-365.54,358-423.42,547 M1069.91,7.5c-211.11,190-309.11,455-329.53,548 M996.75,7.5c-106.95,127-234.95,386-262.31,549  M935.37,7.5c-155.57,262-206.49,492-209.53,551 M879.27,7.5c-88.47,182-137.47,379-163.03,553 M825.15,7.5 c-49.35,166-99.35,374-114.85,554 M777.07,7.5c-47.27,189-74.3,554-74.3,554 M729.44,7.5l-35.94,555 M685.44,7.5l1,554.89
"/>
  </g>

  <use href="#frame" fill="none" filter="url(#f2)"/>  
</svg>

<div class="grain"></div>
              
            
!

CSS

              
                html, body, svg {
  width:100%;
  height:100%;
  margin:0;
  padding:0;
}

body {
  overflow:hidden;
  background:#808080;
  display:flex;
  align-items:center;
  justify-content:center;
}

svg {
  width:90%;
  height:90%;
}

.grain {
  position:absolute;
  left:0;
  top:0;
  background-image:url(https://assets.codepen.io/721952/grain.png);
  opacity:0.2;
  width:100%;
  height:100%;
}
              
            
!

JS

              
                // cone loop + turbulence filter
gsap.timeline({defaults:{ ease:'none', repeat:-1 }})
  .from('.cone ellipse', {
    duration:1,
    attr:{
      cx:(i,t,a)=> (i==a.length-1)?'+=0':gsap.getProperty(a[i+1],'cx'),
      cy:(i,t,a)=> (i==a.length-1)?'+=0':gsap.getProperty(a[i+1],'cy'),
      rx:(i,t,a)=> (i==a.length-1)?'+=0':gsap.getProperty(a[i+1],'rx'),
      ry:(i,t,a)=> (i==a.length-1)?'+=0':gsap.getProperty(a[i+1],'ry')
    }
  }, 0)
  .to(window, {
    duration:0.3,
    onRepeat:()=> gsap.set('feTurbulence', { attr:{seed:'random(1,99)'} })
  }, 0)


//dust + scratches
for (let i=0; i<13; i++){
  let d = document.createElement('div')
  document.querySelector('.grain').appendChild(d)
  gsap.set(d, {
    attr:{ class:'d' },
    position:'absolute',
    width:30,
    height:30,
    backgroundImage:'url(https://assets.codepen.io/721952/filmDust.png)',
    backgroundPosition:'0 -'+gsap.utils.wrap(0,8,i)*30+'px'
  })
}

gsap.timeline({ repeatRefresh:true, repeat:-1 })
  .set('.d', {
    x:()=> innerWidth*1.5*Math.random(),
    y:()=> innerHeight*1.5*Math.random(),
    rotation:()=> 'random(0,360)',
    scale:()=> 'random(0.3,0.8)'
  }, 0.08)
              
            
!
999px

Console