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="wrapper">
    <p>※使用したライブラリ<br><a href="https://daniellaharel.com/raindrops/" target="_blank">https://daniellaharel.com/raindrops/</a></p>
    <!--/wrapper-->
  </div>
  <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js" integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30=" crossorigin="anonymous"></script>
  <script src="https://assets.codepen.io/6329135/raindrops.js"></script>
</body>
              
            
!

CSS

              
                @charset "utf-8";

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

#wrapper {
  height: 100vh;
  /*テキストを中央寄せ*/
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-color: #00704a;
}

a,
p {
  color: #fff;
}

              
            
!

JS

              
                jQuery("#wrapper").raindrops(
  //指定したエリアに描画
  {
    color: "#7b5544", //コーヒーの色を指定
    canvasHeight: 450, //canvasの高さを指定。初期値は親の高さの50%。
    waveLength: 100, //波の長さ(広がり)を指定。数値が大きいほど長さは小さくなる。初期値は340。
    waveHeight: 200, //波の高さを指定。数値が大きいほど高さは高くなる。初期値は100。
    rippleSpeed: 0.05, //波紋のスピードを指定。数値が大きいほど波紋は速くなる。初期値は0.1。
    density: 0.04, //コーヒーの波紋の量を指定。数値が大きいほど波紋は小さくなる。初期値は0.02。
    frequency: 5 //コーヒーが落ちる頻度を指定。数値が大きいほど頻度は多くなる。初期値は3。
  }
);

              
            
!
999px

Console