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.


                <div id="root"></div>



                body {
    background-color: #4B0082;
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    text-transform: uppercase;

.container {
    width: 90%;
    height: 60vh;
    margin: 3.125rem auto 0 auto;
    margin-bottom: 4em;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 0.25rem;
    padding: 1em;
    box-sizing: border-box;
    text-align: center;
    background: rgba(0, 0, 0, 0.35);
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;

.container h1 {
    margin-top: 1.5em;
    font-size: 3rem;
    margin-bottom: 0.7em;

.container h2 {
    font-size: 1.5rem;
    font-weight: 200;
    font-style: italic;

@media only screen and (min-width: 500px) {
    .container {
        max-width: 550px;
        height: 80vh;


                class App extends React.Component{
    this.state={time:new Date()}

      time: new Date()
    setInterval(()=> this.currentTime(), 1000)
    const date = new Date()
    const hours = date.getHours()
    let color
    let timeOfDay
    let backgroundImage
    if (hours < 12) {
      color = "#ADFF2F"
      timeOfDay = "morning"
      backgroundImage = `url("")`
    } else if (hours >= 12 && hours < 17) {
      color = "#ff0000"
      timeOfDay = "afternoon"
      backgroundImage = `url("")`
    } else if (hours >= 17 && hours < 22) {
      color = "#00008B"
      timeOfDay = "evening"
      backgroundImage = `url("")`
    } else {
      color = "#ffffff"
      timeOfDay = "night"
      backgroundImage = `url("")`
     <div className="container" style={{ backgroundImage, color }} >
          <h2>Good {timeOfDay}..!</h2>

ReactDOM.render(<App />, document.getElementById("root"))