<template>
<div class="section">
<div class="shadow"></div>
<div class="box1">
<div class = "liquid"></div>
</div>
<div></div>
</div>
</template>
<script>
export default {
name: "colorLuquid"
}
</script>
<style scoped lang="less">
*{
margin: 0;
padding: 0;
box-sizing: border-box;
/*标准盒子模型: margin、border、padding、content,content不包含其他部分
IE盒子模型:margin、content(border + padding + content)
box-sizing:content-box; //标准盒子模型
box-sizing: border-box; //IE盒子模型*/
}
.section{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #121212;
.box1{
position: relative;
width: 300px;
height: 300px;
background: rgba(255,255,255,0.1);
border-radius: 50%;
border: 0px solid transparent;
transform-origin: bottom center; // 设置旋转的中心点
animation: animate 5s linear infinite; // 动画效果,不会
}
@keyframes animate{
0%
{
filter: hue-rotate(0deg);
transform: rotate(0deg);
}
25%
{
transform: rotate(15deg);
}
50%
{
transform: rotate(0deg);
}
75%
{
transform: rotate(-15deg);
}
100%
{
filter: hue-rotate(360deg);
transform: rotate(0deg);
}
}
.box1::before{
content: '';
position: absolute;
top: -15px;
left: 50%;
transform: translateX(-50%); // https://www.w3school.com.cn/cssref/pr_transform.asp
width: 40%;
height: 30px;
border: 15px solid #ddd;
border-radius: 50%;
box-shadow: 0 10px #222;
}
.box1::after{
content: '';
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 50%;
width: 150px;
height: 80px;
background: rgba(255,255,255,0.05);
}
.liquid{
position: absolute;
top: 50%;
left: 5px;
right: 5px;
bottom: 5px;
background: #41c1fb;
border-bottom-left-radius: 150px;
border-bottom-right-radius: 150px;
filter: drop-shadow(0 0 80px #41c1fb); // https://www.w3school.com.cn/cssref/pr_filter.asp
}
.liquid::before{
content: '';
position: absolute;
top: -10px;
width: 100%;
height: 20px;
background: #1fa4e0;
border-radius: 50%;
}
.shadow{
position: absolute;
top: calc(50% + 150px);
left: 50%;
transform: translate(-50%, -50%);
width: 300px;
height: 30px;
background: rgba(0,0,0,0.5);
border-radius: 50%;
}
}
</style>
液体碗动画视频
最新推荐文章于 2024-07-05 18:33:47 发布