cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <h1>Scroll for Wave Effect</h1>
<div class="svg-container">
  <svg version="1.1" id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
     viewBox="8 0 2048 25" enable-background="new 8 0 2048 25" xml:space="preserve"preserveAspectRatio="none">
  <path fill="#008571" d="M1833.1,1.6c-146.3,0-360.7,22.4-527,22.4s-274-10.6-274-10.6S955.4,1.6,809.1,1.6S448.4,24,282,24
    S8,13.4,8,13.4V25h1024h1024V13.4C2056,13.4,1979.4,1.6,1833.1,1.6z"/>
  </svg>
</div>
<div class="bottom"></div>
            
          
!
            
              html, body {
  padding: 0;
  margin: 0;
  height: 100%;
}
body {
  background: url('http://images8.alphacoders.com/370/370799.jpg');
  background-size: 250vh;
  background-attachment: fixed;
}

h1 {
  color: #fff;
  text-align: center;
  font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
  font-size: 10vh;
  text-shadow: 0 .5vh 1vh rgba(0,0,0,.5);
  margin-top: 30vh;
  margin-bottom: 10vh;
}

.svg-container {
  overflow: hidden;
}

div.bottom {
  background: #008571;
  height: calc(100% - 8vh);
}

svg {
  display: block;
  width: 200%;
  position: relative;
  left: 0px;
  height: 8vh;
}

svg path {
  fill: #008571;
}
            
          
!
            
              (function() {

  var viewWidth, xPos;

  viewWidth = -1 * $(window).width();
  xPos = 0;

  $(document).on('scroll', function() {

    if (xPos > viewWidth) {
      xPos -= 20;
    } else {
      xPos = 0;
    }

    $('#svg').css('left', xPos);
  });

}());

////////////////////
// Automate Animation
////////////////////

(function() {

  var obj, scrollToThis, interval;

  obj = $('body');
  scrollToThis = obj.height();

  function scroll(callback) {

    obj.animate({
      scrollTop: 0
    }, 2000);
  }
  
  obj.scrollTop(obj.height());
  scroll();

}());
            
          
!
999px
Loading ..................

Console