Вот HTML-страница с часами в стиле киберпанк, включающая текущее время, дату и дополнительные эффекты:
html Copy code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CYBER TIME</title>
<style>
:root {
--neon-green: #0ff0fc;
--neon-pink: #ff2ced;
--neon-blue: #00f2ff;
--dark-bg: #0a0a0a;
}
body {
margin: 0;
padding: 0;
background-color: var(--dark-bg);
color: var(--neon-green);
font-family: 'Courier New', monospace;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
overflow: hidden;
position: relative;
}
.scanline {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(
to bottom,
rgba(10, 10, 10, 0) 0%,
rgba(10, 10, 10, 0.1) 50%,
rgba(10, 10, 10, 0) 100%
);
background-size: 100% 4px;
pointer-events: none;
animation: scanline 8s linear infinite;
}
@keyframes scanline {
0% { transform: translateY(-100%); }
100% { transform: translateY(100%); }
}
.time-container {
text-align: center;
z-index: 10;
text-shadow: 0 0 5px var(--neon-green),
0 0 10px var(--neon-green),
0 0 20px var(--neon-green);
}
.time {
font-size: 8rem;
font-weight: bold;
letter-spacing: -5px;
margin: 0;
animation: flicker 1.5s infinite alternate;
}
.date {
font-size: 1.5rem;
margin-top: 1rem;
text-transform: uppercase;
letter-spacing: 3px;
color: var(--neon-pink);
text-shadow: 0 0 5px var(--neon-pink);
}
.timezone {
font-size: 1rem;
margin-top: 0.5rem;
color: var(--neon-blue);
text-shadow: 0 0 3px var(--neon-blue);
}
.binary-clock {
margin-top: 2rem;
font-size: 0.8rem;
color: rgba(0, 255, 255, 0.7);
}
.corner {
position: absolute;
width: 50px;
height: 50px;
border: 2px solid var(--neon-green);
opacity: 0.7;
}
.corner-tl {
top: 20px;
left: 20px;
border-right: none;
border-bottom: none;
}
.corner-tr {
top: 20px;
right: 20px;
border-left: none;
border-bottom: none;
}
.corner-bl {
bottom: 20px;
left: 20px;
border-right: none;
border-top: none;
}
.corner-br {
bottom: 20px;
right: 20px;
border-left: none;
border-top: none;
}
@keyframes flicker {
0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
opacity: 1;
}
20%, 22%, 24%, 55% {
opacity: 0.5;
}
}
.glitch {
position: relative;
}
.glitch::before, .glitch::after {
content: attr(data-text);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.glitch::before {
left: 2px;
text-shadow: -2px 0 var(--neon-pink);
clip: rect(44px, 450px, 56px, 0);
animation: glitch-anim 5s infinite linear alternate-reverse;
}
.glitch::after {
left: -2px;
text-shadow: -2px 0 var(--neon-blue);
clip: rect(44px, 450px, 56px, 0);
animation: glitch-anim2 5s infinite linear alternate-reverse;
}
@keyframes glitch-anim {
0% { clip: rect(31px, 9999px, 94px, 0); }
10% { clip: rect(112px, 9999px, 76px, 0); }
20% { clip: rect(85px, 9999px, 77px, 0); }
30% { clip: rect(27px, 9999px, 97px, 0); }
40% { clip: rect(64px, 9999px, 98px, 0); }
50% { clip: rect(61px, 9999px, 85px, 0); }
60% { clip: rect(99px, 9999px, 114px, 0); }
70% { clip: rect(34px, 9999px, 115px, 0); }
80% { clip: rect(98px, 9999px, 129px, 0); }
90% { clip: rect(43px, 9999px, 96px, 0); }
100% { clip: rect(82px, 9999px, 64px, 0); }
}
@keyframes glitch-anim2 {
0% { clip: rect(65px, 9999px, 119px, 0); }
10% { clip: rect(79px, 9999px, 66px, 0); }
20% { clip: rect(16px, 9999px, 44px, 0); }
30% { clip: rect(86px, 9999px, 82px, 0); }
40% { clip: rect(23px, 9999px, 96px, 0); }
50% { clip: rect(85px, 9999px, 50px, 0); }
60% { clip: rect(28px, 9999px, 99px, 0); }
70% { clip: rect(45px, 9999px, 69px, 0); }
80% { clip: rect(23px, 9999px, 84px, 0); }
90% { clip: rect(95px, 9999px, 73px, 0); }
100% { clip: rect(1px, 9999px, 60px, 0); }
}
</style>
</head>
<body>
<div class="scanline"></div>
<div class="corner corner-tl"></div>
<div class="corner corner-tr"></div>
<div class="corner corner-bl"></div>
<div class="corner corner-br"></div>
<div class="time-container">
<h1 class="time glitch" id="time" data-text="00:00:00">00:00:00</h1>
<p class="date" id="date">MONDAY, JANUARY 1, 2023</p>
<p class="timezone" id="timezone">UTC+0</p>
<p class="binary-clock" id="binary-clock">01000010 01101001 01101110 01100001 01110010 01111001 00100000 01110100 01101001 01101101 01100101</p>
</div>
<script>
function updateTime() {
const now = new Date();
// Format time (HH:MM:SS)
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
document.getElementById('time').textContent = `${hours}:${minutes}:${seconds}`;
document.getElementById('time').setAttribute('data-text', `${hours}:${minutes}:${seconds}`);
// Format date
const options = { weekday: 'long', year: