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.


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.


                <!DOCTYPE html>
<html lang="pt-br">
  <!--  Meta  -->
  <meta charset="UTF-8" />
  <!--  Styles  -->
  <link rel="stylesheet" href="estilo.css">
<body onload="atualizar()"> <!-- Chama a funcao do arqvo js -->
  <div class="quadro">
      <h1> HORAS</h1> 
        <div id="relogio"> O relógio fica aqui</div>
          <img id="imagem" src="" alt="fofura"> 
            <!--nao coloquei o alt= "" pra ver o que acontece: nao rola a imagem-->
          <p id="mensagem"> Tomara que hoje seja um bom dia. </p> 

      <button id="botao" onClick='festa()'> Começar o Happy hour!</button>   
    <p> &copy; Gesiane: Praticando. 2019.</p>
  <!-- Scripts -->
  <script src="hora.js"></script>


    background-color: #FFFF00;
.quadro {
    align-items: center; /* nao funciona*/
    width: 50%;
    max-width: 960px;
    margin: 50px auto;
    text-align: center;
    background-color: rgba(105, 105, 105, 0.5);
    padding-top: 5px;
    padding-bottom: 20px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 20px;
    color: white;
    text-align: center;
    font: small-caps;
    display: block;
    text-align: center;
    font-size: 30px;


    max-width: 90%;
    font-size: 180%;

 button {
    width: 70%;
    background-color: black;
    border: none;
    text-align: center;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif ;
    font-size: 20px;
    color: white;
    padding: 1%;

    font-size: 10px;
    font-style: italic;
    text-align: right;



                // copiei do w3school. Mostrar o relógio:

var span = document.getElementById('relogio');

function time() {
  var d = new Date();
  var s = d.getSeconds();
  var m = d.getMinutes();
  var h = d.getHours();
  span.textContent = h + ":" + m + ":" + s;
setInterval(time, 1000);

//Pra mostrar de acordo com o horário
function atualizar() {

  var data = new Date();
  var hora = 21//data.getHours();
  var msgJS = window.document.getElementById("mensagem");
  var img = window.document.getElementById("imagem");

    if (hora >= 6 && hora < 8) {
      img.src=''; '#00ffff'
      msg = "Acorda, xuxin!!";
    } else if (hora >= 11 && hora < 14) {
      img.src=''; '#FF4233'
      msg = "Hora de comer!";

    } else if (hora >= 17 && hora <21) {
      img.src=''; '#ff00ff'
      msg = "Happy Hour!";

    } else if (hora >=21){
      img.src=''; '#02404b'
      msg= "Hora de mimi!";
    } else { //Por cauda dos parênteces vazios nao tava funcionando o relogio
      img.src= "";
      msgJS.innerHTML= msg

// Botao do c@r@|ho >/ ! id="botao" onclick="festa()"

function festa(){
  //botao.innerHTML= "Acabar a festa =(";
  // "#ff944d"; 0; '#ff00ff';
  mensagem.innerHTML= "Happy Hour!";
  imagem.src = '';

/*function acaboufesta(){
    botao.innerHTML= "Mais festa"; "#f00"; '#ff00ff';}