File size: 3,746 Bytes
5f9177c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f012a83
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Modern Clock</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
    <script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');
        .clock-container {
            perspective: 1000px;
        }
        .clock-face {
            transition: all 0.5s ease;
            transform-style: preserve-3d;
        }
        .clock-face:hover {
            transform: rotateY(10deg) rotateX(5deg);
        }
        .time-segment {
            text-shadow: 0 0 10px rgba(59, 130, 246, 0.7);
        }
        .colon {
            animation: pulse 1s infinite;
        }
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
    </style>
</head>
<body class="bg-gradient-to-br from-gray-900 to-blue-900 min-h-screen flex items-center justify-center">
    <div class="clock-container" data-aos="zoom-in">
        <div class="clock-face bg-gray-800 bg-opacity-50 backdrop-filter backdrop-blur-lg rounded-2xl p-8 shadow-2xl border border-blue-500 border-opacity-30">
            <div class="flex flex-col items-center">
                <h1 class="text-blue-400 font-bold text-xl mb-6 flex items-center">
                    <i data-feather="clock" class="mr-2"></i> DIGITAL CLOCK
                </h1>
                <div class="flex items-center">
                    <div class="time-segment text-6xl md:text-8xl font-bold font-orbitron text-blue-300">
                        <span id="hours">00</span>
                    </div>
                    <div class="colon text-6xl md:text-8xl font-bold text-blue-400 mx-2">:</div>
                    <div class="time-segment text-6xl md:text-8xl font-bold font-orbitron text-blue-300">
                        <span id="minutes">00</span>
                    </div>
                    <div class="colon text-6xl md:text-8xl font-bold text-blue-400 mx-2">:</div>
                    <div class="time-segment text-6xl md:text-8xl font-bold font-orbitron text-blue-300">
                        <span id="seconds">00</span>
                    </div>
                </div>
                <div class="mt-6 text-blue-200 font-medium flex items-center">
                    <i data-feather="calendar" class="mr-2"></i>
                    <span id="date" class="text-lg"></span>
                </div>
            </div>
        </div>
    </div>

    <script>
        function updateClock() {
            const now = new Date();
            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('hours').textContent = hours;
            document.getElementById('minutes').textContent = minutes;
            document.getElementById('seconds').textContent = seconds;
            
            const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
            document.getElementById('date').textContent = now.toLocaleDateString('en-US', options);
        }

        setInterval(updateClock, 1000);
        updateClock();
    </script>
    <script>AOS.init();</script>
    <script>feather.replace();</script>
</body>
</html>