svg+css实现铃铛通知消息炫酷动态动画效果代码
代码语言:html
所属分类:动画
代码描述:svg+css实现铃铛通知消息炫酷动态动画效果代码
代码标签: svg css 铃铛 通知 消息 炫酷 动态 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body {
font-family: sans-serif;
background: #111;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' id='bp'%3E%3Cdefs%3E%3CradialGradient id='grad'%3E%3Cstop offset='0%25' stop-color='%231a1a1a' /%3E%3Cstop offset='100%25' stop-color='%23000' /%3E%3C/radialGradient%3E%3Cpattern id='grid' width='100' height='100' patternUnits='userSpaceOnUse' patternTransform='scale(0.5) skewY(10) skewX(-30)'%3E%3Cpath d='M10 0v100m10 0v-100m10 0v100m10 0v-100m10 0v100m10 0v-100m10 0v100m10 0v-100m10 0v100M0 10h100m0 10h-100m0 10h100m0 10h-100m0 10h100m0 10h-100m0 10h100m0 10h-100m0 10h100' fill='none' stroke='rgba(255,255,255,0.1)' /%3E%3Cpath d='M0 0l0 100 100 0 0-100z' fill='none' stroke='rgba(255,255,255,0.2)' /%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23grad)' /%3E%3Crect width='100%25' height='100%25' fill='url(%23grid)' /%3E%3C/svg%3E");
height: 100vh;
width: 100vw;
margin: 0 auto;
}
}
.notification-center {
position: fixed;
top: 20px;
left: 20px;
width: 300px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.hidden {
display: none;
}
.notification {
padding: 0.5rem;
color: #fff;
border-bottom: 1px dotted #e0e0e0;
}
.notification:last-child {
border-bottom: none;
}
.bell-icon, .circles, .blobulus, .all-notifications {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
cursor: pointer;
}
.circles {
height: 190px;
width: 190px;
}
.blobulus {
height: 300px;
width: 300px;
}
.bell-icon {
height: 100px;
width: 100px;
}
</style>
</head>
<body translate="no">
<div class="notification-center">
<div class="notifications hidden">
<div class="notification">
<p>👍 Abdul liked your post</p>
</div>
<div class="notification">
<p>💬 Sierra commented on your post</p>
</div>
<div class="notification">
<p>👋 Kai accepted your invitation</p>
</div>
<div class="notification">
<p>🎥 Oscar is going live!</p>
</div>
</div>
</div>
<div class="all-notifications">
<svg viewBox="-20 -20 140 140" class="blobulus">
<path d="M 50 0 c 30 0 50 20 50 50 c 0 30 -20 50 -50 50 c -30 0 -50 -20 -50 -50 c 0 -30 20 -50 50 -50" fill="none" stroke="#ddd" stroke-opacity="0.7" stroke-width="1" stroke-dasharray="3" opacity="0.5">
<animateTransform attributeName="transform" attributeType="XML" type="rotate" values="0 50 50; 360 50 50" dur="12419ms" begin="-1733ms" repeatCount="indefinite" />
<animate attributeName="d" values="M 50 0 c 43 0 50 7 50 50 c 0 44 -6 50 -50 50 c -44 0 -50 -6 -50 -50 c 0 -44 6 -50 50 -50; M 50 0 c 15 0 50 35 50 50 c 0 20 -30 50 -50 50 c -26 0 -50 -24 -50 -50 c 0 -41 9 -50 50 -50; M 50 0 c 32 0 50 18 50 50 c 0 44 -6 50 -50 50 c -15 0 -50 -35 -50 -50 c 0 -20 30 -50 50 -50; M 50 0 c 33 0 50 17 50 50 c 0 29 -21 50 -50 50 c -42 0 -50 -8 -50 -50 c 0 -20 30 -50 50 -50; M 50 0 c 23 0 50 27 50 50 c 0 43 -7 50 -50 50 c -24 0 -50 -26 -50 -50 c 0 -21 29 -50 50 -50; M 50 0 c 31 0 50 19 50 50 c 0 15 -35 50 -50 50 c -22 0 -50 -28 -50 -50 c 0 -30 20 -50 50 -50; M 50 0 c 41 0 50 9 50 50 c 0 33 -17 50 -50 50 c -33 0 -50 -17 -50 -50 c 0 -47 3 -50 50 -50; M 50 0 c 15 0 50 35 50 50 c 0 40 -10 50 -50 50 c -49 0 -50 -1 -50 -50 c 0 -23 27 -50 50 -50; M 50 0 c 43 0 50 7 50 50 c 0 23 -27 50 -50 50 c -50 0 -50 0 -50 -50 c 0 -39 11 -50 50 -50; M 50 0 c 18 0 50 32 50 50 c 0 37 -13 50 -50 50 c -27 0 -50 -23 -50 -50 c 0 -48 2 -50 50 -50; M 50 0 c 16 0 50 34 50 50 c 0 19 -31 50 -50 50 c -47 0 -50 -3 -50 -50 c 0 -37 13 -50 50 -50; M 50 0 c 21 0 50 29 50 50 c 0 23 -27 50 -50 50 c -43 0 -50 -7 -50 -50 c 0 -15 35 -50 50 -50; M 50 0 c 37 0 50 13 50 50 c 0 28 -22 50 -50 50 c -30 0 -50 -20 -50 -50 c 0 -23 27 -50 50 -50; M 50 0 c 31 0 50 19 50 50 c 0 26 -24 50 -50 50 c -27 0 -50 -23 -50 -50 c 0 -44 6 -50 50 -50;M 50 0 c 43 0 50 7 50 50 c 0 44 -6 50 -50 50 c -44 0 -50 -6 -50 -50 c 0 -44 6 -50 50 -50" dur="11797ms" begin="-3277ms" repeatCount="indefinite" keyTimes="0; 0.07142857142857142; 0.14285714285714285; 0.21428571428571427; 0.2857142857142857; 0.3571428571428571; 0.42857142857142855; 0.5; 0.5714285714285714; 0.6428571428571428; 0.7142857142857142; 0.7857142857142857; 0.8571428571428571; 0.9285714285714285; 1" keySplines="0.8 0.72 0.81 0.33; 0.7 0.27 0.82 0.87; 0.14 0.21 0.5 0.32; 0.97 0.01 0.31 0.51; 0.67 0.35 0.14 0.25; 0 0.46 0.2 0.1; 0.01 0.52 0.18 0.02; 0.73 0.4 0.87 0.55; 0.03 0.71 0.92 0.71; 0.33 0.6 0.68 0.45; 0.63 0.24 0.02 0.92; 0.34 0.55 0.6 0.44; 0.86 0.47 0.21 0.88; 0.09 0.49 0.09 0.73" calcMode="spline" />
<animate attributeName="stroke-dasharray" values="3;0;3;5;0;3;0;5;4;0;5;3;1;3;3" dur="11797ms" begin="-3277ms" repeatCount="indefinite" keyTimes=&qu.........完整代码请登录后点击上方下载按钮下载查看
网友评论0