@keyframes花瓣动画(代码比较简单,实现炫酷特效)

 第一种,两端开花

<div class="flower">
			<div></div>
			<div></div>
			<div></div>
			<div></div>
			<div></div>
			<div></div>
			<div></div>
			<div></div>
			<div></div>
			<div></div>
			<div></div>
			<div></div>
			<div></div>
			<div></div>
			<div></div>
			<div></div>
			<div></div>
			<div></div>
			<div></div>
		</div>
<style>
			.flower{
				position: relative;
				top: 200px;
				left: 200px;
				width: 500px;
				height: 500px;
				
			}
			.flower>div{
				width: 200px;
				height: 200px;
				border-radius: 0 100%;
				background-color: pink;
				opacity: 0.5;
				position: absolute;
				left: 56px;
				top: 84px;
				/* 设置中心点 */
				transform-origin: right bottom; 
				/* 旋转45度 */
				transform: rotate(45deg);
				/* 过渡 */
				transition: 1s;
			}
			.flower:hover>div:nth-child(2){
				transform: rotate(48deg);
			}
			.flower:hover>div:nth-child(3){
				transform: rotate(42deg);
			}
			.flower:hover>div:nth-child(4){
				transform: rotate(53deg);
			}
			.flower:hover>div:nth-child(5){
				transform: rotate(37deg);
			}
			.flower:hover>div:nth-child(6){
				transform: rotate(58deg);
			}
			.flower:hover>div:nth-child(7){
				transform: rotate(32deg);
			}
			.flower:hover>div:nth-child(8){
				transform: rotate(65deg);
			}
			.flower:hover>div:nth-child(9){
				transform: rotate(25deg);
			}
			.flower:hover>div:nth-child(10){
				transform: rotate(75deg);
			}
			.flower:hover>div:nth-child(11){
				transform: rotate(15deg);
			}
			.flower:hover>div:nth-child(12){
				transform: rotate(85deg);
			}
			.flower:hover>div:nth-child(13){
				transform: rotate(5deg);
			}
			.flower:hover>div:nth-child(14){
				transform: rotate(98deg);
			}
			.flower:hover>div:nth-child(15){
				transform: rotate(-8deg);
			}
			.flower:hover>div:nth-child(16){
				transform: rotate(113deg);
			}
			.flower:hover>div:nth-child(17){
				transform: rotate(-23deg);
			}
			.flower:hover>div:nth-child(18){
				transform: rotate(125deg);
			}
			.flower:hover>div:nth-child(19){
				transform: rotate(-35deg);
			}
		</style>

第二种,圆形开花

<style>
			div:nth-child(1){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
		 	background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move1 6s 1s forwards;
			}
			@keyframes move1 {
				from {
					transform: rotate(0deg);
				}

				to {
					transform: rotate(-20deg);
				}
			}
			
			div:nth-child(2){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move2 6s 1s forwards;
			}
			@keyframes move2 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-40deg);
				}
			}
			div:nth-child(3){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move3 6s 1s forwards;
			}
			@keyframes move3 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-60deg);
				}
			}
			div:nth-child(4){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move4 6s 1s forwards;
			}
			@keyframes move4 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-80deg);
				}
			}
			div:nth-child(5){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move5 6s 1s forwards;
			}
			@keyframes move5 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-100deg);
				}
			}
			div:nth-child(6){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move6 6s 1s forwards;
			}
			@keyframes move6 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-120deg);
				}
			}
			div:nth-child(7){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move7 6s 1s forwards;
			}
			@keyframes move7 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-140deg);
				}
			}
			div:nth-child(8){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move8 6s 1s forwards;
			}
			@keyframes move8 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-160deg);
				}
			}
			div:nth-child(9){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move9 6s 1s forwards;
			}
			@keyframes move9 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-180deg);
				}
			}
			div:nth-child(10){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move10 6s 1s forwards;
			}
			@keyframes move10 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-200deg);
				}
			}
			div:nth-child(11){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move11 6s 1s forwards;
			}
			@keyframes move11 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-220deg);
				}
			}
			div:nth-child(12){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move12 6s 1s forwards;
			}
			@keyframes move12 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-240deg);
				}
			}
			div:nth-child(13){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move13 6s 1s forwards;
			}
			@keyframes move13 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-260deg);
				}
			}
			div:nth-child(14){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move14 6s 1s forwards;
			}
			@keyframes move14 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-280deg);
				}
			}
			div:nth-child(15){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move15 6s 1s forwards;
			}
			@keyframes move15 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-300deg);
				}
			}
			div:nth-child(16){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move16 6s 1s forwards;
			}
			@keyframes move16 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-320deg);
				}
			}
			div:nth-child(17){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move17 6s 1s forwards;
			}
			@keyframes move17 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-340deg);
				}
			}
			div:nth-child(18){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move18 6s 1s forwards;
			}
			@keyframes move18 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(-360deg);
				}
			}
			div:nth-child(19){
				position: absolute;
				left: 400px;
				top: 200px;
				width: 100px;
				height: 300px;
				border-radius: 50%;
			background-color: rgba(234, 73, 191, .3);
				margin: 50px auto;
				transform-origin: 50% 100%;
				animation: move19 6s 1s ;
			}
			@keyframes move19 {
				from {
					transform: rotate(0deg);
				}
			
				to {
					transform: rotate(0deg);
				}
			}
		</style>
<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>

代码比较简单,重复较多

需要源码私信或者评论一下,发成图片了

  • 5
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小刘03

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值