25/11/2023
az
*
{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'poppins', sans-serif;
}
body
{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: rgba(01,99,79,0.99);
}
.container
{
position: relative;
background: lightsteelblue;
/* min-height: 500px;*/
border-radius: 20px;
border-top-left-radius: 225px;
border-top-right-radius: 225px;
box-shadow: 25px 25px 75px rgba(0,0,0,0.75),
inset 5px 5px 10px rgba(0,0,0,0.5),
inset 5px 5px 20px rgba(255,255,255,0.2),
inset -5px -5px 15px rgba(0,0,0,0.75);
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.azom
{
position: absolute;
border: 5px solid red;
padding: 20px;
background-color: aliceblue;
border-radius: 20px;
margin: auto;
width: 65%;
left: 550px;
text-align: center;
bottom: 0px;
}
.azom h1
{
font-size: 30px;
}
.clock
{
position: relative;
width: 450px;
height: 450px;
background: ;
border-radius: 50%;
box-shadow: 10px 50px 70px rgba(0,0,0,0.25),
inset 5px 5px 10px rgba(0,0,0,0.5),
inset 5px 5px 20px rgba(255,255,255,0.2),
inset -5px -5px 15px rgba(0,0,0,0.75);
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 30px;
}
.clock::before
{
content: '';
position: absolute;
width: 4px;
height: 4px;
background: ;
border: 3px solid ;
border-radius: 50%;
z-index: 100000;
}
.clock span
{
position: absolute;
inset: 20px;
color: ;
text-align: center;
transform: rotate(calc(30deg *var(--i)));
/* 360/12 = 30deg */
}
.clock span b
{
font-size: 2em;
opacity: 100;
font-weight: 600;
display: inline-block;
transform: rotate(calc(-30deg * var(--i)));
}
.circle
{
position: absolute;
width: 300px;
height: 300px;
border: 2px solid white;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: flex-start;
z-index: 10;
}
.circle i
{
position: absolute;
width: 6px;
height: 50%;
background: var(--clr);
opacity: 0.75;
transform-origin: bottom;
transform: scaleY(0.5);
}
.circle:nth-child(1) i
{
width: 2px;
}
.circle:nth-child(2) i
{
width: 6px;
}
.circle2
{
width: 240px;
height: 240px;
z-index: 9;
}
.circle3
{
width: 180px;
height: 180px;
z-index: 8;
}
.circle::before
{
content: '';
position: absolute;
top: -8.5px;
width: 15px;
height: 15px;
border-radius: 50%;
background: var(--clr);
box-shadow: 0 0 20px var(--clr),
0 0 60px var(--clr);
}
/* digital clock style */
{
margin-bottom: 40px;
display: flex;
padding: 10px 20px;
font-size: 2em;
font-weight: 600;
background-color: dimgray;
border: 2px solid rgba(0,0,0,0.5);
border-radius: 40px;
box-shadow: 5px 5px 10px rgba(0,0,0,0.5),
inset 5px 5px 20px rgba(255,255,255,0.2),
inset -5px -5px 15px rgba(0,0,0,0.75);
}
div
{
position: relative;
width: 60px;
text-align: center;
font-weight: 500;
color: var(--clr);
}
div:nth-child(1)::after,
div:nth-child(2)::after
{
content: ':';
position: absolute;
right: -4px;
}
div:last-child
{
font-size: 0.5em;
display: flex;
justify-content: center;
align-items: center;
color: ;
}
div:nth-child(2)::after
{
animation: animate 1s steps(1) infinite;
}
animate
{
0%
{
opacity: 1;
}
50%
{
opacity: 0;
}
}
Azom khan Chowdhury
1
2
3
4
5
6
7
8
9
10
11
12
00
00
00
AM
let hr = document.querySelector(' ');
let mn = document.querySelector(' ');
let sc = document.querySelector(' ');
setInterval(() => {
let day = new Date();
let hh = day.getHours() * 30;
let mm = day.getMinutes() * 6;
let ss = day.getSeconds() * 6;
hr.style.transform = `rotate(${hh + (mm / 12)}deg)`;
mn.style.transform = `rotate(${mm}deg)`;
sc.style.transform = `rotate(${ss}deg)`;
// Digital clock
let hours = document.getElementById('hour');
let minutes = document.getElementById('minutes');
let seconds = document.getElementById('seconds');
let ampm = document.getElementById('ampm');
let h = day.getHours();
let m = day.getMinutes();
let s = day.getSeconds();
let am = h >= 12 ? "PM" : "AM";
// Convert 24-hour clock to 12-hour clock
if (h > 12) {
h = h - 12;
}
// Add leading zeros to single-digit numbers
h = (h < 10) ? "0" + h : h;
m = (m < 10) ? "0" + m : m;
s = (s < 10) ? "0" + s : s;
hours.innerHTML = h;
minutes.innerHTML = m;
seconds.innerHTML = s;
ampm.innerHTML = am;
}, 1000);