{"id":27488,"date":"2016-08-01T21:01:15","date_gmt":"2016-08-01T13:01:15","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=27488"},"modified":"2023-04-06T19:01:53","modified_gmt":"2023-04-06T11:01:53","slug":"css3-fan-out-bounce-effect-animation","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/","title":{"rendered":"Create a Fan-Out with Bounce Effect Using CSS3 Animation"},"content":{"rendered":"<p>Did you know  that <strong>geometric transformations<\/strong> added to HTML elements with the <code><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/transform\" target=\"_blank\" rel=\"noopener\">transform<\/a><\/code>CSS property such as scale, skew, and rotate can be animated<strong><\/strong>? They can be animated using the <code><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/transition\" target=\"_blank\" rel=\"noopener\">transition<\/a><\/code> property and <code><a href=\"https:\/\/developer.mozilla.org\/en\/docs\/Web\/CSS\/@keyframes\" target=\"_blank\" rel=\"noopener\">@keyframes<\/a><\/code> animations, but what\u2019s even cooler is that animated transformations can be taken up a notch with the addition of a little <strong>bounce effect<\/strong>, using the <code><a href=\"https:\/\/developer.mozilla.org\/en\/docs\/Web\/CSS\/timing-function#The_cubic-bezier()_class_of_timing-functions\" target=\"_blank\" rel=\"noopener\">cubic-bezier()<\/a><\/code> timing function.<\/p>\n<p>In a nutshell, <code>cubic-bezier()<\/code> (in CSS) is a <strong><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/transition-timing-function\" target=\"_blank\" rel=\"noopener\">timing function<\/a> for transitions<\/strong>. It specifies the speed of the transition, and among other things, it can be also used to <strong>create bouncing effect in animations<\/strong>.<\/p>\n<p>In this post, first we\u2019re going to <strong>create a simple transformation animation<\/strong> to which we later <strong>add a <code>cubic-bezier()<\/code> timing function<\/strong>. At the end of this tutorial, you\u2019ll understand how to create an animation that uses <strong>both a fan-out and a bounce effect<\/strong>. Here is the final result (click to see effect).<\/p>\n<p class=\"recommended_top\">\n\t\t\t\t\t<strong>Read Also:<\/strong>\u00a0\n\t\t\t\t\t<a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/css-cubic-bezier\/\">A Look Into: Cubic-bezier in CSS3 Transition<\/a>\n\t\t\t\t<\/p>\n<p><iframe height=\"370\" scrolling=\"no\" src=\"https:\/\/codepen.io\/rpsthecoder\/embed\/zBoVZG\/?height=370&theme-id=12825&default-tab=result&embed-version=2\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\" style=\"width: 100%;\">See the Pen <a href=\"https:\/\/codepen.io\/rpsthecoder\/pen\/zBoVZG\/\" rel=\"nofollow\">CSS fan-out rotation with bounce<\/a> by Preethi (<a href=\"https:\/\/codepen.io\/rpsthecoder\" rel=\"nofollow\">@rpsthecoder<\/a>) on <a href=\"https:\/\/codepen.io\" rel=\"nofollow\">CodePen<\/a>. <\/iframe><\/p>\n<p>The demo is inspired by this beautiful <a href=\"https:\/\/dribbble.com\/shots\/2778857-Location-pin-star\" target=\"_blank\" rel=\"noopener\">Dribbble shot<\/a> by <a href=\"https:\/\/dribbble.com\/chris_jones3\" target=\"_blank\" rel=\"noopener\">Christopher Jones<\/a> about an animated location marker.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css3-fan-out-bounce-effect-animation\/css-fa-cbz-shot.jpg\" alt=\"Dribbble Shot\" width=\"650\" height=\"241\"><figcaption><a href=\"https:\/\/dribbble.com\/shots\/2778857-Location-pin-star\" target=\"_blank\" rel=\"noopener\">IMAGE: Dribble<\/a><\/figcaption><\/figure>\n<h3>1. Creating the leaves<\/h3>\n<p>The shape of the location marker is made up of five (let\u2019s call them) leaves. To create the <strong>oval shape<\/strong> of a leaf, let\u2019s use the <code><a href=\"https:\/\/developer.mozilla.org\/en\/docs\/Web\/CSS\/border-radius\" target=\"_blank\" rel=\"noopener\">border-radius<\/a><\/code> CSS property. The <code>border-radius<\/code> of a single corner is <strong>made up of two radii<\/strong>, horizontal and vertical, like shown below.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css3-fan-out-bounce-effect-animation\/css-fa-cbz-bdrs.jpg\" alt=\"Border Radius Diagram\" width=\"650\" height=\"299\"><figcaption class=\"entry-image-caption\"><a href=\"https:\/\/www.w3.org\/TR\/css3-background\/\" target=\"_blank\" rel=\"noopener nofollow\">IMAGE: W3C<\/a><\/figcaption><\/figure>\n<p>The <code>border-radius<\/code> property has <a href=\"https:\/\/developer.mozilla.org\/en\/docs\/Web\/CSS\/border-radius\" target=\"_blank\" rel=\"noopener\">many different syntaxes<\/a>. We will use a more complicated one for the shape of the marker:<\/p>\n<pre>\r\nborder-radius: htl htr hbr hbl \/ vtl vtr vbr vbl;\r\n<\/pre>\n<p>In this syntax, horizontal and vertical radii are grouped together; <code>h<\/code> & <code>v<\/code> represent horizontal & vertical radii, and <code>t<\/code>, <code>l<\/code>, <code>b<\/code> & <code>r<\/code> represent top, left, bottom &  right corners. For instance, <code>vbl<\/code> stands for the vertical radius of the bottom-left corner.<\/p>\n<p>If you give <strong>only one value<\/strong> for either the horizontal or the vertical side, that value will be copied to all the other horizontal or vertical radii by the browser.<\/p>\n<p>To <strong>create a vertical oval shape<\/strong>, keep the horizontal radii at <code>50%<\/code> for all corners, and adjust the vertical ones, till the desired shape is seen. The <strong>horizontal side<\/strong> will use only one value: <code>50%<\/code>.<\/p>\n<p>The <strong>vertical radii<\/strong> of the top-left and top-right corners will be <code>30%<\/code>, while the bottom-left and bottom-right corners will use the <code>70%<\/code> value.<\/p>\n<p><strong>HTML<\/strong><\/p>\n<pre>&lt;div class=\"pinStarLeaf\"&gt;&lt;\/div&gt;<\/pre>\n<p><strong>CSS<\/strong><\/p>\n<pre>.pinStarLeaf {\r\n  width: 60px;\r\n  height: 120px;\r\n  border-radius: 50%\/30% 30% 70% 70%;\r\n  background-color: #B8F0F5;\r\n}<\/pre>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css3-fan-out-bounce-effect-animation\/css-fa-cbz-leaf1.jpg\" alt=\"Marker Shape\" width=\"650\" height=\"257\"><figcaption>IMAGE: The shape of the marker (vertical oval)<\/figcaption><\/figure>\n<h3>2. Multiplying the leaves<\/h3>\n<p>Since the marker will fan out showing five leaves, we create <strong>four more copies of the leaf<\/strong> in different colors, and with <a href=\"https:\/\/www.w3schools.com\/css\/tryit.asp?filename=trycss_position_absolute\" target=\"_blank\" rel=\"noopener\">absolute positioning<\/a> in order to stack them on each other.<\/p>\n<p><strong>HTML<\/strong><\/p>\n<pre>&lt;div id=\"pinStarWrapper\"&gt;\r\n  &lt;div class=\"pinStarLeaf\"&gt;&lt;\/div&gt;\r\n  &lt;div class=\"pinStarLeaf\"&gt;&lt;\/div&gt;\r\n  &lt;div class=\"pinStarLeaf\"&gt;&lt;\/div&gt;\r\n  &lt;div class=\"pinStarLeaf\"&gt;&lt;\/div&gt;\r\n  &lt;div class=\"pinStarLeaf\"&gt;&lt;\/div&gt;\r\n&lt;\/div&gt;<\/pre>\n<p><strong>CSS<\/strong><\/p>\n<pre>#pinStarWrapper{\r\n  width: 300px;\r\n  height: 300px;\r\n  position: relative;\r\n}\r\n.pinStarLeaf{\r\n    width: 60px;\r\n    height: 120px;\r\n    position: absolute;\r\n    border-radius: 50%\/30% 30% 70% 70% ;\r\n    left: 0;\r\n    right: 0;\r\n    top: 0;\r\n    bottom: 0;\r\n    margin: auto;\r\n    opacity: .5;\r\n}\r\n.pinStarLeaf:nth-of-type(1){\r\n  background-color: #B8F0F5;\r\n}\r\n.pinStarLeaf:nth-of-type(2){\r\n  background-color: #9CF3DC;\r\n}\r\n.pinStarLeaf:nth-of-type(3){\r\n  background-color: #94F3B0;\r\n}\r\n.pinStarLeaf:nth-of-type(4){\r\n  background-color: #D2F8A1;\r\n}\r\n.pinStarLeaf:nth-of-type(5){\r\n  background-color: #F3EDA2;\r\n}\r\n<\/pre>\n<h3>3. Capturing Click Event & Improving Aesthetics<\/h3>\n<p>Let\u2019s <strong>add a checkbox<\/strong> with the <code>#pinStarCenterChkBox<\/code> identifier to capture the click event. When the checkbox is checked, the leaves will fan out (rotate). We also need to add a <strong>white circle<\/strong> with the <code>#pinStarCenter<\/code> identifier for aesthetics. It will be positioned on top of the marker, and it will be the center piece of the location marker.<\/p>\n<p><strong>HTML<\/strong><\/p>\n<p>We place the checkbox before, and the white circle after, the leaves:<\/p>\n<pre>&lt;div id=\"pinStarWrapper\"&gt;\r\n  &lt;input type=\"checkbox\" id=\"pinStarCenterChkBox\"&gt;\r\n  &lt;div class=\"pinStarLeaf\"&gt;&lt;\/div&gt;\r\n  &lt;div class=\"pinStarLeaf\"&gt;&lt;\/div&gt;\r\n  &lt;div class=\"pinStarLeaf\"&gt;&lt;\/div&gt;\r\n  &lt;div class=\"pinStarLeaf\"&gt;&lt;\/div&gt;\r\n  &lt;div class=\"pinStarLeaf\"&gt;&lt;\/div&gt;\r\n  &lt;div id=\"pinStarCenter\"&gt;&lt;\/div&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<p><strong>CSS<\/strong><\/p>\n<p>First, we set the basic styles for the checkbox and the covering circle:<\/p>\n<pre>\r\n#pinStarCenter, #pinStarCenterChkBox{\r\n    width: 45px;\r\n    height: 50px;\r\n    position: absolute;\r\n    left: 0;\r\n    right: 0;\r\n    top: -60px;\r\n    bottom: 0;\r\n    margin: auto;\r\n    background-color: #fff;\r\n    border-radius: 50%;\r\n    cursor: pointer;\r\n}\r\n#pinStarCenter, .pinStarLeaf{\r\n  pointer-events: none;\r\n}\r\n#pinStarCenter &gt; input[type=\"checkbox\"]{\r\n    width: 100%;\r\n    height: 100%;\r\n    cursor: pointer;\r\n}\r\n<\/pre>\n<p>As each leaf will rotate along the z-axis <strong>in different angles<\/strong>, we need to set the <code>transform: rotatez();<\/code> property accordingly, to <strong>create a star shape<\/strong>. We also apply the <code><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/transition\" target=\"_blank\" rel=\"noopener\">transition<\/a><\/code> property <strong>for the rotation effect<\/strong> (more precisely we use the <code>transition: transform 1s linear<\/code> rule for the leaves).<\/p>\n<pre>\r\n#pinStarCenterChkBox:checked ~ .pinStarLeaf{\r\n    transition: transform 1s linear;\r\n}\r\n#pinStarCenterChkBox:checked ~ .pinStarLeaf:nth-of-type(5){\r\n    transform: rotatez(35deg);\r\n}\r\n#pinStarCenterChkBox:checked ~ .pinStarLeaf:nth-of-type(4){\r\n    transform: rotatez(105deg);\r\n}\r\n#pinStarCenterChkBox:checked ~ .pinStarLeaf:nth-of-type(3){\r\n    transform: rotatez(180deg);\r\n}\r\n#pinStarCenterChkBox:checked ~ .pinStarLeaf:nth-of-type(2){\r\n    transform: rotatez(255deg);\r\n}\r\n#pinStarCenterChkBox:checked ~ .pinStarLeaf:nth-of-type(1){\r\n    transform: rotatez(325deg);\r\n}\r\n<\/pre>\n<p>If you have a look at the CSS above, you can see from the presence of the <code>#pinStarCenterChkBox:checked ~<\/code> <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/General_sibling_selectors\" target=\"_blank\" rel=\"noopener\">general sibling selector<\/a> that we only add the <code>transition<\/code> and <code>transform<\/code> properties <strong>when the checkbox is checked<\/strong> (when the user clicked the marker).<\/p>\n<h3>4. Modifying the Center of the Rotation<\/h3>\n<p>By default, the center of the rotation is positioned <strong>in the center of the rotated element<\/strong>, in our case, at the center of the leaves. We need to move the center of the transformation to the inner end of the leaves. We can do this by using the <code><a href=\"https:\/\/developer.mozilla.org\/en\/docs\/Web\/CSS\/transform-origin\" target=\"_blank\" rel=\"noopener\">transform-origin<\/a><\/code> CSS property that <strong>changes the position of transformed elements<\/strong>.<\/p>\n<p>To make the rotation effect  work properly, let\u2019s add the two following rules to the <code>.pinStarLeaf<\/code> selector in our CSS file:<\/p>\n<pre>\r\n.pinStarLeaf{\r\n    transform-origin: 30px 30px;\r\n    transition: transform 1s linear;\r\n}\r\n<\/pre>\n<p>Let\u2019s see our fan out animation in action \u2014 at this point, without the bounce effect yet. Click on the white circle, on top of the marker.<\/p>\n<p><iframe height=\"370\" scrolling=\"no\" src=\"https:\/\/codepen.io\/rpsthecoder\/embed\/gMLNPX\/?height=370&theme-id=12825&default-tab=result&embed-version=2\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\" style=\"width: 100%;\">See the Pen <a href=\"https:\/\/codepen.io\/rpsthecoder\/pen\/gMLNPX\/\" rel=\"nofollow\">CSS fan-out rotation<\/a> by Preethi (<a href=\"https:\/\/codepen.io\/rpsthecoder\" rel=\"nofollow\">@rpsthecoder<\/a>) on <a href=\"https:\/\/codepen.io\" rel=\"nofollow\">CodePen<\/a>. <\/iframe><\/p>\n<h3>Understanding How ubic-Bezier() Works<\/h3>\n<p>Now, to add the bounce effect, we need to replace the <code>linear<\/code> <a href=\"https:\/\/developer.mozilla.org\/en\/docs\/Web\/CSS\/timing-function\" target=\"_blank\" rel=\"noopener\">timing function<\/a> with <code>cubic-bezier()<\/code> in the <code>transition<\/code> declarations in our CSS file.<\/p>\n<p>But first, let\u2019s understand the <strong>logic behind the <code>cubic-bezier()<\/code> timing function<\/strong> so that you can easily make sense of the bounce effect.<\/p>\n<p>The syntax for the <code>cubic-bezier()<\/code> function is the following, <code>d<\/code> and <code>t<\/code> are <strong>distance<\/strong> and <strong>time<\/strong>, and their values typically range between 0 and 1:<\/p>\n<pre>cubic-bezier (t1, d1, t2, d2)<\/pre>\n<p>Even though explaining CSS <code>cubic-bezier()<\/code> in terms of distance and time isn\u2019t accurate, it\u2019s a lot easier to understand it this way.<\/p>\n<p>Assume there\u2019s <strong>a box that moves from point A to B<\/strong> in 6 seconds. Let\u2019s use the following <code>cubic-bezier()<\/code> timing function for the transition with the <code>t1 = 0<\/code> and <code>d1 = 1<\/code> values.<\/p>\n<pre>\r\n\/* t1 = 0 , d1 = 1, t2 = 0, d2 = 0 *\/\r\ncubic-bezier(0,1,0,0)\r\n<\/pre>\n<p>In almost no time, the box moves from A to mid-point, and takes the rest of the time reaching B.<\/p>\n<p><iframe height=\"350\" scrolling=\"no\" src=\"https:\/\/codepen.io\/rpsthecoder\/embed\/YWYWvO\/?height=350&theme-id=12825&default-tab=result&embed-version=2\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\" style=\"width: 100%;\">See the Pen <a href=\"https:\/\/codepen.io\/rpsthecoder\/pen\/YWYWvO\/\" rel=\"nofollow\">cubic-bezier(0,1,0,0)<\/a> by Preethi (<a href=\"https:\/\/codepen.io\/rpsthecoder\" rel=\"nofollow\">@rpsthecoder<\/a>) on <a href=\"https:\/\/codepen.io\" rel=\"nofollow\">CodePen<\/a>. <\/iframe><\/p>\n<p>Let\u2019s try the same transition with values <code>t1 = 1<\/code> and <code>d1 = 0<\/code>.<\/p>\n<pre>\r\n\/* t1 = 1 , d1 = 0, t2 = 0, d2 = 0 *\/\r\ncubic-bezier(1,0,0,0)\r\n<\/pre>\n<p>For the first three seconds, the box doesn\u2019t move much, and later it almost jumps to mid-point, and starts moving steadily towards B.<\/p>\n<p><iframe height=\"350\" scrolling=\"no\" src=\"https:\/\/codepen.io\/rpsthecoder\/embed\/jAYAZb\/?height=350&theme-id=12825&default-tab=result&embed-version=2\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\" style=\"width: 100%;\">See the Pen <a href=\"https:\/\/codepen.io\/rpsthecoder\/pen\/jAYAZb\/\" rel=\"nofollow\">cubic-bezier(0,1,0,0)<\/a> by Preethi (<a href=\"https:\/\/codepen.io\/rpsthecoder\" rel=\"nofollow\">@rpsthecoder<\/a>) on <a href=\"https:\/\/codepen.io\" rel=\"nofollow\">CodePen<\/a>. <\/iframe><\/p>\n<p>As you can see, <code>d1<\/code> controls the <strong>distance between A<\/strong> &<strong> the mid-point<\/strong>, and <code>t1<\/code> the <strong>time it takes to reach the mid-point from A<\/strong>.<\/p>\n<p>Let\u2019s use <code>d2<\/code> and <code>t2<\/code> now. Both <code>t1<\/code> and <code>d1<\/code> will be 1, and <code>t2 = 1<\/code> and <code>d2 = 0<\/code>.<\/p>\n<pre>\r\n\/* t1 = 1 , d1 = 1, t2 = 0, d2 = 1 *\/\r\ncubic-bezier(1,1,0,1)\r\n<\/pre>\n<p>The box moves almost halfway in 3 seconds (due to <code>t1 = 1<\/code>, <code>d1 = 1<\/code>), and in no time it jumps to point B.<\/p>\n<p><iframe height=\"350\" scrolling=\"no\" src=\"https:\/\/codepen.io\/rpsthecoder\/embed\/wWpWEV\/?height=350&theme-id=12825&default-tab=result&embed-version=2\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\" style=\"width: 100%;\">See the Pen <a href=\"https:\/\/codepen.io\/rpsthecoder\/pen\/wWpWEV\/\" rel=\"nofollow\">cubic-bezier(0,1,0,0)<\/a> by Preethi (<a href=\"https:\/\/codepen.io\/rpsthecoder\" rel=\"nofollow\">@rpsthecoder<\/a>) on <a href=\"https:\/\/codepen.io\" rel=\"nofollow\">CodePen<\/a>. <\/iframe><\/p>\n<p>The last example swaps the previous values of <code>t2<\/code> and <code>d2<\/code>:<\/p>\n<pre>\r\n\/* t1 = 1 , d1 = 1, t2 = 1, d2 = 0 *\/\r\ncubic-bezier(1,1,1,0)\r\n<\/pre>\n<p>The box moves almost halfway in 3 seconds (due to <code>t1 = 1<\/code>, <code>d1 = 1<\/code>), then for 3 more seconds doesn\u2019t move much before jumping to point B.<\/p>\n<p><iframe height=\"350\" scrolling=\"no\" src=\"https:\/\/codepen.io\/rpsthecoder\/embed\/Wxdxab\/?height=350&theme-id=12825&default-tab=result&embed-version=2\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\" style=\"width: 100%;\">See the Pen <a href=\"https:\/\/codepen.io\/rpsthecoder\/pen\/Wxdxab\/\" rel=\"nofollow\">cubic-bezier(0,1,0,0)<\/a> by Preethi (<a href=\"https:\/\/codepen.io\/rpsthecoder\" rel=\"nofollow\">@rpsthecoder<\/a>) on <a href=\"https:\/\/codepen.io\" rel=\"nofollow\">CodePen<\/a>. <\/iframe><\/p>\n<p>These examples show that <code>d2<\/code> and <code>t2<\/code> control the distance and time it takes the box to <strong>go from mid-point to point B<\/strong>.<\/p>\n<p>Although you probably didn\u2019t need this long (yet sparse) explanation of <code>cubic-bezier()<\/code> at this point, I think it will help you understand this function better. Now, where does the bounce come in all of this?<\/p>\n<h3>5. Adding the Bounce Effect with Cubic-Bezier()<\/h3>\n<p>The <strong>key parameters<\/strong> for the bounce effect are the distances, <code>d1<\/code> and <code>d2<\/code>. A <code>d1<\/code> value of <strong>less than 1<\/strong> takes the box <strong>behind point A<\/strong> before proceeding towards B at the beginning of animation.<\/p>\n<p>A <code>d2<\/code> value of <strong>more than 1<\/strong> takes the box <strong>beyond point B<\/strong> before coming back to rest at B at the end of animation. Hence the back and forth bounce effect.<\/p>\n<p>I\u2019ll now add the <code>cubic-bezier()<\/code> values directly to our demo in place of the former <code>linear<\/code> value of the <code>transition<\/code> property, and let you see the results.<\/p>\n<pre>\r\n#pinStarCenterChkBox:checked ~ .pinStarLeaf{\r\n    transition: transform 1s cubic-bezier(.8,-.5,.2,1.4);\r\n}\r\n<\/pre>\n<p>Here\u2019s the final result, a CSS-only fan-out animation with a bounce effect:<\/p>\n<p><iframe height=\"370\" scrolling=\"no\" src=\"https:\/\/codepen.io\/rpsthecoder\/embed\/zBoVZG\/?height=370&theme-id=12825&default-tab=result&embed-version=2\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\" style=\"width: 100%;\">See the Pen <a href=\"https:\/\/codepen.io\/rpsthecoder\/pen\/zBoVZG\/\" rel=\"nofollow\">CSS fan-out rotation with bounce<\/a> by Preethi (<a href=\"https:\/\/codepen.io\/rpsthecoder\" rel=\"nofollow\">@rpsthecoder<\/a>) on <a href=\"https:\/\/codepen.io\" rel=\"nofollow\">CodePen<\/a>. <\/iframe><\/p>\n<p>For comparison and to understand the bounce effect better, here is how the <code>cubic-bezier()<\/code> value of the animation behaves when its applied to our example box:<\/p>\n<p><iframe height=\"350\" scrolling=\"no\" src=\"https:\/\/codepen.io\/rpsthecoder\/embed\/yJpJAV\/?height=350&theme-id=12825&default-tab=result&embed-version=2\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"true\" style=\"width: 100%;\">See the Pen <a href=\"https:\/\/codepen.io\/rpsthecoder\/pen\/yJpJAV\/\" rel=\"nofollow\">cubic-bezier(0,1,0,0)<\/a> by Preethi (<a href=\"https:\/\/codepen.io\/rpsthecoder\" rel=\"nofollow\">@rpsthecoder<\/a>) on <a href=\"https:\/\/codepen.io\" rel=\"nofollow\">CodePen<\/a>. <\/iframe><\/p>","protected":false},"excerpt":{"rendered":"<p>Did you know that geometric transformations added to HTML elements with the transformCSS property such as scale, skew, and rotate can be animated? They can be animated using the transition property and @keyframes animations, but what\u2019s even cooler is that animated transformations can be taken up a notch with the addition of a little bounce&hellip;<\/p>\n","protected":false},"author":145,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3392],"tags":[507,3498,4501],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Create a Fan-Out with Bounce Effect Using CSS3 Animation - Hongkiat<\/title>\n<meta name=\"description\" content=\"Did you know that geometric transformations added to HTML elements with the transformCSS property such as scale, skew, and rotate can be animated? They\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create a Fan-Out with Bounce Effect Using CSS3 Animation\" \/>\n<meta property=\"og:description\" content=\"Did you know that geometric transformations added to HTML elements with the transformCSS property such as scale, skew, and rotate can be animated? They\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-01T13:01:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-06T11:01:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/css3-fan-out-bounce-effect-animation\/css-fa-cbz-shot.jpg\" \/>\n<meta name=\"author\" content=\"Preethi Ranjit\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Preethi Ranjit\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-fan-out-bounce-effect-animation\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-fan-out-bounce-effect-animation\\\/\"},\"author\":{\"name\":\"Preethi Ranjit\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e981676afae36d1ff5feb75094950ab3\"},\"headline\":\"Create a Fan-Out with Bounce Effect Using CSS3 Animation\",\"datePublished\":\"2016-08-01T13:01:15+00:00\",\"dateModified\":\"2023-04-06T11:01:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-fan-out-bounce-effect-animation\\\/\"},\"wordCount\":1218,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-fan-out-bounce-effect-animation\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css3-fan-out-bounce-effect-animation\\\/css-fa-cbz-shot.jpg\",\"keywords\":[\"CSS\",\"CSS Animation\",\"CSS Tutorials\"],\"articleSection\":[\"Coding\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-fan-out-bounce-effect-animation\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-fan-out-bounce-effect-animation\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-fan-out-bounce-effect-animation\\\/\",\"name\":\"Create a Fan-Out with Bounce Effect Using CSS3 Animation - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-fan-out-bounce-effect-animation\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-fan-out-bounce-effect-animation\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css3-fan-out-bounce-effect-animation\\\/css-fa-cbz-shot.jpg\",\"datePublished\":\"2016-08-01T13:01:15+00:00\",\"dateModified\":\"2023-04-06T11:01:53+00:00\",\"description\":\"Did you know that geometric transformations added to HTML elements with the transformCSS property such as scale, skew, and rotate can be animated? They\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-fan-out-bounce-effect-animation\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-fan-out-bounce-effect-animation\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-fan-out-bounce-effect-animation\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css3-fan-out-bounce-effect-animation\\\/css-fa-cbz-shot.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css3-fan-out-bounce-effect-animation\\\/css-fa-cbz-shot.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-fan-out-bounce-effect-animation\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a Fan-Out with Bounce Effect Using CSS3 Animation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e981676afae36d1ff5feb75094950ab3\",\"name\":\"Preethi Ranjit\",\"description\":\"A .NET developer with a JavaScript background, Preethi is expert in front-end coding, JavaScript, HTML, and CSS.\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/preethi\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Create a Fan-Out with Bounce Effect Using CSS3 Animation - Hongkiat","description":"Did you know that geometric transformations added to HTML elements with the transformCSS property such as scale, skew, and rotate can be animated? They","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/","og_locale":"en_US","og_type":"article","og_title":"Create a Fan-Out with Bounce Effect Using CSS3 Animation","og_description":"Did you know that geometric transformations added to HTML elements with the transformCSS property such as scale, skew, and rotate can be animated? They","og_url":"https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2016-08-01T13:01:15+00:00","article_modified_time":"2023-04-06T11:01:53+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/css3-fan-out-bounce-effect-animation\/css-fa-cbz-shot.jpg","type":"","width":"","height":""}],"author":"Preethi Ranjit","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Preethi Ranjit","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/"},"author":{"name":"Preethi Ranjit","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e981676afae36d1ff5feb75094950ab3"},"headline":"Create a Fan-Out with Bounce Effect Using CSS3 Animation","datePublished":"2016-08-01T13:01:15+00:00","dateModified":"2023-04-06T11:01:53+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/"},"wordCount":1218,"commentCount":4,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/css3-fan-out-bounce-effect-animation\/css-fa-cbz-shot.jpg","keywords":["CSS","CSS Animation","CSS Tutorials"],"articleSection":["Coding"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/","url":"https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/","name":"Create a Fan-Out with Bounce Effect Using CSS3 Animation - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/css3-fan-out-bounce-effect-animation\/css-fa-cbz-shot.jpg","datePublished":"2016-08-01T13:01:15+00:00","dateModified":"2023-04-06T11:01:53+00:00","description":"Did you know that geometric transformations added to HTML elements with the transformCSS property such as scale, skew, and rotate can be animated? They","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/css3-fan-out-bounce-effect-animation\/css-fa-cbz-shot.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/css3-fan-out-bounce-effect-animation\/css-fa-cbz-shot.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/css3-fan-out-bounce-effect-animation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create a Fan-Out with Bounce Effect Using CSS3 Animation"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e981676afae36d1ff5feb75094950ab3","name":"Preethi Ranjit","description":"A .NET developer with a JavaScript background, Preethi is expert in front-end coding, JavaScript, HTML, and CSS.","url":"https:\/\/www.hongkiat.com\/blog\/author\/preethi\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-79m","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/27488","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/145"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=27488"}],"version-history":[{"count":4,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/27488\/revisions"}],"predecessor-version":[{"id":65590,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/27488\/revisions\/65590"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=27488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=27488"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=27488"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=27488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}