123

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <!doctype html>
<html ⚡>

<head>
  <meta charset="utf-8">
  <title>Slidein and fadein</title>
  <link rel="canonical" href="https://www.ampstart.com/templates/article.amp">
  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">

  <style amp-boilerplate="">
    body {
      -webkit-animation: -amp-start 8s steps(1, end) 0s 1 normal both;
      -moz-animation: -amp-start 8s steps(1, end) 0s 1 normal both;
      -ms-animation: -amp-start 8s steps(1, end) 0s 1 normal both;
      animation: -amp-start 8s steps(1, end) 0s 1 normal both
    }

    @-webkit-keyframes -amp-start {
      from {
        visibility: hidden
      }
      to {
        visibility: visible
      }
    }

    @-moz-keyframes -amp-start {
      from {
        visibility: hidden
      }
      to {
        visibility: visible
      }
    }

    @-ms-keyframes -amp-start {
      from {
        visibility: hidden
      }
      to {
        visibility: visible
      }
    }

    @-o-keyframes -amp-start {
      from {
        visibility: hidden
      }
      to {
        visibility: visible
      }
    }

    @keyframes -amp-start {
      from {
        visibility: hidden
      }
      to {
        visibility: visible
      }
    }
  </style><noscript><style amp-boilerplate="">body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>

  <script async="" src="https://cdn.ampproject.org/v0.js"></script>
  <script custom-element="amp-animation" src="https://cdn.ampproject.org/v0/amp-animation-0.1.js" async></script>
  <script custom-element="amp-position-observer" src="https://cdn.ampproject.org/v0/amp-position-observer-0.1.js" async></script>
  <script custom-element="amp-fit-text" src="https://cdn.ampproject.org/v0/amp-fit-text-0.1.js" async></script>
  
  <style amp-custom>
    main {
      font-family: Helvetica, sans-serif;
      padding: 10px;
      max-width: 412px;
      margin: auto;
    }

    .spacer {
      height: 100vh;
      width: 100%;
      background-image: -webkit-linear-gradient(#EEE 50%, white 50%);
      background-image: linear-gradient(#EEE 50%, white 50%);
      background-size: 100% 3em;
    }

    pre {
      display: inline;
    }

    /*
   * Fidget Spinner styles
   */

   /*
    * Card transition styles
    */
    .card {
      margin: 30px 0px;
      position: relative;
    }

    .card-title {
      padding: 5%;
      padding-right: 40%;
      font-size: 50%;
      font-weight: bold;
      color: #FAFAFA;
      transform: translateX(-100%);
    }

    /*
     * Parallax window stles
     */
    .parallax-image-window {
      overflow: hidden;
    }

    .parallax-image-window amp-img {
      margin-bottom: -30%;
    }

    /*
   * Carousel transition styles
   */

    .carousel-container {
      margin-right: -60%;
      margin-left: 60%;
    }
  </style>
</head>

<body>

  <main>

    <!--
    Scrollbound animations with amp-position-observer and amp-animation
    The following animation does one round (12pm-6pm) via scrolling when fully visible until partially invisible

 We use `step` easing to stagger the timeline. 
 -->
    <div class="spacer"></div>
    
<div class="parallax-image-window">

  <amp-position-observer on="scroll:parallaxTransition.seekTo(percent=event.percent)"
    intersection-ratios="0"
    layout="nodisplay">
  </amp-position-observer>

  <amp-img id="parallaxImage"
    width="1280"
    height="873"
    layout="responsive"
    src="https://ampbyexample.com/img/elephant.jpg"
    alt="Picture of an elephant"></amp-img>
</div>

    <amp-animation id="parallaxTransition"
  layout="nodisplay">
  <script type="application/json">
    {
      "duration": "1",
      "fill": "both",
      "direction": "reverse",
      "animations": [{
        "selector": "#parallaxImage",
        "keyframes": [{
          "transform": "translateY(-30%)"
        }]
      }]
    }
  </script>
</amp-animation>
    
    <div class="spacer"></div>
    <div class="spacer"></div>
  </main>
</body>

</html>
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console