html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1">
</head>
<body>
<header class="header">
<h1 id="heading"></h1>
</header>
<main class="main">
<div class="clockContainer">
</div>
<div class="msg-modal" id="modal">
<span id="close">×</span>
<div class="msg">
<p id="msg"></p>
</div>
</div>
</main>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
* {
box-sizing: border-box;
}
body {
background: #000;
margin: 0;
color: #fff;
}
h1, h2, h3, h4, h5, h6 {
font-size: 35px;
text-shadow: 0px 3px 1px #00f, 0px 5px 2px #f00, 0px 7px 2px #0f0;
text-align: center;
}
.header {
}
.main {
height: 500px;
display: flex;
justify-content: center;
align-items: center;
font-size: 25px;
}
.clockContainer {
box-shadow: 2px 4px 4px #00f;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'use strict';
//alert('Ok');
// variables declaration
let date;
let time, h, m, s;
let y, mo, d;
// time, hours, minutes, seconds left.
let tLeft, hLeft, mLeft, sLeft;
let cC; // clock container
let c; // clock
let heading, modal, cls, msg;
// loads when Window loads
window.addEventListener('load', ()=> {
// getting clock Container
cC = document.getElementsByClassName('clockContainer')[0];
// create a p element in c
c = document.createElement('p');
// heading for h1
heading = document.getElementById('heading');
// modal window of message
modal = document.getElementById('modal');
// button to close modal window
cls = document.getElementById('close');
cls.addEventListener('click', ()=> {
modal.style.display = 'none';
});
// getting the p with the id msg
msg = document.getElementById('msg');
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run