<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by José Rosário on Medium]]></title>
        <description><![CDATA[Stories by José Rosário on Medium]]></description>
        <link>https://medium.com/@jose.rosario?source=rss-517e1070243c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MqKTVPR3OaZ4LpWEXqo3kA.jpeg</url>
            <title>Stories by José Rosário on Medium</title>
            <link>https://medium.com/@jose.rosario?source=rss-517e1070243c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 04:33:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jose.rosario/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How Can a UX Engineer Help a Design System Team? Part 2 — The Build Up]]></title>
            <link>https://medium.com/outsystems-engineering/how-can-a-ux-engineer-help-a-design-system-team-part-2-the-build-up-ba6578dd8367?source=rss-517e1070243c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba6578dd8367</guid>
            <category><![CDATA[outsystems]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[ux-design]]></category>
            <category><![CDATA[product-design]]></category>
            <dc:creator><![CDATA[José Rosário]]></dc:creator>
            <pubDate>Mon, 26 Jul 2021 16:15:10 GMT</pubDate>
            <atom:updated>2021-08-02T11:45:32.091Z</atom:updated>
            <content:encoded><![CDATA[<h3>How Can a UX Engineer Help a Design System Team? Part 2 — The Build Up</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CofZXxLpx_MjiALQw83fSw.png" /></figure><p><em>OutSystems released a new version of our integrated development environment (IDE), Service Studio, at the end of July 2021. Before the release, we’ve shared a month of content on how our UX/UI Team tackled this project while building and implementing their very own Product Design System to create a delightful experience for all users.</em></p><p><em>As part of this series, </em><a href="https://medium.com/outsystems-engineering/a-delightful-product-how-we-proved-illustrations-add-value-for-the-user-e37213af407b"><em>we presented you with data on why illustrations add value to the interfaces of software products</em></a><em>, courtesy of our Digital Designer David Monteiro; the Team Lead of the Product Content Team, Marina Calado, </em><a href="https://medium.com/outsystems-engineering/writing-the-words-that-matter-establishing-a-ux-writing-practice-1470d575f34f"><em>showed why writing the words that matter is vital to establishing a UX writing practice</em></a><em>, and we interviewed our UX/UI Team Lead, Andreia Mesquita, </em><a href="https://medium.com/outsystems-engineering/building-a-ux-culture-at-outsystems-a-talk-with-ux-ui-team-lead-andreia-mesquita-e8bf3d1bce3c"><em>about how OutSystems built its UX culture.</em></a></p><p><a href="https://www.outsystems.com/blog/posts/how-can-a-ux-engineer-help-a-design-system-team/">In the first part of this article</a>, I shared my views on what it means to be a UX engineer and their main responsibilities while working side by side with Design and Engineering teams. In this article, I will deep-dive into my work at OutSystems by describing some of our UX processes, how we adapted across different projects, and what we achieved in the past year.</p><p>Creating a structured and well-defined design system is fundamental to help you sell such a framework within your company and highlight the value it will bring. This is why we chose a challenging starting point: one of the oldest applications by OutSystems — the Service Center.</p><p>Some of you might have heard about it as it was developed more than 10 years ago! Much like a pilot TV episode that helps sell a particular show, having pilot apps is perfect because you know exactly your priorities and where you should focus.</p><h3>The Pilot Application</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/0*i-nPwOOByyWp35dl" /><figcaption><em>Service Center — past and present (now using the Product Design System)</em></figcaption></figure><p>We have a decade-old application in our hands. Now what? We are aware of the impact that creating a disruptive change in this type of software will bring, as many of our users have been working with this application for a long, long time. So, we need to ensure that old users will have a pleasant new experience while new users still find it attractive and modern.</p><p>With some of the groundwork done — we synced the design and code according to the foundations we’d defined, and we audited the app -, we chose the top three most visited/used screens. Then, we extracted the primary components used, the basic inputs and controls, some tables and data, and the main existing styles.</p><p>Following this, we matched the old styles and components with the new design system we were building. After internal and external feedback loops with stakeholders and the team, we designed the first screens to be implemented. In the meantime, while management decisions were taking place, we continued designing and developing the first components to make sure they fit perfectly inside our product.</p><p>Finally, all was set for our first delivery as the Design System Team. We released the design files and code elements to the dev teams while introducing a completely new framework of components. And, just like that, the team had to learn how to use the new design system on top of a legacy system with more than 10 years while trying not to introduce any breaking changes!</p><p>It was precisely at this point that I switched roles from Design to Engineering, joining the Lifecycle Team as a UX Engineer to help them develop the app. The move was beneficial for us during the initial phase of the design system because it allowed us to improve and further define the system, but it also helped us with:</p><h3>Advocating and Educating</h3><p>As a UX engineer, by collaborating with the Engineering Team, you will have the opportunity to teach them how to use the system while also improving and supporting its ongoing development. The result? We end up with a new team that can fully build new products while using the system. Regarding advocating, it’s all about promoting the need and the importance of using the system and stressing its benefits and outcomes.</p><h3>Collecting Feedback</h3><p>While observing the team using the system, you collect feedback and change some components to make them easier to use in future development processes. You understand what works better and what needs to be improved in Code and Design and then bring back the feedback to the Design System Team to plan future work.</p><h3>Building the Confidence to Succeed</h3><p>Moving such a complex application to a new system and receiving great feedback from our users proved that continued improvement work on the design system would help us evolve and launch new products.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/0*wFCY9dUqEQpAETH0" /><figcaption><em>A new connection to a new team</em></figcaption></figure><h3>We have a Design System, Everyone Wants a Design System</h3><p>As if this was not enough, different Design and Engineering teams were developing new tools and experimenting with the first draft version of the Product Design System at the same time. Use cases popped up both in design and code.</p><p>We focused on improving the system based on the pilot application’s feedback on the design system side. We also prepared for the future by taking in feedback from the experiments by different teams.</p><p>We were developing around eight different products/apps and constantly delivering features. Although the first version of the Product Design System was already in place, it wasn’t ready (yet) to escalate quickly. So, teams continued working on new features and designing specifications for new components. How did it end? A complete mess.</p><p>Apps that should have the same styles and behaviors looked and felt different. I’m not blaming anyone — we were doing the best we could. These mishaps happen, and it’s okay; we were one step closer to having a mean, well-oiled machine. We just needed to learn and overcome those issues.</p><p>So, we went back again to one of the pieces of advice shared in the first part of this article: we prepared the groundwork, designing and building all the necessary assets to accommodate every tool under development. We went through different stages during this process that helped us deliver the best experience for our teams and, most importantly, to our users!</p><h3>Audit</h3><p>By reviewing the work so far, you will once again have the opportunity to identify broken experiences and missing assets. Then, you can easily match those with the most recent features from the Product Design System while removing friction from the current implementation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/0*sDX4oPgKbGEphXlE" /><figcaption><em>What we found: different colors, different types of loading wheel, and different behaviors for the same Button Loading component</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/0*CVBeSq3NkI1CRnJ7" /><figcaption><em>What we found: different sizes, colors, and orders for the icons, plus different shadows and radius for the same Popover component</em></figcaption></figure><h3>Awareness</h3><p>Get involved with the teams and create regular syncs to show (and tell) what’s going on with the Product Design System. By doing this, our teams were able to:</p><ol><li>Better estimate their work without having dependencies on the Design System Team.</li><li>Continue focusing on business logic instead of pixels (as mentioned in the first part of this article).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/0*MtDXwMGS-TwM0rh4" /><figcaption><em>All teams connected and using the Product Design System</em></figcaption></figure><h3>Make It Available, Reusable, and Open to Contributions</h3><p>When all the pieces finally fit together, and we had a “final” version of our Product Design System — well, not final because design systems are constantly evolving, but I’ll leave that to a potential sequel of this text — it was vital to make it available and easy to use by everyone.</p><p>To achieve this and help different teams grow simultaneously, specific tools/assets from the Design System Team were fundamental:</p><ul><li>UI Library — A Figma file with all the necessary UI assets.</li><li>Code Library — Ready-to-use OutSystems blocks on top of the OutSystems UI Framework.</li><li>Product Design System Preview — An application where developers and designers can inspect and interact with the code configurations.</li><li>Design System Documentation — More detailed and specific information about the entire system developed to build OutSystems products.</li><li>Weekly sync meetings to understand the teams’ needs and collect feedback from the field.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-XTwAnGDxDLjgWIN" /><figcaption><em>Product Design System preview</em></figcaption></figure><h3>Design System Today</h3><p>Today, the Product Design System is the single source of truth and the baseline of any new development project inside OutSystems. In the meantime, we delivered a few more components and introduced a new theme for specific use cases. The best part? Teams are now fully autonomous to build their own components while using the foundations and the best practices from the Product Design System. And they do it more quickly and efficiently, providing a seamless user experience.</p><p>Is it mission accomplished? Well, yes and no. The work you put into a design system is never over. As your product evolves, so does your system, or you will end up with an obsolete framework.</p><p>That’s another peculiarity about working between design and engineering — in both these areas, your work is never done. You keep iterating, improving. And that’s a pretty cool thing when you enjoy being a UX engineer as much as I do.</p><p><em>Originally published at </em><a href="https://www.outsystems.com/blog/posts/how-can-a-ux-engineer-part-two/"><em>https://www.outsystems.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba6578dd8367" width="1" height="1" alt=""><hr><p><a href="https://medium.com/outsystems-engineering/how-can-a-ux-engineer-help-a-design-system-team-part-2-the-build-up-ba6578dd8367">How Can a UX Engineer Help a Design System Team? Part 2 — The Build Up</a> was originally published in <a href="https://medium.com/outsystems-engineering">OutSystems Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Can a UX Engineer Help a Design System Team]]></title>
            <link>https://medium.com/outsystems-engineering/how-can-a-ux-engineer-help-a-design-system-team-16f8b0e35146?source=rss-517e1070243c------2</link>
            <guid isPermaLink="false">https://medium.com/p/16f8b0e35146</guid>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[ux-engineering]]></category>
            <category><![CDATA[outsystems]]></category>
            <category><![CDATA[product-design]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[José Rosário]]></dc:creator>
            <pubDate>Wed, 14 Jul 2021 16:01:03 GMT</pubDate>
            <atom:updated>2021-08-02T11:50:02.482Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MIsJIBcxSQGhzpLupUgKcA.png" /></figure><p><em>OutSystems released a new version of our integrated development environment (IDE), Service Studio, at the end of July 2021. Before the release, we’ve shared a month of content on how our UX/UI Team tackled this project while building and implementing their very own Product Design System to create a delightful experience for all users.</em></p><p><em>As part of this series, we showed you </em><a href="https://medium.com/outsystems-engineering/how-we-grew-our-ux-practice-for-max-product-impact-f077b6932521?source=collection_home---4------4-----------------------"><em>how we grew our UX practice</em></a><em>, explained </em><a href="https://medium.com/outsystems-engineering/quantifying-the-uncountable-how-we-landed-our-products-visual-sophistication-a1daf4efbaf7"><em>how we used data to elevate our product’s look and feel</em></a><em>, and spoke to </em><a href="https://medium.com/outsystems-engineering/a-talk-about-design-systems-why-we-need-them-why-we-built-one-41dce2c5d42e"><em>our UX/UI Team about design systems in general and the one they helped create at OutSystems</em></a><em>.</em></p><p><em>In this article, we’ll dive into the role of UX engineers and how their skills can help you turn design language into a code component library.</em></p><p>I’ve been working with front-end development, mainly CSS, for the past couple of years here at OutSystems. My goal? Trying to build the perfect CSS architecture using the most recent features and best practices for the <a href="https://outsystemsui.outsystems.com/OutsystemsUiWebsite/">OutSystems UI framework</a> and following the best approaches for fitting components together seamlessly. Yes, you can blame me for some of the issues that you faced during your projects.</p><p>Last year I was challenged to embrace a new project and help our UX/UI Team build a design system and evolve our product (including <a href="https://www.youtube.com/watch?v=PAkvlXIFcpo">Service Studio’s new version</a> and other new tools). That was precisely what I was looking for after getting more familiar with design systems and what it entails to create one.</p><p>With that, my job role shifted from Front-End Software Engineer to UX Engineer, but at the time, the functions of such a position weren’t clear within the company. All the team knew was: “We need someone to help us translate the design into code, pattern behaviors into variables in a clean, scalable way, and who communicates with the different development teams.”</p><p>In other words, they were looking for someone who could help collaborate with the Design Team and the Engineering Team, turning the design language into a code component library.</p><h3>So, What Exactly Is a UX Engineer?</h3><p>Having worked with user experience, design files, and elegant pieces of implemented code, it was clear to me that I could play that role. I wanted to help the company craft exceptional experiences and welcomed the opportunity of joining a new team entirely focused on building a design system.</p><p>Looking back, I am thankful that I could focus on the tasks ahead before even knowing that the role of a UX engineer was a real thing. Job roles can be complicated to describe, and the term “UX engineer” often confuses people, including some at OutSystems, who ask me about what I do. Are you creative or technical? Do you work in the Experience Team or the Engineering Team? How is a tech guy so visually creative?</p><p>After walking the walk for a while, I had answers. All these questions lead to a fundamental issue: what do UX engineers do, and why do UX teams need them?</p><p>A UX engineer falls between UX design and software engineering. UX engineers, or UXEs, possess the skillset of a front-end or UI engineer, but they have a working knowledge of UX design principles. In essence, a UX engineer is a front-end engineer who works with the Design Team as the link between Design and Engineering.</p><p>As Teo Yu Siang explained <a href="https://www.interaction-design.org/literature/article/the-ultimate-guide-to-understanding-ux-roles-and-which-one-you-should-go-for">in an article for the Interact Design Foundation</a>: “UX unicorns [UX engineers] are a rare and special breed of people who can not only contribute to all phases of the design process; they can also take charge of front-end development.”</p><p>Thus, UX engineering bridges the gap between UX designers and software engineers. Often confused with front-end developers, UX engineers are the magic makers, bringing UX designs to life.</p><p>By doing so, they merge technical know-how and design aesthetics, partnering with programmers, UX researchers, designers, and more, to conceptualize and deliver an effective user experience focusing on the technical elements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*w47TNx48QYbzdzPDZE86tg.png" /><figcaption>Where UX Engineers sit within teams</figcaption></figure><h3>What Are Their Skills and Responsibilities?</h3><p>The role of a UX engineer can vary depending on the project, team, or company, but these are the major skills and responsibilities we have to deal with daily. <strong>Essentially, a UX engineer is involved where it delivers the most value to the team and the product.</strong></p><h4>Ideation</h4><p>During ideation, UX engineers contribute to discussions on usability, brainstorm solutions, and advise on any technical impediments. The latter is essential to help decide which ideas are feasible.</p><h4>Design</h4><p>We also work with UX/UI designers to create a library of consistent and usable components that will be used during the wireframing and prototyping phase and handed off to the Engineering teams.</p><h4>Build and test</h4><p>This is where the technical side of a UX engineer shines through, and the core skills are essential, such as HTML, CSS, Javascript, and OutSystems. We need to develop all the components, layouts, and parts of the designs. And here is where I spend most of my time: trying to build the best, most consistent, and reusable components that are performant, easy to use, accessible, and well documented, and which will be used by everyone.</p><p>Testing is crucial for a UX engineering role because it helps catch and fix issues early. Our goal when testing is understanding if we need to adjust or create new code or simply change the design. In the final production stages of a product, the UX engineer’s job is to reduce any potential friction. At OutSystems, we define friction as any bump in the road during the users’ journey whenever they aim at a particular outcome while using our product.</p><h4>Communicate and collaborate</h4><p>Great communication skills will help you collaborate smoothly with your design system’s stakeholders, such as Design teams, Engineering teams, and Product Management, to ensure that interaction and visual designs are implemented according to design specs. Talk to the team, understand their main challenges, and how you can help overcome them and build a relationship of trust. Also, use the company’s terms, not UX lingo, to ensure you’re communicating clearly.</p><p>It’s vital to communicate clearly and effectively with project teams during all stages of the design process and development while increasing awareness of the Product Design System and its adoption. Such will ensure that the designs are executed exactly as intended — with elegantly simple and efficient code.</p><p>And don’t forget about mentoring and providing guidance to other team members — whether they work in Engineering or Experience groups. Mentoring is a great way to propagate your design system and all the excellent work you’ve been doing.</p><p>When can you do this? Besides sync meetings, which are a great opportunity to pass on your knowledge, you can also set up training sessions on good practices and share documentation and other resources.</p><p>Finally, effective communication will also help you collect feedback to share with both the UX and UI design teams, improving the collaborative process and end result. I will further discuss these topics in the second part of this article.</p><h3>The Life of a UX Engineer at OutSystems</h3><p>Now that I’ve explained what a UX engineer is and does, it’s time to share some of the lessons learned after joining the OutSystems UX Group to help build a design system. I will provide you with more context in the second half of this text, but for the purpose of this article, all you need to know is that soon after our Product Design System was in place, we bumped into a wall.</p><p>The main issue was escalating quickly enough: as Engineering teams started building around eight different applications and products using our Product Design System, the Design Teams were still creating components, screens, and flows — and yes, you guessed it, it was sort of a mess.</p><p>Teams focused so heavily on delivering features that we jumped from “design” to “engineering,” failing to have someone linking the two. In fact, if code comes after the design, why can’t we have somebody who excels at programming writing this particular code?</p><p>We rapidly understood that this missing layer was essential for the design and development process. If you jump from one to the other, a huge chunk of design information can simply disappear. We will miss tiny details — such as how the interactions look, what happens when the user clicks here or there, the animations’ time — and fail to provide the best experience for our customers and users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/0*_sorvOOkSGtpzd9d" /><figcaption><em>Design System Team before having a designated UX Engineer</em></figcaption></figure><p>So, before jumping into design files, development, and planning our next steps, our first mission was to define how we would integrate code within the Product Design System and assess the main benefits of developing it ourselves.</p><p>This is how we came up with the code for our Product Design System — to bring order and consistency to our products and processes. It allows us to build, launch, maintain, and unify products: Engineering can focus on business logic instead of pixels, and designers can focus on user experiences, interactions, and flows. In the end, these components and materials are essential, as they act as a single source of truth for building products.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/0*SU_uIepP0q9aqqEZ" /><figcaption><em>Design System Team after I joined the team</em></figcaption></figure><h3>Stepping Stones</h3><p>Finally, I got where I wanted! I was in the middle of CSS and Figma files, working with a new team, and ready to build the system! I won’t get into the details of what a design system is ( <a href="https://outsystems.com/blog/posts/a-talk-about-design-systems/">my teammates explain it well here</a>) or which technical solutions we developed, but I will leave you with some of the lessons learned so you at least know where to start.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*jBK44_vxInRIHJaK" /><figcaption>Preparing the groundwork</figcaption></figure><h3>Sync Design and Code</h3><p>The first rule is to have everyone communicate in the same language. Translation? It is vital that <strong>what you read in design is what you write in code.</strong> Start by defining your design tokens, foundations, and visual guidelines. Write them as simple CSS Styles using your preferred method.</p><h3>Prepare the Groundwork</h3><p>In new projects, it’s important to have time for experimentation. With your brand guidelines defined, you can start exploring how the many foundations connect and how they can be used in basic components like buttons and inputs.</p><p>If you are creating a design system for an existing system, the first thing to do is to make an inventory and audit all the work done so far. By doing that, we can see precisely where and how the experience is broken. Start by creating a complete list of all the UI elements and Interactions and group the visually similar ones.</p><h3>Build and Document Your Component Library</h3><p>Once all the styles fit together seamlessly, it’s time to start building your UI Library, including both your design and code foundations. With a ready-to-use and well-documented library, you are set to achieve a massive boost in productivity. I will get into more detail in the second part of the article, so watch this space!</p><p>With all these pieces in motion, do you remember why we started this in the first place? Well, you reached your destination. Now you have the proper tools to increase your productivity while delivering the best experiences — welcome to the life of a UX engineer!</p><p><em>Originally published at </em><a href="https://outsystems.com/blog/posts/how-can-a-ux-engineer-help-a-design-system-team/"><em>https://outsystems.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16f8b0e35146" width="1" height="1" alt=""><hr><p><a href="https://medium.com/outsystems-engineering/how-can-a-ux-engineer-help-a-design-system-team-16f8b0e35146">How Can a UX Engineer Help a Design System Team</a> was originally published in <a href="https://medium.com/outsystems-engineering">OutSystems Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Design to Code: Creating and Animating Images with CSS]]></title>
            <link>https://codeburst.io/from-design-to-code-creating-and-animating-images-with-css-b10c2464f37a?source=rss-517e1070243c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b10c2464f37a</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[José Rosário]]></dc:creator>
            <pubDate>Mon, 19 Mar 2018 13:59:30 GMT</pubDate>
            <atom:updated>2018-03-19T13:59:30.741Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DEEWKGshdSLcjanJ4PrpqA.png" /></figure><p>So, there I was. A front-end developer who loves a good challenge. I was determined to turn an image into an elegant piece of code. And I also wanted to animate it. You see, for me, there is nothing more challenging than going deep into CSS and HTML, and honing these skills. Therefore, I’m always on the lookout for something that will push me and also allow me to evaluate where I can improve.</p><p>Before I found this challenge and as part of my self-improvement journey, I tried to play with the <a href="http://dailycssimages.com/">Daily CSS Images</a>, but sadly I don’t have much time to do it! Another thing I do regularly is create small snippets of CSS interactions based on Dribbble Shots.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z4U34DJcpqnMg3AmHWN9IQ.jpeg" /><figcaption>These shots on <a href="https://codepen.io/JoseRosario/">Codepen</a>.</figcaption></figure><p>So when I came across <a href="http://codevember.xyz/">Codevember</a>, my heart skipped a beat! This was perfect. I would have to come up with a creative codepen every day based on the daily Codevember theme.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*OZf7pigOIht6caby." /></figure><p>If you have read any of my previous stuff, you know that I love to <a href="https://medium.com/outsystems-experts/how-to-achieve-60-fps-animations-with-css3-db7b98610108">play with CSS</a>, so this challenge was the perfect opportunity to further explore these skills. Now the catch. I’m not a very creative guy, so I had to come up with some sort of technique to turn an image into an elegant piece of code.</p><p>And that’s what I’d like to share with you.</p><h3>Pick Your Image; Break It Apart</h3><p>To explain this process, I chose the iconic classic yellow tram that runs across Lisbon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5cWBdezncHr42tUt_pBx-Q.jpeg" /></figure><p>I drew the yellow tram as a two-dimensional vector graphic. Oh, and I excluded the graffiti. With an image editor (I used Illustrator, but you can also use Photoshop or Sketch), I picked colors and sizes and began to separate the main areas of the image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Taj4-QYS8KOfasBXpA04Rg.jpeg" /><figcaption>Image broken into 6 main areas.</figcaption></figure><p>Then I split each area of the image into even smaller pieces.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GHe9ONy5IcpA-uyEgVGshw.jpeg" /><figcaption>This main area was broken into even smaller pieces.</figcaption></figure><h3>Image Pieces Into a Relative Stage</h3><p>Now that I’ve set the relative stage for my tram, you can also create your relative stage because we will work with absolute positions and sizes. Inside the relative stage, create the number of divs that represent the image divided into main areas. And, inside each main area, create the divs that represent the smaller pieces. Then center the stage in the screen.</p><p>This will all make sense soon, I promise.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FJoseRosario%2Fembed%2Fpreview%2FaYvdYK%3Fheight%3D600%26slug-hash%3DaYvdYK%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FJoseRosario%2Fpen%2FaYvdYK%2F&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F693640.aYvdYK.small.0f7e9ffe-554f-44ec-98ad-bf64c3fc5db4.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa4c7ce7dc5c185019551a9bfb3d024c/href">https://medium.com/media/aa4c7ce7dc5c185019551a9bfb3d024c/href</a></iframe><p>You can now create classes for each div with an obvious name — you know, call things by their names, as this will help you to know which element of the image the div corresponds to. Style each div with width/height and background-color or border to see the range of the areas, and then work with position absolute to position the divs almost in the right place.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FJoseRosario%2Fembed%2Fpreview%2FQmjNva%3Fheight%3D600%26slug-hash%3DQmjNva%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FJoseRosario%2Fpen%2FQmjNva%2F&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F693640.QmjNva.small.65325d09-214d-4b70-81de-a4247fd142e7.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/1b5c56e90d8b0fbeba2692ad6918f8d5/href">https://medium.com/media/1b5c56e90d8b0fbeba2692ad6918f8d5/href</a></iframe><h3>Optimize Your Code</h3><p>Now that we have this done, we can optimize the code. Code optimization is an important step especially when you’re dealing with CSS because the number of lines can turn your work into a scavenger hunt.</p><p>So, to optimize the code, you should:</p><ul><li>Identify the common repeated styles to help reduce the number of CSS lines. For example, all divs have the position absolute applied, so instead of declaring position absolute in the entire CSS, we only write it once and apply that class to the HTML. (For this example, I will only identify the repeated background colors, position absolute, and center elements horizontally.)</li><li>Create useful classes for them.</li><li>Write the created useful classes in HTML.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b14f9392274dce466a18bc2ae14df096/href">https://medium.com/media/b14f9392274dce466a18bc2ae14df096/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1aa0c3ce3c2833390bcf53df6b039677/href">https://medium.com/media/1aa0c3ce3c2833390bcf53df6b039677/href</a></iframe><p>If you follow this advice, you can significantly improve your code, and it’s easier to debug.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FJoseRosario%2Fembed%2Fpreview%2FwmKbzo%3Fheight%3D600%26slug-hash%3DwmKbzo%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FJoseRosario%2Fpen%2FwmKbzo%2F&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F693640.wmKbzo.small.3704ccfa-6f50-4f79-8c1c-be7c68ec621e.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/db9d65a7a471a9b3f5565e6ae2fc9a87/href">https://medium.com/media/db9d65a7a471a9b3f5565e6ae2fc9a87/href</a></iframe><h3>Going Pixel Perfect</h3><p>To appease the perfectionist in you, there’s even more you can do to ensure perfect-looking images:</p><ul><li>Remove the auxiliary styles that help you identify the main areas.</li><li>Apply the correct background colors in useful classes.</li><li>Style each div with the correct styles by applying the correct sizes, the correct position, and the other styles for a more accurate design.</li></ul><p>For this example, I added some borders and a border-radius, and of course, I changed some positions and sizes to match the final UI Design 100%. Since some styles are duplicated, I created more useful classes to optimize the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ea8Hie7R_iSCV6xhdwd5PQ.jpeg" /></figure><h3>Animate Your Images</h3><p>If you know me, you know that I like to animate things. So, here’s what I did to animate our CSS image. I decided to create an animation that represents the idea of movement, and for that, I slightly changed our initial structure because I wanted to create two different types of animations:</p><p>I wrapped all the divs that I wanted to animate in a single div. This way, I only had to animate that div, instead of all the divs individually.</p><p>Since the railways have another animation, I had to move the railway divs outside the train divs.</p><p>Using only CSS Keyframes with some delays and times, this is the final result:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FJoseRosario%2Fembed%2Fpreview%2FOvXdYy%3Fheight%3D600%26slug-hash%3DOvXdYy%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FJoseRosario%2Fpen%2FOvXdYy%2F&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F693640.OvXdYy.small.3b50309b-458f-40ed-8861-6bf32a92a953.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/cbc580375008eee1ac2bddcf1771188d/href">https://medium.com/media/cbc580375008eee1ac2bddcf1771188d/href</a></iframe><p>Questions? Write them in the comments below!</p><figure><a href="http://bit.ly/codeburst"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i3hPOj27LTt0ZPn5TQuhZg.png" /></a></figure><blockquote>✉️ <em>Subscribe to </em>CodeBurst’s<em> once-weekly </em><a href="http://bit.ly/codeburst-email"><strong><em>Email Blast</em></strong></a><strong><em>, </em></strong>🐦 <em>Follow </em>CodeBurst<em> on </em><a href="http://bit.ly/codeburst-twitter"><strong><em>Twitter</em></strong></a><em>, view </em>🗺️ <a href="http://bit.ly/2018-web-dev-roadmap"><strong><em>The 2018 Web Developer Roadmap</em></strong></a><em>, and </em>🕸️ <a href="http://bit.ly/learn-web-dev-codeburst"><strong><em>Learn Full Stack Web Development</em></strong></a><em>.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b10c2464f37a" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/from-design-to-code-creating-and-animating-images-with-css-b10c2464f37a">From Design to Code: Creating and Animating Images with CSS</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FLIP Your 60 FPS Animations, FLIP ’Em Good]]></title>
            <link>https://medium.com/outsystems-experts/flip-your-60-fps-animations-flip-em-good-372281598865?source=rss-517e1070243c------2</link>
            <guid isPermaLink="false">https://medium.com/p/372281598865</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[José Rosário]]></dc:creator>
            <pubDate>Thu, 23 Feb 2017 16:58:16 GMT</pubDate>
            <atom:updated>2017-03-01T13:53:25.874Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“[FLIP is] absolutely superb for times where you are responding to user input and then animating something in response.” — <em>Paul Lewis, </em><a href="https://aerotwist.com/blog/flip-your-animations/"><em>FLIP Your Animations</em></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6qgHfQBK9T_YboubDpZXkg.png" /></figure><p>I’ll let you in on a secret: If there’s one thing I love, it’s animating elements in mobile applications.</p><p>A while back, I wrote that <a href="https://medium.com/outsystems-experts/how-to-achieve-60-fps-animations-with-css3-db7b98610108">animating for mobile</a> can be easy if you follow the proper approach. I went through the advantages of animating properties in the Composite layer as it prepares the rendering and its calculations to be processed in the GPU.</p><p>Generally speaking, those are proven CSS3 animation guidelines that, once followed, will allow you to create fluid and smooth animations constantly running at 60 FPS.</p><p>So achieving performant animations in the Composite layer is not a problem. The problem is when you want to animate elements in the Layout.</p><h3>The Problem of Animating in the Layout</h3><p>So, I already know I should avoid using transitions that will trigger <a href="https://csstriggers.com/">layout or paint</a> properties — meaning <strong>top</strong>/<strong>left</strong>/<strong>right</strong>/<strong>bottom</strong> properties.</p><p>Here’s an example of how I used the <strong>top</strong> and <strong>height</strong> properties to create an animation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc52c0a56ea74948929a3056fcbbe867/href">https://medium.com/media/cc52c0a56ea74948929a3056fcbbe867/href</a></iframe><p>And here’s the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*3aruhbDaE3zQ4YJcpIAH4A.gif" /></figure><p>And when I checked the timeline… ouch!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/197/0*OkDzRpeR0mCON1yf." /></figure><p>As you can see, this doesn’t create a fluid animation because it has the browser creating layouts each time, which will affect all of their children. <a href="https://www.youtube.com/watch?v=Qh2sWSVRrmo">Think of the children!</a></p><h3>So, Sometimes CSS Alone Doesn’t Cut It</h3><p>Elements in the Layout have widths or heights, lefts or tops. These are the cases in which CSS3 will not be enough. And that’s when this new method comes along. A method that flips the whole thing on its head.</p><p>Make no mistake: we’ll still be animating the Composite layer, but we’re doing pre-calculations and converting Layout animations into Composite ones. Cheaply, jank-free, smooth as butter.</p><p>And, don’t be afraid of that big word: <em>pre-calculations</em>. Yes, math is involved, but I’m here to make it as simple to grasp as possible. All the code I’ll show you is commented and easy to understand.</p><p>In order to manipulate styles in the Layout properly, without all that jank, CSS needs a little boost. This is where JavaScript comes to our rescue: it takes care of the calculations for you, so don’t go running for your <a href="http://i.imgur.com/RFheILB.jpg">TI-84</a> just yet.</p><h3>What’s This FLIP Thing, Then?</h3><p><strong>FLIP</strong> stands for <strong>F</strong>irst, <strong>L</strong>ast, <strong>I</strong>nvert, <strong>P</strong>lay:</p><ul><li><strong>F</strong>irst: Initial state of the element we’re animating.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/17de8c428da3fa2a2f9f80de01a6f27c/href">https://medium.com/media/17de8c428da3fa2a2f9f80de01a6f27c/href</a></iframe><ul><li><strong>L</strong>ast: Final state of the element we’re animating.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fc7f55cb6603015ab2c4f12bf8a35c38/href">https://medium.com/media/fc7f55cb6603015ab2c4f12bf8a35c38/href</a></iframe><ul><li><strong>I</strong>nvert: The magic show. This is where the fun happens, by calculating how the element changed since the first to the last position. (See commented code. Also, if you love magic, there’s more to be had <a href="https://medium.com/outsystems-engineering/making-magic-with-websockets-and-css3-ec22c1dcc8a8#.ms6kak8xq">here</a>).</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/27c9288d954932d98a2fc5fb69770a66/href">https://medium.com/media/27c9288d954932d98a2fc5fb69770a66/href</a></iframe><ul><li><strong>P</strong>lay: Apply the result between the First and the Last, using transform properties, so that the animation runs in the Composite layer.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e85166f2f2e19494ffe747bf6eab7cec/href">https://medium.com/media/e85166f2f2e19494ffe747bf6eab7cec/href</a></iframe><p>Here’s the complete, commented code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5cfb872def722a495e0c2ae87baa3ed/href">https://medium.com/media/d5cfb872def722a495e0c2ae87baa3ed/href</a></iframe><p>And then the CSS:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ee7073211faaa695472d80aed4a93b7f/href">https://medium.com/media/ee7073211faaa695472d80aed4a93b7f/href</a></iframe><p>The result is this buttery smooth gem right here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*tCJS9FeO2vVDBdKetoT6PQ.gif" /></figure><p>And what does the timeline show us?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*RPnDOOVdQPjVeTz_." /><figcaption>Jank-free, baby!</figcaption></figure><h3>FLIP Is Just Right for 60 FPS</h3><p>Animations in mobile apps should run at 60 FPS. This is not always easy to achieve if you try to animate some styles that will impact effects in the Layout layer.</p><p>FLIP is really good for when you want fast responses immediately upon user action. And, for when you don’t know the exact location and dimensions of the object — because you’re smart and you consider all those different devices and screen sizes you have out there.</p><p>This kind of pre-calculation is possible because you have 100 ms after user input, where you can cook some magic to make something happen apparently instantaneously. Look at this beauty:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*MRqZ4Gt7S4LnMxtqwHOzTQ.gif" /><figcaption>Design credits: <a href="https://dribbble.com/shots/3231228-Cinematicket">Sérgio Moreira</a>.</figcaption></figure><p>And here’s the code for you to play with:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FJoseRosario%2Fembed%2Fpreview%2FegZPBN%3Fheight%3D600%26amp%3Bslug-hash%3DegZPBN%26amp%3Bdefault-tabs%3Djs%2Cresult%26amp%3Bhost%3Dhttp%253A%252F%252Fcodepen.io%26amp%3Bembed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FJoseRosario%2Fpen%2FegZPBN&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F693640.egZPBN.small.18b5b6ad-5804-40e9-8af0-34b806ca0c6c.png&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c0bff6cee8047fc8e88c8152ce011e6/href">https://medium.com/media/8c0bff6cee8047fc8e88c8152ce011e6/href</a></iframe><p>See you on the FLIP side!</p><h3>References</h3><p><a href="https://medium.com/outsystems-experts/how-to-achieve-60-fps-animations-with-css3-db7b98610108">Smooth as Butter: Achieving 60 FPS Animations with CSS3</a>, José Rosário</p><p><a href="https://aerotwist.com/blog/flip-your-animations/">FLIP Your Animations</a>, Paul Lewis</p><p><a href="http://slides.com/davidkhourshid/flip#/">FLIPping Awesome Animations</a>, David Khourshid</p><p><strong>José Rosário</strong> | Mobile and Front-End Expert at <a href="https://www.outsystems.com/?utm_source=medium&amp;utm_medium=author_blurb&amp;utm_term=OutSystems&amp;utm_content=FLIP%20Your%2060%20FPS%20Animations%2C%20FLIP%20%E2%80%99Em%20Good&amp;utm_campaign=blog">OutSystems</a></p><p><em>You were going to leave </em><strong><em>without</em></strong><em> sharing? That’s FLIP’d up…</em></p><p><em>(editor’s note: I’ve lost control of José, I gave him this flip idea and now he can’t breathe without spilling out a cringe-worthy pun. If you’re reading this, I’m still hiding from him in a supply closet on the 3rd floor — send help!)</em></p><p><em>So please FLIP this to the top on </em><a href="https://www.facebook.com/sharer/sharer.php?u=http%3A//outsyste.ms/2lS0fQR"><em>Facebook</em></a><em>, </em><a href="https://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A//outsyste.ms/2lS2KT9&amp;title=FLIP%20Your%2060%20FPS%20Animations,%20FLIP%20%E2%80%99Em%20Good&amp;summary=%E2%80%9C%5BFLIP%20is%5D%20absolutely%20superb%20for%20times%20where%20you%20are%20responding%20to%20user%20input%20and%20then%20animating%20something%20in%20response.%E2%80%9D%E2%80%8A%E2%80%94%E2%80%8APaul%20Lewis,%20FLIP%20Your%20Animations&amp;source="><em>LinkedIn</em></a><em>, </em><a href="https://twitter.com/home?status=FLIP%20Your%2060%20FPS%20Animations,%20FLIP%20%E2%80%99Em%20Good%20http%3A//outsyste.ms/2lRPlKB"><em>Twitter</em></a><em>, or </em><a href="/service/mailto:?&amp;subject=Check%20this%20article%20out&amp;body=FLIP%20Your%2060%20FPS%20Animations,%20FLIP%20%E2%80%99Em%20Good%20http%3A//outsyste.ms/2lS7Hv5"><em>email</em></a><em>!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=372281598865" width="1" height="1" alt=""><hr><p><a href="https://medium.com/outsystems-experts/flip-your-60-fps-animations-flip-em-good-372281598865">FLIP Your 60 FPS Animations, FLIP ’Em Good</a> was originally published in <a href="https://medium.com/outsystems-experts">OutSystems Experts</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Smooth as Butter: Achieving 60 FPS Animations with CSS3]]></title>
            <link>https://medium.com/outsystems-experts/how-to-achieve-60-fps-animations-with-css3-db7b98610108?source=rss-517e1070243c------2</link>
            <guid isPermaLink="false">https://medium.com/p/db7b98610108</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[enterprise-mobility]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[José Rosário]]></dc:creator>
            <pubDate>Fri, 12 Aug 2016 13:19:58 GMT</pubDate>
            <atom:updated>2020-04-21T09:32:34.468Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fthumbs.gfycat.com%2FThankfulContentCoypu-mobile.mp4&amp;src_secure=1&amp;url=https%3A%2F%2Fgfycat.com%2FThankfulContentCoypu&amp;image=https%3A%2F%2Fthumbs.gfycat.com%2FThankfulContentCoypu-size_restricted.gif&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=video%2Fmp4&amp;schema=gfycat" width="2400" height="840" frameborder="0" scrolling="no"><a href="https://medium.com/media/5d26f111a75427c914cd904793e50b8b/href">https://medium.com/media/5d26f111a75427c914cd904793e50b8b/href</a></iframe><p>Animating elements in your mobile applications is easy.</p><p>Animating elements in your mobile applications <strong>properly</strong> may be easy, too… if you follow our tips here.</p><p>While everyone is using CSS3 animations in mobile these days, many are not doing it properly. There are best practices to take into account that are constantly and considerably disregarded. This happens mainly because there are still people who don’t really understand the real reasons why those practices exist and are so vigorously endorsed.</p><p>There is such a large spectrum of device specifications nowadays, that if you don’t optimize your code to consider this, instead of animations that are smooth as butter, you’ll end up delivering a subpar experience to the highest share.</p><p>Remember: though there are some high-end, flagship devices out there which keep pushing the envelope, you still have most of the world using the type of device that compared to those spec monsters is nothing but an abacus with an LCD.</p><p>We want to give you a hand in harnessing the power of CSS3 <strong>correctly</strong>. To do just that we need to understand a few things first.</p><h3>Understand the Timeline</h3><p>What is the browser doing while rendering and playing around with the elements? This very simple timeline is called the <strong>Critical Rendering Path</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*gMqY9IVJXuBbE8DF." /><figcaption><em>Image Source: </em><a href="http://www.csstriggers.com/"><em>www.csstriggers.com</em></a></figcaption></figure><p>To achieve smooth animations we need to focus on changing properties that affect the <strong>Composite</strong> step, instead of adding this stress to the previous layers.</p><p><strong>1. Styles</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*LDiyh_mOgH1n21wF." /></figure><p>The browser starts calculating the styles to apply in elements — Recalculate <strong>Style</strong>.</p><p><strong>2. Layout</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*X_6VTAJuRQCt1qXM." /></figure><p>In the following layer, the browser will start generating the shape and position for each of those elements — <strong>Layout</strong>. This is where the browser sets the page properties such as <strong>width</strong> and <strong>height</strong>, as well as its <strong>margins</strong>, or <strong>left</strong>/<strong>top</strong>/<strong>right</strong>/<strong>bottom</strong> for instance.</p><p><strong>3. Paint</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*wJKTvKHyYi13kPoI." /></figure><p>The browser will now start filling in the pixels for each element into layers. The properties that it uses are, for instance: <strong>box-shadow</strong>, <strong>border-radius</strong>, <strong>color</strong>, <strong>background-color</strong>, among others.</p><p><strong>4. Composite</strong></p><p>This is where you want to do your magic, as this is when the browser starts drawing all the layers in the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*JHTvclhMvkYYEBEY." /></figure><p>Modern browsers can animate four styles pretty, pretty well, making use of the <strong>transform</strong> and <strong>opacity</strong> properties.</p><ul><li><strong>Position</strong> — transform: translateX(<em>n</em>) translateY(<em>n</em>) translateZ<em>(n</em>);</li><li><strong>Scale</strong> — transform: scale(<em>n</em>);</li><li><strong>Rotation</strong> — transform: rotate(<em>n</em>deg);</li><li><strong>Opacity</strong> — opacity: <em>n</em>;</li></ul><h3>How to Achieve the 60 Frames Per Second Mark</h3><p>With this in mind, it’s time to roll up our sleeves and get to work.</p><p>Let’s start with the HTML. We’re going to create a very simple structure and put our app-menu inside a layout class.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e1c72c46170a5a9a0f295a51c7a6360d/href">https://medium.com/media/e1c72c46170a5a9a0f295a51c7a6360d/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*rXGvLKSlZGRmz4Jd." /></figure><h3>Going About It the Wrong Way</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4651a8ff37fac6861260a472eec7a820/href">https://medium.com/media/4651a8ff37fac6861260a472eec7a820/href</a></iframe><p>See those properties we changed? You should avoid using <strong>transitions</strong> with the <strong>left</strong>/<strong>top</strong>/<strong>right</strong>/<strong>bottom</strong> properties. Those don’t create a fluid animation because they have the browser creating layouts each time, which will affect all of their children.</p><p>The result is something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/0*ZWyuzfeBSbFbQjOy." /></figure><p>That animation is not smooth at all. We checked with <a href="https://developers.google.com/web/tools/chrome-devtools/profile/evaluate-performance/timeline-tool?hl=en">DevTools Timeline</a> to see what was happening under the hood, and this was the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/0*y6jExBTCikGX2hVC." /><figcaption><em>Green areas represent the time spent rendering an animation.</em></figcaption></figure><p>This clearly shows FPS are irregular and that performance is quite slow.</p><blockquote>“The green bar indicates FPS. A high bar indicates that the animation is rendering at 60 FPS. A low bar indicates sub-60 FPS. So, ideally, you want the green bar to be consistently high across the Timeline. Those red bars also indicate jank, so, alternatively, another way to gauge your progress is by eliminating those red bars.”<br>Thank you, <a href="https://medium.com/u/c8187519a8ef">Kayce Basques</a>!</blockquote><h3>Using Transform</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b2247377b7ce32eaf7aa98bcdc0fcc5b/href">https://medium.com/media/b2247377b7ce32eaf7aa98bcdc0fcc5b/href</a></iframe><p>The <strong>transform</strong> properties affect a <strong>Composite</strong>. Here we’re telling the browser that layers will be painted and ready to go as soon as the animation starts, so there are fewer hiccups when rendering the animation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/0*D9YAp9EQwbKunIZ-." /></figure><p>That’s exactly what Timeline is showing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/0*qc1qxqFudZPYpIUE." /></figure><p>The results start getting better, FPS are more regular and, therefore, the animation is smoother.</p><h3>Running Animations in GPU</h3><p>Let’s take it up a notch, then. To really get it running smooth and buttery, we’re going to use the GPU to render the animation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2ee6d131d87a2f3e1fb0dfd640367433/href">https://medium.com/media/2ee6d131d87a2f3e1fb0dfd640367433/href</a></iframe><p>Though <strong>translateZ()</strong> or <strong>translate3d()</strong> will still be needed by some browsers as a fallback, the <strong>will-change</strong> property is the future. What this does is that it promotes the elements to another layer, so the browser doesn’t have to consider the layout render or painting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/0*ZeuG8kachde9iCnR." /></figure><p>See how smooth that is? Timeline substantiates that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/117/0*ekofIUN-X7br1bIH." /></figure><p>The animation’s FPS are much more constant and the animation renders much quicker here. But there’s still a long frame running there. There’s still a little bit of a bottleneck at the beginning.</p><p>Remember the HTML structure created right in the beginning? Let’s control the <strong>app-menu</strong> div on that structure by using JavaScript:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/47388e7c10eb56cb4f457f0b93b390bd/href">https://medium.com/media/47388e7c10eb56cb4f457f0b93b390bd/href</a></iframe><p>The problem here is that by adding that class within the <strong>layout</strong> div, we made the browser recalculate styles one more time — and that affects the rendering performance.</p><h3>The 60 FPS Smooth as Butter Solution</h3><p>What if we have the menu created outside of the viewport area, instead? Having this in an isolated area will ensure that you only affect the element that you really want to animate.</p><p>So, we propose the following HTML structure:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/56c34b234bd3f1c0ce7ad132d33f140c/href">https://medium.com/media/56c34b234bd3f1c0ce7ad132d33f140c/href</a></iframe><p>And now we can control the state of the menu in a slightly different way. We’re going to manipulate animations in a class that gets removed when the time of transition ends, by using the <strong>transitionend</strong> function in JavaScript.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/96e70c4e15592983a8ef94c5534ad7b2/href">https://medium.com/media/96e70c4e15592983a8ef94c5534ad7b2/href</a></iframe><p>Let’s put it all together and check the results, then.</p><p>Here’s a complete fully-enabled CSS3 example, with everything in its right place:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e59c4c6455ea1eb622479f622a0dd64d/href">https://medium.com/media/e59c4c6455ea1eb622479f622a0dd64d/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*EFkarCSe2mQEYK0e." /></figure><p>And what does Timeline show us?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/0*mDp5_LD08xtZKQyS." /></figure><p>Smooth as butter, see?</p><p><strong>Edit <em>(17th Aug)</em>:</strong> Due to popular demand, here’s a working example for you guys:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FOnyros%2Fembed%2Fpreview%2FjAJxkW%3Fheight%3D600%26amp%3Bslug-hash%3DjAJxkW%26amp%3Bdefault-tabs%3Dcss%2Cresult%26amp%3Bhost%3Dhttp%253A%252F%252Fcodepen.io%26amp%3Bembed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FOnyros%2Fpen%2FjAJxkW&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.png&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/a2e0940c1142cc1381fdaf2a2a7aeb1d/href">https://medium.com/media/a2e0940c1142cc1381fdaf2a2a7aeb1d/href</a></iframe><p><strong><em>Edit (23rd Feb, 2017):</em></strong> Part II of this article is live! <a href="https://medium.com/outsystems-experts/flip-your-60-fps-animations-flip-em-good-372281598865"><strong>FLIP Your 60 FPS Animations, FLIP’em Good</strong></a></p><p><strong>José Rosário</strong> | Mobile and Front-End <a href="https://success.outsystems.com/Evaluation/Getting_Started_With_OutSystems/05_Does_OutSystems_help_customers_build_applications/Expert_Services?utm_source=medium&amp;utm_medium=author_blurb&amp;utm_content=Smooth%20as%20Butter%3A%20Achieving%2060%20FPS%20Animations%20with%20CSS3&amp;utm_campaign=blog">Expert</a> at <a href="https://www.outsystems.com/?utm_source=medium&amp;utm_medium=author_blurb&amp;utm_content=Smooth%20as%20Butter%3A%20Achieving%2060%20FPS%20Animations%20with%20CSS3&amp;utm_campaign=blog">OutSystems</a></p><p><em>You can bake a cake with all this butter! Tell your friends: </em><a href="http://bit.ly/2czeUeB"><em>LinkedIn</em></a><em> | </em><a href="http://bit.ly/2cAirGf"><em>Twitter</em></a><em> | </em><a href="http://bit.ly/2cLDwj4"><em>Facebook</em></a><em> | </em><a href="/service/mailto:?&amp;subject=Smooth%20as%20Butter:%20Achieving%2060%20FPS%20Animations%20with%20CSS3&amp;body=http%3A//bit.ly/2ccuNsw"><em>Email</em></a></p><p>The ideas shared in this post resulted partially from the <a href="https://www.outsystems.com/financial-incentive-program/">research project RADicalize</a>, which was supported by the EU and PT2020.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db7b98610108" width="1" height="1" alt=""><hr><p><a href="https://medium.com/outsystems-experts/how-to-achieve-60-fps-animations-with-css3-db7b98610108">Smooth as Butter: Achieving 60 FPS Animations with CSS3</a> was originally published in <a href="https://medium.com/outsystems-experts">OutSystems Experts</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>