Thursday, 10 October 2019

Count Timmer use in Java Script


Count timer














<!Doctype html>
<html>
<head>
<title> Count timer </title>
<style>
*{
margin:0px;
padding:0px;
}
div{
width:100%;
height:100vh;
display:flex;
flex-direction:column;
justify-content:center;
align-items:center;
background-image:linear-gradient(#db68e2,#1cd6ff);
}
p{
height: 100px;
    width: 700px;
    background-image: linear-gradient(#9C27B0,#9C27B0);
    color: #f3f3f7;
    text-align: center;
    font-size: 80px;
}
h1{
color:#fff;
font-family:cursive;
}
</style>
</head>
<body>
 <div>
 <h1> Count Down Start for New Year</h1>
<p id="time"></p>
 </div>
 <script>

 var date = new Date("jan 1,2020  12:00:00").getTime();
 var x = setInterval(function(){
 var current = new Date().getTime();
 var rest = date - current;
 var days = Math.floor(rest / (1000*60*60*24));
 var hours = Math.floor((rest % (1000*60*60*24)) / (1000*60*60));
 var min = Math.floor((rest % (1000*60*60)) / (1000*60));
 var sec = Math.floor((rest % (1000*60)) / 1000);
 document.getElementById("time").innerHTML = days+"d," + hours+"h:,"+min+"m:,"+sec+"s"
 },1000);
 </script>
</body>
</html>

No comments:

Post a Comment

SEO introduction

What is SEO? SEO(Search Engine Optimization ) is a technique that helps to bring the Website on top. Seo depends on the Keyword . Ke...