html5 文字转换烟花,HTML5交互式烟花(点击并保持)

CSS

语言:

CSSSCSS

确定

body {

display: flex;

margin: 0;

height: 100vh;

justify-content: center;

align-items: center;

font-size: 50px;

font-family: monospace;

background: #000;

color: #333;

/* filter: blur(2px) contrast(30); */

}

body:before {

content: 'Click and hold';

}

.explosion {

position: absolute;

top: 50%;

left: 50%;

width: 10px;

height: 10px;

}

.explosion div {

content: '';

position: absolute;

top: 0;

left: 0;

width: 100%;

height: 100%;

background: crimson;

border-radius: 500px;

animation-fill-mode: forwards;

transform-origin: left center;

}

.explosion div:nth-child(1) {

animation: explode1 .3s;

transform: rotate(0) translate(0, 0);

}

.explosion div:nth-child(2) {

animation: explode2 .3s;

transform: rotate(45deg) translate(0, 0);

}

.explosion div:nth-child(3) {

animation: explode3 .3s;

transform: rotate(90deg) translate(0, 0);

}

.explosion div:nth-child(4) {

animation: explode4 .3s;

transform: rotate(135deg) translate(0, 0);

}

.explosion div:nth-child(5) {

animation: explode5 .3s;

transform: rotate(180deg) translate(0, 0);

}

.explosion div:nth-child(6) {

animation: explode6 .3s;

transform: rotate(225deg) translate(0, 0);

}

.explosion div:nth-child(7) {

animation: explode7 .3s;

transform: rotate(270deg) translate(0, 0);

}

.explosion div:nth-child(8) {

animation: explode8 .3s;

transform: rotate(315deg) translate(0, 0);

}

@keyframes explode1 {

0 {

width: 100%;

transform: rotate(0) translate(0, 0);

}

50% {

width: 400%;

transform: rotate(0) translate(0, 0);

}

100% {

width: 100%;

transform: rotate(0) translate(300%, 0);

}

}

@keyframes explode2 {

0 {

width: 100%;

transform: rotate(45deg) translate(0, 0);

}

50% {

width: 400%;

transform: rotate(45deg) translate(0, 0);

}

100% {

width: 100%;

transform: rotate(45deg) translate(300%, 0);

}

}

@keyframes explode3 {

0 {

width: 100%;

transform: rotate(90deg) translate(0, 0);

}

50% {

width: 400%;

transform: rotate(90deg) translate(0, 0);

}

100% {

width: 100%;

transform: rotate(90deg) translate(300%, 0);

}

}

@keyframes explode4 {

0 {

width: 100%;

transform: rotate(135deg) translate(0, 0);

}

50% {

width: 400%;

transform: rotate(135deg) translate(0, 0);

}

100% {

width: 100%;

transform: rotate(135deg) translate(300%, 0);

}

}

@keyframes explode5 {

0 {

width: 100%;

transform: rotate(180deg) translate(0, 0);

}

50% {

width: 400%;

transform: rotate(180deg) translate(0, 0);

}

100% {

width: 100%;

transform: rotate(180deg) translate(300%, 0);

}

}

@keyframes explode6 {

0 {

width: 100%;

transform: rotate(225deg) translate(0, 0);

}

50% {

width: 400%;

transform: rotate(225deg) translate(0, 0);

}

100% {

width: 100%;

transform: rotate(225deg) translate(300%, 0);

}

}

@keyframes explode7 {

0 {

width: 100%;

transform: rotate(270deg) translate(0, 0);

}

50% {

width: 400%;

transform: rotate(270deg) translate(0, 0);

}

100% {

width: 100%;

transform: rotate(270deg) translate(300%, 0);

}

}

@keyframes explode8 {

0 {

width: 100%;

transform: rotate(315deg) translate(0, 0);

}

50% {

width: 400%;

transform: rotate(315deg) translate(0, 0);

}

100% {

width: 100%;

transform: rotate(315deg) translate(300%, 0);

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值