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.


                <article class="content">
    <h1>Lorem ipsum</h1>
    <p><a href="#" id="rss">RSS feed</a></p>
  <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
  <footer><p><button id="action">A button here</button></p></footer>

<div class="overlay">
  <div id="banner">
    <h2>Click anywhere to continue</h2>
  <div id="indication">
    <span class="message">Lorem ipsum</span>
   <svg class="arrow" width="50" height="20">
     <rect x="0" y="5" width="30" height="10" />
     <polygon points="30 0, 50 10, 30 20"/>


                .content {
  max-width: 600px;
  margin: 0 auto;

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;

#indication {
  position: absolute;
  display: none;

#banner {
  position: absolute;
  display: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: rgba(255, 255, 255, 0.8);
  padding: 1em;

.message { 
  margin: 0 0.5em;

.flipped {
  transform: scaleX(-1); 



                const TOUR = [
  { msg: 'Begin of tour'},
  { msg: 'Subscribe here to our RSS feed', selector: '#rss'}, 
  { msg: 'Dolors sit amet', selector: '#action'},
  { msg: 'Have fun!'}

const sign = document.querySelector('#indication');
const textBanner = document.querySelector('#banner');
const overlay = document.querySelector('.overlay');
var content = document.querySelector('.content');


function playTour(tour) { = 'block';

  let currentStep = 0;
  let clickHandler = function () {

    if (currentStep >= tour.length) { // end
      overlay.removeEventListener('click', clickHandler); = 'none';
    else {
  let click = overlay.addEventListener('click', clickHandler);

function showNext(step) {
  if (step.selector) { // element an arrow must point to = 'none'; = 'flex';
    pointMessage(sign, step.msg, document.querySelector(step.selector));
  else {
    textBanner.querySelector('h1').innerHTML = step.msg; = 'block'; = 'none';

function clipElement(el) {
  let containerBounds = content.getBoundingClientRect();
  let elBounds = el.getBoundingClientRect();
  let clip = {
    top: -,
    left: elBounds.left - containerBounds.left,
    right: containerBounds.left + containerBounds.width - (elBounds.left + elBounds.width),
    bottom: + containerBounds.height - ( + elBounds.height)
  let inset = `inset(${}px ${clip.right}px ${clip.bottom}px ${clip.left}px)`;['-webkit-clip-path'] = inset;['clip-path'] = inset;

function unclip() {['-webkit-clip-path'] = 'none';['clip-path'] = 'none';

function pointMessage(sign, msg, el) {
  const PADDING = 5;  
  let signBox = sign.getBoundingClientRect(); = `${el.offsetLeft - signBox.width - PADDING}px`; = `${el.offsetTop - signBox.height / 2 + el.getBoundingClientRect().height / 2}px`;