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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

    <div id="shine"></div>   
    Click background to test JS
    <p class="button">
      <span id="demo"></span>
        <i class= 'fa fa-empire fa-2x'   

@import url('https://fonts.googleapis.com/css?family=Space+Mono');
@import url('https://fonts.googleapis.com/css?family=Rubik+Mono+One');
@import url('https://fonts.googleapis.com/css?family=Monofett');
@import url('https://fonts.googleapis.com/css?family=Share+Tech+Mono');
@import url('https://fonts.googleapis.com/css?family=Nova+Mono');
html, body {
  height: 100%;
 /* overflow: hidden; */
body {
  background: #444;
   background-image: url("https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/e94ec4c4-842e-49bf-9b1e-a2336856856e/dcx7jrc-53062c97-b182-423f-a05a-069241a7d773.png/v1/fill/w_1280,h_800,q_80,strp/wp_dark_kanji_by_hroomha_dcx7jrc-fullview.jpg");
   background-size:     cover;                      /* <------ */
    background-repeat:   no-repeat;
    background-position: center center;    
  color: #fff;
  font-weight: 600;
    font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;


.button {
  background-image: linear-gradient(0deg, #222 0%, #555 49%, #999 100%);  
  position: relative;
  padding: 3px !important;;
  display: inline-block;
  border-radius: 20px;
   width: 450px;
/* inner span still changes size when numbers are diff size - 11 sec & 12 sec */
 span {
    display: inline-block; // newp
   /* box-sizing: content-box; // newp */
    width: 400px;
    background: #444;
    background-color: cyan;
  /*  background-image: linear-gradient(0deg, #63604c 0%, #f9efca 49%, #f4f1e3 100%); */
  /*  background-image: linear-gradient(0deg, #222, lime 40%, #eee 100%); */
    color: #5FF;
    font-family: "Nova Mono"; 
    text-transform: uppercase;
    text-shadow: #222 2px 2px 0px  , #000 4px 4px 20px;
    padding: 0.5rem 2rem ;
    border-radius: 25px;   
    border-style: groove;
    font-weight: 800;
    font-size: 40px;
    letter-spacing: .2rem ;
  color: orange;
  text-shadow: #222 2px 2px 0;
  padding: 10px;
  background-image: linear-gradient(0deg, #222, lime 40%, #eee 100%);
background: linear-gradient(to bottom, 
  rgba(255,255,255, 1) 0%,
  rgba(0,0,0,0) 80%,
  rgba(0,0,0,0) 100%);
  position: fixed; 
  height: 100px;
  width: 500px;
  left: 530px;
  top: 65px;
  z-index: 2;
   border-radius: 25px; 

              // CLOCK
var myVar = setInterval(function(){ myTimer() }, 1000);
function myTimer() {
    var d = new Date();
    var t = d.toLocaleTimeString();
    document.getElementById("demo").innerHTML = t;
// =========================================================
var rainColor;
function recolor()
  rainColor = "#"+("000"+(Math.random()*(1<<24)|0).toString(16)).substr(-6);
  var demo = document.getElementById("demo"); 
  var colz = "linear-gradient(0deg, #63604c 0%, " +  rainColor  + " 49%, #f4f1e3 100%)";
  //console.log("got " + colz); 
  document.getElementById("demo").style.backgroundImage = (colz);
// =========================
document.onclick = recolor;
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.