Giter VIP home page Giter VIP logo

1-gotit's Introduction

gotit

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>greeting2</title>

<style>

    /*CSS RESETS*/

body{ background-color: #fff; line-height: 1.6;

}

h1 { margin-top: 0; }

/CSS START/

.full-table { display: table; height: 100%; width: 100%; }

.table-cell { display: table-cell; vertical-align: middle; text-align: center; }

.card { padding: 10px 25px 10px 25px; border-radius: 10px; background: #F6D6FF; width: 85vw; color: #fff; display: inline-block; box-shadow: 2px 2px 1px 0px #330835; }

.card:hover { margin-top: 2px; box-shadow: none; }

.clock { display: inline; font-family: 'Bebas Neue', cursive; font-size: 2em;

}

.time { display: inline; min-width: 37px; }

.colon { font-size: 1.1em; display: inline-block; }

.date { display: inline; min-width: 162px; font-family: 'Bebas Neue', cursive; font-size: 2em; padding-right: 30px; } .greet{

display:inline;
font-family: 'Dancing Script', cursive;
font-size: 2rem;
 padding-right: 30px;

}

</style>
<div class="card">
    <div class="greet" id="greet"></div>
  <div class="date" id="date"></div>
  <div class="clock">
    <div class="time" id="hour"></div>
    <div class="colon">:</div>
    <div class="time" id="min"></div>
    <div class="colon">:</div>
    <div class="time" id="sec"></div>
  </div>
</div>
<script> function date() { var today = new Date(); document.getElementById('date').innerHTML = today.toDateString(); } function clock() { var today = new Date(); var hour = zeros(twelveHour(today.getHours())); var minutes = zeros(today.getMinutes()); var seconds = zeros(today.getSeconds()); if(today.getHours() >=12){ seconds+=" pm" } else{ seconds+=" am" } hrs = today.getHours(); if (hrs < 12) greet = 'Good Morning '; else if (hrs >= 12 && hrs <= 17) greet = 'Good Afternoon '; else if (hrs >= 17 && hrs <= 24) greet = 'Good Evening '; // console.log(today.toLocaleTimeString()); document.getElementById('greet').innerHTML = greet; document.getElementById('hour').innerHTML = hour; document.getElementById('min').innerHTML = minutes; document.getElementById('sec').innerHTML = seconds; } function twelveHour(hour) { if (hour > 12) { return hour -= 12 } else if (hour === 0) { return hour = 12; } else { return hour } } // adds zero infront of single digit number function zeros(num) { if (num < 10) { num = '0' + num }; return num; } function dateTime() { date(); clock(); setTimeout(dateTime, 500); } dateTime() // END </script>

1-gotit's People

Contributors

ldavis1011 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.