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

              
                <div class="container">
  <div class="wave"></div>

  <div class="underwater">

    <div class="submarine move-down fadeInDown">

    </div>
    
    <div class="moving-content move-down text-delay fadeInDownText">
      <h2>Cute Submarine</h2>
      
      <p>Most large submarines consist of a cylindrical body with hemispherical (or conical) ends and a vertical structure, usually located amidships, which houses communications and sensing devices as well as periscopes. In modern submarines, this structure is the "sail" in American usage, and "fin" in European usage. A "conning tower" was a feature of earlier designs: a separate pressure hull above the main body of the boat that allowed the use of shorter periscopes. There is a propeller (or pump jet) at the rear, and various hydrodynamic control fins. Smaller, deep-diving and specialty submarines may deviate significantly from this traditional layout. Submarines use diving planes and also change the amount of water and air in ballast tanks to change buoyancy for submerging and surfacing.</p>
    </div>

  
</div>
              
            
!

CSS

              
                /* tangerine font */
@import url('https://fonts.googleapis.com/css?family=Raleway:500,700');

@keyframes fadeInDown {
  0% {
    opacity: .8;
    transform: none;
  }

  25% {
    opacity: 1;
    transform: translate(0, 15px);
  }
  
  50% {
    opacity: 1;
    transform: translate(0, 30px);
  }
  
  75% {
    opacity: 1;
    transform: translate(0, 15px);
  }
  
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeInDownText {
  0% {
    opacity: .8;
    transform: none;
  }

  100% {
    opacity: 1;
    transform: translate(0, 35px);
  }
}

.fadeInDown {
    -webkit-animation-name: fadeInDown;
    animation-name: fadeInDown;
}

.fadeInDownText {
    -webkit-animation-name: fadeInDownText;
    animation-name: fadeInDownText;
}

.container {
  max-width: 60%;
  margin: 0 auto;
}

.underwater {
  position: relative;
  min-height: 600px;
  background-color: #4fc3da;
}

.move-down{
    -webkit-animation-duration: 4s;
    animation-duration: 4s;
    -webkit-animation-timing-function: ease-in-out;
    animation-timing-function: ease-in-out;
    -webkit-animation-iteration-count: 15;
    animation-iteration-count: 15;
}

.text-delay {
    -webkit-animation-delay: 2s; /* Safari 4.0 - 8.0 */
    animation-delay: 2s;
    -webkit-animation-iteration-count: 15;
    animation-iteration-count: 15;
}

.submarine {
  height: 100px;
  width: 100px;
  margin: 0 auto;
  background: url("http://www.abbeyjfitzgerald.com/wp-content/uploads/2017/03/little-submarine.svg") no-repeat;
}



.moving-content {
  font-family: 'Raleway', sans-serif;
  width: 80%;
  margin: 30px auto;
  text-align: center;
  color: white;
}

.moving-content h2 {
  color: #4d275f;
}

.wave{
  background-color: #afdee8;
  height: 50px;
  position: relative;
}
.wave::before{
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  background-repeat: repeat;
  height: 10px;
  background-size: 20px 20px;
  background-image:
    radial-gradient(circle at 10px -5px, transparent 12px, #4fc3da 13px);
}
.wave::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  background-repeat: repeat;
  height: 15px;
  background-size: 80px 20px;
  background-image:
    radial-gradient(circle at 30px 15px, #4fc3da 12px, transparent 13px);
}


              
            
!

JS

              
                
              
            
!
999px

Console