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


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


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.


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.


                <h1 id="heading">恐るべきスピード。</h1>
<p id="paragraph">M1アーキテクチャの卓越したパフォーマンスを、プロユーザーのためにまったく新しいレベルに進化させるチップ。それが、M1 Proです。最大10個のCPUコア。最大16個のGPUコア。16コアのNeural Engine。そしてH.264、HEVC、ProResコーデックに対応する専用のエンコードとデコード用メディアエンジン。どんなに壮大なプロジェクトでも簡単に形にできます。</p>

<p class="scroll">↓ スクロール ↓</p>


                #heading {
  background-image: linear-gradient(
    rgb(37, 47, 255) 0%,
    rgb(124, 192, 226) 100%,
    rgb(37, 47, 255) 200%
  font-size: 4rem;
  font-weight: bold;
  -webkit-text-fill-color: transparent;
  text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
#paragraph {
  font-size: 21px;
  color: #a1a1a6;
  line-height: 1.4;

body {
  background: #000;
  padding: 100vh 1rem;
  font-weight: 600;
  font-family: "SF Pro JP", sans-serif;
.scroll {
  text-align: center;
  position: fixed;
  top: 0;
  width: 100%;
  color: #fff;


                // 着火点となる要素
const p = document.getElementById("paragraph");

const options = {
  threshold: buildThresholdList()

// 実行するよ
const observer = new IntersectionObserver(showElements, options);

// p に到達したら発動

// threshold の設定
function buildThresholdList() {
  let thresholds = [];
  let numSteps = 20;

  for (let i = 1; i <= numSteps; i++) {
    let ratio = i / numSteps;
  return thresholds;

// 要素が表示されたら実行する動作
function showElements(entries) {
  entries.forEach((entry) => {
    if (entry.isIntersecting) {
      let ratio = Math.round(entry.intersectionRatio * 100);

      const heading = document.getElementById("heading"); = `
        rgb(37, 47, 255) ${0 - ratio}%,
        rgb(124, 192, 226) ${100 - ratio}%,
        rgb(37, 47, 255) ${200 - ratio}%