Skip to content

Commit

Permalink
structured files (codemaniac-sahil#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
Misterr-H authored Oct 4, 2022
1 parent b0ff54f commit 3103b3a
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 90 deletions.
File renamed without changes
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Javascript clock </title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="styles/style.css">
</head>
<body>
<div class="navbar">
<img src="js_logo.svg" alt="logo">
<img src="assets/images/js_logo.svg" alt="logo">
<ul class="navlinks">

<li><a href="https://angry-hodgkin-eb3dce.netlify.app/
Expand All @@ -27,6 +27,6 @@ <h1>Javascript clock</h1>
<p id="timep">Time : <span id="clock"></span></p>
<p id="timep">Date : <span id="day"></span></p>
</div>
<script src="script.js"></script>
<script src="js/script.js"></script>
</body>
</html>
78 changes: 39 additions & 39 deletions script.js → js/script.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
let time;
let date;
let a;
const option = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
setInterval(() => {
a = new Date();
s = a.getHours()
f = a.getSeconds()
if (f < 10) {
f = '0' + f;
}
if (s < 10) {
s = '0' + s;
}
m = a.getMinutes()
if (m < 10) {
m = '0' + m;
}

time = s + ':' + '' + m + ':' + '' + f;
date = a.toLocaleDateString(undefined, option);
document.getElementById('clock').innerHTML = time;
document.getElementById('day').innerHTML = date;
}, 1000

)
a = new Date();
s = a.getHours()
if (s<12){
document.getElementById('time').innerHTML = " Morning";
document.body.style = "background-image:linear-gradient(yellow,orange);";
}else if (s<16) {
document.getElementById('time').innerHTML = " Afternoon";
document.body.style = "background-image:linear-gradient(red,yellow);";
}else{
document.getElementById('time').innerHTML = " Evening";
document.body.style = "background-image:linear-gradient(black,gray);";
}
let time;
let date;
let a;
const option = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
setInterval(() => {
a = new Date();
s = a.getHours()
f = a.getSeconds()
if (f < 10) {
f = '0' + f;
}
if (s < 10) {
s = '0' + s;
}
m = a.getMinutes()
if (m < 10) {
m = '0' + m;
}

time = s + ':' + '' + m + ':' + '' + f;
date = a.toLocaleDateString(undefined, option);
document.getElementById('clock').innerHTML = time;
document.getElementById('day').innerHTML = date;
}, 1000

)
a = new Date();
s = a.getHours()
if (s<12){
document.getElementById('time').innerHTML = " Morning";
document.body.style = "background-image:linear-gradient(yellow,orange);";
}else if (s<16) {
document.getElementById('time').innerHTML = " Afternoon";
document.body.style = "background-image:linear-gradient(red,yellow);";
}else{
document.getElementById('time').innerHTML = " Evening";
document.body.style = "background-image:linear-gradient(black,gray);";
}

96 changes: 48 additions & 48 deletions style.css → styles/style.css
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
body{
margin: 0;
padding: 0;
background-color: black;
font-family: Verdana, Geneva, Tahoma, sans-serif;
color: white;
}
.navbar{
background-color: #242424;
display: flex;
position: sticky;
top:0;


}
.navbar img{
width: 5%;
}
.navlinks{
list-style: none;
display: flex;
align-items: center;
justify-content: center;


}
.navlinks a{
text-decoration: none;
color: white;
padding-left: 10px;

}
.container{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
.container h1{
font-size: 80px;
}
#clock,#timep{
font-size: 40px;
}
.container p{
font-size: 30px;
}
body{
margin: 0;
padding: 0;
background-color: black;
font-family: Verdana, Geneva, Tahoma, sans-serif;
color: white;
}
.navbar{
background-color: #242424;
display: flex;
position: sticky;
top:0;


}
.navbar img{
width: 5%;
}
.navlinks{
list-style: none;
display: flex;
align-items: center;
justify-content: center;


}
.navlinks a{
text-decoration: none;
color: white;
padding-left: 10px;

}
.container{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
.container h1{
font-size: 80px;
}
#clock,#timep{
font-size: 40px;
}
.container p{
font-size: 30px;
}

0 comments on commit 3103b3a

Please sign in to comment.