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

              
                .path-cont
  svg(preserveAspectRatio="none" viewbox='0 0 100 100' xmlns='http://www.w3.org/2000/svg').svgpath
    path(fill='none' stroke-dasharray="5,3" stroke='#0070f3' d='M51,0 L61,7 L69,12 L74,18 L72,25 L62,29 L45,32 L29,32 L13,26 L20,19 L37,15 L56,15 L68,17 L80,24 L82 31 L76,37 L67,43 L57,49 L44,55 L35,60 L26,66 L25,70 L30,75 L36,81 L46,86 L55,91 L65,96 L72,99')
  .obj
.big-thing 
  h1 Scroll Onwards
  p 
     strong Sadly no love in firefox and safari yet for animation timeline, have to wait on such implementations.
  p 
  a(href="https://codepen.io/ghaste/pen/PoVWgZp" target="_blank") SVG path 
  | based offset-path does not support responsive design, which is another draw-back.
  p You can use a 
    strong polygon path
    |, which is responsive, but you will then have to create that visible path yourself (intentionally terrible job here). It will not be a smooth path as shown here.
  p I found that the 
    a(href="https://bennettfeely.com/clippy/" target="_blank") Clippy
    |  - clip-path generator 
    | can be used for generating the polygon.
  p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tristique sit amet erat vitae ultrices. Proin ultrices, velit a gravida convallis, orci neque aliquet quam, ac aliquam odio dolor sit amet est. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed faucibus magna ac lorem pellentesque tincidunt. Cras eu sem sit amet orci tincidunt convallis. Aliquam faucibus blandit porttitor. Donec efficitur in quam vitae blandit. Sed sed dui mi. Integer euismod enim quis gravida pretium. Curabitur sed lacus nec nulla tristique tincidunt ut id ex. Aenean dignissim lorem sit amet neque vulputate, vel consequat magna mattis. Integer et volutpat orci. Sed vehicula, nisl vel dignissim feugiat, eros risus condimentum neque, et lacinia est purus sed sem. Mauris sagittis ultricies dolor.

  p Sed nec neque tempus, vulputate ligula sit amet, euismod orci. Nunc cursus quam a pharetra sagittis. Donec quis diam vel quam feugiat laoreet. Ut lobortis semper turpis, vitae fermentum tortor scelerisque pharetra. Nullam aliquet ipsum a condimentum bibendum. Integer ac purus mi. Nam rutrum orci vitae feugiat luctus. Quisque sodales, nisi eu accumsan sodales, nisl metus semper nisl, non fringilla turpis quam a tortor. Aenean posuere nisl vitae felis fermentum congue.

  p Integer imperdiet ligula tristique, tincidunt augue in, congue elit. Etiam elementum nec urna nec tincidunt. Fusce arcu nisl, rhoncus non dignissim vel, venenatis at augue. In auctor eu nisl et imperdiet. Duis imperdiet vehicula est, ac convallis urna hendrerit et. Sed pulvinar nunc eu enim placerat, eget lobortis libero laoreet. Donec et mollis metus. Nunc leo magna, dignissim eu neque hendrerit, commodo varius lacus. Morbi pretium, augue vel commodo convallis, felis nisi tincidunt mauris, sed scelerisque massa quam ut ipsum. Sed pellentesque nisl ut dapibus condimentum. Quisque nec dapibus ante. Mauris ac accumsan augue. Donec tincidunt est imperdiet augue ultricies finibus. Vivamus volutpat egestas tellus a malesuada.

  p Duis at velit bibendum ligula accumsan tempor vel ac justo. Ut rutrum lectus vel tristique maximus. Cras vitae nibh sit amet justo mattis porta in sit amet tellus. Aenean vitae nunc elementum, auctor arcu in, hendrerit ligula. Pellentesque nec vehicula sapien. Suspendisse ac metus consectetur, gravida ante quis, suscipit mauris. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam tincidunt venenatis tristique. Pellentesque tristique lectus nunc, ac gravida ante scelerisque nec. Nullam a libero sit amet ipsum malesuada porttitor.
              
            
!

CSS

              
                .path-cont {
  position: fixed;
  width: 20vw;
  height: 100vh;
  top: 0;
  left: 0;
  pointer-events: none;
  color: #FBF7F490;
  z-index: -10;
}
.svgpath {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  path {
    stroke: #FBF7F430;  
  }
}
.obj {
  position: absolute;
  offset-path: polygon(51% 0%, 61% 7%, 69% 12%, 74% 18%, 72% 25%, 62% 29%, 45% 32%, 29% 32%, 13% 26%, 20% 19%, 37% 15%, 56% 15%, 68% 17%, 80% 24%, 82% 31%, 76% 37%, 67% 43%, 57% 49%, 44% 55%, 35% 60%, 26% 66%, 25% 70%, 30% 75%, 36% 81%, 46% 86%, 55% 91%, 65% 96%, 72% 99%);
  animation: followpath linear;
  animation-timeline: scroll();
}
@keyframes followpath {
  from {
    offset-distance: 2%;
  }
  //unlike a path, a polygon is a closed, so you will have to test this out, on where to end your offset.
  to {
    offset-distance: 60%;
  }
}


@import url('https://fonts.googleapis.com/css2?family=Architects+Daughter&family=Roboto:wght@100;400&display=swap');

body {
  background-color: #1f2020;
  color: #FBF7F4;
  font-family: Roboto, sans-serif;
  font-weight: 100;
}
h1 {
  font-family: 'Architects Daughter', cursive;
  font-size: clamp(2rem, 8vw + 1rem, 10rem);
  line-height: 1;
  margin: 0;
  background-image: 
    linear-gradient(#ff6090, #E23636);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
p {
  line-height: 1.5;
}
.big-thing {
  width: min(50ch, 100% - 2rem);
  margin: 0 auto;
}

.obj {
  --bg: white;
  --brd: #ff6090;
  width: 3vmin;
  height: 1.5vmin;
  border-top-right-radius: 30% 20%;
  border-bottom-right-radius: 30% 20%;
  border-top-left-radius: 30% 15%;
  border-bottom-left-radius: 30% 15%;
  border: 1px solid var(--brd);
  border-width: .5vmin 2.5vmin .5vmin .8vmin;
  box-shadow: 0 0 0 .08em #000;
  background-color: var(--bg);
}
.path-cont:before {
  content: '0%';
  position: absolute;
  left: 40%;
}
.path-cont:after {
  content: '100%';
  position: absolute;
  right: 0;
  bottom: 0;
}
a {
  color: #ff6090;
  text-decoration-color: #ffafaf90;
}
              
            
!

JS

              
                
              
            
!
999px

Console