Вот несколько вариантов HTML и CSS для киберпанк-часов с сегментными индикаторами:
- Минималистичные цифровые часы:
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Киберпанк Часы</title>
<style>
body {
background-color: #0a0a1a;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-family: 'Orbitron', sans-serif;
color: #00ffff;
}
.clock {
display: flex;
gap: 20px;
background-color: rgba(0,255,255,0.1);
padding: 30px;
border-radius: 15px;
box-shadow: 0 0 20px rgba(0,255,255,0.5);
}
.digit {
display: grid;
grid-template-columns: repeat(3, 20px);
grid-template-rows: repeat(5, 20px);
gap: 5px;
}
.segment {
background-color: rgba(0,255,255,0.2);
border-radius: 3px;
}
.segment.active {
background-color: #00ffff;
}
</style>
</head>
<body>
<div class="clock" id="clock"></div>
<script>
const segments = {
0: [1,1,1,1,0,1,0,0,0,1,1,0,0,0,1],
1: [0,0,1,0,0,1,0,0,0,1,0,0,0,0,1],
// Добавьте остальные цифры
};
function createDigit(num) {
const digit = document.createElement('div');
digit.className = 'digit';
segments[num].forEach((active, index) => {
const segment = document.createElement('div');
segment.className = `segment ${active ? 'active' : ''}`;
digit.appendChild(segment);
});
return digit;
}
function updateClock() {
const now = new Date();
const clock = document.getElementById('clock');
clock.innerHTML = '';
const hours = now.getHours().toString().padStart(2, '0');
const minutes = now.getMinutes().toString().padStart(2, '0');
hours.split('').forEach(num => {
clock.appendChild(createDigit(parseInt(num)));
});
const separator = document.createElement('div');
separator.textContent = ':';
separator.style.color = '#00ffff';
clock.appendChild(separator);
minutes.split('').forEach(num => {
clock.appendChild(createDigit(parseInt(num)));
});
}
setInterval(updateClock, 1000);
updateClock();
</script>
</body>
</html>
- Неоновые футуристические часы:
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Футуристические Часы</title>
<style>
body {
background-color: #000;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-family: 'Roboto Mono', monospace;
overflow: hidden;
}
.clock {
display: flex;
font-size: 4rem;
color: #0ff;
text-shadow:
0 0 10px #0ff,
0 0 20px #0ff,
0 0 40px #0ff;
}
.segment {
width: 20px;
height: 100px;
background: rgba(0,255,255,0.2);
margin: 5px;
position: relative;
overflow: hidden;
}
.segment::before {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: linear-gradient(
transparent,
#0ff,
transparent
);
animation: scan 3s linear infinite;
}
@keyframes scan {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</head>
<body>
<div class="clock" id="clock"></div>
<script>
function updateClock() {
const now = new Date();
const clock = document.getElementById('clock');
clock.innerHTML = now.toLocaleTimeString();
}
setInterval(updateClock, 1000);
updateClock();
</script>
</body>
</html>
- Технологический дисплей с сегментами:
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Технологические Часы</title>
<style>
body {
background-color: #121212;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-family: 'Share Tech Mono', monospace;
}
.clock {
display: flex;
gap: 15px;
background-color: rgba(20,20,20,0.8);
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 15px rgba(0,255,0,0.3);
}
.digit {
display: grid;
grid-template-columns: repeat(3, 15px);
grid-template-rows: repeat(5, 15px);
gap: 3px;
}
.segment {
background-color: rgba(0,255,0,0.1);
border-radius: 2px;
transition: background-color 0.3s;
}
.segment.active {
background-color: #00ff00;
box-shadow: 0 0 5px #00ff00;
}
</style>
</head>
<body>
<div class="clock" id="clock"></div>
<script>
// Аналогичен первому примеру,
// но с зеленой цветовой схемой
</script>
</body>
</html>
Каждый из этих примеров предлагает уникальный киберпанк-стиль для часов:
- Первый - с сегментными индикаторами и синим неоном
- Второй - с динамическим сканированием и эффектами свечения
- Третий - с технологическим дизайном и зеленой цветовой гаммой
Выберите тот, который больше соответствует вашей концепции киберпанк-дизайна!