CSS3 饮料瓶造型文字旋转特效

<!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 {

            margin: 0;

            padding: 0;

            height: 100vh;

            display: flex;

            justify-content: center;

            align-items: center;

            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);

            font-family: 'Arial', sans-serif;

            overflow: hidden;

        }

       

        .bottle-container {

            position: relative;

            width: 300px;

            height: 500px;

            perspective: 1000px;

        }

       

        .bottle {

            position: absolute;

            width: 100%;

            height: 100%;

            transform-style: preserve-3d;

            animation: rotate 15s infinite linear;

        }

       

        .bottle-side {

            position: absolute;

            width: 100%;

            height: 100%;

            background: rgba(100, 200, 255, 0.6);

            border: 3px solid #fff;

            border-radius: 40px;

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

            display: flex;

            justify-content: center;

            align-items: center;

            font-size: 24px;

            font-weight: bold;

            color: #fff;

            text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);

            backface-visibility: hidden;

        }

       

        /* 饮料瓶四个侧面 */

        .bottle-side:nth-child(1) {

            transform: rotateY(0deg) translateZ(150px);

            background: rgba(70, 130, 180, 0.7);

        }

       

        .bottle-side:nth-child(2) {

            transform: rotateY(90deg) translateZ(150px);

            background: rgba(100, 149, 237, 0.7);

        }

       

        .bottle-side:nth-child(3) {

            transform: rotateY(180deg) translateZ(150px);

            background: rgba(30, 144, 255, 0.7);

        }

       

        .bottle-side:nth-child(4) {

            transform: rotateY(270deg) translateZ(150px);

            background: rgba(0, 191, 255, 0.7);

        }

       

        /* 饮料瓶顶部 */

        .bottle-top {

            position: absolute;

            width: 60px;

            height: 80px;

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

            border: 3px solid #fff;

            border-radius: 10px;

            top: -90px;

            left: 50%;

            transform: translateX(-50%);

        }

       

        /* 饮料瓶底部 */

        .bottle-bottom {

            position: absolute;

            width: 200px;

            height: 30px;

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

            border: 3px solid #fff;

            border-radius: 50%;

            bottom: -20px;

            left: 50%;

            transform: translateX(-50%);

        }

       

        /* 旋转动画 */

        @keyframes rotate {

            from {

                transform: rotateY(0deg);

            }

            to {

                transform: rotateY(360deg);

            }

        }

       

        .info {

            position: absolute;

            bottom: 50px;

            text-align: center;

            color: #555;

            width: 100%;

        }

       

        .info a {

            color: #4682b4;

            text-decoration: none;

            font-weight: bold;

        }

       

        .info a:hover {

            text-decoration: underline;

        }

        .hao{

            display: none;

        }

    </style>

</head>

<body>

    <div class="bottle-container">

       

        <div class="bottle">

            <div class="bottle-side">冰爽可乐</div>

            <div class="bottle-side">清新雪碧</div>

            <div class="bottle-side">果味芬达</div>

            <div class="bottle-side">经典矿泉水</div>

        </div>

        <div class="bottle-bottom"></div>

    </div>

</body>

</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值