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 is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.


                <div id="circle-nav">
  <div class="title">
    <h1><span class="highlight">Bubble Gum Pop<span></h1>
  <div class="startBtn">
    <button id="startGame">Make Bubbles</button></div>

<div id="circle-canvas"></div>



@import url('');

$body: 'IBM Plex Mono', monospace;

body {
  margin: 0;
  font-family: $body;

.circle {
  border-radius: 100%;
  position: absolute;
  opacity: .8;

.circle, button {
    cursor: pointer;

#circle-canvas {
  position: relative;
  height: 100vw;
  max-width: 100%;

#circle-nav {
  height: 80px;
  background: #fff;
  display: flex;
  padding: 1em;
  justify-content: space-between;
  .title {
      h1 {
      margin: 0;
      font-weight: 500;
      border-bottom: 3px solid #f6d3dd; 

.startBtn {
    #startGame {
      border: none;
      background: #D62F61;
      color: #fff;
      text-align: center;
      padding: 1em;
      font-family: $body;
      font-weight: 500;
      font-size: 16px;



// array of colors
var colorsArray = [

// choose random color from array
function randomColor() {
  var color = colorsArray[Math.floor(Math.random() * colorsArray.length)];
    return color;

// generate random height and width
function randomSize() {
  var max = 250;
  var min = 40;
  var size = Math.floor(Math.random() * max) + min + 'px';   
  return size;

// generate random location
function randomLocation() {
  var location = Math.floor(Math.random() * 100) + 1 + '%';
  return location;


var body = document.querySelector('body');

var canvas = document.getElementById('circle-canvas');

var start = document.getElementById('startGame');
// add click event
start.addEventListener('click', function(){

  // but should say reset game after click
  // make this sticky
}, false);

// generate circles

function generateCircles() {
  var numOfCircles = 100;
  var circles = [];

  for ( var i = 0; i <= numOfCircles; i++ ) {
    var background = randomColor();
    var size = randomSize();
    var createCircle = document.createElement('div');
    circles[i] = createCircle;
    // circle attributes 
    circles[i].setAttribute('class', 'circle');
    circles[i].setAttribute('data-circle', i);
    // circle styles
    circles[i].style.backgroundColor = background;  
    circles[i].style.height = size;
    circles[i].style.width = size;
    circles[i] = randomLocation();
    circles[i].style.right = randomLocation();
    circles[i].style.bottom = randomLocation();
    circles[i].style.left = randomLocation();

     // append to body document

// create helper function to set attributes

// remove circle on click
// circle.addEventListener("click", function(event) {
//   body.appendChild(createCircle);
// }, false);