%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home2/rezakur1/dashboard.rezakurnia.com/timer/
Upload File :
Create Path :
Current File : //home2/rezakur1/dashboard.rezakurnia.com/timer/index.php

<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Work Timer โ€” Premium Dashboard</title>

    <script src="https://cdn.tailwindcss.com"></script>

    <style>
        :root {
            --bg: #030712;
            --panel: rgba(10, 22, 40, .72);
            --line: rgba(148, 163, 184, .14);
            --muted: #8da0b8;
            --green: #55e68a;
            --cyan: #60d5ff;
            --amber: #fbbf58;
        }

        * {
            box-sizing: border-box;
        }

        html,
        body {
            min-height: 100%;
        }

        body {
            margin: 0;
            color: #f8fafc;
            font-family: Inter, ui-sans-serif, system-ui, -apple-system,
                BlinkMacSystemFont, "Segoe UI", sans-serif;

            background:
                radial-gradient(
                    circle at 12% 0%,
                    rgba(37, 99, 235, .18),
                    transparent 30%
                ),
                radial-gradient(
                    circle at 90% 10%,
                    rgba(16, 185, 129, .12),
                    transparent 30%
                ),
                radial-gradient(
                    circle at 50% 100%,
                    rgba(59, 130, 246, .08),
                    transparent 34%
                ),
                #030712;
        }

        body::before {
            content: "";
            position: fixed;
            inset: 0;
            pointer-events: none;
            opacity: .18;

            background-image:
                linear-gradient(
                    rgba(255,255,255,.018) 1px,
                    transparent 1px
                ),
                linear-gradient(
                    90deg,
                    rgba(255,255,255,.018) 1px,
                    transparent 1px
                );

            background-size: 42px 42px;

            mask-image: linear-gradient(
                to bottom,
                black,
                transparent
            );
        }

        .shell {
            width: min(1480px, calc(100% - 40px));
            margin: auto;
        }

        .glass {
            background:
                linear-gradient(
                    145deg,
                    rgba(15, 32, 55, .78),
                    rgba(6, 18, 34, .62)
                );

            border: 1px solid var(--line);

            box-shadow:
                0 25px 70px rgba(0, 0, 0, .25),
                inset 0 1px 0 rgba(255,255,255,.035);

            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
        }

        .hero {
            position: relative;
            overflow: hidden;

            background:
                radial-gradient(
                    circle at 88% 45%,
                    rgba(34, 197, 94, .16),
                    transparent 30%
                ),
                radial-gradient(
                    circle at 42% 105%,
                    rgba(59, 130, 246, .12),
                    transparent 34%
                ),
                linear-gradient(
                    120deg,
                    rgba(7, 26, 49, .94),
                    rgba(4, 38, 42, .84)
                );

            border: 1px solid rgba(52, 211, 153, .38);
        }

        .hero::after {
            content: "";
            position: absolute;

            width: 520px;
            height: 520px;

            right: -220px;
            top: -250px;

            border-radius: 50%;

            border: 1px solid rgba(94, 234, 212, .10);

            box-shadow:
                0 0 0 70px rgba(94,234,212,.025),
                0 0 0 140px rgba(94,234,212,.018);

            pointer-events: none;
        }

        .eyebrow {
            color: #91a5bd;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: .22em;
        }

        .mono {
            font-variant-numeric: tabular-nums;

            font-family:
                ui-monospace,
                SFMono-Regular,
                Menlo,
                Monaco,
                Consolas,
                monospace;
        }

        .countdown {
            font-variant-numeric: tabular-nums;
            letter-spacing: -.075em;
            line-height: .88;

            background:
                linear-gradient(
                    180deg,
                    #9af7bb 0%,
                    #4ade80 48%,
                    #22c55e 100%
                );

            -webkit-background-clip: text;
            background-clip: text;

            color: transparent;

            filter:
                drop-shadow(
                    0 0 28px rgba(74,222,128,.16)
                );
        }

        .bar {
            background: rgba(148,163,184,.12);

            box-shadow:
                inset 0 1px 2px rgba(0,0,0,.25);
        }

        .bar>div {
            background:
                linear-gradient(
                    90deg,
                    #22c55e,
                    #4ade80,
                    #6ee7b7
                );

            box-shadow:
                0 0 20px rgba(74,222,128,.28);

            transition: width 1s linear;
        }

        .metric {
            background: rgba(4, 15, 29, .42);
            border: 1px solid rgba(148,163,184,.11);
        }

        .timeline-track {
            background:
                linear-gradient(
                    90deg,
                    #22c55e 0%,
                    #34d399 42%,
                    rgba(96,165,250,.4) 72%,
                    rgba(148,163,184,.2) 100%
                );
        }

        .timeline-node {
            box-shadow:
                0 0 0 7px rgba(255,255,255,.02);
        }

        .active-node {
            box-shadow:
                0 0 0 6px rgba(74,222,128,.09),
                0 0 30px rgba(74,222,128,.28);
        }

        .glow-green {
            box-shadow:
                0 0 35px rgba(34,197,94,.13);
        }

        .glow-blue {
            box-shadow:
                0 0 35px rgba(59,130,246,.10);
        }

        /* =========================================
           FIREWORKS CANVAS
        ========================================= */

        #fireworksCanvas {
            position: fixed;
            inset: 0;

            width: 100%;
            height: 100%;

            pointer-events: none;

            z-index: 99999;
        }

        @media (max-width: 768px) {
            .shell {
                width: min(100% - 24px, 1480px);
            }
        }
    </style>
</head>

<body>

    <canvas id="fireworksCanvas"></canvas>

    <div class="py-5 md:py-7">

        <div class="shell">

            <!-- =========================================
                     TOP BAR
            ========================================== -->

            <header
            class="flex flex-col xl:flex-row xl:items-center xl:justify-between gap-5 mb-5"
            >

            <div class="flex items-center gap-4">

                <div
                class="w-14 h-14 rounded-2xl glass flex items-center justify-center border-blue-400/20"
                >
                <svg
                class="w-7 h-7 text-blue-300"
                fill="none"
                stroke="currentColor"
                viewBox="0 0 24 24"
                >
                <circle cx="12" cy="12" r="9"></circle>

                <path
                stroke-linecap="round"
                stroke-width="1.8"
                d="M12 7v5l3 2"
                ></path>
            </svg>
        </div>

        <div>

            <div class="flex items-center gap-3">

                <h1 class="text-xl font-bold tracking-wide">
                    WORK TIMER
                </h1>

                <span
                class="px-2.5 py-1 rounded-full bg-emerald-400/10 border border-emerald-400/15 text-emerald-300 text-[10px] font-semibold uppercase tracking-wider"
                >
                Live
            </span>

        </div>

        <p class="text-slate-400 text-sm mt-1">
            Semangat bekerja, selesaikan hari dengan baik. ๐Ÿ’ช
        </p>

    </div>

</div>

<div
class="glass rounded-2xl px-5 py-3.5 flex flex-wrap items-center gap-5 md:gap-7"
>

<div class="flex items-center gap-3">

    <svg
    class="w-5 h-5 text-blue-300"
    fill="none"
    stroke="currentColor"
    viewBox="0 0 24 24"
    >
    <rect
    x="3"
    y="4"
    width="18"
    height="17"
    rx="2"
    ></rect>

    <path d="M16 2v4M8 2v4M3 9h18"></path>
</svg>

<span
id="date"
class="text-sm text-slate-200"
>
-
</span>

</div>

<div
class="hidden md:block h-7 w-px bg-slate-700/70"
></div>

<div class="flex items-center gap-3">

    <svg
    class="w-5 h-5 text-blue-300"
    fill="none"
    stroke="currentColor"
    viewBox="0 0 24 24"
    >
    <circle
    cx="12"
    cy="12"
    r="9"
    ></circle>

    <path
    stroke-linecap="round"
    d="M12 7v5l3 2"
    ></path>
</svg>

<span
id="clock"
class="mono text-xl font-semibold tracking-tight"
>
00:00:00
</span>

</div>

</div>

</header>


<!-- =========================================
             HERO
========================================== -->

<section
id="hero"
class="hero rounded-[28px] p-6 md:p-8 lg:p-10"
>

<div
class="grid xl:grid-cols-[.74fr_1.26fr] gap-8 lg:gap-12 items-center relative z-10"
>

<!-- HERO INFO -->

<div>

    <div
    id="dayBadge"
    class="inline-flex items-center gap-2 px-3.5 py-2 rounded-xl bg-emerald-400/10 border border-emerald-400/15 text-emerald-300 text-xs font-bold uppercase tracking-wider"
    >

    <span
    class="w-2 h-2 rounded-full bg-emerald-400 shadow-[0_0_10px_rgba(74,222,128,.7)]"
    ></span>

    <span>Senin</span>

</div>


<div class="flex items-center gap-4 mt-9">

    <div
    id="targetIcon"
    class="w-[70px] h-[70px] rounded-full border border-emerald-400/35 bg-emerald-400/10 flex items-center justify-center text-3xl active-node"
    >
    โ˜•
</div>

<div>

    <p class="text-slate-400 text-base">
        Menuju
    </p>

    <h2
    id="targetLabel"
    class="text-3xl md:text-4xl font-bold tracking-tight mt-1"
    >
    Istirahat
</h2>

</div>

</div>


<p
id="heroDescription"
class="text-slate-300 text-lg mt-8"
>
Waktu istirahat sebentar lagi.
</p>


<div class="mt-7 max-w-lg">

    <p
    id="quote"
    class="text-slate-400 leading-8"
    >
    โ€œIstirahat sejenak agar kembali dengan energi yang lebih baik.โ€
</p>

<p
id="quoteAccent"
class="text-emerald-400 mt-1 font-medium"
>
Jaga energi, sebentar lagi istirahat. โ˜•
</p>

</div>

</div>


<!-- HERO TIMER -->

<div>

    <div class="flex items-center justify-between mb-3">

        <span class="text-sm text-slate-400">

            Sisa waktu menuju

            <strong
            id="targetTimeTop"
            class="text-emerald-300"
            >
            12:30
        </strong>

    </span>

    <span
    id="remainingMinutes"
    class="text-xs text-slate-500"
    >
    -
</span>

</div>


<div class="bar h-2 rounded-full overflow-hidden">

    <div
    id="heroProgress"
    class="h-full rounded-full"
    style="width:0%"
    ></div>

</div>


<div
id="countdown"
class="countdown text-[4.5rem] sm:text-[6.2rem] md:text-[7.4rem] lg:text-[8.5rem] font-black text-center xl:text-left mt-10"
>
00:00:00
</div>


<div
class="grid grid-cols-3 text-center xl:text-left text-[10px] md:text-xs uppercase tracking-[.25em] text-slate-500 mt-3"
>

<span>Jam</span>
<span>Menit</span>
<span>Detik</span>

</div>


<div
class="metric rounded-2xl mt-8 px-5 py-4 flex items-center gap-4"
>

<div
class="w-10 h-10 rounded-full bg-emerald-400/10 flex items-center justify-center text-emerald-300"
>

<svg
class="w-5 h-5"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>

<circle
cx="12"
cy="12"
r="9"
></circle>

<path
stroke-linecap="round"
d="M12 7v5l3 2"
></path>

</svg>

</div>

<div class="text-sm">

    <span
    id="targetTimeCard"
    class="font-bold text-lg"
    >
    12:30
</span>

<span class="mx-2 text-slate-600">
    |
</span>

<span
id="targetActivityCard"
class="text-slate-300"
>
Istirahat
</span>

</div>

</div>

</div>

</div>

</section>


<!-- =========================================
             TIMELINE
========================================== -->

<section
class="grid xl:grid-cols-[1fr_310px] gap-5 mt-5"
>

<div
class="glass rounded-[24px] p-6 md:p-7"
>

<div class="flex items-center justify-between">

    <div>

        <p class="eyebrow">
            Daily schedule
        </p>

        <h3 class="text-xl font-semibold mt-1">
            Jadwal Hari Ini
        </h3>

    </div>

    <span
    id="scheduleHours"
    class="text-xs text-slate-500"
    >
    08:00 โ€” 17:00
</span>

</div>

<div
id="timeline"
class="mt-9"
></div>

</div>


<!-- NEXT -->

<div
class="glass rounded-[24px] p-6 md:p-7 glow-green"
>

<p class="eyebrow">
    Next up
</p>

<h3 class="text-xl font-semibold mt-1">
    Setelah Ini
</h3>


<div class="mt-7 flex items-center gap-4">

    <div
    id="nextIcon"
    class="w-[68px] h-[68px] rounded-full border border-amber-400/50 bg-amber-400/10 flex items-center justify-center text-3xl"
    >
    โ˜•
</div>

<div>

    <p
    id="nextActivity"
    class="text-amber-300 font-semibold"
    >
    Istirahat
</p>

<p
id="nextTime"
class="text-3xl font-bold mt-1"
>
12:30
</p>

</div>

</div>


<div
class="mt-8 p-4 rounded-2xl bg-white/[.025] border border-white/[.06]"
>

<p class="eyebrow">
    Upcoming
</p>

<p
id="nextRemaining"
class="text-slate-300 mt-2 text-sm leading-6"
>
-
</p>

</div>


<div class="mt-6 flex items-center justify-between">

    <span class="text-sm text-slate-500">
        Status
    </span>

    <span
    id="statusText"
    class="px-3 py-1.5 rounded-full bg-emerald-400/10 text-emerald-300 text-xs font-semibold"
    >
    Waktu Kerja
</span>

</div>

</div>

</section>


<!-- =========================================
             ANALYTICS
========================================== -->

<section
class="grid xl:grid-cols-[1fr_1fr] gap-5 mt-5"
>

<!-- PROGRESS -->

<div
class="glass rounded-[24px] p-6 md:p-7 glow-blue"
>

<div class="flex items-start justify-between">

    <div>

        <p class="eyebrow">
            Performance
        </p>

        <h3 class="text-xl font-semibold mt-1">
            Progress Hari Ini
        </h3>

    </div>

    <span
    id="dayProgressText"
    class="text-2xl font-bold text-emerald-400"
    >
    0%
</span>

</div>


<div class="flex items-end justify-between mt-8">

    <div>

        <p class="text-sm text-slate-500">
            Waktu berjalan
        </p>

        <p
        id="workedTime"
        class="text-3xl font-bold text-emerald-400 mt-1"
        >
        0j 00m
    </p>

</div>

<div class="text-right">

    <p class="text-sm text-slate-500">
        Jam kerja
    </p>

    <p class="text-slate-200 font-semibold mt-1">
        08:00 โ€” 17:00
    </p>

</div>

</div>


<div class="bar h-3 rounded-full overflow-hidden mt-6">

    <div
    id="dayProgress"
    class="h-full rounded-full"
    style="width:0%"
    ></div>

</div>


<div class="flex justify-between text-xs text-slate-500 mt-3">

    <span>08:00</span>
    <span>17:00</span>

</div>


<div class="grid grid-cols-3 gap-3 mt-7">

    <div class="metric rounded-2xl p-4">

        <p class="text-xs text-slate-500">
            ๐Ÿ’ผ Kerja
        </p>

        <p
        id="workStat"
        class="font-bold text-lg mt-2"
        >
        0j 00m
    </p>

</div>


<div class="metric rounded-2xl p-4">

    <p class="text-xs text-slate-500">
        โ˜• Istirahat
    </p>

    <p
    id="breakStat"
    class="font-bold text-lg mt-2"
    >
    0j 00m
</p>

</div>


<div class="metric rounded-2xl p-4">

    <p class="text-xs text-slate-500">
        โ—ท Total
    </p>

    <p class="font-bold text-lg mt-2">
        9j 00m
    </p>

</div>

</div>

</div>


<!-- INFO -->

<div
class="glass rounded-[24px] p-6 md:p-7"
>

<div>

    <p class="eyebrow">
        Overview
    </p>

    <h3 class="text-xl font-semibold mt-1">
        Informasi Hari Ini
    </h3>

</div>


<div class="mt-6 space-y-2">

    <div
    class="metric rounded-2xl px-5 py-4 flex items-center justify-between"
    >

    <span class="text-slate-500">
        Tanggal
    </span>

    <span
    id="infoDate"
    class="font-medium"
    >
    -
</span>

</div>


<div
class="metric rounded-2xl px-5 py-4 flex items-center justify-between"
>

<span class="text-slate-500">
    Jam Kerja
</span>

<span
id="infoWorkingHours"
class="font-medium"
>
08:00 โ€” 17:00
</span>

</div>


<div
class="metric rounded-2xl px-5 py-4 flex items-center justify-between"
>

<span class="text-slate-500">
    Status
</span>

<span
id="infoStatus"
class="font-medium text-emerald-400"
>
Waktu Kerja
</span>

</div>


<div
class="metric rounded-2xl px-5 py-4 flex items-center justify-between"
>

<span class="text-slate-500">
    Target berikutnya
</span>

<span
id="infoNext"
class="font-medium"
>
12:30
</span>

</div>

</div>

</div>

</section>


<!-- =========================================
             HOLIDAY
========================================== -->

<section
id="holidayCard"
class="glass rounded-[24px] p-6 md:p-8 mt-5 hidden"
>

<div
class="grid md:grid-cols-[190px_1fr_170px] gap-6 items-center"
>

<div class="text-7xl text-center">
    ๐Ÿ๏ธ
</div>

<div>

    <p class="eyebrow">
        Weekend mode
    </p>

    <h3
    class="text-3xl font-bold mt-2 text-blue-300"
    >
    Sabtu โ€” Minggu
</h3>

<p
class="text-xl font-semibold text-indigo-300 mt-1"
>
Hari Libur
</p>

<p
class="text-slate-400 mt-4 max-w-xl"
>
Nikmati waktu bersama keluarga, recharge energi,
dan bersiap untuk minggu berikutnya. ๐Ÿ˜Š
</p>

</div>


<div
class="metric rounded-2xl p-5 text-center"
>

<p
id="holidayDays"
class="text-5xl font-bold text-blue-300"
>
โ€”
</p>

<p class="text-blue-300 mt-1">
    Hari Lagi
</p>

<p class="text-slate-500 text-xs mt-2">
    Menuju Senin
</p>

</div>

</div>

</section>


<!-- =========================================
             FOOTER
========================================== -->

<footer
class="glass rounded-2xl px-5 py-4 mt-5 mb-6 text-center text-slate-500 text-sm"
>

<span>
    โ™ก Bekerjalah dengan ikhlas,
    beristirahatlah dengan tenang,
    pulanglah dengan bahagia.
</span>

<span class="ml-2 text-blue-300">
    โœฆ
</span>

</footer>

</div>

</div>


<script>

    /* =========================================
       ELEMENT HELPER
    ========================================= */

    const $ = id => document.getElementById(id);


    /* =========================================
       SCHEDULE
    ========================================= */

    const schedules = {

        weekday: [

            {
                time: "08:00",
                label: "Mulai Kerja",
                icon: "โœ“",
                type: "start",
                description: "Waktu kerja dimulai"
            },

            {
                time: "12:30",
                label: "Istirahat",
                icon: "โ˜•",
                type: "break",
                description: "Waktu makan siang"
            },

            {
                time: "17:00",
                label: "Pulang",
                icon: "โŒ‚",
                type: "finish",
                description: "Saatnya pulang"
            }

        ],

        friday: [

            {
                time: "08:00",
                label: "Mulai Kerja",
                icon: "โœ“",
                type: "start",
                description: "Waktu kerja dimulai"
            },

            {
                time: "11:30",
                label: "Sholat Jumat",
                icon: "๐Ÿ•Œ",
                type: "prayer",
                description: "Waktu ibadah"
            },

            {
                time: "13:00",
                label: "Masuk Kerja",
                icon: "โ†ฉ๏ธ",
                type: "back",
                description: "Kembali bekerja"
            },

            {
                time: "17:30",
                label: "Pulang",
                icon: "โŒ‚",
                type: "finish",
                description: "Saatnya pulang"
            }

        ]

    };


    /* =========================================
       BASIC FUNCTIONS
    ========================================= */

    function pad(n) {

        return String(n).padStart(2, "0");

    }


    function formatClock(d) {

        return `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;

    }


    function formatDate(d) {

        return d.toLocaleDateString(
            "id-ID",
            {
                weekday: "long",
                day: "numeric",
                month: "long",
                year: "numeric"
            }
        );

    }


    function atTime(time, base = new Date()) {

        const [h, m] = time.split(":").map(Number);

        const d = new Date(base);

        d.setHours(h, m, 0, 0);

        return d;

    }


    function duration(ms) {

        const total = Math.max(
            0,
            Math.floor(ms / 1000)
        );

        return `${pad(Math.floor(total / 3600))}:${pad(Math.floor((total % 3600) / 60))}:${pad(total % 60)}`;

    }


    function durationText(ms) {

        const min = Math.max(
            0,
            Math.ceil(ms / 60000)
        );

        const h = Math.floor(min / 60);

        const m = min % 60;

        return h
            ? `${h} jam ${m} menit lagi`
            : `${m} menit lagi`;

    }


    function shortDuration(ms) {

        const min = Math.max(
            0,
            Math.floor(ms / 60000)
        );

        return `${Math.floor(min / 60)}j ${pad(min % 60)}m`;

    }


    /* =========================================
       GET SCHEDULE
    ========================================= */

    function getSchedule() {

        const day = new Date().getDay();

        // Sunday
        if (day === 0) {
            return null;
        }

        // Saturday
        if (day === 6) {
            return null;
        }

        // Friday
        if (day === 5) {
            return schedules.friday;
        }

        return schedules.weekday;

    }


    /* =========================================
       GET CURRENT STATE
    ========================================= */

    function getState() {

        const now = new Date();

        const schedule = getSchedule();

        if (!schedule) {

            return {
                holiday: true
            };

        }


        const events = schedule.map(
            (item, index) => ({

                ...item,

                index,

                date: atTime(
                    item.time,
                    now
                )

            })
        );


        const nextIndex = events.findIndex(
            e => e.date > now
        );


        if (nextIndex === -1) {

            return {
                finished: true,
                events
            };

        }


        return {

            finished: false,

            events,

            next: events[nextIndex],

            previous:
                events[nextIndex - 1] || null,

            nextIndex,

            remaining:
                events[nextIndex].date - now

        };

    }


    /* =========================================
       HEADER
    ========================================= */

    function updateHeader(now) {

        $("clock").textContent =
            formatClock(now);

        $("date").textContent =
            formatDate(now);

        $("infoDate").textContent =
            formatDate(now);

    }


    /* =========================================
       TIMELINE
    ========================================= */

    function renderTimeline(
        events,
        now,
        nextIndex
    ) {

        const signature =
            events
            .map(
                e =>
                    e.time + ":" + e.label
            )
            .join("|");


        /*
         * Build DOM only when schedule changes.
         */

        if (
            $("timeline").dataset.signature
            !== signature
        ) {

            $("timeline").dataset.signature =
                signature;


            $("timeline").innerHTML = `

                    <div class="relative">

                        <div
                            class="absolute left-[9%] right-[9%] top-[54px] h-[2px] timeline-track rounded-full opacity-70"
                        ></div>


                        <div
                            class="grid gap-3 relative"
                            style="grid-template-columns: repeat(${events.length}, minmax(0,1fr));"
                        >

                            ${events.map(
                        (item, i) => `

                                    <div
                                        class="timeline-item text-center min-w-0"
                                        data-index="${i}"
                                    >

                                        <p
                                            class="timeline-time mono text-sm"
                                        ></p>


                                        <div
                                            class="timeline-node mx-auto mt-5 w-14 h-14 md:w-16 md:h-16 rounded-full border-2 flex items-center justify-center text-xl relative z-10"
                                        ></div>


                                        <p
                                            class="timeline-label mt-4 text-sm md:text-base font-semibold"
                                        ></p>


                                        <p
                                            class="timeline-description text-xs text-slate-500 mt-1 hidden sm:block"
                                        ></p>

                                    </div>

                                `
                    ).join("")}

                        </div>

                    </div>

                `;

        }


        document
            .querySelectorAll(".timeline-item")
            .forEach(
                (el, i) => {

                    const item = events[i];

                    const done =
                        item.date < now;

                    const next =
                        i === nextIndex;


                    const timeEl =
                        el.querySelector(
                            ".timeline-time"
                        );

                    const nodeEl =
                        el.querySelector(
                            ".timeline-node"
                        );

                    const labelEl =
                        el.querySelector(
                            ".timeline-label"
                        );

                    const descEl =
                        el.querySelector(
                            ".timeline-description"
                        );


                    timeEl.textContent =
                        item.time;

                    labelEl.textContent =
                        item.label;

                    descEl.textContent =
                        item.description;


                    nodeEl.textContent =
                        done
                            ? "โœ“"
                            : item.icon;


                    timeEl.className =
                        "timeline-time mono text-sm " +
                        (
                            next
                                ? "text-emerald-300"
                                : "text-slate-500"
                        );


                    nodeEl.className =
                        "timeline-node mx-auto mt-5 w-14 h-14 md:w-16 md:h-16 rounded-full border-2 " +
                        "flex items-center justify-center text-xl relative z-10 " +

                        (
                            done

                                ? "bg-emerald-500 border-emerald-300 text-white"

                                : next

                                    ? "bg-slate-950 border-emerald-300 text-emerald-300 active-node"

                                    : "bg-slate-950 border-slate-600 text-slate-400"
                        );


                    labelEl.className =
                        "timeline-label mt-4 text-sm md:text-base font-semibold " +

                        (
                            next

                                ? "text-white"

                                : done

                                    ? "text-emerald-400"

                                    : "text-slate-300"
                        );

                }
            );

    }


    /* =========================================
       PROGRESS
    ========================================= */

    function updateProgress(now) {

        const isFriday = new Date().getDay() === 5;

        const start = atTime("08:00", now);
        const end = isFriday ? atTime("17:30", now) : atTime("17:00", now);

        const total = end - start;
        const elapsed = Math.max(0, Math.min(total, now - start));

        const pct = Math.max(0, Math.min(100, elapsed / total * 100));

        $("dayProgress").style.width = `${pct}%`;
        $("dayProgressText").textContent = `${Math.floor(pct)}%`;
        $("workedTime").textContent = shortDuration(elapsed);
        $("workStat").textContent = shortDuration(elapsed);

        // Break time for Friday (11:30 - 13:00)
        let breakMs = 0;
        if (isFriday) {
            const breakStart = atTime("11:30", now);
            const breakEnd = atTime("13:00", now);
            if (now > breakStart) {
                breakMs = Math.max(0, Math.min(now, breakEnd) - breakStart);
            }
        } else {
            const breakStart = atTime("12:30", now);
            const breakEnd = atTime("13:30", now);
            if (now > breakStart) {
                breakMs = Math.max(0, Math.min(now, breakEnd) - breakStart);
            }
        }

        $("breakStat").textContent = shortDuration(breakMs);

        // Update schedule hours display
        const scheduleHours = isFriday ? "08:00 โ€” 17:30" : "08:00 โ€” 17:00";
        $("scheduleHours").textContent = scheduleHours;
        $("infoWorkingHours").textContent = scheduleHours;
        // Update work hours display in metrics
        document.querySelectorAll('.metric .text-slate-200.font-semibold').forEach(el => {
            if (el.closest('.text-right')) {
                el.textContent = scheduleHours;
            }
        });
    }


    /* =========================================
       FIREWORKS
    ========================================= */

    const fireworksCanvas =
        $("fireworksCanvas");

    const fireworksCtx =
        fireworksCanvas.getContext("2d");


    let fireworks = [];

    let particles = [];

    let fireworksRunning = false;


    /* Resize canvas */

    function resizeFireworksCanvas() {

        fireworksCanvas.width =
            window.innerWidth;

        fireworksCanvas.height =
            window.innerHeight;

    }


    window.addEventListener(
        "resize",
        resizeFireworksCanvas
    );

    resizeFireworksCanvas();


    /* Create rocket */

    function createFirework(x, y) {

        const colors = [

            "#22c55e",
            "#4ade80",
            "#60a5fa",
            "#fbbf24",
            "#f472b6",
            "#a78bfa",
            "#ffffff"

        ];


        const color =
            colors[
                Math.floor(
                    Math.random() *
                    colors.length
                )
            ];


        fireworks.push({

            x,

            y,

            targetY:
                y -
                (
                    150 +
                    Math.random() * 180
                ),

            speed:
                6 +
                Math.random() * 2,

            color,

            exploded: false

        });

    }


    /* Explosion */

    function explodeFirework(
        firework
    ) {

        const particleCount = 100;


        for (
            let i = 0;
            i < particleCount;
            i++
        ) {

            const angle =
                (
                    Math.PI * 2 * i
                ) / particleCount;


            const speed =
                2 +
                Math.random() * 6;


            particles.push({

                x: firework.x,

                y: firework.y,

                vx:
                    Math.cos(angle) *
                    speed,

                vy:
                    Math.sin(angle) *
                    speed,

                gravity: 0.045,

                friction: 0.985,

                alpha: 1,

                decay:
                    0.012 +
                    Math.random() * 0.015,

                size:
                    1.5 +
                    Math.random() * 2.5,

                color:
                    firework.color

            });

        }

    }


    /* Animation */

    function animateFireworks() {

        fireworksCtx.clearRect(
            0,
            0,
            fireworksCanvas.width,
            fireworksCanvas.height
        );


        /* Rockets */

        fireworks.forEach(
            firework => {

                if (!firework.exploded) {

                    firework.y -=
                        firework.speed;


                    fireworksCtx.beginPath();

                    fireworksCtx.arc(
                        firework.x,
                        firework.y,
                        3,
                        0,
                        Math.PI * 2
                    );


                    fireworksCtx.fillStyle =
                        firework.color;


                    fireworksCtx.shadowBlur =
                        15;

                    fireworksCtx.shadowColor =
                        firework.color;


                    fireworksCtx.fill();


                    fireworksCtx.shadowBlur =
                        0;


                    if (
                        firework.y <=
                        firework.targetY
                    ) {

                        firework.exploded =
                            true;

                        explodeFirework(
                            firework
                        );

                    }

                }

            }
        );


        fireworks =
            fireworks.filter(
                f => !f.exploded
            );


        /* Particles */

        particles.forEach(
            particle => {

                particle.vx *=
                    particle.friction;

                particle.vy *=
                    particle.friction;

                particle.vy +=
                    particle.gravity;


                particle.x +=
                    particle.vx;

                particle.y +=
                    particle.vy;


                particle.alpha -=
                    particle.decay;


                fireworksCtx.save();


                fireworksCtx.globalAlpha =
                    Math.max(
                        0,
                        particle.alpha
                    );


                fireworksCtx.fillStyle =
                    particle.color;


                fireworksCtx.shadowBlur =
                    12;

                fireworksCtx.shadowColor =
                    particle.color;


                fireworksCtx.beginPath();


                fireworksCtx.arc(
                    particle.x,
                    particle.y,
                    particle.size,
                    0,
                    Math.PI * 2
                );


                fireworksCtx.fill();


                fireworksCtx.restore();

            }
        );


        particles =
            particles.filter(
                p => p.alpha > 0
            );


        if (
            fireworks.length > 0 ||
            particles.length > 0
        ) {

            requestAnimationFrame(
                animateFireworks
            );

        } else {

            fireworksRunning =
                false;


            fireworksCtx.clearRect(
                0,
                0,
                fireworksCanvas.width,
                fireworksCanvas.height
            );

        }

    }


    /* Launch fireworks */

    function launchFireworks() {

        if (fireworksRunning) {
            return;
        }


        fireworksRunning = true;


        const width =
            fireworksCanvas.width;

        const height =
            fireworksCanvas.height;


        /*
         * Main fireworks
         */

        createFirework(
            width * 0.20,
            height * 0.90
        );


        createFirework(
            width * 0.35,
            height * 0.92
        );


        createFirework(
            width * 0.50,
            height * 0.90
        );


        createFirework(
            width * 0.65,
            height * 0.92
        );


        createFirework(
            width * 0.80,
            height * 0.90
        );


        /*
         * Second wave
         */

        setTimeout(
            () => {

                createFirework(
                    width * 0.28,
                    height * 0.90
                );

                createFirework(
                    width * 0.72,
                    height * 0.90
                );

            },
            350
        );


        /*
         * Third wave
         */

        setTimeout(
            () => {

                createFirework(
                    width * 0.50,
                    height * 0.92
                );

            },
            700
        );


        animateFireworks();

    }


    /* =========================================
       MILESTONE DETECTOR
    ========================================= */

    let lastTargetTime = null;

    let lastTargetType = null;


    function checkMilestone(state) {

        if (
            state.holiday ||
            state.finished ||
            !state.next
        ) {
            return;
        }


        const target =
            state.next;


        /*
         * Target berubah berarti
         * kita baru melewati milestone.
         */

        if (
            lastTargetTime !== null &&

            (
                target.time !==
                lastTargetTime ||

                target.type !==
                lastTargetType
            )
        ) {

            /*
             * Istirahat / Sholat Jumat
             */

            if (
                target.type ===
                "break" ||
                target.type === "prayer"
            ) {

                launchFireworks();

            }


            /*
             * Pulang
             */

            else if (
                target.type ===
                "finish"
            ) {

                launchFireworks();

            }

        }


        lastTargetTime =
            target.time;

        lastTargetType =
            target.type;

    }


    /* =========================================
       NORMAL STATE
    ========================================= */

    function setNormal(data) {

        const next =
            data.next;


        const meta = {

            break: {

                description:
                    "Waktu istirahat sebentar lagi.",

                quote:
                    "โ€œIstirahat sejenak agar kembali dengan energi yang lebih baik.โ€",

                accent:
                    "Jaga energi, sebentar lagi istirahat. โ˜•"

            },


            prayer: {

                description:
                    "Waktu ibadah, waktu berkah.",

                quote:
                    "โ€œIngatlah, hanya dengan mengingat Allah hati menjadi tenteram.โ€",

                accent:
                    "(QS. Ar-Ra'd: 28)"

            },

            back: {

                description:
                    "Kembali bekerja setelah sholat Jumat.",

                quote:
                    "โ€œSelesaikan tugas dengan semangat baru.โ€",

                accent:
                    "Semangat! ๐Ÿ’ช"

            },


            finish: {

                description:
                    "Sedikit lagi menuju waktu pulang.",

                quote:
                    "โ€œSelesaikan pekerjaan dengan baik, lalu pulang dengan bahagia.โ€",

                accent:
                    "Semangat sampai akhir! ๐Ÿ "

            }

        };


        const info =
            meta[next.type] ||
            meta.break;


        $("dayBadge").innerHTML = `

                <span
                    class="w-2 h-2 rounded-full bg-emerald-400 shadow-[0_0_10px_rgba(74,222,128,.7)]"
                ></span>

                <span>
                    ${new Date().toLocaleDateString(
                    "id-ID",
                    {
                        weekday: "long"
                    }
                ).toUpperCase()}
                </span>

            `;


        $("targetIcon").textContent =
            next.icon;

        $("targetLabel").textContent =
            next.label;

        $("heroDescription").textContent =
            info.description;

        $("quote").textContent =
            info.quote;

        $("quoteAccent").textContent =
            info.accent;


        $("targetTimeTop").textContent =
            next.time;

        $("targetTimeCard").textContent =
            next.time;

        $("targetActivityCard").textContent =
            next.label;


        $("countdown").textContent =
            duration(data.remaining);

        $("remainingMinutes").textContent =
            durationText(data.remaining);


        const start =
            data.previous
                ? data.previous.date
                : atTime("08:00");


        const total =
            Math.max(
                1,
                next.date - start
            );


        const elapsed =
            Math.max(
                0,
                new Date() - start
            );


        const pct =
            Math.min(
                100,
                Math.max(
                    0,
                    elapsed /
                    total *
                    100
                )
            );


        $("heroProgress").style.width =
            `${pct}%`;


        const after =
            data.events[
                data.nextIndex + 1
            ];


        if (after) {

            $("nextIcon").textContent =
                after.icon;

            $("nextActivity").textContent =
                after.label;

            $("nextTime").textContent =
                after.time;

            $("nextRemaining").textContent =
                `Setelah ${next.label.toLowerCase()} โ†’ ${after.time}`;

        } else {

            $("nextIcon").textContent =
                "๐Ÿ ";

            $("nextActivity").textContent =
                "Pulang";

            $("nextTime").textContent =
                "17:30";

            $("nextRemaining").textContent =
                "Target terakhir hari ini.";

        }


        $("statusText").textContent =
            "Waktu Kerja";

        $("infoStatus").textContent =
            "Waktu Kerja";

        $("infoStatus").className =
            "font-medium text-emerald-400";

        $("infoNext").textContent =
            next.time;

        // Update working hours based on schedule
        const isFriday = new Date().getDay() === 5;
        const scheduleHours = isFriday ? "08:00 โ€” 17:30" : "08:00 โ€” 17:00";
        $("infoWorkingHours").textContent = scheduleHours;

    }


    /* =========================================
       FINISHED
    ========================================= */

    function setFinished(data) {

        $("dayBadge").innerHTML = `

                <span
                    class="w-2 h-2 rounded-full bg-blue-400"
                ></span>

                <span>
                    SELESAI
                </span>

            `;


        $("targetIcon").textContent =
            "๐Ÿ ";

        $("targetLabel").textContent =
            "Waktu Pulang";


        $("heroDescription").textContent =
            "Seluruh jadwal kerja hari ini telah selesai.";


        $("quote").textContent =
            "โ€œTerima kasih untuk kerja keras hari ini.โ€";


        $("quoteAccent").textContent =
            "Sampai jumpa besok. ๐Ÿ‘‹";


        const isFriday = new Date().getDay() === 5;
        const endTime = isFriday ? "17:30" : "17:00";

        $("targetTimeTop").textContent =
            endTime;

        $("targetTimeCard").textContent =
            endTime;

        $("targetActivityCard").textContent =
            "Pulang";


        $("countdown").textContent =
            "SELESAI";


        $("remainingMinutes").textContent =
            "Waktunya beristirahat.";


        $("heroProgress").style.width =
            "100%";


        $("dayProgress").style.width =
            "100%";


        $("dayProgressText").textContent =
            "100%";


        $("nextIcon").textContent =
            "๐Ÿ ";

        $("nextActivity").textContent =
            "Hari Kerja Berikutnya";

        $("nextTime").textContent =
            "Besok";

        $("nextRemaining").textContent =
            "Waktunya beristirahat.";


        $("statusText").textContent =
            "Jam Kerja Selesai";


        $("infoStatus").textContent =
            "Selesai";


        $("infoStatus").className =
            "font-medium text-blue-300";


        $("infoNext").textContent =
            "Besok";

    }


    /* =========================================
       HOLIDAY
    ========================================= */

    function setHoliday() {

        $("holidayCard")
            .classList
            .remove("hidden");


        $("dayBadge").innerHTML = `

                <span
                    class="w-2 h-2 rounded-full bg-blue-400"
                ></span>

                <span>
                    HARI LIBUR
                </span>

            `;


        $("targetIcon").textContent =
            "๐Ÿ๏ธ";

        $("targetLabel").textContent =
            "Selamat Berlibur";


        $("heroDescription").textContent =
            "Tidak ada jadwal kerja hari ini.";


        $("quote").textContent =
            "โ€œNikmati waktu bersama keluarga dan istirahat yang cukup.โ€";


        $("quoteAccent").textContent =
            "Sampai jumpa di hari kerja berikutnya. ๐Ÿ˜Š";


        $("targetTimeTop").textContent =
            "โ€”";

        $("targetTimeCard").textContent =
            "โ€”";

        $("targetActivityCard").textContent =
            "Hari Libur";


        $("countdown").textContent =
            "LIBUR";


        $("remainingMinutes").textContent =
            "Sabtu โ€” Minggu";


        $("heroProgress").style.width =
            "0%";


        $("nextIcon").textContent =
            "๐ŸŒด";

        $("nextActivity").textContent =
            "Hari Kerja";

        $("nextTime").textContent =
            "Senin";

        $("nextRemaining").textContent =
            "Nikmati akhir pekan.";


        $("statusText").textContent =
            "Hari Libur";


        $("infoStatus").textContent =
            "Hari Libur";


        $("infoStatus").className =
            "font-medium text-blue-300";


        $("infoNext").textContent =
            "Senin";


        $("infoWorkingHours").textContent =
            "Libur";


        $("workedTime").textContent =
            "0j 00m";

        $("workStat").textContent =
            "0j 00m";

        $("breakStat").textContent =
            "0j 00m";


        $("dayProgress").style.width =
            "0%";

        $("dayProgressText").textContent =
            "0%";


        if (
            $("timeline").dataset.holiday
            !== "true"
        ) {

            $("timeline").dataset.holiday =
                "true";

            $("timeline").dataset.signature =
                "";


            $("timeline").innerHTML = `

                    <div class="py-10 text-center">

                        <div class="text-5xl mb-4">
                            ๐Ÿ–๏ธ
                        </div>

                        <p
                            class="text-xl font-semibold text-blue-300"
                        >
                            Tidak ada jadwal kerja
                        </p>

                        <p
                            class="text-slate-500 mt-2"
                        >
                            Sabtu dan Minggu adalah hari libur.
                        </p>

                    </div>

                `;

        }

    }


    /* =========================================
       MAIN UPDATE
    ========================================= */

    function update() {

        const now =
            new Date();


        updateHeader(now);

        updateProgress(now);


        const state =
            getState();


        /* ==========================
           HOLIDAY
        ========================== */

        if (state.holiday) {

            setHoliday();

            return;

        }


        $("holidayCard")
            .classList
            .add("hidden");


        $("timeline")
            .dataset
            .holiday = "false";


        const isFriday = new Date().getDay() === 5;
        const scheduleHours = isFriday ? "08:00 โ€” 17:30" : "08:00 โ€” 17:00";
        $("scheduleHours").textContent = scheduleHours;


        renderTimeline(
            state.events,
            now,
            state.nextIndex
        );


        /* ==========================
           FINISHED
        ========================== */

        if (state.finished) {

            /*
             * Jalankan fireworks
             * hanya sekali ketika
             * hari kerja selesai.
             */

            if (
                lastTargetType !==
                "finished"
            ) {

                launchFireworks();

                lastTargetType =
                    "finished";

            }


            setFinished(state);

        }


        /* ==========================
           NORMAL
        ========================== */

        else {

            checkMilestone(state);

            setNormal(state);

        }

    }


    /* =========================================
       INITIALIZE
    ========================================= */

    update();


    /*
     * Update timer setiap detik.
     */

    setInterval(
        update,
        1000
    );

</script>

</body>
</html>

Zerion Mini Shell 1.0