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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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.


                <div class="bubbling">fushigi no monogatari</div>


                @import url('');

body {
  display: flex;
  height: 100vh;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #3498db;

.bubbling {
  position: relative;
  z-index: 2;
  display: inline-block;
  color: white;
  font-size: 2.5rem;
  font-family: 'Bubblegum Sans', cursive;
  font-weight: bold;
  text-transform: uppercase;

.bubble {
  position: absolute;
  background: white;
  border-radius: 100%;


                // For a better performance, use requestAnimationFrame instead of setInterval
const requestInterval = (fn: Function, delay: number) => {
  let start = new Date().getTime();
  let handle = { value: 0 };
  let loop = () => {
    handle.value = requestAnimationFrame(loop);
    let current = new Date().getTime();
    let delta = current - start;
    if (delta >= delay) {
      start = new Date().getTime();
  handle.value = requestAnimationFrame(loop);
  return handle;
const sample = (arr: any[]) => arr[Math.floor(Math.random() * arr.length)];

let bubbleSizes = [3, 6, 9, 12];
let bubbleText = document.querySelector(".bubbling");
let bubblePositions = Array.from(
  Array((bubbleText as HTMLElement).offsetWidth).keys()
requestInterval(() => {
  let bubbleSize = sample(bubbleSizes);
  let bubblePosition = sample(bubblePositions);
  let bubble = document.createElement("div");
  bubble.className = "bubble"; = `${bubbleSize}px`; = `${bubbleSize}px`; = `${bubblePosition}px`;
  let bubbleAnimation = bubble.animate(
    [{ bottom: "10px", opacity: 1 }, { bottom: "180%", opacity: 0.6 }],
      fill: "forwards",
      duration: 3000
  bubbleAnimation.onfinish = () => bubble.remove();
}, 300);