{"id":1383,"date":"2012-06-15T17:32:09","date_gmt":"2012-06-15T17:32:09","guid":{"rendered":"http:\/\/cssreset.com\/?p=1383"},"modified":"2012-06-15T17:32:09","modified_gmt":"2012-06-15T17:32:09","slug":"bring-life-to-your-projects-by-rotating-objects-with-css3-animations","status":"publish","type":"post","link":"https:\/\/cssdeck.com\/blog\/bring-life-to-your-projects-by-rotating-objects-with-css3-animations\/","title":{"rendered":"Bring Life to Your Projects by Rotating Objects with CSS3 Animations"},"content":{"rendered":"<p>With some of the more advanced features of CSS3, you can animate objects on a whole new level.<!--more--> This video makes mention of the fact that only Safari and Chrome browsers currently support this kind of CSS transition. Although this was still true at the time Craig Pattenden made the tutorial, many updates have occurred since then and according to http:\/\/caniuse.com\/css-transitions Firefox, iOS, Opera, Opera Mobile and Android have been added to the list of supported browsers.<\/p>\n<p>By simply assigning a border radius to a box <code>&lt;div&gt;<\/code>, we are able to change a box into a circle. In this example a moon is meant to orbit around the Earth and this requires a few divs to be created first. The Earth <code>&lt;div&gt;<\/code> is positioned relatively with the orbit path and the moon divs being positioned as absolutely. The moon then must be attached to the orbit path. Once all your CSS positions are set you are ready to move on. There is obviously a bit of code involved in all of this, but here is the basic structure of the divs.<\/p>\n<pre class=\"prettyprint linenums\"><code>&lt;div id=\"earth\"&gt;<\/code>\r\n<code> &lt;div id=\"moonContainer\"&gt;<\/code>\r\n<code> &lt;div id=\"moon\"&gt;<\/code>\r\n<code> &lt;\/div&gt;<\/code>\r\n<code> &lt;\/div&gt;<\/code>\r\n<code>&lt;\/div&gt;<\/code><\/pre>\n<p>He does a really good job of breaking down in detail the CSS code for all of the positioning, so make sure you take a moment and look at that even though he spends a few minutes explaining the reasoning and mechanics of the orbit and rotation transitions being created. Transitions like this are incredibly slick and can change the way a page or website is perceived by the visitor.<\/p>\n<p>Taking the time to then go deeper into this endeavor, Craig then tackles the position of the moon&#8217;s shadow and the rotation of the moon itself. The end result is a truly amazing feat, especially knowing that there was no JavaScript used in the making of this animation. CSS3 has most definitely raised the bar of design potential for the online experience. If you are interested in checking out another tutorial exploring some cool transition animations, this video on <a title=\"Create a Sweet Animated Popout Effect with CSS3 box-shadow and Webkit Keyframe Animations\" href=\"https:\/\/cssdeck.com\/blog\/\/animated-popout-effect-css3-box-shadow-webkit-keyframe-animations\/\">creating a sweet pop-out effect<\/a> is a good place to start.<\/p>\n<div class=\"wp-socializer wpsr-share-icons \" data-lg-action=\"show\" data-sm-action=\"show\" data-sm-width=\"768\" ><h3>Share and Enjoy !<\/h3><div class=\"wpsr-si-inner\"><div class=\"wpsr-counter wpsrc-sz-32px\" style=\"color:#000\"><span class=\"scount\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"facebook,twitter,linkedin,pinterest,print,pdf\">0<\/span><\/span><small class=\"stext\">Shares<\/small><\/div><div class=\"socializer sr-popup sr-32px sr-circle sr-opacity sr-pad sr-count-1 sr-count-1\"><span class=\"sr-facebook\"><a rel=\"nofollow\" href=\"https:\/\/www.facebook.com\/share.php?u=\" target=\"_blank\"  title=\"Share this on Facebook\"  style=\"color: #ffffff\" ><i class=\"fab fa-facebook-f\"><\/i><span class=\"ctext\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"facebook\">0<\/span><\/span><\/a><\/span>\n<span class=\"sr-twitter\"><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/intent\/tweet?text=%20-%20%20\" target=\"_blank\"  title=\"Tweet this !\"  style=\"color: #ffffff\" ><i class=\"fab fa-twitter\"><\/i><\/a><\/span>\n<span class=\"sr-linkedin\"><a rel=\"nofollow\" href=\"https:\/\/www.linkedin.com\/sharing\/share-offsite\/?url=\" target=\"_blank\"  title=\"Add this to LinkedIn\"  style=\"color: #ffffff\" ><i class=\"fab fa-linkedin-in\"><\/i><\/a><\/span>\n<span class=\"sr-pinterest\"><a rel=\"nofollow\" href=\"https:\/\/www.pinterest.com\/pin\/create\/button\/?url=&amp;media=&amp;description=\" target=\"_blank\"  title=\"Submit this to Pinterest\"  style=\"color: #ffffff\" data-pin-custom=\"true\"><i class=\"fab fa-pinterest\"><\/i><span class=\"ctext\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"pinterest\">0<\/span><\/span><\/a><\/span>\n<span class=\"sr-print\"><a rel=\"nofollow\" href=\"https:\/\/www.printfriendly.com\/print?url=\" target=\"_blank\"  title=\"Print this article \"  style=\"color: #ffffff\" ><i class=\"fa fa-print\"><\/i><\/a><\/span>\n<span class=\"sr-pdf\"><a rel=\"nofollow\" href=\"https:\/\/www.printfriendly.com\/print?url=\" target=\"_blank\"  title=\"Convert to PDF\"  style=\"color: #ffffff\" ><i class=\"fa fa-file-pdf\"><\/i><\/a><\/span><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>With some of the more advanced features of CSS3, you can animate objects on a whole new level.<\/p>\n<p>Share and Enjoy !0Shares0<\/p>\n<p>0<\/p>\n<p> [&#8230;]<\/p>\n<p><a class=\"more-link video\" href=\"https:\/\/cssdeck.com\/blog\/bring-life-to-your-projects-by-rotating-objects-with-css3-animations\/\" title=\"Click to watch 'Bring Life to Your Projects by Rotating Objects with CSS3 Animations'\">Watch Video<\/a><\/p>\n","protected":false},"author":18,"featured_media":1386,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,13],"tags":[64,62,47,82,49,39,81,83],"_links":{"self":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/1383"}],"collection":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/comments?post=1383"}],"version-history":[{"count":5,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/1383\/revisions"}],"predecessor-version":[{"id":1394,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/1383\/revisions\/1394"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/media\/1386"}],"wp:attachment":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/media?parent=1383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/categories?post=1383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/tags?post=1383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}