Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

How to Extend Axure's Animation Capability

27,237 views

Published on

It can be argued that animations and particularly transitions are integral part of innovative mobile experiences for iOS and Android. Nowadays, UXers must know about motion design and staging.

While there are tools out there which are built for prototyping animations, Axure has similar if not identical capability with the help of few technologies.

In this presentation, we will go over the current animation limitations of Axure 7.0 including firing multiple animations on the same item, resizing, animation origin and others. In the process we will step by step build a complex animation sequence with the help of AxQuery (Axure’s flavor of jQuery) and CSS3 transform properties.

This presentation will give you the tools to build animations otherwise not possible in Axure such as dynamic rotations, varying the animation speed with custom Bezier curves, and others.

Published in: Technology

How to Extend Axure's Animation Capability

  1. 1. Here Be Dragons
 How to Extend Axure’s Animation Capability by Svetlin Denkov @svetlindenkov +
  2. 2. Who Am I?
  3. 3. WHO AM I Svetlin “Svet” Denkov **Pseudo name on Axure Forums = light_forger Ÿ UXer with passion for IxD & Vis. Design Ÿ  DePaul HCI Graduate Ÿ  Constantly evolves own prototyping tool kit with different technologies Ÿ  Writes and presents when the muse strikes him J Ÿ  Oh, and a GoT fan! Go crows!
  4. 4. What We Will Cover
  5. 5. WHAT WE WILL COVER Topics & Demos - Animation limitations of Axure 7.0 - How to do code injection - Basics of using CSS and jQuery - Transitions and Transforms in CSS3 …and if time allows (fingers crossed): - Building custom Bezier curves - CSS Filter property **Main content will be supplemented by a series of demos!
  6. 6. WHAT WE WILL COVER Not in Scope - Multi-line code injection with Axure Plugins - CSS 3D rotations and perspective property - Taking it further with SVG - External animation libraries such as Velocity.js **Feel free to drop me a line at @svetlindenkov after the presentation with questions.
  7. 7. WHAT WE WILL COVER Code Notation stuff – Axure actions/events or jQuery/CSS code <stuff> - Code placeholder stuff – Putting extra attention **I promise, this will be entertaining. No, really! J
  8. 8. Axure & Animation 1  
  9. 9. AXURE & ANIMATION Robust Event Model widget-based page-based
  10. 10. AXURE & ANIMATION Rich User-customizable Actions
  11. 11. AXURE & ANIMATION Some Level of Transition Support “Show” action “Set Panel to State” action
  12. 12. AXURE & ANIMATION Capabilities - Moving widgets by a distance/to a location - Changing state of a widget via dynamic panels - Showing/hiding widgets - Scaling widgets - Text manipulations
  13. 13. AXURE & ANIMATION Painpoints - No widget rotation of widgets on different axes Source: http://bit.ly/1L9RJSa - No simultaneous animation of multiple widget properties Source: http://bit.ly/1exZkxM - Can’t specify an animation origin Source: http://bit.ly/1LpZNfG - And others: scaling, animating to an opacity, no custom animation curves, etc.
  14. 14. “Dracarys!”
 
 (Painpoint demo)
  15. 15. Identified Solution
 
 (Let’s tackle the dragon!) 2  
  16. 16. IDENTIFIED SOLUTION Prototype Structure - Axure prototypes have mostly HTML and CSS files
  17. 17. IDENTIFIED SOLUTION Role of jQuery - Axure uses custom version of jQuery called AxQuery
  18. 18. IDENTIFIED SOLUTION Prototype Code - Each widget has a unique id in the HTML (and name if given one)
  19. 19. IDENTIFIED SOLUTION Next Steps - Based on Axure’s inner workings, we can do code injection on widget <div>s via CSS3 and jQuery BUT - What about Axure 8.0 beta, which comes out this summer? Source: http://bit.ly/1It92Lp
  20. 20. IDENTIFIED SOLUTION Axure 8.0 beta Source: http://bit.ly/1Fzn4H1
  21. 21. IDENTIFIED SOLUTION Axure 8.0 beta (cont) - Surprise!!! 2 days ago Axure announced improved animation support (secretly grinning here J) - So what has been confirmed so far? Ÿ Rotation action Ÿ Multiple animations at once - Need more details on the following Ÿ Animation origin Ÿ Dynamic Panel 3D rotations
  22. 22. IDENTIFIED SOLUTION Why This Talk is Relevant - It will be a while before we can use Axure 8.0 animations for production ready projects - The method to be presented is useful for any code injection - More robust control over easing functions - Animations not yet available in 8.0 such as blurs, tonal changes, animating shadows, etc. Source:
  23. 23. Code Injection Methods 3  
  24. 24. CODE INJECTION METHODS Method 1 - Axure Plugins
  25. 25. CODE INJECTION METHODS Method 1 - Axure Plugins (cont.) - First introduced in Axure 7.0 as part of the AxShare service - Used for attaching HTML/CSS/Javascript code blocks - Each AxShare project has this feature - One or more plugins can be attached in the header, footer or a dynamic panel of a page
  26. 26. CODE INJECTION METHODS Method 1 - Axure Plugins (cont.) - For more information, check this resources out: http://bit.ly/1CjPvsi http://bit.ly/1GZzw8d Axure Supplied Info: Examples: http://bit.ly/1Bu7UYl http://bit.ly/1Nd86g5 http://bit.ly/1l6Rsn0 http://bit.ly/1Ftjr5d Detailed Walkthrough:
  27. 27. CODE INJECTION METHODS Method 2 – Third-party Hacks
  28. 28. CODE INJECTION METHODS Method 2 – Third-party Hacks (cont.) - Finer control wanted for a long time, resulting in many user attempts of hacking Axure - A variety of options: custom libraries (.rplib), external JS files, and code read in from local widgets - Use these approaches with caution! Many may not work properly or at all as Axure evolves
  29. 29. CODE INJECTION METHODS Method 2 – Third-party Hacks (cont.) - There is too much variability with this method, so we won’t cover it, but if your curiosity grabs you: Zeroskillz’s http://bit.ly/1Rjsywl ColinB’s http://bit.ly/1tfNQ6V Different Attempts: Various Threads on JS: http://bit.ly/1Lq4IgD http://bit.ly/1K2CTxN http://bit.ly/1I5S7jH Rootnot’s http://bit.ly/1JasSOH
  30. 30. CODE INJECTION METHODS Method 3 - Using Open Link in Current Window Action
  31. 31. CODE INJECTION METHODS Method 3 - Using Open Link in Current Window Action (cont.) - Method discovered back in v6.0 by power users - Quick way of executing short code without Axure Plugins - This is the high level flow: 1. We pick the event we want to use e.g., OnClick 2. Pass an Open in Window action 3. Select Current Window option 4. Past inline the code to be executed 5. Magic happens!!!
  32. 32. “Dracarys!”
 
 (“Open Link in Current Window” demo)
  33. 33. “Open Link in Current Window” Method Details 4  
  34. 34. METHOD DETAILS Pros - Anyone can learn it. Yes, anyone!!! - Quick to implement and use - Will work as long as your browser is supported Cons - Doesn’t scale well for multi-line code - Readability of code is poor, so write it in Coda or Gedit - May not handle complex cross-widget interactions
  35. 35. METHOD DETAILS Building Blocks 1. use javascript: keyword 2. select appropriate widget(s) 3. pass a method (action) and its argument list (values)
  36. 36. METHOD DETAILS Part 1 – javascript: - It is an URI (Uniform Resource Identifier) scheme. In English? - It allows us to run JavaScript code (jQuery too): javascript:<statement 1>; <statement 2>; void(0); OR javascript:void(<single statement>); ß We will use this one! - It is evaluated on top of the existing prototype code http://bit.ly/1BucuWA http://bit.ly/1Bucupm More on URIs: More on void keyword: http://mzl.la/1x6OJC7
  37. 37. METHOD DETAILS Part 2 – Select Widgets - Two different ways of doing this: Option 1: $axure(‘@<widget-name>’) – uses an Axure object (part of API) Option 2: $(‘[data-label=<widget-name>]’) – using jQuery and custom HTML5 data- attribute - I am sorry, WHAT??!!!
  38. 38. METHOD DETAILS Part 2 – Select Widgets (cont.) - Let’s back up! Here is a primer on jQuery: $ or jQuery( ) = encapsulation object. It tells that jQuery stuff will happen. Obviously, there is more to this! (<stuff>) = query. Informs the DOM (Document Object Model), what we are searching for. Can use id, <> tag, class, etc. http://bit.ly/1GcYBsA http://bit.ly/1nJVbqD More on jQuery object:
  39. 39. METHOD DETAILS Part 2 – Select Widgets (cont.) Back to Option 1, $axure(‘@<widget-name>’): - Axure has an API built on top of jQuery called AxQuery - $axure is referencing that API - Has different support of jQuery methods - You can read a very detailed writeup here: http://bit.ly/1LaoG0P
  40. 40. METHOD DETAILS Part 2 – Select Widgets (cont.) And back to Option 2, $(‘[data-label=<widget-name>]’): - Uses jQuery object and HTML5 data- property - Axure uses data-label for any named widgets. Name your widgets, people!!! - <widge-name> = name given to widget in Axure e.g., bs_Click http://bit.ly/1d83j2h More on data- property:
  41. 41. METHOD DETAILS Part 2 – Select Widgets (cont.) - jQuery behavior differs based on whether using $ or $axure - .css() is not predictable. Some properties work (“color”), while others don’t (“background-color”, “height”) - Both topics require additional investigation
  42. 42. METHOD DETAILS Part 3 – Use .css() Method - Can be used to modify CSS properties, but we will primarily use it for animations - It is a jQuery method that passes property: value pairs - Can be used for a single CSS property: <widget-name selection>.css(“text”, “Hello!”); - Can also be used for a long list of items: <widget-name selection>.css ({“text”:“Hello!”, “color”:”red”}); http://bit.ly/1SyZVxA More on .css():
  43. 43. METHOD DETAILS Putting It All Together - Open Link in Current Window: javascript:void($('[data-label=bs_block1]').text(”Drogon rules!")); and for kicks, let’s throw in $axure too to see change in behavior: javascript:void($axure('@bs_block2').text(“Told you he rules!”));
  44. 44. “Dracarys!”
 
 (Break time! jQuery demo)
  45. 45. Let’s Build an Example
 with CSS Transforms 5  
  46. 46. CSS TRANSFORMS Targeted interaction = tap to remove item from grid of items. The animation will include: 1. Scaling widget by x3 factor 2. Rotating it by 50 degrees 3. Moving it out of the way by 1000px 4. Changing the opacity to 0% to hide it Copyright of the cute fella is Game of Thrones (sold via POP): http://bit.ly/1eyj5oV “BBQ, anyone?” - Drogon
  47. 47. CSS TRANSFORMS Scale, Move, and Rotate - We can use Move and Set Panel Size Axure actions but that becomes complicating - We will stick to CSS3 Transforms, which creates a unified method for modifying the widget - But what are Transforms? Transformers!? Heck, no! We are fighting a dragon!
  48. 48. CSS TRANSFORMS Background - Originally came from WebKit, then folded into 2 W3C Working Drafts, CSS 2D and 3D Transforms - More prominent in CSS3 which has good browser support - Transforms include translations, scalings, rotations, skewing and perspective changes - Last two are too much for today! Gotta keep you focused J http://bit.ly/Y629ge More on Transforms: http://bit.ly/1fojScj
  49. 49. CSS TRANSFORMS Background (cont.) http://mzl.la/1ze7NPsSource:
  50. 50. CSS TRANSFORMS Background (cont.) - We can add separate statements for each browser. Target one only for effectiveness - We will target Firefox with transform (also works for Chrome). For Safari, we need to use –webkit-transform - Transforms can be single value or multi-value: transform: <value1(arg1)> OR transform: <value1(arg1)> <value2(arg2)>
  51. 51. CSS TRANSFORMS Part 1 - Scale - To scale an item we use: transform: scale (<number1>, <number2>) <number1> is the scaling factor for the x-axis <number2> is the scaling factor for the y-axis - To grow symmetrically we can use the same value for both - There are also scaleX(<number>) and scaleY(<number>)
  52. 52. CSS TRANSFORMS Part 2 - Move - To move an item we use: transform: translate (<number>px) <number> is the end x-coordinate of the end state - translate = translateX - Translate can also be used with 2 arguments: translate(<number1>, <number2>), but for our purposes we will move the item on the X-axis only - There are also translateX(<number>) and translateY(<number>)
  53. 53. CSS TRANSFORMS Part 3 - Rotate - To rotate an item we use: transform: rotate (<number>deg) <number> is the number of degrees of rotation we want for the end state - rotate = rotateZ or rotation on the Z-axis (the plane facing us) - There are also rotateX (vertical card flips) and rotateY (horizontal card flips)
  54. 54. CSS TRANSFORMS Part 4 - Opacity - To change the opacity we can use the opacity property: opacity: <number> <number> is % of opaqueness in decimal: 0 = transparent, 1 = fully visible. We will use 0. - Name of the property is opacity in all browsers - This is not a Transform property
  55. 55. CSS TRANSFORMS End Statement - Written for Firefox: javascript:void($('[data- label=img_drogon]').css({"transform":"scale(3,3) translate(1000px) rotate(50deg)", "opacity":”0"})); - We will modify it slightly. You will see why! javascript:void($('[data- label=img_drogon]').css({"transform":"scale(3,3) translate(200px) rotate(50deg)", "opacity":"0.2"})); - As homework, read on transform-style and transform-origin!
  56. 56. “Dracarys!”
 
 (CSS Transforms demo)
  57. 57. Adding CSS Transitions 6  
  58. 58. CSS TRANSITIONS Background - Last example didn’t animate. For this, we need a CSS Transition - Similarly to CSS Transforms, CSS Transitions originated with the WebKit team and later folded in own W3C draft - Now integral part of animating CSS Transforms as per CSS3 http://bit.ly/1BFMibH More on Transitions: http://bit.ly/1Gdp4WO
  59. 59. CSS TRANSITIONS Background (cont.) http://mzl.la/1eV9SiASource:
  60. 60. CSS TRANSITIONS Background (cont.) - Axure has animation type (ease in) and duration (500 ms). CSS3 Transitions have: property – element being animated duration – identical to Axure timing function – similar to Axure delay – similar to Axure’s Wait action
  61. 61. CSS TRANSITIONS Background (cont.) - Each has an associated CSS property: 1. transition-property 2. transition-duration 3. transition-timing-function 4. transition-delay - Can be used individually or via a shorthand: transition: <property> <duration> <timing function> <delay> - Remember, we are using transition which works for Firefox and Chrome. For Safari it is –webkit-transition
  62. 62. CSS TRANSITIONS Part 1 - transition-property - Acts on one or comma-separated list of CSS properties - Default value is all, which is what we will use: transition: all <duration> <timing function> <delay> http://bit.ly/1TEpj6z More Info:
  63. 63. CSS TRANSITIONS Part 2 - transition-duration - Uses seconds in the format <number>s - So we can see the transition details, let’s use 4 seconds or 4s: transition: all 4s <timing function> <delay> http://bit.ly/1Ird4kY More Info:
  64. 64. CSS TRANSITIONS Part 3 - transition-timing-function - It can use a built-in value such as ease-in or custom Bezier curve (more on that later) - For our example, let’s use ease-in or gradually speeding up: transition: all 4s ease-in <delay> http://bit.ly/1K30Ch4 More Info:
  65. 65. CSS TRANSITIONS Part 4 - transition-delay - Similar format as transition-duration - We will use no delay, so the value will be 0s: transition: all 4s ease-in 0s http://bit.ly/1GZVSqa More Info:
  66. 66. CSS TRANSITIONS Updated End Statement - We are adding transition: all 4s ease-in 0s - The jQuery written for Firefox looks likes: javascript:void($('[data- label=img_drogon]').css({"transform":"scale(3,3) translate(1000px) rotate(50deg)", "opacity":"0", "transition":"all 4s ease-in 0s"})); - Now we should be able to see a smooth transition
  67. 67. “Dracarys!”
 
 (CSS Transition demo)
  68. 68. Time Check!!!
  69. 69. Custom Timing 
 Functions 7  
  70. 70. CUSTOM TIMING FUNCTIONS Background - Earlier we discussed CSS has pre-built timing functions such as linear, ease-in, ease-in-out and others - These are considered specific implementations of a Cubic Bezier curve - Animation behaviors come into two flavors: swings and curves (Cubic Bezier curves), so let’s review each briefly
  71. 71. CUSTOM TIMING FUNCTIONS Swings - Axure has this as a built-in value swing - Swings are how springy an item is e.g., bounce of a ball - A swing has tension, friction, velocity, tolerance (RK4 spring). There are also DHO springs - CSS natively does not YET have spring property. This may be simulated via animation keyframes, but requires more research http://bit.ly/1ALicze More on Swing with CSS: http://bit.ly/1K3gw9V
  72. 72. CUSTOM TIMING FUNCTIONS Curves - Axure has some built-in values ease in, ease in out, etc. - We have two points in space and a cubic curve (x3 curve) between them - The curve determines the animation progress over time http://bit.ly/1EeJXi7 http://bit.ly/IFqq5p More on Curves:
  73. 73. CUSTOM TIMING FUNCTIONS Custom Cubic Bezier Curves - Certain implementations are provided as built-in CSS values - We can build our own using: cubic-bezier(<x1>, <y1>, <x2>, <y2>) where the numbers specify the x/y coordinates of the 2 points - This can be confusing if we are just plugging numbers, so there are visual tools for this http://bit.ly/1j89N0S http://bit.ly/1cMqCf2 More on Building a Curve:
  74. 74. CUSTOM TIMING FUNCTIONS Building the Curve - Copy the value of the built curve and update the CSS Transition: transition: all 4s cubic-bezier(.08,.78,.89,-0.61) 0s - The jQuery updated for Firefox: javascript:void($('[data- label=img_drogon3]').css({"transform":"scale(3,3) translate(1000px) rotate(50deg)", "opacity":"0", "transition":"all 4s cubic-bezier(.08,.78,.89,-0.61) 0s"}));
  75. 75. CUSTOM TIMING FUNCTIONS Integrating - To modularize the code we can save the curve to an Axure global variable and re-insert it in the code: varTestAnim = cubic-bezier(.08,.78,.89,-0.61) - The jQuery re-updated for Firefox: javascript:void($('[data- label=img_drogon]').css({"transform":"scale(3,3) translate(1000px) rotate(50deg)", "opacity":"0", "transition":"all 4s [[varTestAnim]] 0s"}));
  76. 76. CUSTOM TIMING FUNCTIONS Best Practices - Keep animations between 150ms and 350ms - Staging is important: for multiple animating items, what’s the order and timing of each - Introduce animations only if they bring value to the overall user experience http://bit.ly/1PgMzHY More on Best Practices:
  77. 77. “Dracarys!”
 
 (Custom Cubic Bezier curve demo)
  78. 78. Going Further 
 with CSS Filter
 
 (We killed the dragon. 
 Now let’s get its genome!) 8  
  79. 79. CSS FILTER Background - What about dynamic blurs, tonal changes, and drop shadows? Sure. We can do that! - Enter the filter CSS property - It is in draft form (W3C Filter Effects Module), so it is not officially released, yet most main browsers support it - Used to apply images effects, but we will hack it for any widget (insert evil laugh here) http://bit.ly/1K5L9LK More on Filter: http://bit.ly/1G0g61j
  80. 80. CSS FILTER Background (cont.) http://mzl.la/1eyTKLzSource:
  81. 81. CSS FILTER Basic Syntax - It uses the familiar property: value approach: filter: <value(arg)> Just like transform multiple values can be stringed together: filter: <value1(arg1)> <value2(arg2)>
  82. 82. CSS FILTER Re-Updated End Statement filter: blur(5px) grayscale(100%) drop-shadow(16px 16px 20px red); - Optionally we can replace opacity: 0.0 with filter’s opacity(0%) - jQuery rewritten for Firefox: javascript:void($('[data- label=img_drogon5]').css({"transform":"scale(3,3) translate(1000px) rotate(50deg)", "opacity":"0", "transition":"all 4s [[varTestAnim]] 0s", "filter":"blur(5px) grayscale(100%) drop-shadow(16px 16px 20px red)"}));
  83. 83. “Dracarys!”
 
 (CSS Filter demo)
  84. 84. And Beyond?
 
 (Cloning your own dragon!) 9  
  85. 85. AND BEYOND? When CSS/jQuery Is Not Enough - CSS3 offers even more: animations, perspective changes, masks and clip-paths, SVG object manipulation, etc. - We can even tie in 3rd party animation libraries via Axure Plugins: GreenSock (GSAP), Velocity, and others - The next level in animation is using tools such as: 1. Framer JS (code-based) 2. AfterEffects and Mitya (timeline-based) 3. Origami and Google Form (node-based)
  86. 86. Summary
 
 (You survived the battle!) 10  
  87. 87. SUMMARY Quick Takeaways - This is an experimental technique. Support in mobile depends on the browser quality - Transforms/Transitions can be applied to a single widget or a dynamic panel - CSS Transforms are written differently across browsers - Some CSS properties are not animatable via jQuery - Code is best written outside of Axure
  88. 88. SUMMARY Closing Thoughts - Animations play a key part in interactions when done right - Axure animations right now have limitations, but 8.0 beta is going to change that - Regardless if use CSS3/jQuery with Axure or not, understanding code can expand your prototyping skills - Axure is great but not always the solution, so explore other prototyping technologies, too
  89. 89. Questions?
 
 (Polish your armor and ask away!) **Take a look at the Additional Resources section for more goodies!  
  90. 90. That’s All, Folks!
 light_forger @svetlindenkov Svetlin Denkov
  91. 91. Additional Resources 11  
  92. 92. ADDITIONAL RESOURCES Presentation Resources - Generated prototype on AxShare - Source Axure .rp file http://bit.ly/1e7XNxJ http://bit.ly/1LtVwtX
  93. 93. ADDITIONAL RESOURCES Books
  94. 94. ADDITIONAL RESOURCES Specification Information - W3C - W3Schools - CSS Tricks Animation Libraries - Dynamics JS - GreenSock (GSAP) - Velocity JS http://bit.ly/1kMucX1 http://bit.ly/1Cfzqnr http://bit.ly/1SzFkJs http://bit.ly/1sFYIq7 http://bit.ly/1hLLLc0 http://bit.ly/1hALtFq
  95. 95. ADDITIONAL RESOURCES CSS Code Examples SVG Code Examples http://bit.ly/1FlQRs9 http://bit.ly/1TEFHUx http://bit.ly/1ESt9B6 http://bit.ly/1MpYPRM

×