Pen Settings

HTML

CSS

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

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

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.

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

              
                <head>
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <!--==============レイアウトを制御する独自のCSSを読み込み===============-->
  <link href="https://assets.codepen.io/6329135/reset04.css" rel="stylesheet">
</head>

<body>

  <div class="wrapper">
    <p>画面が読み込まれるとpng画像が1度だけ動く</p>
    <div class="steps"></div>
  </div>
  <!--/wrapper-->
</body>
              
            
!

CSS

              
                @charset "utf-8";

/*========= レイアウトのためのCSS ===============*/
.wrapper {
  text-align: center;
  padding: 0 0 100px 0;
}

p {
  text-align: center;
  padding: 20px 0;
  font-size: clamp(1rem, 2vw, 1.5rem);
  color: #333;
  white-space: nowrap;
  font-weight: bold;
}

.steps {
  margin: 0 auto;
}

/*=============== 画面が読み込まれるとpng画像が1度だけ動く =================*/

.steps {
  width: 100px; /*1フレーム分の横幅*/
  height: 100px; /*1フレーム分の縦幅*/
  background: url("https://assets.codepen.io/6329135/steps.png") no-repeat; /*背景画像の読み込み*/
  animation: stepsline 1s steps(3) forwards;
  /*stepsline→アニメーション名
    1s→アニメーションをする時間
    step→()の中には、アニメーション制作コマ数-1の値を入れる(例:4コマ-1コマ=3コマ)
    forwards→最後の形を維持*/
}

@keyframes stepsline {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: -300px 0; /*アニメーション制作コマ数から1コマ分引いた横幅を指定。
(例:今回は1フレーム横幅100pxで制作しているので全体の400px-100px=300px⇒-300px)を指定。*/
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console