.butterfly-leftVings { position: absolute; height: 400px; width: 200px; animation: moving 5s linear infinite; transform-origin: right; margin-left: 0px; } .butterfly-rightVings { position: absolute; height: 400px; width: 200px; animation: moving 5s linear infinite; transform-origin: left; margin-left: 250px; }
< div class=”butterfly-leftVings” >
< div class=”butterfly-ving” id=”butterflyVing2″ >< /div >
< div class=”butterfly-ving” id=”butterflyVing1″ >< /div>
< /div >
.butterfly-ving { position: absolute; height: 200px; width: 200px; background-image: radial-gradient(circle at top, hsl(var(--hue, 0), 50%, 83%), hsl(var(--hue, 0), 50%, 50%)); } #butterflyVing1 { margin-top: 50px; border-radius: 0px 150px 0px 150px; } #butterflyVing2 { margin-top: 225px; border-radius: 150px 0px 150px 0px; } #butterflyVing3 { margin-top: 50px; border-radius: 150px 0px 150px 0px; } #butterflyVing4 { margin-top: 225px; border-radius: 0px 150px 0px 150px; }
< div class=”butterfly-leftVings” >
< div class=”butterfly-ving” id=”butterflyVing2″ >
< div class=”butterfly-middle” >< /div >
< /div >
< div class=”butterfly-ving” id=”butterflyVing1″ >
< div class=”butterfly-middle” >< /div >
< /div>
< /div >
< div class=”butterfly-rightVings” >
< div class=”butterfly-ving” id=”butterflyVing4″ >
< div class=”butterfly-middle” >< /div >
< /div >
< div class=”butterfly-ving” id=”butterflyVing3″ >
< div class=”butterfly-middle” >< /div >
< /div >
< /div >
< /div >
.butterfly-middle { position: absolute; height: 100px; width: 100px; background-image: radial-gradient(circle at top, purple, magenta); border-radius: 50%; margin-left: 50px; margin-top: 50px; }
Din allersidste div boks skal være EFTER dette stykke kode.
.butterfly-body { position: absolute; height: 275px; width: 50px; background-image: repeating-linear-gradient(black 2%, purple 2%, black 10%); border-radius: 50px; margin-left: 200px; margin-top: 100px; }
.butterfly-sticks { position: absolute; width: 80px; height: 80px; border-radius: 50%; box-shadow: 10px 5px 0 0 black inset; } #butterflyStickL { margin-left: -65px; margin-top: -55px; transform: rotate(90deg); } #butterflyStickR { margin-left: 35px; margin-top: -55px; transform: rotate(40deg); }
.butterfly-tales { position: absolute; height: 50px; width: 5px; background-color: black; border-radius: 50px; } #butterflyTaleL { margin-left: 5px; margin-top: 260px; } #butterflyTaleR { margin-left: 40px; margin-top: 260px; }
@keyframes moving { 0% {transform: rotateY(0deg)} 10% {transform: rotateY(-45deg)} 20% {transform: rotateY(0deg)} 30% {transform: rotateY(-55deg)} 40% {transform: rotateY(0deg)} 50% {transform: rotateY(-25deg)} 60% {transform: rotateY(0deg)} 70% {transform: rotateY(-90deg)} 80% {transform: rotateY(0deg)} 90% {transform: rotateY(-55deg)} 100% {transform: rotateY(0deg)} }