HTML实现动态地球

地球


<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>地球</title>
    <link rel="stylesheet" href="./index.css">
    <style>
        body {
            background: #000;
        }

        .planet {
            width: 280px;
            height: 280px;
            background: #07132f;
            border-radius: 150px;
            position: absolute;
            left: 50%;
            top: 50%;
            margin-left: -140px;
            margin-top: -140px;
            overflow: hidden;
            box-shadow: 0px 0px 55px rgba(20, 100, 255, 0.7);
            border: 1px solid #0089dd;
            border-right: none;
            -webkit-transform: rotateZ(15deg);
            transform: rotateZ(15deg)
        }

        .planet:after {
            content: "";
            width: 90px;
            height: 100%;
            background: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.9));
            position: absolute;
            right: 0;
        }

        .planet:before {
            content: "";
            width: 90px;
            height: 100%;
            background: linear-gradient(to right, rgba(10, 130, 255, 0.6), rgba(0, 0, 0, 0));
            position: absolute;
            left: 0;
            z-index: 3;
        }

        .texture {
            position: absolute;
            left: -360px;
            -webkit-animation: rotation 30s linear infinite;
            animation: rotation 30s linear infinite;
            content: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/184191/earth_copy.jpg);
            height: 320px;
            background-size: cover;
        }

        @keyframes rotation {
            0% {
                left: -845px
            }

            100% {
                left: -185px
            }
        }

        @-webkit-keyframes rotation {
            0% {
                left: -845px
            }

            100% {
                left: -185px
            }
        }
    </style>
</head>

<body>
    <div class="planet">
        <div class="texture"></div>
    </div>
</body>

</html>

预览   |   下载

动态地球    下载

感谢各位的阅读,更多文章请前往九天小窝

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值