{"id":454,"date":"2012-09-11T22:25:39","date_gmt":"2012-09-11T22:25:39","guid":{"rendered":"http:\/\/a.parsons.edu\/~dejongo\/12-fall\/?p=454"},"modified":"2019-08-27T16:09:50","modified_gmt":"2019-08-27T16:09:50","slug":"10-animation","status":"publish","type":"post","link":"https:\/\/b.parsons.edu\/~dejongo\/10-animation\/","title":{"rendered":"10 Animation"},"content":{"rendered":"<p>Apple&#8217;s <a href=\"http:\/\/www.webkit.org\/\">Webkit<\/a> team introduced a number of technologies, one of which is <a href=\"http:\/\/www.w3.org\/TR\/css3-animations\/\">CSS Animations<\/a>, which allow an author to modify CSS property values over time. This is an evolving specification. Expect lots of changes as time goes by.\n<\/p>\n<p>The good news is that animations are hardware accelerated. The computer&#8217;s graphic chip does the heavy lifting, and not the CPU. This speeds animations up from the start.\n<\/p>\n<p>Here is an example by <a href=\"http:\/\/www.anthonycalzadilla.com\/\">Anthony Calzadilla<\/a>:\n<link rel=\"stylesheet\" type=\"text\/css\" href=\"http:\/\/anthonycalzadilla.com\/css3-ATAT\/master.css\" \/>\n<link rel=\"stylesheet\" type=\"text\/css\" href=\"http:\/\/anthonycalzadilla.com\/css3-ATAT\/moz-master.css\" \/>\n<link rel=\"stylesheet\" type=\"text\/css\" href=\"http:\/\/anthonycalzadilla.com\/css3-ATAT\/ms-master.css\" \/>\n<div id=\"the-screen\" style=\"top: 0; left: 0;\">\n<div id=\"atat\" href=\"\/\">\n<div id=\"head\">\n<div id=\"skull\"><\/div>\n<div id=\"neck\"><\/div>\n<\/div>\n<div id=\"leg-a\" class=\"background\">\n<div class=\"leg-thigh\">\n<div class=\"leg-shin\">\n<div class=\"exo\"><\/div>\n<div class=\"leg-foot\"><\/div>\n<\/div>\n<p><!-- end shin -->\n<\/div>\n<p><!-- end thigh -->\n<\/div>\n<div id=\"leg-b\" class=\"background\">\n<div class=\"leg-thigh\">\n<div class=\"leg-shin\">\n<div class=\"exo\"><\/div>\n<div class=\"leg-foot\"><\/div>\n<\/div>\n<p><!-- end shin -->\n<\/div>\n<p><!-- end thigh -->\n<\/div>\n<div id=\"shell\"><\/div>\n<div id=\"leg-c\">\n<div class=\"leg-thigh\">\n<div class=\"leg-shin\">\n<div class=\"exo\"><\/div>\n<div class=\"leg-foot\"><\/div>\n<\/div>\n<p><!-- end shin -->\n<\/div>\n<p><!-- end thigh -->\n<\/div>\n<div id=\"leg-d\">\n<div class=\"leg-thigh\">\n<div class=\"leg-shin\">\n<div class=\"exo\"><\/div>\n<div class=\"leg-foot\"><\/div>\n<\/div>\n<p><!-- end shin -->\n<\/div>\n<p><!-- end thigh -->\n<\/div>\n<\/div>\n<\/div>\n<p><!-- end screen --><\/p>\n<p>Involved animations are complicated, and all kinds of tools will be developed to facilitate building more complicated CSS animations. In the mean time, there is a lot you can <a href=\"https:\/\/daneden.github.io\/animate.css\/\">do<\/a> and instructions on <a href=\"https:\/\/github.com\/daneden\/animate.css\/blob\/master\/README.md\">how to do it<\/a> by adding class names to your code.<br \/>\n<iframe src=\"https:\/\/daneden.github.io\/animate.css\/\" style=\"width: 100%; height: 275px;\"  seamless scrolling=\"no\"><\/iframe>\n<\/p>\n<p>There are several programs targeting the creation of CSS animations, primarily targeting the building of ads without using Flash, including <a href=\"http:\/\/www.sencha.com\/products\/animator\/\">Sencha&#8217;s Animator<\/a>, Adobe&#8217;s <a href=\"http:\/\/labs.adobe.com\/technologies\/edge\/?sdid=JAXXJ&#038;skwcid=TC|23230|adobe%20edge||S|b|9263245986\">Edge<\/a> and Google&#8217;s <a href=\"https:\/\/www.google.com\/webdesigner\/\">Google Web Designer <\/a>. Be aware that most of these solutions rely on javascript to help with the CSS3 animations but since the program is writing the code, all you need to deal with is a timeline interface. <\/p>\n<h2>@Keyframe<\/h2>\n<\/p>\n<p>You have seen these @ rules used before, in @media, @font-face and @import. At-rules are instructions or directives to the CSS parser.\n<\/p>\n<p>What follows are two brackets, and all the code is entered inside. This is referred to as the &#8220;code block.&#8221;\n<\/p>\n<p>The <code>@keyframe<\/code> code block contains the keyframes of the animation. The way to write it is: <\/p>\n<pre>\r\n@-webkit-keyframes name-for-animation {\r\n  \/* RULE SETS *\/\r\n}\r\n<\/pre>\n<\/p>\n<p>In between the brackets are the rule sets, which always start with the start and stop keyframes: <code>from<\/code> or 0% and <code>to<\/code> or 100%. The entire keyframe at rule looks like:<\/p>\n<pre>\r\n@-webkit-keyframes name-for-animation {\r\n   0% \/* from *\/{\r\n   }\r\n   100% \/* to *\/ {\r\n   }\r\n}\r\n<\/pre>\n<\/p>\n<p>All other reframes come between the start and end, and you can use <code>from<\/code> and <code>to<\/code>, or <code>0%<\/code> and <code>100%<\/code> keyframes. To make it work, however, you also need to include the animation name as a quality of the animation property.\n<\/p>\n<p>Now to assign the keyframes. In the demo below, the div with and id of &#8220;ani-1&#8221; contains the animation property shorthand that calls up the keyframe at rule.\n<\/p>\n<p>Within this property we\u2019re specifying the name of the animation <code>animation-name: name-for-animation<\/code>,  to specify which keyframes to use, the duration, <code>animation-duration: 10s<\/code>,  the timing function: <code>animation-timing-function: linear<\/code> and the number of times to repeat the keyframes <code>animation-iteration-count: infinite<\/code>.\n<\/p>\n<p>There is also a direction property <code>animation-direction: normal<\/code>, and the possibility to set a delay <code>animation-delay: 0<\/code>. \u00a0\n<\/p>\n<p> You can change the animation but to get the demo to register the changes, you need to temporarily change the keyframe name in the animation property, and then change it back, and it will recognize any changes you&#8217;ve made to the keyframes, otherwise it will continue on its previously determined course. The animation is set up for webkit only.<\/p>\n<div class=\"handson_demo\">\n<h3>CSS Code View<\/h3>\n<pre>\r\n<style contenteditable=\"true\">\r\n@-webkit-keyframes name-for-animation {\r\n\t0%  {  top: 30px; left: 100%; }\r\n\t10% { top: 100px; left: 90%;   }\r\n\t20% { top: \u2212200px; left: 80%;   }\r\n\t30% { top: 100px; left: 70%;   \r\n\twidth: 20px; height: 20px;\r\n\tborder-width: 100px; \r\n}\r\n\t40% { top: \u2212200px; left: 60%;  \r\n\twidth: 200px; height: 200px;\r\n\tborder-radius: 100%;\r\n\tborder-width: 0px; \r\n}\r\n\t50% { top: 50px; left: 50%;   \r\n\twidth: 20px; height: 20px;\r\n\tborder-radius: 0%;\r\n\tborder-width: 100px; \r\n}\r\n\t60% { top: \u2212200px; left: 40%;   }\r\n\t70% { top: 200px; left: 30%;   }\r\n\t80% { top: -200px; left: 20%;   }\r\n\t90% { top: 500px; left: 10%;   }\r\n\t100% { top: 30px; left: -10%; }\r\n}\r\n#ani-1 {\t\r\n-webkit-animation: name-for-animation 10s linear infinite;\r\nposition: absolute;\r\ntop: 30px;\r\nleft: 100%;\r\nz-index: 50;\r\nwidth: 20px;\r\nheight: 20px;\r\nbackground: red;\r\nborder: 4px solid yellow;\r\ntext-overflow: hidden;\r\ntext-align: center;\r\n}\r\n<\/style><\/pre>\n<\/div>\n<div style=\"position: relative\">\n<div id=\"ani-1\"><\/div>\n<\/div>\n<p>The animation could have been optimized. I could have used the transform property, rather than top and left, which is suppose to be faster, and use sub pixel rendering to create a more fluid experience.\n<\/p>\n<p>Animation is in its infancy, and the specification will evolve and change several times before settling down but it&#8217;s actively being implemented by all major browsers and here to stay. If you want to peruse CSS animations, check out Lea Veroa&#8217;s <a href=\"http:\/\/leaverou.github.com\/animatable\/\">Animatable<\/a> for inspiration.<\/p>\n<div style=\"padding: 100px 0; width: 1px;\"><\/div>\n<h1>Interactive Stories\/Ads<\/h1>\n<\/p>\n<p> <a href=\"http:\/\/rachelnabors.com\/alice-in-videoland\/book\/\">Digital storytelling<\/a> \u2014 Designing this Interactive HTML5 Storybook is explained in detail at the end of the story.\n<\/p>\n<p>Google recently introduced <a href=\"https:\/\/www.google.com\/webdesigner\/\">Google Web Designer<\/a> and Adobe has <a href=\"http:\/\/html.adobe.com\/edge\/\">The Edge Suite and in particular <\/a><a href=\"http:\/\/html.adobe.com\/edge\/animate\/\">Edge Animate<\/a>. These tools produce interactive content for desktop and mobile devices.  See the Adobe Edge tools used to <a href=\"http:\/\/html.adobe.com\/edge\/animate\/showcase.html\">showcase<\/a><a href=\"http:\/\/html.adobe.com\/edge\/animate\/showcase\/modern-web\/\">themselves<\/a>.\n<\/p>\n<p>Flash used to dominate this domain, which was used primarily for ads but was pushed out after stepping foul of Apple&#8217;s QuickTime and the popularity of the iPhone. Who wants to pay for ads that wealthy iPhone owners cannot see?\n<\/p>\n<p>That left a vacuum that CSS3, HTML5, and Javascript are supposed to fill. CSS, HTML, and Javascript are not Flash, and as you can see, even creating basic animation is challenging.\n<\/p>\n<p>To solve this, both programs provide a drag-and-drop, easy-to-use user interface for creating animation and interactivity using HTML, CSS, and JavaScript. Adobe wants to recapture the Flash market, and Google wants people to create ads because that is where Google makes its money. Google is an expert at the commercialization of goodwill.\n<\/p>\n<p>Though we have access to both programs, I like the way Google Designer allows me to switch to code view and edit the parameters directly. Adobe Edge Animate requires Edge Code to look at the underlying code and may be more ambitious in the long run but it is not nearly so interesting and useful for us as Google&#8217;s Web Designer.  <\/p>\n<h2>Google Web Designer<\/h2>\n<\/p>\n<p>Download a copy and use it to do your animatic or motion enabled ad. Instructions on how to use the program can be found on the original download page.\n<\/p>\n<p><a href=\"https:\/\/support.google.com\/webdesigner\/#topic=3243982\">Google Web Designer help and tutorials<\/a><\/p>\n<h2>SVG<\/h2>\n<p>SVG or scalable vector graphics, are waiting to HTML and can be animated. Illustrator can export .svg file format and those can be imported into this online app <a href=\"https:\/\/svgartista.net\" target=\"_blank\"  rel=\"noopener noreferrer\"> Svgartista<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apple&#8217;s Webkit team introduced a number of technologies, one of which is CSS Animations, which allow an author to modify CSS property values over time. This is an evolving specification. Expect lots of changes as time goes by. The good &hellip; <a href=\"https:\/\/b.parsons.edu\/~dejongo\/10-animation\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[15],"tags":[],"_links":{"self":[{"href":"https:\/\/b.parsons.edu\/~dejongo\/wp-json\/wp\/v2\/posts\/454"}],"collection":[{"href":"https:\/\/b.parsons.edu\/~dejongo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/b.parsons.edu\/~dejongo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/b.parsons.edu\/~dejongo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/b.parsons.edu\/~dejongo\/wp-json\/wp\/v2\/comments?post=454"}],"version-history":[{"count":28,"href":"https:\/\/b.parsons.edu\/~dejongo\/wp-json\/wp\/v2\/posts\/454\/revisions"}],"predecessor-version":[{"id":4714,"href":"https:\/\/b.parsons.edu\/~dejongo\/wp-json\/wp\/v2\/posts\/454\/revisions\/4714"}],"wp:attachment":[{"href":"https:\/\/b.parsons.edu\/~dejongo\/wp-json\/wp\/v2\/media?parent=454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/b.parsons.edu\/~dejongo\/wp-json\/wp\/v2\/categories?post=454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/b.parsons.edu\/~dejongo\/wp-json\/wp\/v2\/tags?post=454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}