【漫步特效】半山听雨/贺素心芳辰/15种滤镜过渡动画+CSS雨
<style>.rain-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 9999;
pointer-events: none;
overflow: hidden;
}
.rain {
position: absolute;
width: 2px;
height: 60px;
background: linear-gradient(to bottom, rgba(255,255,255,0.1), rgba(200, 230, 255, 0.9));
border-radius: 50%;
opacity: 0.85;
animation: rain-fall linear infinite;
}
@keyframes rain-fall {
0% {transform: translateY(-100px);}
100% {transform: translateY(850px);}
}
.rain:nth-child(1) { left: 2%; animation-duration: 0.8s; }
.rain:nth-child(2) { left: 6%; animation-duration: 1s; height: 50px; }
.rain:nth-child(3) { left: 10%; animation-duration: 0.7s; }
.rain:nth-child(4) { left: 14%; animation-duration: 0.9s; height: 55px; }
.rain:nth-child(5) { left: 18%; animation-duration: 0.85s; }
.rain:nth-child(6) { left: 22%; animation-duration: 1.1s; height: 45px; }
.rain:nth-child(7) { left: 26%; animation-duration: 0.75s; }
.rain:nth-child(8) { left: 30%; animation-duration: 0.95s; height: 50px; }
.rain:nth-child(9) { left: 34%; animation-duration: 0.8s; }
.rain:nth-child(10) { left: 38%; animation-duration: 1s; height: 65px; }
.rain:nth-child(11) { left: 42%; animation-duration: 0.7s; }
.rain:nth-child(12) { left: 46%; animation-duration: 0.9s; height: 40px; }
.rain:nth-child(13) { left: 50%; animation-duration: 0.85s; }
.rain:nth-child(14) { left: 54%; animation-duration: 1.05s; height: 55px; }
.rain:nth-child(15) { left: 58%; animation-duration: 0.78s; }
.rain:nth-child(16) { left: 62%; animation-duration: 0.92s; height: 50px; }
.rain:nth-child(17) { left: 66%; animation-duration: 0.82s; }
.rain:nth-child(18) { left: 70%; animation-duration: 1s; height: 48px; }
.rain:nth-child(19) { left: 74%; animation-duration: 0.76s; }
.rain:nth-child(20) { left: 78%; animation-duration: 0.98s; height: 60px; }
.rain:nth-child(21) { left: 82%; animation-duration: 0.72s; height: 52px; }
.rain:nth-child(22) { left: 86%; animation-duration: 1.02s; }
.rain:nth-child(23) { left: 90%; animation-duration: 0.88s; height: 46px; }
.rain:nth-child(24) { left: 94%; animation-duration: 0.79s; }
.rain:nth-child(25) { left: 97%; animation-duration: 0.94s; height: 58px; }
.rain:nth-child(26) { left: 4%; animation-duration: 1.08s; height: 42px; }
.rain:nth-child(27) { left: 24%; animation-duration: 0.74s; }
.rain:nth-child(28) { left: 44%; animation-duration: 0.91s; height: 62px; }
.rain:nth-child(29) { left: 68%; animation-duration: 0.81s; }
.rain:nth-child(30) { left: 88%; animation-duration: 1.04s; height: 51px; }
#mydiv {
margin: 160px 0 30px calc(50% - 800px);
display: grid;
place-items: center;
width: 1700px;
height: 850px;
background: lightblue url('https://644220.freep.cn/644220/4/k31.jpg') no-repeat center/cover;
box-shadow: 3px 3px 20px #000;
user-select: none;
overflow: hidden;
position: relative;
z-index: 1;
}
#vid {
position: absolute;
width: 130%;
height: 130%;
object-fit: cover;
pointer-events: none;
mix-blend-mode: screen;
mask: linear-gradient(to top right, red 88%, transparent 0);
-webkit-mask: linear-gradient(to top right, red 88%, transparent 0);
z-index: 6;
opacity: .40;
}
.img-slider {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2;
}
.slide-item {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
opacity: 0;
will-change: transform, opacity, clip-path, filter;
-webkit-will-change: transform, opacity, clip-path, filter;
transform: translateZ(0);
-webkit-transform: translateZ(0);
animation: slideAnimation 180s linear infinite;
}
.slide-item:nth-child(1) {
background-image: url('https://644220.freep.cn/644220/4/k31.jpg');
animation-delay: 0s;
}
.slide-item:nth-child(2) {
background-image: url('https://644220.freep.cn/644220/4/k32.jpg');
animation-delay: 30s;
}
.slide-item:nth-child(3) {
background-image: url('https://644220.freep.cn/644220/4/k33.jpg');
animation-delay: 60s;
}
.slide-item:nth-child(4) {
background-image: url('https://644220.freep.cn/644220/4/k34.jpg');
animation-delay: 90s;
}
.slide-item:nth-child(5) {
background-image: url('https://644220.freep.cn/644220/4/k35.jpg');
animation-delay: 120s;
}
.slide-item:nth-child(6) {
background-image: url('https://644220.freep.cn/644220/4/k36.jpg');
animation-delay: 150s;
}
@keyframes slideAnimation {
0% { opacity:0; transform:scale(0.5) translateZ(0); clip-path:circle(0% at 50% 50%); filter:blur(6px); }
8% { opacity:1; transform:scale(1) translateZ(0); clip-path:circle(100% at 50% 50%); filter:blur(0); }
16% { opacity:1; transform:translateX(0) translateZ(0); }
19% { opacity:0; transform:translateX(-100%) translateZ(0); }
22% { opacity:1; transform:translateX(0) translateZ(0); }
28% { opacity:1; transform:skewY(0) translateZ(0); clip-path:inset(0); }
31% { opacity:0; transform:skewY(6deg) translateZ(0); clip-path:inset(0 0 10% 0); }
34% { opacity:1; transform:skewY(0) translateZ(0); clip-path:inset(0); }
40% { opacity:1; filter:brightness(1); transform:translateZ(0); }
43% { opacity:0; filter:brightness(2); transform:translateZ(0); }
46% { opacity:1; filter:brightness(1); transform:translateZ(0); }
52% { opacity:1; clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%); transform:translateZ(0); }
55% { opacity:0; clip-path:polygon(50% 50%,50% 50%,50% 50%,50% 50%); transform:translateZ(0); }
58% { opacity:1; clip-path:polygon(0 0,100% 0,100% 100%,0 100%); transform:translateZ(0); }
64% { opacity:1; transform:translateY(0) translateZ(0); }
67% { opacity:0; transform:translateY(-70%) translateZ(0); }
70% { opacity:1; transform:translateY(0) translateZ(0); }
76% { opacity:1; transform:perspective(1000px) rotateY(0deg) translateZ(0); }
79% { opacity:0; transform:perspective(1000px) rotateY(180deg) translateZ(0); }
82% { opacity:1; transform:perspective(1000px) rotateY(0deg) translateZ(0); }
88% { opacity:1; border-radius:0; transform:scale(1) translateZ(0); }
91% { opacity:0; border-radius:50%; transform:scale(0.8) translateZ(0); }
94% { opacity:1; border-radius:0; transform:scale(1) translateZ(0); }
95% { opacity:1; transform:rotate(0deg) translateZ(0); }
96.5% { opacity:0; transform:rotate(5deg) translateZ(0); }
98% { opacity:1; transform:rotate(0deg) translateZ(0); }
98.3% { opacity:1; filter:blur(0); transform:translateZ(0); }
98.9% { opacity:0; filter:blur(10px); transform:translateZ(0); }
99% { opacity:1; clip-path:inset(0); transform:translateZ(0); }
99.4% { opacity:0; clip-path:inset(20% 20%); transform:translateZ(0); }
99.5% { opacity:1; transform:scale(1) translateZ(0); }
99.65% { opacity:0; transform:scale(1.1) translateZ(0); }
99.7% { opacity:1; filter:hue-rotate(0deg); transform:translateZ(0); }
99.8% { opacity:0; filter:hue-rotate(180deg); transform:translateZ(0); }
99.82% { opacity:1; clip-path:polygon(0 0,100% 0,100% 100%,0 100%); transform:translateZ(0); }
99.92% { opacity:0; clip-path:polygon(0 0,0 0,100% 100%,100% 100%); transform:translateZ(0); }
100% { opacity:0; transform:scale(0.6) translate(-20px,-20px) translateZ(0); filter:blur(5px); }
}
#top-png {
position: absolute;
top: 0;
left: 0;
width: 1700px;
height: 850px;
object-fit: cover;
z-index: 999;
pointer-events: none;
}
</style>
<div id="mydiv">
<video id="vid"
src="https://img2.tukuppt.com/video_show/3664703/00/01/99/5b4eba60cc57c.mp4"
autoplay loop muted
referrerpolicy="no-referrer">
</video>
<div class="rain-container">
<div class="rain"></div><div class="rain"></div><div class="rain"></div><div class="rain"></div><div class="rain"></div>
<div class="rain"></div><div class="rain"></div><div class="rain"></div><div class="rain"></div><div class="rain"></div>
<div class="rain"></div><div class="rain"></div><div class="rain"></div><div class="rain"></div><div class="rain"></div>
<div class="rain"></div><div class="rain"></div><div class="rain"></div><div class="rain"></div><div class="rain"></div>
<div class="rain"></div><div class="rain"></div><div class="rain"></div><div class="rain"></div><div class="rain"></div>
<div class="rain"></div><div class="rain"></div><div class="rain"></div><div class="rain"></div><div class="rain"></div>
</div>
<img id="top-png" src="https://644220.freep.cn/644220/4/u44.png">
<div class="img-slider">
<div class="slide-item"></div>
<div class="slide-item"></div>
<div class="slide-item"></div>
<div class="slide-item"></div>
<div class="slide-item"></div>
<div class="slide-item"></div>
</div>
<audio id="aud" src="https://mp3.joy127.com/music/12901.mp3" autoplay loop>
</div></td></tr></table>
漂亮,谢谢分享
页:
[1]