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.


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>Spotlight Center X</div>
<div id="valueDisplay">10</div>
<input type="range" id="slider" min="0" max="500" step="1" value="400"
<div>Spotlight Center Y</div>
<div id="valueDisplay2">0</div>
<input type="range" id="slider2" min="0" max="370" step="1" value="50"

<svg xmlns="" version="1.1" x="0" y="0" width="800px" height="600px">
        <filter id="f1" x="0%" y="0%" width="100%" height="100%">

       <feDiffuseLighting result = "diffOut" diffuseConstant = "1" lighting-color = "white">
            <feSpotLight id="spotlight" x = "100" y = "200" z = "150" pointsAtX = "200" pointsAtY = "400" pointsAtZ = "40" specularExponent ="12" limitingConeAngle="70"/>

     <feColorMatrix in="diffOut" result="alphaMap" type="luminanceToAlpha"/>
            <feComponentTransfer in="alphaMap" result="invertlight">
                <feFuncA type="table" tableValues="1 0 0 0 0"/>
          <feGaussianBlur in="invertlight" result="featherspot" stdDeviation="10"/>
     <feComposite operator="xor" result="infocus" in2="SourceGraphic" in="featherspot"/>
            <feGaussianBlur in="SourceGraphic" result="outfocus" stdDeviation="3"/>
            <feComposite operator="over" in="infocus" in2="outfocus"/>     
    <image x="0" y="0" width="550" height="370" preserveAspectRatio="true"
    filter="url(#f1)" xlink:href=""


                svg {
    margin: 50px 50px;
input[type=range] {
    width: 300px;
    height: 10px;


                  var slider = document.getElementById("slider");
    var blurDisplay = document.getElementById("valueDisplay");
    var blurValue = document.getElementById("spotlight");
    slider.addEventListener('change', changeBlur, false);

    function changeBlur() {
        blurDisplay.innerHTML = slider.value;
        blurValue.setAttribute("x", slider.value);

    var slider2 = document.getElementById("slider2");
    var mixDisplay = document.getElementById("valueDisplay2");
    var mixValue = document.getElementById("spotlight");
    slider2.addEventListener('change', changeMix, false);

    function changeMix() {
        mixDisplay.innerHTML = slider2.value;
        mixValue.setAttribute("y", slider2.value);