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 id="particles-js"></div>
  <div id="wrapper">
    <p class="panel">particles.js Demo<br><a href="https://vincentgarreau.com/particles.js/" target="_blank">https://vincentgarreau.com/particles.js/</a></p>
    <!--/wrapper-->
  </div>
  <script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
</body>
              
            
!

CSS

              
                @charset "utf-8";

/*========= レイアウトのためのCSS ===============*/

#wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #fff;
}

a {
  color: #fff;
}

/*========= particle js を描画するエリア設定 ===============*/

html,
body {
  height: 100%; /*高さを100%にして描画エリアをとる*/
}

#particles-js {
  position: fixed; /*描画固定*/
  z-index: -1; /*描画を一番下に*/
  width: 100%;
  height: 100%;
  background-color: #000; /*背景色*/
}

#wrapper {
  position: relative; /*描画を#particles-jsよりも上にするためposition:relative;を指定*/
  z-index: 1; /*z-indexの数字を大きくすることで描画を#particles-jsよりも上に*/
  width: 100%;
  height: 100%;
}

.panel {
  font-family: "Merienda", cursive;
  background: #fff;
  border-radius: 5px;
  padding: 20px;
  text-align: center;
  position: absolute;
  z-index: 1;
  color: #000;
}

a {
  color: #0bd;
}

              
            
!

JS

              
                particlesJS("particles-js", {
  particles: {
    number: {
      value: 125, //この数値を変更すると紙吹雪の数が増減できる
      density: {
        enable: false,
        value_area: 400
      }
    },
    color: {
      value: [
        "#EA5532",
        "#F6AD3C",
        "#FFF33F",
        "#00A95F",
        "#00ADA9",
        "#00AFEC",
        "#4D4398",
        "#E85298"
      ] //紙吹雪の色の数を増やすことが出来る
    },
    shape: {
      type: "polygon", //形状はpolygonを指定
      stroke: {
        width: 0
      },
      polygon: {
        nb_sides: 5 //多角形の角の数
      }
    },
    opacity: {
      value: 1,
      random: false,
      anim: {
        enable: true,
        speed: 20,
        opacity_min: 0,
        sync: false
      }
    },
    size: {
      value: 5.305992965476349,
      random: true, //サイズをランダムに
      anim: {
        enable: true,
        speed: 1.345709068776642,
        size_min: 0.8,
        sync: false
      }
    },
    line_linked: {
      enable: false
    },
    move: {
      enable: true,
      speed: 10, //この数値を小さくするとゆっくりな動きになる
      direction: "bottom", //下に向かって落ちる
      random: false, //動きはランダムにならないように
      straight: false, //動きをとどめない
      out_mode: "out", //画面の外に出るように描写
      bounce: false, //跳ね返りなし
      attract: {
        enable: false,
        rotateX: 600,
        rotateY: 1200
      }
    }
  },
  interactivity: {
    detect_on: "canvas",
    events: {
      onhover: {
        enable: false
      },
      onclick: {
        enable: false
      },
      resize: true
    }
  },
  retina_detect: true
});

              
            
!
999px

Console