html+css 热茶效果

handlebars 复制代码
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>热茶特效</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            background: #607d8b;
        }
        
        .container {
            position: relative;
            top: 50px;
        }
        
        .cup {
            position: relative;
            width: 280px;
            height: 300px;
            background: linear-gradient(to right, #f9f9f9, #f9f9f9);
            border-bottom-left-radius: 45%;
            border-bottom-right-radius: 45%;
        }
        
        .top {
            position: absolute;
            top: -30px;
            left: 0;
            width: 100%;
            height: 60px;
            background: linear-gradient(to right, #f9f9f9, #f9f9f9);
            border-radius: 50%;
        }
        
        .circle {
            position: absolute;
            top: 5px;
            left: 10px;
            width: calc(100% - 20px);
            height: 50px;
            background: linear-gradient(to left, #f9f9f9, #f9f9f9);
            border-radius: 50%;
            overflow: hidden;
        }
        
        .tea {
            position: absolute;
            top: 20px;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(#c57e65, #e28462);
            border-radius: 50%;
        }
        
        .handle {
            position: absolute;
            right: -70px;
            top: 40px;
            width: 160px;
            height: 180px;
            border: 25px solid #dcdcdc;
            border-left: 25px solid transparent;
            border-bottom: 25px solid transparent;
            border-radius: 50%;
            transform: rotate(42deg);
        }
        
        .plate {
            position: absolute;
            bottom: -50px;
            left: 50%;
            transform: translateX(-50%);
            width: 500px;
            height: 200px;
            background: linear-gradient(to right, #f9f9f9, #e7e7e7);
            border-radius: 50%;
            box-shadow: 0 35px 35px rgba(0, 0, 0, 0.2);
        }
        
        .plate::before {
            content: '';
            position: absolute;
            top: 10px;
            left: 10px;
            right: 10px;
            bottom: 10px;
            border-radius: 50%;
            background: linear-gradient(to left, #f9f9f9, #e7e7e7);
        }
        
        .plate::after {
            content: '';
            position: absolute;
            top: 30px;
            left: 30px;
            right: 30px;
            bottom: 30px;
            border-radius: 50%;
            background: linear-gradient(rgba(0, 0, 0, 0.2) 25%, transparent, transparent);
        }
        
        .vapour {
            position: relative;
            display: flex;
            z-index: 1;
            padding: 0 20px;
        }
        
        .vapour>div {
            position: relative;
            bottom: 50px;
            margin: 0 2px 50px;
            min-width: 8px;
            height: 120px;
            border-radius: 50%;
            background: #fff;
            animation: vapours 5s linear infinite;
            opacity: 0;
            filter: blur(8px);
            animation-delay: calc(var(--i)*-0.5s);
        }
        
        @keyframes vapours {
            0% {
                transform: translateY(0) scaleX(1);
                opacity: 0;
            }
            15% {
                opacity: 1;
            }
            50% {
                transform: translateY(-150px) scaleX(5);
            }
            95% {
                opacity: 0;
            }
            100% {
                transform: translateY(-300px) scaleX(10);
            }
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="plate"></div>
        <div class="cup">
            <div class="top">
                <div class="vapour">
                    <div style="--i: 1"></div>
                    <div style="--i: 2"></div>
                    <div style="--i: 3"></div>
                    <div style="--i: 4"></div>
                    <div style="--i: 5"></div>
                    <div style="--i: 6"></div>
                    <div style="--i: 7"></div>
                    <div style="--i: 8"></div>
                    <div style="--i: 9"></div>
                    <div style="--i: 10"></div>
                    <div style="--i: 11"></div>
                    <div style="--i: 12"></div>
                    <div style="--i: 13"></div>
                    <div style="--i: 14"></div>
                    <div style="--i: 15"></div>
                    <div style="--i: 16"></div>
                    <div style="--i: 17"></div>
                    <div style="--i: 18"></div>
                    <div style="--i: 19"></div>
                    <div style="--i: 20"></div>
                </div>
                <div class="circle">
                    <div class="tea"></div>
                </div>
            </div>
            <div class="handle"></div>
        </div>
    </div>
</body>

</html>
相关推荐
我科绝伦(Huanhuan Zhou)2 分钟前
MOP数据库备份脚本生成工具
前端·css·数据库
海的诗篇_8 分钟前
前端开发面试题总结-vue2框架篇(三)
前端·javascript·css·面试·vue·html
Danny_FD10 分钟前
在 React 函数组件中实现 `<textarea>` 平滑自动滚动到底部
前端
掘金一周21 分钟前
数据脱敏的这6种方案,真香!| 掘金一周 5.29
前端·人工智能·后端
小小愿望22 分钟前
彻底禁用移动端H5页面默认下拉刷新功能:原理与实战
前端
Antioper31 分钟前
盘点前端经典手写代码题
前端
断竿散人31 分钟前
⚡CSS动画性能优化:60fps丝滑体验的终极秘籍
前端·css·性能优化
天天摸鱼的java工程师36 分钟前
前端难还是后端难?作为八年后端开发,我想说点实话
前端·后端·程序员
工呈士1 小时前
TCP/IP 协议详解
前端·后端·面试
AryaNimbus1 小时前
“我 Cursor Pro 怎么用三天就没了?”——500 次额度的真相是这样
前端·cursor