文章编号:461 /
更新时间:2024-12-29 18:41:02 / 浏览:
次
烟花
使用 CSS 动画和 HTML 元素创建逼真的烟花效果。
``````css.firework {position: absolute;
Top: 0;left: 0;width: 10px;height: 10px;background-color: f00;border-radius: 50%;animation: firework 5s infinite;}.fuse {position: absolute;top: -20px;left: 5px;width: 2px;height: 20px;background-color: fff;animation: fuse 5s infinite;}.burst {position: absolute;top: -10px;left: 5px;width: 20px;height: 20px;background-color: ff0;border-radius: 50%;animation: burst 5s infinite;}.star {position: absolute;top: 0;left: 0;width: 2px;height: 2px;background-color: fff;border-radius: 50%;animation: star 5s infinite;}@keyframes firework{0% {top: 0;left: 0;}50% {top: 50vh;left: 50vw;}
100% {top: 100vh;left: 100vw;}}@keyframes fuse {0% {top: -20px;opa
City: 1;}50% {top: 0;opacity: 0;}100% {top: -20px;opacity: 1;}}@keyframes burst {0% {top: -10px;width: 20px;height: 20px;opacity: 0;}50% {top: -50px;width: 100px;height: 100px;opacity: 1;}100% {top: -10px;width: 20px;height: 20px;opacity: 0;}}@keyframes star {0% {top: 0;left: 0;opacity: 1;}50% {top: 50px;left: 50px;opacity: 0;}100% {top: 0;left: 0;opacity: 1;}}```
红包
使用 CSS 3D 变换和动画创建逼真的红包效果。
``````css.red-envelope {width: 200px;height: 100px;perspective: 1000px;position: relative;}.front, .back, .flap, .money {width: 200px;height: 100px;position: absolute;backface-visibility: hidden;}.front {transform: translateZ(100px) rotateY(0deg);}.back {transform: translateZ(100px) rotateY(180deg);}.flap {transform: translateZ(50px) rotateY(90deg);transition: transform 0.5s ease-in-out;}.money {transform: translateZ(50px) rotateY(-90deg);}.red-envelope:hover .flap {transform: translateZ(50px) rotateY(0deg);}```
灯笼
使用 SVG 和 CSS 动画创建逼真的灯笼效果。
``````csssvg {width: 100px;height: 100px;animation: lantern 5s infinite;}@keyframes lantern{0% {transform: scale(1);}50% {transform: scale(1.2);}100% {transform: scale(1);}}```
相关标签:
网页特效代码、
网页特效代码春节、
分开展示、
本文地址:https://www.qianwe.cn/article/461.html
上一篇:网页特效代码的应用方式有和网页特效代码春...
下一篇:网页特效代码怎么用网页特效代码春节...