Flower expansion
How do I make an flower expansion?
What is a flower expansion? How do you make a flower expansion? This script and codes were developed by Sylvain Reucherand on 07 November 2022, Monday.
Flower expansion - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Flower expansion</title> <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="flower-motion-stage"> <span class="flower-pistillate"></span>
</div>
<button class="btn-play">Let's play</button> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://lab.sylvainreucherand.fr/resources/jquery.velocity.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Flower expansion - Script Codes CSS Codes
/* The version of Bourbon used in this Pen was 4.* */
@import "bourbon";
/* Variables */
$light-blue: #567bae;
/* Common */
body { font-family: 'Montserrat', sans-serif;
}
input,
button { @include appearance(none);
}
/* Motion */
.flower-motion-stage { position: relative; width: 256px; height: 256px; margin: auto;
}
.flower-petal { display: none; position: absolute; left: 50%; width: 50px; height: 128px; margin-left: -25px; background-color: grey; border-radius: 100%; @include radial-gradient(ellipse at center, #ffffff 0%, #cccccc 100%); @include transform-origin(bottom center);
}
.flower-pistillate { display: none; position: absolute; z-index: 2; top: 50%; left: 50%; margin-top: -12px; margin-left: -12px; width: 24px; height: 24px; background-color: yellow; border-radius: 100%; @include radial-gradient(ellipse at center, #fff132 0%, #b2ae60 100%);
}
/* UI */
.btn-play { display: block; padding: 10px 15px; margin: auto; margin-top: 50px; font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: bold; text-transform: uppercase; color: $light-blue; background: transparent; border: 3px solid $light-blue; cursor: pointer;
}
.btn-play:before { content: ''; display: block; float: left; margin-top: 4px; @include triangle(15px, $light-blue, right);
}
.btn-play:focus { outline: none;
}
Flower expansion - Script Codes JS Codes
var petals = [{ degree: -5, delay: 0
}, { degree: 65, delay: 5
}, { degree: 95, delay: 2
}, { degree: 120, delay: 1
}, { degree: 160, delay: 7
}, { degree: -150, delay: 4
}, { degree: -100, delay: 3
}, { degree: -60, delay: 6
}];
$('.btn-play').on('click', function () { animation();
});
var animation = function () { // Clean stage $('.flower-motion-stage .flower-petal').remove(); $('.flower-pistillate').hide().velocity('stop'); // Adds and animate petals for(var i=0; i<petals.length; i++) { $('<span>') .addClass('flower-petal flower-petal-' + i) .appendTo($('.flower-motion-stage')) .velocity({ scale: [(Math.round(Math.random() * 2) + 9) / 10, 0], rotateZ: [petals[i].degree +'deg', petals[i].degree - 45 + 'deg'] }, { duration: 1250, delay: 100 * petals[i].delay, display: 'block', easing: 'easeOutElastic' }); } // Animate pistillate $('.flower-pistillate').velocity({ scale: [1, 0] }, { duration: 1500, display: 'block', easing: 'easeOutElastic' });
};
Developer | Sylvain Reucherand |
Username | sreucherand |
Uploaded | November 07, 2022 |
Rating | 3 |
Size | 3,425 Kb |
Views | 26,312 |
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!
Name | Size |
Closest point of a polygon to another point | 3,203 Kb |
Spinner | 4,080 Kb |
Mousewheel indicator animation | 4,740 Kb |
Blurred text | 3,500 Kb |
UI Buttons animation | 6,420 Kb |
A Pen by Sylvain Reucherand | 3,847 Kb |
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!
Name | Username | Size |
3d css cube | Semenchenko | 4,578 Kb |
A Pen by Adrien Clerbois | AClerbois | 6,501 Kb |
Twitch Live Channels | Inkblotty | 4,956 Kb |
LAMP PURE CSS with Animation | Dam62500 | 2,911 Kb |
Sencha Touch 2.3.1 Basic Grid Example | Trozdol | 2,770 Kb |
Portfolio Page | HuffmanJ25 | 5,240 Kb |
Awesome | Samarthpd | 2,901 Kb |
Social.svg.min | Larsenwork | 13,849 Kb |
AngularJS Skills | Supro | 3,312 Kb |
Experiments with Vertical Centering | KatieK2 | 3,924 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!