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

Untitled

A Pen By Captain Anonymous

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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.

            
              <div id="page-container">
        <div id="example-container">
            <div class="example-box">
                <div class="original">
                    <div id="animate01">

                    </div>
                    <!-- animate01 end -->
                </div>
                <!-- original end -->
                <div class="text-box">
                    <pre>
@keyframes demo {
        from {width: 100px;}
        to {width: 500px;}
    }</pre>
                </div>
            </div>
            <!-- example-box end -->

        </div>
        <!-- example-container end -->
        <div id="example-container">
            <div class="example-box">
                <div class="original">
                    <div id="animate02">

                    </div>
                    <!-- animate02 end -->
                </div>
                <!-- original end -->
                <div class="text-box">
                    <pre>
@keyframes demo {
    0% {width: 0px;}
    25% {width: 100px;}
    50% {width: 200px;}
    75% {width: 300px;}
    100% {width: 400px;}
}
</pre>
                </div>
            </div>
            <!-- example-box end -->
        </div>
        <!-- example-container end -->
        <div id="example-container">
            <div class="example-box">
                <div class="original">
                    <div id="animate03">

                    </div>
                    <!-- animate03 end -->
                </div>
                <!-- original end -->
                <div class="text-box">
                    <pre>
@keyframes demo {
    from {top: 25px;
          left: 25px;
          background-color: navy;}
    to {top: 25px;
        left: 300px;
        background-color: orangered;}
}
</pre>
                </div>
            </div>
            <!-- example-box end -->
        </div>
        <!-- example-container end -->
        <div id="example-container">
            <div class="example-box">
                <div class="original">
                    <div id="animate04">

                    </div>
                    <!-- animate04 end -->
                </div>
                <!-- original end -->
                <div class="text-box">Wie oben, aber mit
                    <br/>
                    <em>animation-fill-mode: forwards;</em>
                </div>
            </div>
            <!-- example-box end -->
        </div>
        <!-- example-container end -->

        <div id="example-container">
            <div class="example-box">
                <div class="original">
                    <div id="animate05">

                    </div>
                    <!-- animate05 end -->
                </div>
                <!-- original end -->
                <div class="text-box">Wie oben, aber mit
                    <br/>
                    <em>animation-delay: 800ms;</em>
                </div>
            </div>
            <!-- example-box end -->
        </div>
        <!-- example-container end -->
        <div id="example-container">
            <div class="example-box">
                <div class="original">
                    <div id="animate06">

                    </div>
                    <!-- animate06 end -->
                </div>
                <!-- original end -->
                <div class="text-box">
                    Wie oben, aber mit
                    <br/>
                    <em>animation-timing-function: linear;</em>
                </div>
            </div>
            <!-- example-box end -->
        </div>
        <!-- example-container end -->
        <div id="example-container">
            <div class="example-box">
                <div class="original">
                    <div id="animate07">

                    </div>
                    <!-- animate07 end -->
                </div>
                <!-- original end -->
                <div class="text-box">
                    Wie oben, aber mit
                    <br/>
                    <em>animation-direction: reverse;</em>
                </div>
            </div>
            <!-- example-box end -->
        </div>
        <!-- example-container end -->
        <div id="example-container">
            <div class="example-box">
                <div class="original">
                    <div id="animate08">

                    </div>
                    <!-- animate08 end -->
                </div>
                <!-- original end -->
                <div class="text-box">
                    Wie oben, aber mit<br/>
                    <em>animation-direction: alternate;</em> und
                    <em>animation-iteration-count: infinite;</em>
                </div>
            </div>
            <!-- example-box end -->
        </div>
        <!-- example-container end -->

    </div>
    <!-- page-container end -->
            
          
!
            
              * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        em {
            font-family: Consolas, monospace;
            background-color: lightgray;
            padding: 1px;
        }

        #page-container {
            padding: 100px;
            font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
            font-size: 18px;
        }

        #example-container {
            width: 90%;
            margin: 0 auto;
        }

        .text-box {
            font-family: Consolas, monospace;
            width: 35%;
        }

        .example-box {
            margin: 0 auto;
            padding: 50px;
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            border-bottom: 2px solid aliceblue;
        }

        [id^="animate"] {
            position: absolute;
            width: 150px;
            height: 150px;
            background-color: navy;
            padding: 0 5px;
        }

        .original {
            position: relative;
            width: 150px;
            height: 150px;
            background-color: orangered;
        }

        /* Animation 01: Rechteck wird breiter mit from-to */

        #animate01 {
            width: 100px;
            height: 100px;

            animation-name: demo01;
            animation-duration: 2s;
        }

        @keyframes demo01 {
            from {
                width: 100px;
            }
            to {
                width: 500px;
            }
        }

        /* Animation 02: Rechteck wird breiter in 25%-Schritten */

        #animate02 {
            width: 0px;
            height: 100px;
            padding: 0;

            animation-name: demo02;
            animation-duration: 4s;
        }

        @keyframes demo02 {
            0% {
                width: 0px;
            }
            25% {
                width: 100px;
            }
            50% {
                width: 200px;
            }
            75% {
                width: 300px;
            }
            100% {
                width: 400px;
            }
        }

        /* Animation 03: Kugel rollt nach rechts, springt in Ausgangsposition zurück */

        #animate03 {
            width: 100px;
            height: 100px;
            padding: 0;
            top: 25px;
            left: 25px;
            border-radius: 50%;

            animation-name: demo03;
            animation-duration: 4s;
        }

        @keyframes demo03 {
            from {
                top: 25px;
                left: 25px;
                background-color: navy;
            }
            to {
                top: 25px;
                left: 300px;
                background-color: orangered;
            }
        }

        /* Animation 04: Kugel bleibt rechts liegen */

        #animate04 {
            width: 100px;
            height: 100px;
            padding: 0;

            left: 25px;
            border-radius: 50%;

            animation-name: demo04;
            animation-duration: 4s;

            animation-fill-mode: forwards;
        }

        @keyframes demo04 {
            from {
                top: 25px;
                left: 25px;
                background-color: navy;
            }
            to {
                top: 25px;
                left: 300px;
                background-color: orangered;
            }
        }

        /* Animation 05: Start verzögert mit animation-delay */

        #animate05 {
            width: 100px;
            height: 100px;
            padding: 0;
            top: 25px;
            left: 25px;
            border-radius: 50%;

            animation-name: demo05;
            animation-duration: 4s;

            animation-fill-mode: forwards;

            animation-delay: 800ms;
        }

        @keyframes demo05 {
            from {
                top: 25px;
                left: 25px;
                background-color: navy;
            }
            to {
                top: 25px;
                left: 300px;
                background-color: orangered;
            }
        }

        /* Animation 06: animation-timing-function: linear
           gleichmäßige Geschwindigkeit der Animation */

        #animate06 {
            width: 100px;
            height: 100px;
            padding: 0;
            top: 25px;
            left: 25px;
            border-radius: 50%;

            animation-name: demo06;
            animation-duration: 4s;

            animation-fill-mode: forwards;

            animation-delay: 800ms;

            animation-timing-function: linear;
        }

        @keyframes demo06 {
            from {
                top: 25px;
                left: 25px;
                background-color: navy;
            }
            to {
                top: 25px;
                left: 300px;
                background-color: orangered;
            }
        }

        /* Animation 07: Animation rückwärts abspielen */

        #animate07 {
            width: 100px;
            height: 100px;
            padding: 0;
            top: 25px;
            left: 25px;
            border-radius: 50%;

            animation-name: demo07;
            animation-duration: 4s;

            /* animation-fill-mode: forwards; */
            animation-delay: 800ms;

            animation-timing-function: linear;

            animation-direction: reverse;
        }

        @keyframes demo07 {
            from {
                top: 25px;
                left: 25px;
                background-color: navy;
            }
            to {
                top: 25px;
                left: 300px;
                background-color: orangered;
            }
        }

        /* Animation 07: Animation rückwärts abspielen */

        #animate08 {
            width: 100px;
            height: 100px;
            padding: 0;
            top: 25px;
            left: 25px;
            border-radius: 50%;

            animation-name: demo08;
            animation-duration: 4s;

            /* animation-fill-mode: forwards; */
            animation-delay: 800ms;

            animation-timing-function: linear;

            animation-direction: alternate;

            animation-iteration-count: infinite;
        }

        @keyframes demo08 {
            from {
                top: 25px;
                left: 25px;
                background-color: navy;
            }
            to {
                top: 25px;
                left: 300px;
                background-color: orangered;
            }
        }
            
          
!
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.
Loading ..................

Console