仰视无缝滚动背景特效

<!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>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            overflow: hidden;
            height: 100vh;
            perspective: 1000px;
            background: #000;
        }
        
        .sky-container {
            position: absolute;
            width: 100%;
            height: 200%;
            transform-style: preserve-3d;
            transform: rotateX(75deg) translateZ(-300px);
            animation: scrollSky 60s linear infinite;
        }
        
        .sky-layer {
            position: absolute;
            width: 100%;
            height: 100%;
            background-size: cover;
            background-repeat: repeat;
            transform-style: preserve-3d;
        }
        
        .layer-1 {
            background-image: url('https://source.unsplash.com/random/1920x1080?stars');
            transform: translateZ(-500px);
            opacity: 0.8;
            filter: brightness(1.2);
        }
        
        .layer-2 {
            background-image: url('https://source.unsplash.com/random/1920x1080?clouds');
            transform: translateZ(-300px);
            opacity: 0.6;
            animation: pulse 8s ease-in-out infinite alternate;
        }
        
        .layer-3 {
            background-image: url('https://source.unsplash.com/random/1920x1080?nightcity');
            transform: translateZ(-100px);
            opacity: 0.9;
        }
        
        .content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: white;
            text-align: center;
            z-index: 100;
            text-shadow: 0 0 10px rgba(0,0,0,0.8);
            font-family: 'Arial', sans-serif;
        }
        
        .content h1 {
            font-size: 3rem;
            margin-bottom: 1rem;
        }
        
        .content p {
            font-size: 1.2rem;
            max-width: 600px;
            margin: 0 auto 2rem;
        }
        
        .btn {
            display: inline-block;
            padding: 12px 30px;
            background: rgba(255,255,255,0.2);
            color: white;
            text-decoration: none;
            border-radius: 30px;
            border: 1px solid rgba(255,255,255,0.4);
            transition: all 0.3s ease;
            backdrop-filter: blur(5px);
        }
        
        .btn:hover {
            background: rgba(255,255,255,0.4);
            transform: translateY(-3px);
        }
        
        .link {
            position: absolute;
            bottom: 20px;
            right: 20px;
            color: rgba(255,255,255,0.7);
            font-family: Arial, sans-serif;
            text-decoration: none;
            z-index: 1000;
            transition: color 0.3s ease;
        }
        
        .link:hover {
            color: #fff;
        }
        
        @keyframes scrollSky {
            0% {
                transform: rotateX(75deg) translateZ(-300px) translateY(0);
            }
            100% {
                transform: rotateX(75deg) translateZ(-300px) translateY(-50%);
            }
        }
        
        @keyframes pulse {
            0% {
                opacity: 0.5;
            }
            100% {
                opacity: 0.8;
            }
        }
    </style>
</head>
<body>
    <div class="sky-container">
        <div class="sky-layer layer-1"></div>
        <div class="sky-layer layer-2"></div>
        <div class="sky-layer layer-3"></div>
    </div>
    
    <div class="content">
        <h1>仰望星空</h1>
        <p>在这浩瀚宇宙中,感受无限可能。我们的视角决定了我们能看到的世界。</p>
        <a href="#" class="btn">探索更多</a>
    </div>
    

</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值