svg实现火苗燃烧铃铛摇摆提醒动画效果代码
代码语言:html
所属分类:动画
代码描述:svg实现火苗燃烧铃铛摇摆提醒动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Archivo+Black&display=swap");
html {
font-size: 12px;
}
body {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
background-color: #f5fccd;
font-family: "Archivo Black", "Arial Black", sans-serif;
font-size: 2rem;
overflow: hidden;
}
.bell {
position: relative;
}
.bell__icon-background {
position: absolute;
z-index: -1;
top: -10%;
left: -10%;
width: 120%;
height: 120%;
background: linear-gradient(#fff 50%, #ff7d66 200%);
background-size: 100% 200%;
background-position: 0 0;
border-radius: 30%;
box-shadow: 0 0.5rem 0 0 rgba(0, 0, 56, 0.1);
}
.bell__icon-shadow {
position: absolute;
opacity: 0.2;
transform-origin: top;
animation: ring;
animation-duration: 3s;
animation-iteration-count: infinite;
animation-delay: -0.04s;
}
.bell__icon {
transform-origin: top;
animation: ring;
animation-duration: 3s;
animation-iteration-count: infinite;
}
@keyframes ring {
0%, 50% {
transform: rotate(0);
}
10%, 30% {
transform: rotate(-30deg);
}
20%, 40% {
transform: rotate(30deg);
}
}
.bell__icon-tip {
position: absolute;
bottom: 0;
left: 0;
transform: rotate(8deg);
transform-origin: top;
animation: ring-tip;
animation-duration: 3s;
animation-iteration-count: infinite;
}
@keyframes ring-tip {
0%, 50% {
transform: rotate(8deg);
}
10%, 30% {
transform: rotate(-10deg);
}
20%, 40% {
transform: rotate(30deg);
}
}
.bell:after {
content: "3";
position: absolute;
top: 0;
right: 0;
display: flex;
justify-content: center;
align-items: center;
width: 2.5rem;
height: 2.5rem;
color: #ff7d66;
animation-duration: 3s;
animation-iteration-count: infinite;
}
@keyframes number {
0%, 50% {
transform: rotate(0deg);
}
10%, 30% {
transform: rotate(-10deg);
}
20%, 40% {
transform: rotate(10deg);
}
}
.fire {
position: absolute;
top: -14.5rem;
right: -8.8rem;
display: flex;
flex-direction: column;
align-items: center;
width: 20rem;
height: 20rem;
animation-duration: 1s;
animation-iteration-count: infinite;
}
.fire__part {
position: absolute;
}
@keyframes flames {
0%, 100% {
transform: scale3d(0.8, 1.1, 1) rotate(1deg);
}
20% {
transform: scale3d(0.9, 1, 1) rotate(4deg);
}
40% {
transform: scale3d(0.8, 1.2, 1) rotate(2deg);
}
60% {
transform: scale3d(0.9, 1, 1) rotate(-4deg);
}
80% {
transform: scale3d(0.8, 1.2, 1) rotate(-2deg);
}
}
.fire__part--red {
bottom: 2rem;
width: 8rem;
height: 8rem;
background: #ff7d66;
border-radius: 50%;
transform-origin: bottom;
animation: flames;
animation-duration: 6s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
animation-delay: -0.6s;
}
.fire__part--orange {
bottom: 2.5rem;
width: 6rem;
height: 6rem;
background: orange;
border-radius: 50%;
transform-origin: bottom;
animation: flames;
animation-duration: 6s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
animation-delay: -0.4s;
}
.fire__part--yellow {
bottom: 3rem;
width: 4rem;
height: 4rem;
background: #f5fccd;
border-radius: 50%;
transform-origin: bottom;
animation: flames;
animation-duration: 6s;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
animation-delay: -0.2s;
}
</style>
</head>
<body translate="no">
<div class="bell">
<div class="bell__icon-background"></div>
<div class="fire">
<div class="fire__part fire__part--red"></div>
<div class="fire__part fire__part--orange"></div>
<div class="fire__part fire__part--yellow"></div>
</div>&l.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0