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

              
                <p>ゆっくりスクロールして下さい↓</p>
<div class="container">
  <div class="box">
    <img
      src="https://junpei-sugiyama.com/wp-content/uploads/2021/07/Joy-1024x1024.png"
      alt=""
    />
  </div>
  <div class="box">
    <img
      src="https://junpei-sugiyama.com/wp-content/uploads/2021/07/Question-1024x1024.png"
      alt=""
    />
  </div>
  <div class="box">
    <img
      src="https://junpei-sugiyama.com/wp-content/uploads/2021/07/Sleepy-1024x1024.png"
      alt=""
    />
  </div>
  <div class="box">
    <img
      src="https://junpei-sugiyama.com/wp-content/uploads/2021/07/Cry-1024x1024.png"
      alt=""
    />
  </div>
  <div class="box">
    <img
      src="https://junpei-sugiyama.com/wp-content/uploads/2021/07/Inspiration-1024x1024.png"
      alt=""
    />
  </div>
</div>
              
            
!

CSS

              
                .container {
  display: flex;
  margin-bottom: 300px;
  margin-top: 300px;
}
.box {
  height: 15vw;
  width: 15vw;
}
p {
  font-size: 20px;
  margin: 20px;
  position: fixed;
  top: 0;
}
img {
  width: 100%;
}
              
            
!

JS

              
                gsap.fromTo(
  ".box", // アニメーションさせる要素
  {
    rotate: 0,
    scale: 0,  // 縦横0.5倍
    y: 50, // アニメーション開始前の縦位置(下に50px)
    autoAlpha: 0, // アニメーション開始前は透明
  },
  {
    rotate: 360,
    scale: 1.2,  // 縦横1.2倍
    y: 0, // アニメーション後の縦位置(上に100px)
    autoAlpha: 1, // アニメーション後に出現(透過率0)
    stagger: 0.2, // 0.2秒遅れて順番に再生
    duration: 1.5, // 1.5秒間アニメーション
    ease: "bounce.out", // イージング
    scrollTrigger: {
      trigger: ".box", // アニメーションが始まるトリガーとなる要素
      toggleActions: "play none none reverse", // 上スクロールで戻る
      start: "top center", // アニメーションの開始位置
      markers: true, // マーカー表示
    },
  }
);
              
            
!
999px

Console