Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <div class="BGWrapper">
    <div class="BGNight"></div>

</div>
<div class="clouds">
    <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 198.6 87.67'%3E%3Cpath fill='%23efefef' d='M337.25,263.73h-8.6A31.72,31.72,0,0,0,296.93,232h0a31.56,31.56,0,0,0-17,4.93,33.68,33.68,0,0,0-32.48-24.77h0a33.67,33.67,0,0,0-33.67,33.67h0a34,34,0,0,0,.24,3.93,14.44,14.44,0,0,0-18.31,14h-6.66A18.05,18.05,0,0,0,171,281.78h0a18.13,18.13,0,0,0,.16,2.3h-6.62a7.87,7.87,0,0,0,0,15.75H337.25a18.05,18.05,0,0,0,18.05-18.05h0A18.05,18.05,0,0,0,337.25,263.73Z' transform='translate(-156.7 -212.16)'/%3E%3C/svg%3E%0A" class="cloud c1">
  
    <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160.11 62.61'%3E%3Cpath fill='%23efefef' d='M320.31,255.8h-0.39A31.11,31.11,0,0,0,288.8,224.7h0a31.12,31.12,0,0,0-29.72,21.91,19.27,19.27,0,0,0-16.94-10.08h0a19.27,19.27,0,0,0-19.27,19.27h-13a15.75,15.75,0,0,0-15.75,15.75H183.82a7.87,7.87,0,1,0,0,15.75H320.31a15.75,15.75,0,0,0,15.75-15.75h0A15.75,15.75,0,0,0,320.31,255.8Z' transform='translate(-175.95 -224.7)'/%3E%3C/svg%3E" class="cloud c2">
  
    <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 551.1 227.99'%3E%3Cpath fill='%23efefef' d='M526.8,271v0h0a61.12,61.12,0,0,0-61.12-61.12h0a60.87,60.87,0,0,0-25.36,5.51A95.09,95.09,0,0,0,347.75,142h0a95.06,95.06,0,0,0-95.06,95.06h0A61.11,61.11,0,0,0,197.95,271H163.07a49.5,49.5,0,0,0-49.5,49.5H49.2a24.75,24.75,0,0,0-24.75,24.75h0A24.75,24.75,0,0,0,49.2,370H526.05a49.5,49.5,0,0,0,49.5-49.5h0A49.49,49.49,0,0,0,526.8,271Z' transform='translate(-24.45 -142.01)'/%3E%3C/svg%3E%0A" class="cloud c3">
  
    <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 347.98 148.78'%3E%3Cpath fill='%23efefef' d='M392.49,255.39h-2.33a73.79,73.79,0,0,0-73.79-73.79h0A73.74,73.74,0,0,0,252.76,218a49.74,49.74,0,0,0-20.88-4.58h0a50,50,0,0,0-49.3,41.94H152.41a37.5,37.5,0,0,0-37.5,37.5H100.76a18.75,18.75,0,1,0,0,37.5H392.49a37.5,37.5,0,0,0,37.5-37.5h0A37.5,37.5,0,0,0,392.49,255.39Z' transform='translate(-82.01 -181.61)'/%3E%3C/svg%3E%0A" class="cloud c4">
  
    <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 747.35 200.93'%3E%3Cpath fill='%23efefef' d='M798.18,356.46a71,71,0,0,0-50.44-20.94h-30.8c-2-99.75-83.47-180-183.69-180h0a183.78,183.78,0,0,0-168.8,111.07,83.52,83.52,0,0,0-47.88-15h0a84,84,0,0,0-79,55.56,46.55,46.55,0,0,0-37-18.26h0a46.63,46.63,0,0,0-46.63,46.63H101.27a71,71,0,0,0-50.44,20.94H798.18Z' transform='translate(-50.82 -155.54)'/%3E%3C/svg%3E%0A" class="cloud c5">
  
    <img src="data:image/svg+xml,%3Csvg id='stars' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1838.83 1020.83'%3E%3Cdefs%3E%3Cstyle%3E .cls-1 %7B fill: %23efefef; %7D %23small circle:nth-child(even) %7B animation: starsBlink 2.7s ease-in-out infinite alternate; %7D %23small circle:nth-child(odd) %7B animation: starsBlink 1.5s ease-in-out infinite alternate; %7D %23big circle:nth-child(even) %7B animation: starsBlink 3s ease-in-out infinite alternate; %7D %23big circle:nth-child(odd) %7B animation: starsBlink 1.7s ease-in-out infinite alternate; %7D @keyframes starsBlink %7B 0%25 %7Bopacity: .2;%7D 100%25 %7Bopacity: 1;%7D %7D %3C/style%3E%3C/defs%3E%3Ctitle%3Estars%3C/title%3E%3Cg id='big'%3E%3Ccircle class='cls-1' cx='80.92' cy='88.92' r='3.92'/%3E%3Ccircle class='cls-1' cx='1013.92' cy='625.92' r='3.92'/%3E%3Ccircle class='cls-1' cx='574.92' cy='682.92' r='3.92'/%3E%3Ccircle class='cls-1' cx='1164.92' cy='241.92' r='3.92'/%3E%3Ccircle class='cls-1' cx='682.92' cy='139.92' r='3.92'/%3E%3Ccircle class='cls-1' cx='1389.92' cy='802.92' r='3.92'/%3E%3Ccircle class='cls-1' cx='892.92' cy='517.92' r='3.92'/%3E%3Ccircle class='cls-1' cx='97.92' cy='745.92' r='3.92'/%3E%3Ccircle class='cls-1' cx='253.92' cy='490.92' r='3.92'/%3E%3Ccircle class='cls-1' cx='1548.92' cy='220.92' r='3.92'/%3E%3Ccircle class='cls-1' cx='1683.92' cy='577.92' r='3.92'/%3E%3Ccircle class='cls-1' cx='1551.92' cy='955.92' r='3.92'/%3E%3Ccircle class='cls-1' cx='628.92' cy='430.92' r='3.92'/%3E%3Ccircle class='cls-1' cx='886.92' cy='991.92' r='3.92'/%3E%3C/g%3E%3Cg id='small'%3E%3Ccircle class='cls-1' cx='947.92' cy='486.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='373.92' cy='430.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='598.92' cy='301.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1293.92' cy='223.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1479.92' cy='151.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1506.92' cy='418.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1176.92' cy='532.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1260.92' cy='439.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1593.92' cy='865.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1015.92' cy='892.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='742.92' cy='940.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='712.92' cy='754.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='595.92' cy='628.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='337.92' cy='751.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='142.92' cy='865.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='46.92' cy='511.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='232.92' cy='196.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='391.92' cy='94.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='421.92' cy='304.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='952.92' cy='367.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1512.92' cy='772.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1317.92' cy='589.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='454.92' cy='952.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1051.92' cy='232.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='577.92' cy='283.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1749.92' cy='1.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1800.92' cy='322.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1836.92' cy='187.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1194.92' cy='100.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='622.92' cy='106.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1.92' cy='268.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1284.92' cy='1018.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1743.92' cy='907.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='1809.92' cy='787.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='382.92' cy='1003.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='40.92' cy='964.92' r='1.92'/%3E%3Ccircle class='cls-1' cx='115.92' cy='244.92' r='1.92'/%3E%3C/g%3E%3C/svg%3E%0A" class="stars">
</div>
<div class="bodyWrapper">
    <h1>A checkbox</h1>
    <h6>Because the standard one is boring</h6>

    <div class="select">
        <label class="slider">
            <input type="checkbox" id="check">
            <span class="circle"></span>
        </label>
    </div>
</div>
              
            
!

CSS

              
                * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
body {
    font-family: 'Roboto', sans-serif;
    color: #efefef;
    /*background-color: #0E2234;*/
    transition: background .3s;
    /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#0e2234+0,183a59+100 */
    background: #0e2234; /* Old browsers */
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}
body.bodyChecked div.BGWrapper div {
    transform: translateX(-66.66666%);
}
div.BGWrapper {
    width: 100%;
    height: 100%;


    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    overflow: hidden;


}
div.BGWrapper div {
    width: 300%;
    height: 100%;
    /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#0e2234+0,27bce5+100 */
    background: #0e2234; /* Old browsers */
    background: -moz-linear-gradient(45deg,  #0e2234 0%, #27bce5 100%); /* FF3.6-15 */
    background: -webkit-linear-gradient(45deg,  #0e2234 0%,#27bce5 100%); /* Chrome10-25,Safari5.1-6 */
    background: linear-gradient(45deg,  #0e2234 0%,#27bce5 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0e2234', endColorstr='#27bce5',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
    transition: transform .5s ease-in-out;
}

h1 {
    text-align: center;
    margin-top: 30px;
    font-weight: 100;
    font-size: 3em;

}
h2 {
    text-align: center;
    font-weight: 100;
}
h6 {
    text-align: center;
    font-weight: 400;
}
div.select {
    display: flex;
    justify-content: center;
}


input[type="checkbox"] {
    display: none;
}

input[type="checkbox"]:checked + span.circle {
    left: 64px;
    background-color: #FABC62;
    box-shadow: 0 0 40px 0 #FABC62;
}
input[type="checkbox"]:checked + span.circle::before, input[type="checkbox"]:checked + span.circle::after {
    background-color: rgba(250, 188, 98, 0);
}
label.slider {
    margin-top: 50vh;
    border: 6px solid #06121C;
    border-radius: 100px;
    width: 128px;
    height: 64px;
    position: relative;
    background-color: #06121C;
    box-sizing: content-box;
    z-index: 1;
    /*overflow: hidden; Add if using span.circle::before */
    transition: border .3s, background-color .3s, box-shadow .3s;
    cursor: pointer;
}
label.slider.isChecked {
    border: 6px solid #167694;
    background-color: #167694;
}
label.slider:hover {
    box-shadow: 0 0 6px rgba(239, 239, 239, 0.32);
}
span.circle {
    position: absolute;
    width: 64px;
    height: 64px;
    background-color: #FEFAF4;
    border-radius: 50%;
    top: 0;
    left: 0;
    transition: left .3s, background-color .7s, box-shadow .3s;
    box-shadow: 0 0 20px 0 #FEFAF4;
}
span.circle::before, span.circle::after {
    content: '';
    background-color: #dcd8d3;
    position: absolute;
    border-radius: 50%;
    transition: background-color .7s;
}
span.circle::before {
    height: 6px;
    width: 6px;
    bottom: 10px;
    right: 20px;
}
span.circle::after {
    height: 10px;
    width: 10px;
    bottom: 20px;
    right: 10px;
}
/* used for color slide in from the side
span.circle::before {
    content: '';
    background-color: rgba(17, 220, 67, 1);
    height: 64px;
    width: 128px;
    z-index: -1;
    position: absolute;
    left: -96px;
}
*/
div.clouds {
    height: 100vh;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
}
img.cloud {
    position: absolute;
    opacity: 0;
    transition: opacity .3s;
    transition-delay: .3s;
}
img.c1 {
    top: 11%;
    left: 34%;
    width: 10%;
    animation: movingClouds 10s linear infinite;
}
img.c2 {
    top: 14%;
    left: 78%;
    width: 8%;
    animation: movingClouds 13s linear infinite;}
img.c3 {
    top: 40%;
    left: 10%;
    width: 30%;
    animation: movingClouds 15s linear infinite;}
img.c4 {
    top: 37%;
    left: 60%;
    width: 18%;
    animation: movingClouds 18s linear infinite;}
img.c5 {
    bottom: 0;
    left: 55%;
    width: 40%;
    animation: movingClouds 20s linear infinite;
}
@keyframes movingClouds {
    0% {left: 110%;}
    100% {left: -50%;}
}

img.stars {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 1;
    transition: opacity .3s;
}

body.bodyChecked img.stars {
    opacity: 0;
}


              
            
!

JS

              
                $(document).ready(function(){

    //Toggle Class to change border on label, and add class to body
    $("#check").change(function(){
        if($(this).is(":checked")) {
            $(".slider").addClass("isChecked");
            $("body").addClass("bodyChecked");
            $(".cloud").css("opacity",".5");
        } else {
            $(".slider").removeClass("isChecked");
            $("body").removeClass("bodyChecked");
            $(".cloud").css("opacity","0");
        }
    });

});
              
            
!
999px

Console