Flower Petal Animation

Developer
Size
2,317 Kb
Views
46,552

How do I make an flower petal animation?

Experimental Petal opening of a flower in CSS3. What is a flower petal animation? How do you make a flower petal animation? This script and codes were developed by Prashant Sani on 15 November 2022, Tuesday.

Flower Petal Animation Previews

Flower Petal Animation - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Flower Petal Animation</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <!--
HOVER OVER THE DOT
-->
<div class="flowerContain"> <div class="leafContain"> <img src="https://www.prashantsani.com/Misc/codepen/l1.svg" alt="" class="leaf leaf1"> <img src="https://www.prashantsani.com/Misc/codepen/l2.svg" alt="" class="leaf leaf2"> <img src="https://www.prashantsani.com/Misc/codepen/l3.svg" alt="" class="leaf leaf3"> <img src="https://www.prashantsani.com/Misc/codepen/l4.svg" alt="" class="leaf leaf4"> <img src="https://www.prashantsani.com/Misc/codepen/l5.svg" alt="" class="leaf leaf5"> <img src="https://www.prashantsani.com/Misc/codepen/l6.svg" alt="" class="leaf leaf6"> <img src="https://www.prashantsani.com/Misc/codepen/l7.svg" alt="" class="leaf leaf7"> <img src="https://www.prashantsani.com/Misc/codepen/l8.svg" alt="" class="leaf leaf8"> <img src="https://www.prashantsani.com/Misc/codepen/l9.svg" alt="" class="leaf leaf9"> <img src="https://www.prashantsani.com/Misc/codepen/l10.svg" alt=""class="leaf leaf10"> </div> <img src="https://www.prashantsani.com/Misc/codepen/center.svg" alt="" class="center">
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://prashantsani.com/Misc/codepen/prefixfree.js'></script>
</body>
</html>

Flower Petal Animation - Script Codes CSS Codes

*{ margin:0; padding:0
}
html,body{ width: 100%; height: 100%; position: relative; background: #e8f9ff; /* Old browsers */ background: -moz-linear-gradient(top, #e8f9ff 0%, #ffffff 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e8f9ff), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #e8f9ff 0%,#ffffff 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #e8f9ff 0%,#ffffff 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, #e8f9ff 0%,#ffffff 100%); /* IE10+ */ background: linear-gradient(to bottom, #e8f9ff 0%,#ffffff 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e8f9ff', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */
}
.flowerContain{ position: absolute; top: 50%; left: 50%; width: 183px; height: 183px; margin: -91px 0 0 -91px; cursor: pointer;
}
.center{ position: absolute; left: 0; top: 0; z-index: 10;
}
.leafContain{ position: absolute; top: 0; left: 0;
}
.leaf{ position: absolute; left: 0; top: 0; opacity: 0; transition: all 0.5s ease-out; transform-origin: center center; transform: scale(0);
}
.flowerContain:hover .leaf{ opacity: 1; transform: scale(1);
}
.flowerContain:hover .leaf1{ animation: leaf1Anim 0.7s ease;
}
@keyframes leaf1Anim { 0% { transform: scale(0); } 70% { transform: scale(1.1); } 100% { transform: scale(1); }
}
.flowerContain:hover .leaf2{ transition: all 0s 0.2s ease-out; animation: leaf2Anim 0.7s 0.2s ease;
}
@keyframes leaf2Anim { 0% { transform: scale(0); } 70% { transform: scale(1.1); } 100% { transform: scale(1); }
}
.flowerContain:hover .leaf3{ transition: all 0s 0.4s ease-out; animation: leaf3Anim 0.7s 0.4s ease;
}
@keyframes leaf3Anim { 0% { transform: scale(0); } 70% { transform: scale(1.1); } 100% { transform: scale(1); }
}
.flowerContain:hover .leaf4{ transition: all 0s 0.6s ease-out; animation: leaf4Anim 0.7s 0.6s ease;
}
@keyframes leaf4Anim { 0% { transform: scale(0); } 70% { transform: scale(1.1); } 100% { transform: scale(1); }
}
.flowerContain:hover .leaf5{ transition: all 0s 0.8s ease-out; animation: leaf5Anim 0.7s 0.8s ease;
}
@keyframes leaf5Anim { 0% { transform: scale(0); } 70% { transform: scale(1.1); } 100% { transform: scale(1); }
}
.flowerContain:hover .leaf6{ transition: all 0s 1s ease-out; animation: leaf6Anim 0.7s 1s ease;
}
@keyframes leaf6Anim { 0% { transform: scale(0); } 70% { transform: scale(1.1); } 100% { transform: scale(1); }
}
.flowerContain:hover .leaf7{ transition: all 0s 1.2s ease-out; animation: leaf7Anim 0.7s 1.2s ease;
}
@keyframes leaf7Anim { 0% { transform: scale(0); } 70% { transform: scale(1.1); } 100% { transform: scale(1); }
}
.flowerContain:hover .leaf8{ transition: all 0s 1.4s ease-out; animation: leaf8Anim 0.7s 1.4s ease;
}
@keyframes leaf8Anim { 0% { transform: scale(0); } 70% { transform: scale(1.1); } 100% { transform: scale(1); }
}
.flowerContain:hover .leaf9{ transition: all 0s 1.6s ease-out; animation: leaf9Anim 0.7s 1.6s ease;
}
@keyframes leaf9Anim { 0% { transform: scale(0); } 70% { transform: scale(1.1); } 100% { transform: scale(1); }
}
.flowerContain:hover .leaf10{ transition: all 0s 1.8s ease-out; animation: leaf10Anim 0.7s 1.8s ease;
}
@keyframes leaf10Anim { 0% { transform: scale(0); } 70% { transform: scale(1.1); } 100% { transform: scale(1); }
}
Flower Petal Animation - Script Codes
Flower Petal Animation - Script Codes
Home Page Home
Developer Prashant Sani
Username Prashantsani
Uploaded November 15, 2022
Rating 4
Size 2,317 Kb
Views 46,552
Do you need developer help for Flower Petal Animation?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Prashant Sani (Prashantsani) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!