第一种,两端开花
<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>
代码比较简单,重复较多
需要源码私信或者评论一下,发成图片了