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">
  <p class="text">
    初めまして、<span class="marker">犬が大好きな犬専門カメラマンをやっていた戌年生まれのじゅんぺい</span>です🐶
  </p>
</div>
              
            
!

CSS

              
                /* マーカーのスタイル */
.marker {
  background-image: linear-gradient(90deg, #b7dbff, #b7dbff); /* 線の色 */
  background-position: left bottom; /* 線の起点を左・下に設定 */
  background-repeat: no-repeat;
  background-size: 0 .5em; /* 線の横幅を0、縦幅を0.5emに */
  padding-bottom: 3px; /* 下線を下にズラす */
  transition: background-size 1.5s; /* 線を伸ばすアニメーション実行時間を指定 */
}
/* マーカーが表示された時のスタイル */
.marker.active {
  background-size: 100% .5em; /* 線の横幅を100%にする */
}
/* レイアウトのためのスタイル */
.container {
  margin-bottom: 500px;
  margin-inline: auto;
  margin-top: 500px;
  max-width: 600px;
  padding-left: 20px;
  padding-right: 20px;
}
/* テキストのスタイル */
p {
  color: #333; /* 文字色 */
  font-size: clamp(16px, 5vw, 30px); /* 文字サイズ */
  line-height: 1.5; /* 行間 */
  text-align: center;
}

              
            
!

JS

              
                gsap.to(".marker", {
  scrollTrigger: {
    trigger: ".marker", // アニメーションが始まるトリガーとなる要素
    start: "top center", // アニメーションが始まる位置
    toggleClass: {
      targets: ".marker", // クラスを切り替える対象の要素
      className: "active", // クラス名 "active" を付け外し
    },
  },
});

              
            
!
999px

Console