Pen Settings



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


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.


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.






                const setting = {
  cricleNum: 20, // オブジェクトの総数
  cx: 0, // 中心点xの座標位置
  cy: 0, // 中心点yの座標位置
  h: 100, // 円の半径
  angle: 0.01 // 円全体の角度

// dat.GUI を使うための準備
const gui = new dat.GUI();
gui.add(setting, 'angle', 0, 1);
gui.add(setting, 'h', 0, window.innerHeight);
gui.add(setting, 'CirclesNum', 1, 40).step(1);
gui.add(setting, 'cx', 0, window.innerWidth).listen();
gui.add(setting, 'cy', 0, window.innerHeight).listen();

// 最初に実行される処理
function setup() {
  createCanvas(windowWidth, windowHeight); // ウィンドウのサイズでキャンバスを作る = width / 2; // x軸の中心座標を求めて に代入する = height / 2; // y軸の中心座標を求め

// 毎フレームごとに実行される処理
function draw() {
  clear(); // 前のフレームで描画されているものをクリアする
  background('rgba(76,141,161,1)'); // 背景を塗りつぶす
  noStroke(); // 線を描画しない
  fill("rgb(254,240,195)"); // 塗りつぶしの色指定

  [ Array(setting.cricleNum)].forEach((_, i) => {
    const _rad = i / setting.cricleNum * PI * 2 + setting.angle; //  現在の円のインデックス / 円の総数 * 2π + 円全体の角度
    const x = setting.h * cos(_rad) +; // x座標を求める
    const y = setting.h * sin(_rad) +; // y座標を求める
    ellipse(x, y, 10, 10); // 円を描画する