用AI做了一个网站维护倒计时模板,还有优化空间

tetepay  (UID: 2470) [复制链接]
帖子链接已复制到剪贴板
帖子已经有人评论啦,不支持删除!

840 4

 

<!--
制作:AI
资源宝:www.httple.net
时间:2025-6-21
-->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网站维护倒计时</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #3498db; /* 设置背景颜色为蓝色 */
            color: white;
            display: flex;
            height: 100vh;
            justify-content: center;
            align-items: center;
        }
        .countdown-container {
            text-align: center;
            background: rgba(0, 0, 0, 0.7); /* 半透明黑色背景 */
            padding: 20px 40px;
            border-radius: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }
        .countdown h1 {
            margin: 0;
            font-size: 3em;
        }
        .countdown p {
            margin: 10px 0;
            font-size: 1.2em;
        }
        .maintenance-tip {
            margin-top: 20px;
            font-size: 1.1em;
        }
    </style>
</head>
<body>

<div class="countdown-container">
    <div class="countdown">
        <h1>00:00:00</h1>
        <p>网站将在以上时间后恢复访问</p>
    </div>
    <div class="maintenance-tip">
        <p>我们正在进行网站维护,请稍后再访问!</p>
        <p>感谢您的耐心等待。</p>
    </div>
</div>

<script>
    // 设置目标日期(网站上线的时间)
    var countDownDate = new Date("June 22, 2025 00:00:00").getTime();

    var x = setInterval(function() {

        // 获取当前日期和时间
        var now = new Date().getTime();

        // 计算距离目标日期的时间差
        var distance = countDownDate - now;

        if (distance < 0) {
            clearInterval(x);
            document.querySelector('.countdown h1').textContent = "时间已到!";
            return;
        }

        // 时间计算:年、月、日、小时、分钟和秒
        var years = Math.floor(distance / (1000 * 60 * 60 * 24 * 365));
        var months = Math.floor((distance % (1000 * 60 * 60 * 24 * 365)) / (1000 * 60 * 60 * 24 * 30));
        var days = Math.floor((distance % (1000 * 60 * 60 * 24 * 30)) / (1000 * 60 * 60 * 24));
        var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
        var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
        var seconds = Math.floor((distance % (1000 * 60)) / 1000);

        // 输出结果到HTML元素中
        document.querySelector('.countdown h1').textContent = days + "天 " + hours + "时 " + minutes + "分 " + seconds + "秒 ";
    }, 1000);
</script>

</body>
</html>
9000多个源码网站:https://www.httple.net
已有评论 ( 4 )
  • 头像
    tetepay (UID: 2470)
    (9000多个源码网站:https://www.httple.net)
    1楼

    美化版

    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>网站维护倒计时</title>
        <style>
            @keyframes gradient {
                0% { background-color: #ff00cc; }
                25% { background-color: #3333ff; }
                50% { background-color: #00ccff; }
                75% { background-color: #00ff99; }
                100% { background-color: #ff00cc; }
            }
    
            body {
                font-family: 'Orbitron', sans-serif; /* 使用具有科幻感的字体 */
                background: linear-gradient(135deg, #ff00cc, #3333ff, #00ccff, #00ff99); /* 渐变背景 */
                background-size: 400% 400%;
                animation: gradient 10s ease infinite; /* 动态渐变动画 */
                color: white; /* 白色文字 */
                display: flex;
                height: 100vh;
                justify-content: center;
                align-items: center;
                margin: 0;
                overflow: hidden;
            }
            
            .countdown-container {
                text-align: center;
                background: rgba(0, 0, 0, 0.7); /* 深色半透明背景 */
                padding: 40px 60px;
                border-radius: 20px;
                box-shadow: 0 5px 30px rgba(0, 0, 0, 0.4);
            }
    
            .countdown h1 {
                margin: 0;
                font-size: 5em; /* 更大的时间数显示 */
                text-shadow: 0 0 10px #00ffcc, 0 0 20px #00ccff; /* 添加发光效果 */
            }
    
            .countdown p {
                margin: 10px 0;
                font-size: 1.8em; /* 更大字体 */
                opacity: 0.9;
                text-shadow: 0 0 5px #00ffcc, 0 0 10px #00ccff; /* 科幻风格的文字阴影 */
            }
    
            .maintenance-tip {
                margin-top: 25px;
                font-size: 1.5em; /* 更大字体 */
                text-shadow: 0 0 5px #ffffff, 0 0 10px #00ffcc; /* 亮色文字阴影效果 */
            }
        </style>
        <link href="https://fonts.googleapis.com/css2?family=Orbitron&display=swap" rel="stylesheet"> <!-- 引入Orbitron字体 -->
    </head>
    <body>
    
    <div class="countdown-container">
        <div class="countdown">
            <h1>00:00:00</h1>
            <p>网站将在以上时间后恢复访问</p>
        </div>
        <div class="maintenance-tip">
            <p>我们正在进行网站维护,请稍后再访问!</p>
            <p>感谢您的耐心等待。</p>
        </div>
    </div>
    
    <script>
        var countDownDate = new Date("June 22, 2025 00:00:00").getTime();
    
        var x = setInterval(function() {
            var now = new Date().getTime();
            var distance = countDownDate - now;
    
            if (distance < 0) {
                clearInterval(x);
                document.querySelector('.countdown h1').textContent = "时间已到!";
                return;
            }
    
            var days = Math.floor(distance / (1000 * 60 * 60 * 24));
            var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
            var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
            var seconds = Math.floor((distance % (1000 * 60)) / 1000);
    
            document.querySelector('.countdown h1').textContent = days + "天 " + hours + "时 " + minutes + "分 " + seconds + "秒 ";
        }, 1000);
    </script>
    
    </body>
    </html>
  • 头像
    LAOMA (UID: 5047)
    (哈哈哈哈)
    2楼
  • 头像
    V 绚丽智云 (UID: 542)
    (绚丽智云 https://www.vibncloud.cn)
    3楼

     

    <!DOCTYPE html>

    <html lang="zh-CN">

    <head>

        <meta charset="UTF-8">

        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <title>网站维护中 - 即将恢复服务</title>

        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">

        <style>

            /* 基础样式 */

            * {

                margin: 0;

                padding: 0;

                box-sizing: border-box;

            }

            

            body {

                font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

                background: linear-gradient(135deg, #1a2980, #26d0ce);

                color: white;

                display: flex;

                justify-content: center;

                align-items: center;

                min-height: 100vh;

                overflow-x: hidden;

                padding: 20px;

            }

            

            /* 半透明玻璃效果卡片 */

            .countdown-container {

                text-align: center;

                background: rgba(255, 255, 255, 0.1);

                backdrop-filter: blur(12px);

                padding: 40px 50px;

                border-radius: 20px;

                box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);

                max-width: 800px;

                width: 90%;

                border: 1px solid rgba(255, 255, 255, 0.2);

                position: relative;

                overflow: hidden;

                animation: fadeInUp 0.8s ease-out;

            }

            

            .countdown-container::before {

                content: "";

                position: absolute;

                top: -50%;

                left: -50%;

                width: 200%;

                height: 200%;

                background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);

                z-index: -1;

            }

            

            .logo {

                margin-bottom: 20px;

                font-size: 2.5rem;

            }

            

            .logo i {

                color: #ff6b6b;

                font-size: 3rem;

                margin-right: 15px;

                text-shadow: 0 0 20px rgba(255, 107, 107, 0.7);

            }

            

            .logo h1 {

                display: inline-block;

                font-weight: 600;

                letter-spacing: 1px;

                text-shadow: 0 2px 4px rgba(0,0,0,0.2);

            }

            

            /* 倒计时显示样式 */

            .countdown {

                margin: 30px 0;

                display: flex;

                justify-content: center;

                flex-wrap: wrap;

            }

            

            .time-unit {

                margin: 0 10px;

                min-width: 110px;

            }

            

            .time-value {

                font-size: 3.5rem;

                font-weight: 700;

                background: rgba(255, 255, 255, 0.12);

                border-radius: 15px;

                padding: 15px 20px;

                margin-bottom: 10px;

                display: flex;

                justify-content: center;

                align-items: center;

                box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);

                transition: all 0.3s ease;

            }

            

            .time-value:hover {

                transform: translateY(-5px);

                box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);

                background: rgba(255, 255, 255, 0.18);

            }

            

            .time-label {

                font-size: 1.1rem;

                letter-spacing: 1px;

                opacity: 0.9;

                font-weight: 500;

            }

            

            /* 进度条样式 */

            .progress-container {

                width: 100%;

                height: 6px;

                background: rgba(255, 255, 255, 0.15);

                border-radius: 10px;

                margin: 30px auto;

                overflow: hidden;

            }

            

            .progress-bar {

                height: 100%;

                background: linear-gradient(90deg, #ff9a9e, #fad0c4);

                border-radius: 10px;

                width: 0;

                transition: width 0.5s ease;

            }

            

            /* 提示信息和社交链接 */

            .maintenance-tip {

                margin-top: 30px;

                font-size: 1.2rem;

                line-height: 1.6;

            }

            

            .maintenance-tip p {

                margin: 15px 0;

            }

            

            .highlight {

                color: #ffff76;

                font-weight: 600;

            }

            

            .social-links {

                display: flex;

                justify-content: center;

                gap: 20px;

                margin-top: 25px;

            }

            

            .social-links a {

                width: 50px;

                height: 50px;

                display: flex;

                align-items: center;

                justify-content: center;

                background: rgba(255, 255, 255, 0.1);

                border-radius: 50%;

                font-size: 1.5rem;

                color: white;

                transition: all 0.3s ease;

                text-decoration: none;

                border: 1px solid rgba(255, 255, 255, 0.2);

            }

            

            .social-links a:hover {

                transform: translateY(-5px);

                background: rgba(255, 255, 255, 0.2);

                box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);

            }

            

            /* 页脚信息 */

            .footer {

                margin-top: 40px;

                font-size: 0.9rem;

                opacity: 0.8;

            }

            

            /* 动画效果 */

            @keyframes fadeInUp {

                from {

                    opacity: 0;

                    transform: translateY(30px);

                }

                to {

                    opacity: 1;

                    transform: translateY(0);

                }

            }

            

            @keyframes pulse {

                0% {

                    transform: scale(1);

                    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);

                }

                50% {

                    transform: scale(1.03);

                    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);

                }

                100% {

                    transform: scale(1);

                    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);

                }

            }

            

            /* 响应式设计 */

            @media (max-width: 768px) {

                .countdown-container {

                    padding: 30px;

                }

                

                .time-unit {

                    min-width: 90px;

                }

                

                .time-value {

                    font-size: 2.8rem;

                    padding: 12px 15px;

                }

            }

            

            @media (max-width: 576px) {

                .countdown-container {

                    padding: 25px 15px;

                    width: 95%;

                }

                

                .logo {

                    font-size: 2rem;

                }

                

                .time-unit {

                    min-width: 70px;

                    margin: 5px;

                }

                

                .time-value {

                    font-size: 2.2rem;

                    padding: 10px;

                }

                

                .time-label {

                    font-size: 0.9rem;

                }

                

                .maintenance-tip {

                    font-size: 1rem;

                }

            }

        </style>

    </head>

    <body>

     

    <div class="countdown-container">

        <div class="logo">

            <i class="fas fa-tools"></i>

            <h1>网站维护中</h1>

        </div>

        

        <div class="maintenance-tip">

            <p>我们正在进行系统维护升级,以提供更优质的服务体验</p>

            <p>请稍后访问!<span class="highlight">感谢您的理解与支持</span></p>

        </div>

        

        <div class="countdown">

            <div class="time-unit">

                <div class="time-value" id="days">00</div>

                <div class="time-label">天</div>

            </div>

            <div class="time-unit">

                <div class="time-value" id="hours">00</div>

                <div class="time-label">时</div>

            </div>

            <div class="time-unit">

                <div class="time-value" id="minutes">00</div>

                <div class="time-label">分</div>

            </div>

            <div class="time-unit">

                <div class="time-value" id="seconds">00</div>

                <div class="time-label">秒</div>

            </div>

        </div>

        

        <div class="progress-container">

            <div class="progress-bar" id="progress-bar"></div>

        </div>

        

        <div class="maintenance-tip">

            <p>在此期间,您可以通过以下方式获取最新信息:</p>

            

            <div class="social-links">

                <a href="#" title="微信公众号"><i class="fab fa-weixin"></i></a>

                <a href="#" title="微博"><i class="fab fa-weibo"></i></a>

                <a href="#" title="邮件订阅"><i class="fas fa-envelope"></i></a>

                <a href="#" title="客服"><i class="fas fa-headset"></i></a>

            </div>

        </div>

        

        <div class="footer">

            <p>资源宝 · www.httple.net · © 2025</p>

        </div>

    </div>

     

    <script>

        // 设置目标日期(网站上线的时间)

        var countDownDate = new Date("June 22, 2025 00:00:00").getTime();

        var startDate = new Date("June 21, 2025 00:00:00").getTime();

        var totalDuration = countDownDate - startDate;

        

        // 获取显示元素

        var daysElement = document.getElementById("days");

        var hoursElement = document.getElementById("hours");

        var minutesElement = document.getElementById("minutes");

        var secondsElement = document.getElementById("seconds");

        var progressBar = document.getElementById("progress-bar");

        

        var x = setInterval(function() {

            // 获取当前日期和时间

            var now = new Date().getTime();

            

            // 计算距离目标日期的时间差

            var distance = countDownDate - now;

            var elapsed = now - startDate;

            

            // 计算进度百分比

            var percent = (elapsed / totalDuration) * 100;

            progressBar.style.width = Math.min(percent, 100) + "%";

            

            if (distance < 0) {

                clearInterval(x);

                daysElement.textContent = "00";

                hoursElement.textContent = "00";

                minutesElement.textContent = "00";

                secondsElement.textContent = "00";

                document.querySelector('.maintenance-tip p:first-child').innerHTML = 

                    "网站维护已完成!<span class='highlight'>正在恢复服务...</span>";

                progressBar.style.width = "100%";

                return;

            }

            

            // 时间计算:天、小时、分钟和秒

            var days = Math.floor(distance / (1000 * 60 * 60 * 24));

            var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));

            var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));

            var seconds = Math.floor((distance % (1000 * 60)) / 1000);

            

            // 添加前导零

            days = days < 10 ? "0" + days : days;

            hours = hours < 10 ? "0" + hours : hours;

            minutes = minutes < 10 ? "0" + minutes : minutes;

            seconds = seconds < 10 ? "0" + seconds : seconds;

            

            // 更新显示元素

            daysElement.textContent = days;

            hoursElement.textContent = hours;

            minutesElement.textContent = minutes;

            secondsElement.textContent = seconds;

            

            // 为当前变化的单位添加动画效果

            animateElement(secondsElement);

        }, 1000);

        

        // 为变化的数字添加动画效果

        function animateElement(element) {

            element.style.animation = "pulse 0.5s ease";

            setTimeout(() => {

                element.style.animation = "";

            }, 500);

        }

    </script>

     

    </body>

    </html>

     

  • 头像
    tetepay (UID: 2470)
    (9000多个源码网站:https://www.httple.net)
    4楼

    你们的美术感真好,我用十几种方法没达到这效果

域名市场
   域名载入中...
创建新帖
自助推广购买广告位
确认删除
确定要删除这篇帖子吗?删除后将无法恢复。
删除成功
帖子已成功删除,页面将自动刷新。
删除失败
删除帖子时发生错误,请稍后再试。