CSS3齿轮滚动动画

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS3齿轮滚动动画</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background-color: #222;
            overflow: hidden;
        }
        
        .gear-container {
            position: relative;
            width: 300px;
            height: 300px;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        
        /* 齿轮基础样式 */
        .gear {
            position: absolute;
            background-color: #444;
            border-radius: 50%;
            box-shadow: 0 0 10px rgba(0,0,0,0.5);
            display: flex;
            justify-content: center;
            align-items: center;
        }
        
        /* 齿轮齿样式 */
        .gear::before {
            content: '';
            position: absolute;
            width: 100%;
            height: 100%;
            background: 
                repeating-conic-gradient(
                    from 0deg,
                    #555 0deg 20deg,
                    transparent 20deg 40deg
                );
            border-radius: 50%;
        }
        
        /* 中心孔 */
        .gear::after {
            content: '';
            position: absolute;
            width: 25%;
            height: 25%;
            background-color: #222;
            border-radius: 50%;
            box-shadow: inset 0 0 5px rgba(0,0,0,0.8);
        }
        
        /* 大齿轮 */
        .gear-large {
            width: 200px;
            height: 200px;
            animation: rotate 8s linear infinite;
        }
        
        /* 中齿轮 */
        .gear-medium {
            width: 140px;
            height: 140px;
            top: 180px;
            left: 180px;
            animation: rotate-reverse 6s linear infinite;
        }
        
        /* 小齿轮 */
        .gear-small {
            width: 80px;
            height: 80px;
            top: 50px;
            left: 50px;
            animation: rotate 4s linear infinite;
        }
        
        /* 旋转动画 */
        @keyframes rotate {
            from {
                transform: rotate(0deg);
            }
            to {
                transform: rotate(360deg);
            }
        }
        
        @keyframes rotate-reverse {
            from {
                transform: rotate(0deg);
            }
            to {
                transform: rotate(-360deg);
            }
        }
        
        /* 连接杆 */
        .connector {
            position: absolute;
            background-color: #555;
            z-index: -1;
        }
        
        .connector-1 {
            width: 120px;
            height: 20px;
            top: 90px;
            left: 90px;
            transform: rotate(45deg);
        }
        
        .connector-2 {
            width: 120px;
            height: 20px;
            top: 90px;
            left: 90px;
            transform: rotate(-45deg);
        }
        
        /* 发光效果 */
        .glow {
            position: absolute;
            width: 300px;
            height: 300px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(100,200,255,0.2) 0%, transparent 70%);
            filter: blur(10px);
            animation: pulse 3s ease-in-out infinite alternate;
        }
        
        @keyframes pulse {
            from {
                opacity: 0.5;
                transform: scale(0.9);
            }
            to {
                opacity: 0.8;
                transform: scale(1.1);
            }
        }
        
        /* 标题样式 */
        .title {
            position: absolute;
            bottom: 50px;
            color: #eee;
            font-family: Arial, sans-serif;
            font-size: 24px;
            text-shadow: 0 0 10px rgba(100,200,255,0.5);
            opacity: 0;
            animation: fadeIn 2s ease-in-out 1s forwards;
        }
        
        @keyframes fadeIn {
            to {
                opacity: 1;
            }
        }
    </style>
</head>
<body>
    <div class="gear-container">
        <div class="glow"></div>
        
        <div class="gear gear-large"></div>
        <div class="gear gear-medium"></div>
        <div class="gear gear-small"></div>
        
        <div class="connector connector-1"></div>
        <div class="connector connector-2"></div>
        
        <div class="title">机械动力系统</div>
    </div>

</body>
</html>

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值