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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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.


                <main style="background-color: rgba(0,0,0,0.2);">
  <div class="container">
    <div id="txt"></div>




                .container {
    display: flex;
    justify-content: center;

#txt {
    width: auto;
    padding: 2% 2% 2% 2%;
    color: greenyellow;
    font-family: verdana;
    margin-top: 17%;
    font-size: 122px;



                //function for js clock
function startTime() {
    var today = new Date();
    var h = today.getHours();
    var m = today.getMinutes();
    var s = today.getSeconds();

    // Adds leading zero 0
    h = (h < 10) ? '0' + h : h;
    m = (m < 10) ? '0' + m : m;
    s = (s < 10) ? '0' + s : s;

    // shows clock
    document.getElementById('txt').innerHTML = h + ":" + m + ":" + s;

    setTimeout(startTime, 500);

var now = new Date(),
    hour = now.getHours(),
    color = "#000";

if (hour >= 6 && hour < 12) {
  color = "#e09572";
} else if (hour >= 12 && hour < 18) {
  color = "#e0bfb0";
} else if (hour >= 18) {
  color = "#94624b";
//fade in the background according to whatever 'color' we set with the conditions above"html", 2, {backgroundColor:color});


//slide in the clock from the left and fade it in.
TweenMax.from(".container", 2, {x:"-=200", opacity:0});