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.


                <h1>Fun Facts</h1>
<h3>Why are there balls on the power lines?</h3>
<p>Power lines are thin and may be difficult to see by even low-flying aircraft, and we don't want airplanes colliding with them. The big marker balls are there to warn airplanes of the power lines.</p>
<a href="" title="Flashlight effect on GitHub" target="_blank">Flashlight effect on GitHub</a>

<div class="darkness" id="darkness">
  <div class="light" id="light">
    <div class="shadow"></div>


body {
    padding: 30px 90px;
    max-height: 100%;
    overflow: hidden;

a {
    background: #24292e;
    display: inline-block;
    padding: 15px;
    border-radius: 3px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    text-align: center;

/* Flashlight effect's styles */
.darkness {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
.light {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 100%;
    -webkit-box-shadow: 400vh 0px 0px 400vw rgba(0,0,0,0.99);
    -moz-box-shadow: 400vh 0px 0px 400vw rgba(0,0,0,0.99);
    box-shadow: 400vh 0px 0px 400vw rgba(0,0,0,0.99);
.shadow {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 100%;
    -webkit-box-shadow: inset 4px 0 37px 53px rgba(0,0,0,0.9);
    -moz-box-shadow: inset 4px 0 37px 53px rgba(0,0,0,0.9);
    box-shadow: inset 4px 0 37px 53px rgba(0,0,0,0.9);



                const light = document.getElementById('light');
const roomPosition = { 
    'top': document.getElementById('darkness').offsetTop,
    'left': document.getElementById('darkness').offsetLeft

const topMargin = + (window.innerHeight * Math.random());
const position = {
    left:  Math.random() * roomPosition.left,
    top: topMargin + 150 < window.innerHeight ? topMargin : topMargin - 350

function update(e) {

    var x = ( e.clientX - 150) || (e.touches[0].clientX - 150);
    var y = (e.clientY - 150) || (e.touches[0].clientY - 150); = x + "px"; = y + "px";


document.addEventListener('mousemove', update);
document.addEventListener('touchmove', update);