<?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 Wael Yasmina on Medium]]></title>
        <description><![CDATA[Stories by Wael Yasmina on Medium]]></description>
        <link>https://medium.com/@waelyasmina?source=rss-ddf22844a647------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*_Sr08Ww-LHzyyOzfALut0w.png</url>
            <title>Stories by Wael Yasmina on Medium</title>
            <link>https://medium.com/@waelyasmina?source=rss-ddf22844a647------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 11:47:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@waelyasmina/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[A Step By Step Guide To The GSAP Animation Library -Part 2-]]></title>
            <link>https://waelyasmina.medium.com/a-step-by-step-guide-to-the-gsap-animation-library-part2-537696c25170?source=rss-ddf22844a647------2</link>
            <guid isPermaLink="false">https://medium.com/p/537696c25170</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[gsap]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[website]]></category>
            <dc:creator><![CDATA[Wael Yasmina]]></dc:creator>
            <pubDate>Sun, 08 Sep 2019 14:56:31 GMT</pubDate>
            <atom:updated>2019-09-29T18:16:09.119Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bNjUfqqxLpnyTdtN_0gZVw.png" /></figure><p>What is GSAP ?</p><p>Why should I use it ?</p><p>What are the main components of it ?</p><p>What are GreenSock, TweenLite and TweenMax ?</p><p>Different questions might have surrounded your mind if you stumbled upon a video or a blog post talking about the library (especially if you’re a new to the world of web animation), but don’t worry I have already answered all of them in my previous article <a href="https://medium.com/@waelyasmina/a-step-by-step-guide-to-the-gsap-animation-library-part1-9d38e706433c">A Step By Step Guide To The GSAP Animation Library -Part1-</a>, so make sure to take 6 minutes of your time reading it before diving into this one.</p><p>As I have already covered 2 of the fundamental parts of the suite which are <strong>TweenLite</strong> and <strong>TweenMax</strong> in the previous article, in this one I’ll be focusing on another 2 which are <strong>TimelineLite</strong> and <strong>TimelineMax</strong>, so no further talking, let’s get started !</p><p>Let’s start by creating an animation of the square1 and square2 swaping places using what we’ve learned in the previous post</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FzYORBbg%3Fheight%3D600%26slug-hash%3DzYORBbg%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FzYORBbg&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/1b0b780f4cc630916ea3d760ff453296/href">https://medium.com/media/1b0b780f4cc630916ea3d760ff453296/href</a></iframe><p>As you can see from the code I’ve just typed, I wanted the first square to go up and the third one to go down then a translation on the X axis had to happen, then another one on the Y axis so the squares go back to 0 on the Y axis which we can’t see right now because all of the changes are happening<br>at the same time.</p><p>If we want to see the steps one after the other, we need to delay each change so it can take place only after the end of the previous one. The delay of each sequence should be the same as the sum of previous animations’ duration</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FjONZrov%3Fheight%3D600%26slug-hash%3DjONZrov%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FjONZrov&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/c1358f5f9c861c07bfcf811e51baf76d/href">https://medium.com/media/c1358f5f9c861c07bfcf811e51baf76d/href</a></iframe><p>For a small animation like this, this code should be enough but for more complex animations, this could turn into a big insolvable puzzle with a lot a unreadable and repetitive code, and that’s where <strong>TimlelineLite</strong> and <strong>TimelineMax</strong> come in handy.</p><h3>TimelineLite</h3><p>First things first, you should use npm or a CDN hosted version of TimelineLite or TimelineMax, simple step to do yet there’s a very important thing to mention is if you want to use TimelineLite/TimelineMax <strong>you have to also add either TweenLite + CSSPlugin or TweenMax to your project</strong>, if you don’t nothing will work !</p><pre>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/plugins/CSSPlugin.min.js&quot;&gt;&lt;/script&gt;</pre><pre>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenLite.min.js&quot;&gt;&lt;/script&gt;</pre><pre>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TimelineLite.min.js&quot;&gt;&lt;/script&gt;</pre><p>Or</p><pre>&lt;script src=&quot;<a href="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenMax.min.js">https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenMax.min.js</a>&quot;&gt;&lt;/script&gt;</pre><p>Now we only need to create a new instance of TimelineLite and then remove all the delays, and that should be enough to create the same animation.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FyLBvaLw%3Fheight%3D600%26slug-hash%3DyLBvaLw%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FyLBvaLw&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/dc8691e5f58b1cb711330630cf1f51e1/href">https://medium.com/media/dc8691e5f58b1cb711330630cf1f51e1/href</a></iframe><p>We have control of when any of the sequences can take place, let’s say for instance that we want the second sequence to take place at 0 second from the beginning</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FOJLQWbb%3Fheight%3D600%26slug-hash%3DOJLQWbb%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FOJLQWbb&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/7bc70107addb0b2256a839779465636c/href">https://medium.com/media/7bc70107addb0b2256a839779465636c/href</a></iframe><p>As you can see now the second sequence start at the same time as the first one (at 0 seconds).</p><p>Let’s do the same with the fourth sequence (we want the 4th sequence to start at 0 seconds)</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FExYQZNG%3Fheight%3D600%26slug-hash%3DExYQZNG%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FExYQZNG&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/1d2c0801bb58512c6fa4f6724699936e/href">https://medium.com/media/1d2c0801bb58512c6fa4f6724699936e/href</a></iframe><p>We can also use the <strong>+=</strong> or <strong>-=</strong> signs to add a delay relative to the previous animation’s end time</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FdybdNNb%3Fheight%3D600%26slug-hash%3DdybdNNb%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FdybdNNb&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/979134adc6c0ae2c4de9120efb00097c/href">https://medium.com/media/979134adc6c0ae2c4de9120efb00097c/href</a></iframe><p>In this case I used <strong>-=1</strong> which makes the change start 1 second <strong>before</strong> the previous animation’s end, so basically both of the changes start at the same time.</p><p><strong>-=0</strong> is the default behavior where there is <strong>no delay</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FOJLQWWb%3Fheight%3D600%26slug-hash%3DOJLQWWb%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FOJLQWWb&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/ee8b99c74aa3d460b51fa509f4418ab1/href">https://medium.com/media/ee8b99c74aa3d460b51fa509f4418ab1/href</a></iframe><p><strong>+=1</strong> means that the change occurs 1 second <strong>after</strong> the end of the previous change</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FyLBvggK%3Fheight%3D600%26slug-hash%3DyLBvggK%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FyLBvggK&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/86b6cf121682f03865c525a7217ac154/href">https://medium.com/media/86b6cf121682f03865c525a7217ac154/href</a></iframe><p>If I use a simple integer without the equal sign, that means the starting time of the change is relative to the start of the whole timeline, so 1 here means the change has to occur 1 second after the start of the whole animation</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FVwZQPpY%3Fheight%3D600%26slug-hash%3DVwZQPpY%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FVwZQPpY&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/cb7863421d5e92b840be043b8689f023/href">https://medium.com/media/cb7863421d5e92b840be043b8689f023/href</a></iframe><p>We can reverse the animation by using the <strong>reverse</strong> method, so we can see the animation taking place from the end state to the initial one</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FOJLQWpW%3Fheight%3D600%26slug-hash%3DOJLQWpW%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FOJLQWpW&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/77cb8bf12af3815f71e15bf697779735/href">https://medium.com/media/77cb8bf12af3815f71e15bf697779735/href</a></iframe><p>There’s also the <strong>play</strong> method which you can use to specify where exactly you want the animation to start, making it possible to skip some sequences</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FeYOVgvL%3Fheight%3D600%26slug-hash%3DeYOVgvL%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FeYOVgvL&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/a1059f1a0d4b484ef69efc8238cc8445/href">https://medium.com/media/a1059f1a0d4b484ef69efc8238cc8445/href</a></iframe><p>We can specify when an animation can take place despite of its order inside the code. Using delays in this case can be confusing as I mentioned earlier, that’s why a handy method can be used to solve this problem which is <strong>addLabel</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FgOYvgWw%3Fheight%3D600%26slug-hash%3DgOYvgWw%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FgOYvgWw&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/9ef7bc6dba7dcff1f38c88e5623d8435/href">https://medium.com/media/9ef7bc6dba7dcff1f38c88e5623d8435/href</a></iframe><p>As you can tell by its name, this method uses a label that figures in the chosen sequence then uses it as it’s the real sequence taking place. addLabel takes 2 arguments, the <strong>label name</strong> and <strong>the time where the sequence should trigger</strong>.</p><p><strong>-=0 </strong>changes the order of the last animation to the third one (in the provided example of course).</p><p>Using <strong>0</strong> makes the sequence start at the very beginning as you have already guessed because using a simple integer without the equal sign makes the timing of the change static or relative to the beginning of the timeline as a whole</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FMWgQJoB%3Fheight%3D600%26slug-hash%3DMWgQJoB%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FMWgQJoB&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/4c99b885f4f39c4b43d07082e620f7f3/href">https://medium.com/media/4c99b885f4f39c4b43d07082e620f7f3/href</a></iframe><p>The label can be used also as a reference for the play method</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FrNBJjwQ%3Fheight%3D600%26slug-hash%3DrNBJjwQ%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FrNBJjwQ&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/787927645fc35bf4d5eadb13594e7d82/href">https://medium.com/media/787927645fc35bf4d5eadb13594e7d82/href</a></iframe><p>We can nest a timeline inside another one using the <strong>add</strong> method which can be useful for advanced and complex animations</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FJjPpEJQ%3Fheight%3D600%26slug-hash%3DJjPpEJQ%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FJjPpEJQ&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/1e895d0f790b17755181c103b66d0687/href">https://medium.com/media/1e895d0f790b17755181c103b66d0687/href</a></iframe><h3>TimelineMax</h3><p>TimelineMax is the big brother of TimelineLite if I can say, the relation between the two is the same as the relation between TweenLite and TweenMax, what I mean here is that TimelineMax includes TimelineLite and adds more features on it.</p><p>We need to include TimelineMax into the project first:</p><pre>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/plugins/CSSPlugin.min.js&quot;&gt;&lt;/script&gt;</pre><pre>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenLite.min.js&quot;&gt;&lt;/script&gt;</pre><pre>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TimelineMax.min.js&quot;&gt;&lt;/script&gt;</pre><p>Or</p><pre>&lt;script src=&quot;<a href="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenMax.min.js">https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenMax.min.js</a>&quot;&gt;&lt;/script&gt;</pre><p>The first additional feature provided by TimelineMax is <strong>repeat</strong>, which repeats all of the sequences as many time as we want to, for instance 1 will repeat the animation one more time after it occurs once. 2 will repeat the animation twice after the initial occurrence. -1 though will repeat the animation infinitely</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FjONZyLZ%3Fheight%3D600%26slug-hash%3DjONZyLZ%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FjONZyLZ&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/31e9873b48f68cf17e58e825791d056e/href">https://medium.com/media/31e9873b48f68cf17e58e825791d056e/href</a></iframe><p><strong>yoyo</strong> is another extra feature provided by TimelineMax which will make the animation repeat from the starting state to the final one and vice versa</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2Faboqpyx%3Fheight%3D600%26slug-hash%3Daboqpyx%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2Faboqpyx&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/40c327f63ee82fc0aa43c1c68173dbb6/href">https://medium.com/media/40c327f63ee82fc0aa43c1c68173dbb6/href</a></iframe><p>With TimelineLite we can specify at which point the animation trigger using the play method, but what if we wanted the reverse of that, what I mean here is what if we want the animation to end at a certain point, well the answer is provided also by TimelineMax with the <strong>tweenTo</strong> method</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FYzKeNry%3Fheight%3D600%26slug-hash%3DYzKeNry%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FYzKeNry&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/4297bc0a57b52ba594780f920681e7a1/href">https://medium.com/media/4297bc0a57b52ba594780f920681e7a1/href</a></iframe><p>We also can do both, meaning that we can specify where the animation can start and where it should finish using the <strong>tweenFromTo</strong> method</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FWNeMRZX%3Fheight%3D600%26slug-hash%3DWNeMRZX%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FWNeMRZX&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/d45234c144df4da46fb07a349113660c/href">https://medium.com/media/d45234c144df4da46fb07a349113660c/href</a></iframe><p><strong>NB:</strong> I used a label in both of the previous examples but you can still use integers or both of them at the same time.</p><p>You can take a look at <a href="https://greensock.com/docs/">the documentation</a> for way more additional methods and functions provided by 2 the timelines. Also to mention, there’s a very powerful tool that makes debugging animations way easier which is the <a href="https://greensock.com/gsdevtools/">GSDevTools</a>, but you should have a paid subscription to make use of it.</p><p>Well this guide should end here, I hope I succeeded to provide some valuable information about the different points of this article especially for people who are getting started with the library.</p><p>See you in a next one and until then I wish you happy tweening !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=537696c25170" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Step By Step Guide To The GSAP Animation Library -Part 1-]]></title>
            <link>https://waelyasmina.medium.com/a-step-by-step-guide-to-the-gsap-animation-library-part1-9d38e706433c?source=rss-ddf22844a647------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d38e706433c</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[gsap]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[greensock]]></category>
            <dc:creator><![CDATA[Wael Yasmina]]></dc:creator>
            <pubDate>Mon, 02 Sep 2019 14:23:40 GMT</pubDate>
            <atom:updated>2019-09-13T18:23:01.202Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l-sU75PDRDM6UyPRlhT0ZQ.png" /></figure><p>Web animation is where the fun and professionalism fusion, nothing is more satisfying to watch on a web page than a smooth and beautiful animation of some elements which in return can be convincing and leading visitors to buy, subscribe or whatever call to action you have on your page.</p><p>Different techniques can be used to achieve cool animations on the web which I’ve already covered the fundamentals of them in the couple of my previous posts <a href="https://medium.com/@waelyasmina/web-animation-with-css-transition-1080183541fa">Web Animation With CSS -Transition-</a> and <a href="https://medium.com/@waelyasmina/web-animation-with-css-keyframes-d363c53d1582">Web Animation With CSS -Keyframes-</a>. Both of these articles were made to cover the basics of the animation tools provided by CSS.</p><p>The question here is “are <em>CSS transitions and keyframes enough to create cool animations ?”</em>, the answer is definitely <strong>YES</strong> !<em> “okay then, are they enough to make the greatest animations”</em>, the answer is also yes <strong>BUT </strong>it would need a heck of exhausting work to do, not only that but a lot has to be taken in consideration like performance, compatibility, debugging etc... not to mention how many days or even weeks it would take to achieve some complex animation.</p><p>“<em>So, what should be done to create amazing animations without the fear of falling into a vortex of worries about long time coding, compatibility, hundreds of line of code and all of that ‘expensive’ work ?</em>”, well the answer is simply Javascript, more precisely a Javascript library, or let me just say <strong>GSAP</strong> !</p><h3>What Is GSAP ?</h3><p>GSAP stands for <strong>G</strong>reen<strong>S</strong>ock <strong>A</strong>nimation <strong>P</strong>latform, created by the Greensock team. It’s one of the best web animation libraries if it’s not the best.</p><h3>Why GSAP ?</h3><p>If you look for :</p><ul><li>a crazy fast and performant animation library;</li><li>a library that is armed with a tremendous amount of features to help you achieve beautiful animation no matter how complex it could be;</li><li>a library that is compatible with every browser and with various frameworks and libraries;</li><li>a library that can almost animate every single property of an element;</li><li>a lightweight and expandable library and not dependent on any other 3rd party tools like Jquery;</li></ul><p>Well then GSAP must be your choice !</p><h3>GSAP Tools</h3><p>GSAP is basically a suite of 4 major tools plus extra plugins.</p><h4>TweenLite</h4><p>The lightweight core of the engine which animates any property of any object. It can be expanded using optional plugins.</p><h4>TweenMax</h4><p>Includes a package of features without the need to import them one at a time (TweenLite included).</p><h4>TimeLineLite</h4><p>Sequencing tool, making it simple to control entire groups of animations and precisely manage relative timing.</p><h4>TimeLineMax</h4><p>Same as TimeLineLite but with more features.</p><h4>Plugins</h4><p>As I mentioned before a variety of plugins can be added to these 4 tools to add extra features.</p><h3>How Does GSAP Work ?</h3><h4>Including The Library</h4><p>The first step to use GSAP is to include it to the project files. To do so we can download the files using npm or simply use a <a href="https://cdnjs.com/libraries/gsap">CDN hosted version</a>.</p><pre>&lt;script src=&quot;<a href="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenLite.min.js">https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenLite.min.js</a>&quot;&gt;&lt;/script&gt;</pre><pre>&lt;script src=&quot;<a href="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/plugins/CSSPlugin.min.js">https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/plugins/CSSPlugin.min.js</a>&quot;&gt;&lt;/script&gt;</pre><p><strong>Important: </strong>If you consider using TweenLite <strong>you should also include the CSSPlugin link, it’s crucial for TweenLite to work</strong>.</p><h4><strong>Declaring A Tween</strong></h4><p>A tween in GSAP is similar to keyframes in CSS, you just create an animation then add it to an element, so to create a tween we can do it in 3 different ways:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5820f59cc091740df841ba32040bf740/href">https://medium.com/media/5820f59cc091740df841ba32040bf740/href</a></iframe><h4>The Different Components Of A Tween</h4><p><strong>Element:</strong> it’s literally the element that we want to animate. It can be a simple variable or constant, it can be an array of elements that we want to animate all together or a nodelist.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3cef87fc1486b3ab5dda662d8d01427/href">https://medium.com/media/c3cef87fc1486b3ab5dda662d8d01427/href</a></iframe><p><strong>Duration:</strong> represents the duration of the animation.</p><p><strong>Vars:</strong> it’s an object that contains the different properties that we want to change over the duration. It also holds different other properties and callback functions. The properties to change are the same as CSS properties with some exceptions like transforms, if we want to use transform: translateX(200px) we can simply type:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/95d1e03228a8a0e0a162cb883e2fac71/href">https://medium.com/media/95d1e03228a8a0e0a162cb883e2fac71/href</a></iframe><p>As you can see by default the unity of measurement is pixels, we can set it explicitly by using a string instead of an integer:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2053e055aa42b5f1d02976c6ebfc1f83/href">https://medium.com/media/2053e055aa42b5f1d02976c6ebfc1f83/href</a></iframe><p>Speaking of percentages we can use the <strong>xPercent</strong> property to do the same thing:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/69216ea2a8eb766aee6a4b9be391be05/href">https://medium.com/media/69216ea2a8eb766aee6a4b9be391be05/href</a></iframe><p><strong>Important:</strong> Even though a lot of the properties have the same name as CSS properties the naming style is different, GSAP uses the <strong>camel case style </strong>to name its properties, so if we want to change the background color for instance, we should type <strong>backgroundColor</strong> instead of background-color.</p><p>There’s also a very useful property exclusive to GSAP which is <strong>autoAlpha.</strong> autoAlpha is basically a combination of 2 CSS properties (opacity and visibility). autoAlpha: 0 is same as opacity: 0 and visibility: hidden in CSS, while autoAlpha: 1 in GSAP is same as opacity: 1 and visibility: visible in CSS.</p><p><strong>Method:</strong> TweenLite has <strong>4 basic methods (out of total of 32 method)</strong>, they work very similar to the animation-direction in CSS.</p><p>The first method is <strong>To</strong>, this method sets the values of the properties in the vars object as the final state of the element we want to animate.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FQWLMXzL%3Fheight%3D600%26slug-hash%3DQWLMXzL%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FQWLMXzL&amp;image=https%3A%2F%2Fscreenshot.codepen.io%2F381653.QWLMXzL.small.f09f3e72-8b80-4b48-8484-1bc9fd411575.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/39932f11242329c9b72afe9bc411a0d6/href">https://medium.com/media/39932f11242329c9b72afe9bc411a0d6/href</a></iframe><p>The second method is <strong>set</strong> which is almost the same as the previous one except that it changes the different properties instantly that’s why we need to get rid of the duration (the argument). We can do the same using the <strong>to</strong> method by setting the duration to zero.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FrNBzEgW%3Fheight%3D600%26slug-hash%3DrNBzEgW%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FrNBzEgW&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/128e897421796f6ec61d54b2f78416ff/href">https://medium.com/media/128e897421796f6ec61d54b2f78416ff/href</a></iframe><p>The third method is <strong>from</strong> which is the reverse of <strong>to</strong>, this method sets the values of the properties in the vars object as the initial state of the element that we want to animate.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FVwZzJOx%3Fheight%3D600%26slug-hash%3DVwZzJOx%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FVwZzJOx&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/0db48c6fc84b72e3e8e300d92ae4c452/href">https://medium.com/media/0db48c6fc84b72e3e8e300d92ae4c452/href</a></iframe><p>The fourth method is <strong>fromTo</strong> method which is a combination of the <strong>to</strong> and <strong>from</strong> methods,with that in mind we need 2 objects which represent respectively the initial and final states of the element.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FGRKvbaw%3Fheight%3D600%26slug-hash%3DGRKvbaw%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FGRKvbaw&amp;image=https%3A%2F%2Fscreenshot.codepen.io%2F381653.GRKvbaw.small.97071bb3-1f80-4d4c-96a0-2ac77de7fd05.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/ceeb6eb36ee697ac2529ca9502a1388e/href">https://medium.com/media/ceeb6eb36ee697ac2529ca9502a1388e/href</a></iframe><p>Now let’s take a look at a few of the vars properties.</p><p>The first one is <strong>ease</strong> which is the timing function, we can use different values going from <strong>Power0</strong> which is the less intense to <strong>Power4</strong> which is the most intense. We can use different easing functions including custom ones that you can create on the GreenSock’s website where they have a powerful tool called the <a href="https://greensock.com/docs/Easing">GreenSock Ease Visualizer</a> which can help you out with experimenting with different easing functions and also creating custom ones.</p><p>Examples: Power0.easeIn, Power3.easeIn, Power2.easeOut etc…</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FwvwqVwL%3Fheight%3D600%26slug-hash%3DwvwqVwL%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FwvwqVwL&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/03962f3db9e8131653a3c1f950725651/href">https://medium.com/media/03962f3db9e8131653a3c1f950725651/href</a></iframe><p><strong>onStart</strong> is a very useful property which takes a function that triggers before the animation start:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FXWravWR%3Fheight%3D600%26slug-hash%3DXWravWR%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FXWravWR&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/11332147706ce5f5a4d3d877d8e04271/href">https://medium.com/media/11332147706ce5f5a4d3d877d8e04271/href</a></iframe><p>There’s also <strong>onComplete</strong> which triggers a function right after the end of the animation:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FaboyezL%3Fheight%3D600%26slug-hash%3DaboyezL%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FaboyezL&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/243bd7fcdd5bf5265d755447465961f8/href">https://medium.com/media/243bd7fcdd5bf5265d755447465961f8/href</a></iframe><p><strong>delay</strong>, this property delays the animation for a certain amount of time:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FGRKvVgz%3Fheight%3D600%26slug-hash%3DGRKvVgz%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FGRKvVgz&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/a012d86795437a8c05c31d103db06164/href">https://medium.com/media/a012d86795437a8c05c31d103db06164/href</a></iframe><p>You can find a lot of other useful properties in the GSAP documentation at <a href="https://greensock.com/docs/">the GreenSock official website</a> make sure to take a look.</p><h4>Dynamic Values</h4><p>Up until now we have been setting the same values to the elements properties, however we can give random numbers using a function that returns a dynamically calculated value specific for every single element.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FgOYGYJG%3Fheight%3D600%26slug-hash%3DgOYGYJG%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FgOYGYJG&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/ee212958d94a60d8436c584953a7fdec/href">https://medium.com/media/ee212958d94a60d8436c584953a7fdec/href</a></iframe><p>We also can use a function to give each element of the array/nodelist’s items a value depending on its index in the array/nodelist, by using the index argument of the function. The index has the elements indexes in the array/nodelist starting the count from 0, so the first element of the array/nodelist has 0 as index.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FMWgEgMx%3Fheight%3D600%26slug-hash%3DMWgEgMx%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FMWgEgMx&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/4db169429ce51b6c2b27e1c278b021a1/href">https://medium.com/media/4db169429ce51b6c2b27e1c278b021a1/href</a></iframe><p>Now let’s take a look into the TweenMax part.</p><p>TweenMax includes TweenLite and CSSplugin so once you use the link to TweenMax you can can get rid of the CSSPlugin’s link.</p><pre>&lt;script src=&quot;<a href="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenMax.min.js">https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.3/TweenMax.min.js</a>&quot;&gt;&lt;/script&gt;</pre><p>TweenMax has <strong>13 additional methods over TweenLite</strong>, here are 3 of them.</p><p>The first method is <strong>staggerTo</strong> which is similar to the <strong>to</strong> method<br>except that this one animates each of the elements in the array/nodelist<br>after a certain delay that we can specify in the <strong>stagger property </strong>inside of the vars object.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FzYOEYYY%3Fheight%3D600%26slug-hash%3DzYOEYYY%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FzYOEYYY&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/7ebb0d86891be9fb8dc69d00a73dc8b6/href">https://medium.com/media/7ebb0d86891be9fb8dc69d00a73dc8b6/href</a></iframe><p>The second additional method is the <strong>staggerFrom</strong> which is the reverse of the <strong>StaggerTo</strong> method, meaning that the values of the properties in the vars object represent the initial state of the element.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FJjPrjoX%3Fheight%3D600%26slug-hash%3DJjPrjoX%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FJjPrjoX&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/dcabbcbabfbbf85a28b3b146204fc2bc/href">https://medium.com/media/dcabbcbabfbbf85a28b3b146204fc2bc/href</a></iframe><p>The third additional method is <strong>staggerFromTo</strong> which is the combination of the 2 of previous methods.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FOJLxJPv%3Fheight%3D600%26slug-hash%3DOJLxJPv%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FOJLxJPv&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/ad47818c219ff24ff57f74a2894ac706/href">https://medium.com/media/ad47818c219ff24ff57f74a2894ac706/href</a></iframe><p>Now let’s see some additional vars properties provided by TweenMax.</p><p>The first one is <strong>repeat</strong> which you can use to specify how many times the animation can take place, you can use a positive number to specify how many repetitions can take place or use <strong>-1 to make an infinite number of repetitions</strong>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FbGboGdj%3Fheight%3D600%26slug-hash%3DbGboGdj%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FbGboGdj&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/172abf4e301ced4396cd421356c9243e/href">https://medium.com/media/172abf4e301ced4396cd421356c9243e/href</a></iframe><p>The next property is <strong>yoyo</strong> which makes the animation goes from the initial state to the final one and vice versa.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FXWreWmW%3Fheight%3D600%26slug-hash%3DXWreWmW%26default-tabs%3Dcss%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FXWreWmW&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/8899e5e055b020967a8cf1482cf509dc/href">https://medium.com/media/8899e5e055b020967a8cf1482cf509dc/href</a></iframe><p>Another property which <strong>can be used only with the stagger methods is cycle</strong>. This property takes an object that holds the different properties we want to animate, then these properties take arrays as values, each array has to contain one or more values that can be repeated over the different elements, in other words we’re creating a pattern with the array values.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fembed%2Fpreview%2FqBWPBON%3Fheight%3D600%26slug-hash%3DqBWPBON%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2FWaelYasmina%2Fpen%2FqBWPBON&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.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/223a96d88cc1cfea26bc3a4b5133bd40/href">https://medium.com/media/223a96d88cc1cfea26bc3a4b5133bd40/href</a></iframe><p>This should be enough for this article, I’ll cover other parts like TweenLineLite and TweenLineMax and other features in future article(s), up until then, I wish happy tweening !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d38e706433c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Animation With CSS -Keyframes-]]></title>
            <link>https://waelyasmina.medium.com/web-animation-with-css-keyframes-d363c53d1582?source=rss-ddf22844a647------2</link>
            <guid isPermaLink="false">https://medium.com/p/d363c53d1582</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[animation]]></category>
            <dc:creator><![CDATA[Wael Yasmina]]></dc:creator>
            <pubDate>Thu, 22 Aug 2019 18:04:08 GMT</pubDate>
            <atom:updated>2019-09-07T17:12:05.057Z</atom:updated>
            <content:encoded><![CDATA[<h3>Web Animation With CSS -Keyframes -</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tQLb0ZSlFghqWmbzvUcZDA.png" /></figure><p>As I mentioned in my <a href="https://medium.com/@waelyasmina/web-animation-with-css-transition-1080183541fa">previous article</a>, web animation is a key factor for a better experience for visitors/users of a website/web app which eventually leads to more conversion.</p><p>In this article I’m covering the basics of another technique of animation built in CSS which is <strong>keyframes.</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F355346363%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F355346363&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F808103979_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/6620606a7b69527e0e3c961e9572dc1e/href">https://medium.com/media/6620606a7b69527e0e3c961e9572dc1e/href</a></iframe><h3>CSS Keyframes</h3><p>Keyframes and transitions are similar in the matter of what they do, what I mean here is that in both cases you set a duration for the change you want to occur to the html element and then you see it changing over that period of time, yet the main differences between the two is that:</p><ul><li>keyframes don’t require a trigger to start (transitions require one);</li><li>you can repeat the animation <em>n</em> times or an unlimited number of times (not possible with transitions unless using Javascript);</li><li>you have more control of the flow of the animation with a multitude of states over the duration (transitions have only 2 states, a starting and finishing one).</li></ul><h4>Defining The Animation</h4><p>To animate something with keyframes we need to “declare” an animation (same as declaring a variable before using it in programming languages), to do that we need to use the keyword <strong>@keyframes</strong> and set <strong>a name </strong>for the animation.</p><p>Then we have to specify what should happen in each period of the duration of the animation either by using <strong>from</strong>/<strong>to</strong> syntax, or using <strong>percentages</strong> (which I prefer personally), or <strong>both</strong> at the same time.</p><pre>@keyframes animationName {<br>  from { transform: translateX(0) }<br>  to {<br>    transform: translateX(100px);<br>    background-color: deepskyblue;<br>  }<br>}</pre><pre>/* Or */</pre><pre>@keyframes animationName {<br>  0% { transform: translateX(0) }<br>  50% {<br>    transform: translateX(50px);<br>    background-color: deepskyblue;<br>  }<br>  100% { transform: translateX(100px) }<br>}</pre><pre>/* Or */</pre><pre>@keyframes animationName {<br>  from { transform: translateX(0) }<br>  50% {<br>    transform: translateX(50px);<br>    background-color: deepskyblue;<br>  }<br>  to { transform: translateX(100px) }<br>}</pre><p><strong>NB:</strong> you can use as many percentages as you want to.</p><p>That’s enough to create an animation that can be used to animate different elements in a web page.</p><p>That done let’s learn how to use it.</p><h4>animation-name (required)</h4><p>To use a specific animation we need to set its name as a value for the animation-name property, let’s say we need to animate a div :</p><pre>div {<br> animation-name: animationName;<br>}</pre><h4>animation-duration (required)</h4><p>The period of time that the animation should take to go through the different states.</p><pre>div {<br>  ... /* some styling */<br>  animation-name: animationName;<br>  animation-duration: 2s<br>}</pre><pre>@keyframes animationName {</pre><pre>  0% {<br>  transform: scale(1, 1) rotate(0deg);<br>  }</pre><pre>  25% {<br>    transform: scale(2, 2) rotate(0deg);<br>    background-color: deepskyblue;<br>  }</pre><pre>  50% {<br>    background-color: limegreen;<br>    transform: scale(2, 2) rotate(0deg);<br>  }</pre><pre>  75% {<br>    transform: scale(2, 1) rotate(0deg);<br>  }</pre><pre>  100% {<br>    background-color: deeppink;<br>    transform: scale(1, 1) rotate(0deg);<br>  }</pre><pre>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*LG_IrvLZD-xa7RM3gGULKQ.gif" /></figure><p><strong>NB:</strong> the animation <strong>occurs only once</strong> and starts with the div having the yellow color and stops at the same state that it started in, the example keeps repeating because it’s a gif image.</p><h4>animation-delay (optional)</h4><p>A delay that occurs before the animation takes place.</p><pre>div {<br>  ... /* some styling */<br>  animation-name: animationName;<br>  animation-duration: 2s;<br>  animation-delay: 1s;<br>}</pre><pre>@keyframes animationName {<br>  ...<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*FQfZ0uZPaZ_pdqvFAKh1ww.gif" /></figure><h4>animation-play-state (optional)</h4><p>The default value is <em>running</em>, this property sets the animation in a paused or running state.</p><pre>div {<br>  ... /* some styling */<br>  animation-name: animationName;<br>  animation-duration: 1s;<br>  animation-play-state: paused;<br>}</pre><pre>@keyframes animationName {<br>  ...<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*X5R1U8K4h2bVUYeJMHCGug.gif" /></figure><h4>animation-timing-function (optional)</h4><p>Adds effects to the animation so it can be more realistic, like giving a bouncing or elastic effect to the motion of the element.</p><pre>div {<br>  ... /* some styling */<br>  animation-name: animationName;<br>  animation-duration: 2s;<br>  animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);<br>}</pre><pre>@keyframes animationName {<br>  ...<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*392G25y0hOyA8IlEynIwxA.gif" /></figure><h4>animation-fill-mode (optional)</h4><p>By default this property has a value of <em>backwards</em>, which means that the element should have its initial state after the end of the animation, if we want the element to stay in its final state after the animation we can set the value of this property as <em>forwards.</em></p><pre>div {<br>  ... /* some styling */<br>  animation-name: animationName;<br>  animation-duration: 2s;<br>  animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);<br>  animation-fill-mode: forwards;<br>}</pre><pre>@keyframes animationName {<br>  ...<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*F4Y3KcZRrLBjfDFBY4R5Lw.gif" /></figure><p><strong>NB:</strong> the square should still in the state where it has the pink color.</p><h4>animation-iteration-count (optional)</h4><p>You can set how many times the square should animate before stopping, either giving a numeric value or setting the <em>infinite</em> value so it keeps animating infinitely.</p><pre>div {<br>  ... /* some styling */<br>  animation-name: animationName;<br>  animation-duration: 2s;<br>  animation-iteration-count: 3 /* animates 3 times then stops */<br>}</pre><pre>@keyframes animationName {<br>  ...<br>}</pre><p>Or</p><pre>div {<br>  ... /* some styling */<br>  animation-name: animationName;<br>  animation-duration: 2s;<br>  animation-iteration-count: inifinte /* keeps animating */<br>}</pre><pre>@keyframes animationName {<br>  ...<br>}</pre><h4>animation-direction (optional)</h4><p>With this property you can decide if you want your animation to start from the initial state to the final, or from the final to the initial one or maybe alternate between the two.</p><pre>div {<br>  ... /* some styling */<br>  animation-name: animationName;<br>  animation-duration: 2s;<br>  animation-iteration-count: inifinte;<br>  animation-direction: alternate<br>}</pre><pre>@keyframes animationName {<br>  ...<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*67wgiomNlU9poR4uBG4vsg.gif" /></figure><h4>Shorthand Syntax</h4><p>Finally, a shorthand syntax can be used for a shorter code, it can be used in a different way where you can skip some properties (the optional ones) or change their occurrence (except the animation-duration which always comes first before the animation-delay).</p><p>Examples :</p><pre>.div1 {<br>  animation: animationName 2s infinite;<br>}</pre><pre>.div2 {<br>  animation: animationName 2s 1s ease-in-out;<br>}</pre><pre>.div3 {<br>  animation: animationName 2s ease-in-out forwards;<br>}</pre><pre>.div4 {<br>  animation: animationName 2s forwards infinite ease-out;<br>}</pre><pre>@keyframes animationName {<br>  ...<br>}</pre><p>This is should be enough for this basic CSS keyframes guide, I hope you learned something useful from it, and see you next time, have a nice day !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d363c53d1582" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Animation With CSS -Transition-]]></title>
            <link>https://waelyasmina.medium.com/web-animation-with-css-transition-1080183541fa?source=rss-ddf22844a647------2</link>
            <guid isPermaLink="false">https://medium.com/p/1080183541fa</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[transitions]]></category>
            <category><![CDATA[web-design]]></category>
            <dc:creator><![CDATA[Wael Yasmina]]></dc:creator>
            <pubDate>Sun, 11 Aug 2019 01:24:19 GMT</pubDate>
            <atom:updated>2019-08-11T01:33:11.835Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LpFbQlek0Bw_K57tITJNpw.png" /></figure><p>Web animation was and still one of the hottest topics when it comes to the world of the internet from the late nineties where almost every single web page was submerged with blinking gifs, through mid 2000’s where flash reigned over the web with funny and interactive applications, until Steve Jobs declaration in 2010 which was literally the death sentence to flash and the beginning of the era of CSS3.</p><blockquote><a href="https://www.apple.com/hotnews/thoughts-on-flash/">Flash was created during the PC era — for PCs and mice. Flash is a successful business for Adobe, and we can understand why they want to push it beyond PCs. But the mobile era is about low power devices, touch interfaces and open web standards — all areas where Flash falls short. Steve Jobs — 2010</a></blockquote><p>Through 3 decades, websites got better and better and most importantly individuals and companies gained more interest in them. People started to look at websites in a more serious way and have seen big opportunities on them to make them a real source of income (business) rather than only simple virtual pages to read or surf on.</p><p>So that being said animation on websites floated to the surface as one of the most important key factors for a better design and especially a better user experience which leads to more traffic and more traction, resulting finally to more conversion and sales.</p><p>In this article I’m going to talk about <strong>the basics</strong> of one of different techniques used to animate web pages’ components (html elements) which is the CSS transition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*JgMRjJIWiVPlLQJhgWquMA.gif" /><figcaption><a href="https://codepen.io/WaelYasmina/pen/bXmEzJ">Basic example of what can be done with transition</a></figcaption></figure><h3>CSS Transition</h3><p>Usually when you want a state of an html element to be changed after a certain event, let’s say hovering on a div, the state of that element gets changed instantly which happens to not be an interesting effect to say the least.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*NWakxsgWWtc9j0zUHZ1igg.gif" /><figcaption>Changing the scale of a div when it gets hovered without transition</figcaption></figure><p>However with transition, you can set a duration for that change of state, and then see the progression of that change during that period of time, which leaves a smooth and pleasing experience for the eyes of the user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*SPJHcNtZwR2We3FEL8yDJw.gif" /><figcaption>Changing the scale of a div when it gets hovered with transition</figcaption></figure><h4>transition-duration</h4><p>As mentioned before we need to set a duration for the transition from the state 1 to state 2 and this is when this property comes in handy. I used a duration of 0.5 seconds for the animation of the square: <strong>transition-duration: 0.5s</strong></p><h4>transition-delay</h4><p>This property delays the animation of the element for a given period of time. In the below example I delayed the animation of the square scaling for 0.5 seconds like so: <strong>transition-delay: 0.5s</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*4wPpiCkjQq01l7oC4aE2eQ.gif" /></figure><h4>transition-property</h4><p>You can specify the exact property you want to see the transition on if you apply more than one change on the element. Let’s say I want to change the scale and the opacity of the square but I only want to see the transition effect of the scale but I want the opacity to be changed instantly, in this case I can do that by typing the following line: <strong>transition-property: transform</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*jR7-GW101zI2Z5Kzh_gZnw.gif" /><figcaption>Transition applied only on the scaling effect</figcaption></figure><p>If I want the transition to hit both of the scaling and the opacity effects, I can type this: <strong>transition-property: transform opacity</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*4M_QnukctUA8zV75JnPYSA.gif" /><figcaption>Transition applied on both of the scaling effect and opacity</figcaption></figure><p>You can add the transition effect by giving the “all” value to this property: <strong>transition-property: all </strong>or you can just simply not use at all and by default the transition will effect every property of the element.</p><h4>transition-timing-function</h4><p>My favorite part of transition, this adds much of impact on the animation, it adds more realistic look to how the element is animated, like adding an elastic feel to how the square gets bigger or a bouncing effect. Let’s add the elastic effect to the square motion by adding this: <strong>transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*Bx8t6Aq81eb7oEioe3_hGQ.gif" /></figure><p>There’s some websites that you can get values or create custom ones before adding them to your code and here’s 2 of them:</p><p><a href="https://easings.net/en">Easing Functions Cheat Sheet</a></p><p><a href="https://cubic-bezier.com/#.17,.67,.83,.67">https://cubic-bezier.com/</a></p><p><strong>Shorthand Syntax</strong></p><p>Finally you can use all of the above properties in just one single line, and here’s a variety of how you can use the shorthand syntax:</p><ul><li><strong>transtion: 0.5s 0.5s all </strong>: duration delay property</li><li><strong>transtion: 0.5s 0.5s ease-in </strong>: duration delay timing-function</li><li><strong>transtion: 0.5s ease-out </strong>: duration timing-function</li></ul><p>I hope this helped especially if you’re a beginner, and I’m probably going to post more articles about other different techniques of animation so I hope to see you in the next post, have a nice day !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1080183541fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ultimate Plugin That Every Web Developer Should Have On Their Code Editor]]></title>
            <link>https://waelyasmina.medium.com/the-ultimate-plugin-that-every-web-developer-should-have-on-their-code-editor-dfcab67b0e18?source=rss-ddf22844a647------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfcab67b0e18</guid>
            <category><![CDATA[code]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Wael Yasmina]]></dc:creator>
            <pubDate>Tue, 09 Jul 2019 14:22:30 GMT</pubDate>
            <atom:updated>2019-07-12T23:17:50.159Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are a web developer and you haven’t ever heard or used Emmet, then you should go and install it right now ! well not before you finish reading this blog post first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A4TeKXtjwGKCdMKqbo342A.png" /></figure><p>Basically Emmet is a plugin that makes typing HTML and CSS code way faster (and more fun) by using abbreviations of the tags names and properties.</p><p>Another thing to mention is that you can use this plugin in almost every code editor, whether it’s an offline editor that you have already installed on your computer such as VSCode, Sublime Text, Atom, Netbeans, Vim etc… or an online code editor like CodePen, JSFiddle, JSBin etc…</p><h3>HTML With Emmet</h3><h4>The Exclamation Mark Abbreviation</h4><p>An exclamation mark is enough to generate the basic html stuff that each html page has to include.</p><pre>!<br>//equivalent to<br>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>  &lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;ie=edge&quot;&gt;<br>    &lt;title&gt;Document&lt;/title&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F346751523%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F346751523&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F796899243_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/688b3d3041254b6bdb113dbde8e2533f/href">https://medium.com/media/688b3d3041254b6bdb113dbde8e2533f/href</a></iframe><h4>Tag Name Or First Letter(s)</h4><p>Typing the tag name or just the first letter(s) without the less-than/greater-than sign is all what is needed to create the wanted element with its opening and closing tags.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F346751544%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F346751544&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F796899303_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/b5de174a614c009b351ddaab8911143e/href">https://medium.com/media/b5de174a614c009b351ddaab8911143e/href</a></iframe><h4>Id And Class</h4><p>You need to put # right after the element you want to create to add an id, and put . if you want to add a class, you can also add both if you wish to:</p><pre>element#id.class1.class2<br>//equivalent to :<br>&lt;element id=&quot;id&quot; class=&quot;class1 class2&quot;&gt;&lt;/element&gt;</pre><p>You can skip the element name in case the element you want to create is a div:</p><pre>#id.cls<br>//equivalent to :<br>&lt;div id=&quot;id&quot; class=&quot;cls&quot;&gt;&lt;/div&gt;</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F346751586%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F346751586&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F796899472_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/4c0152f090feac4aa7f5bfb236468dea/href">https://medium.com/media/4c0152f090feac4aa7f5bfb236468dea/href</a></iframe><h4>Crucial Attributes, Optional Attributes And The Type Attribute</h4><p><strong>Crucial Attributes</strong></p><p>Emmet will add automatically the attributes that are necessary for an HTML in order to work, like the href attribute for the anchor tag:</p><pre>a<br>//equivalent to<br>&lt;a href=&quot;&quot;&gt;&lt;/a&gt;</pre><p><strong>Optional Attributes</strong></p><p>To add optional attributes, you need to place them inside of a pair of square brackets:</p><pre>img[height=&quot;300px&quot; width=&quot;300px&quot;]<br>//equivalent to<br>&lt;img alt=&quot;&quot; height=&quot;300px&quot; width=&quot;300px&quot;] /&gt;</pre><p><strong>The Type Attribute</strong></p><p>If your element happens to be an input which of course has a type attribute you can use a shorter syntax to create it by typing input:type :</p><pre>input:b<br>//equivalent to<br>input[type=&quot;button id=&quot;&quot;]<br>//equivalent to<br>&lt;input type=&quot;button&quot; id=&quot;&quot; /&gt;</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F346751706%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F346751706&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F796899651_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/dda35ebd07cd976adaa460210f732f87/href">https://medium.com/media/dda35ebd07cd976adaa460210f732f87/href</a></iframe><h4>Text, Siblings And Nested Elements</h4><p><strong>Text</strong></p><p>To fill a text element such an h tag or a p tag you need to put it (the inner text) between a couple of brackets, element{text}:</p><pre>h1{Title}<br>//equivalent to<br>&lt;h1&gt;Title&lt;/h1&gt;</pre><p><strong>Siblings</strong></p><p>To put elements in a same level (one after the other) you have to put a + between each two elements:</p><pre>section+section+section<br>//equivalent to<br>&lt;section&gt;&lt;/section&gt;<br>&lt;section&gt;&lt;/section&gt;<br>&lt;section&gt;&lt;/section&gt;</pre><p><strong>Nested Elements</strong></p><p>To put an element inside another one you should put a &gt; right after the parent and before the child element:</p><pre>#parent&gt;#child<br>//equivalent to<br>&lt;div id=&quot;parent&quot;&gt;<br>  &lt;div id=&quot;child&quot;&gt;&lt;/div&gt;<br>&lt;/div&gt;</pre><pre>#grand-parent&gt;#parent&gt;#grand-child<br>//equivalent to<br>&lt;div id=&quot;grand-parent&quot;&gt;<br>  &lt;div id=&quot;parent&quot;&gt;<br>    &lt;div id=&quot;grand-child&gt;&lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>You can also group elements by wrapping them by a couple of parenthesis.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F346751832%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F346751832&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F796900020_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/1f842a24cf77b6dad477be1327757479/href">https://medium.com/media/1f842a24cf77b6dad477be1327757479/href</a></iframe><h4><strong>X Elements And Item’s Number</strong></h4><p>You can create x number of elements by typing only one command and also give each item a unique id/class by its order number using $:</p><pre>ul&gt;li*3<br>//equivalent to<br>&lt;ul&gt;<br>  &lt;li&gt;&lt;/li&gt;<br>  &lt;li&gt;&lt;/li&gt;<br>  &lt;li&gt;&lt;/li&gt;<br>&lt;ul&gt;</pre><pre><br>section&gt;#id$*3<br>//equivalent to<br>&lt;section&gt;<br>  &lt;div id=&quot;id1&quot;&gt;&lt;/div&gt;<br>  &lt;div id=&quot;id2&quot;&gt;&lt;/div&gt;<br>  &lt;div id=&quot;id3&quot;&gt;&lt;/div&gt;<br>&lt;/section</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F346752117%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F346752117&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F796900161_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/6603dae6b8e9f6111c3eaa3cc2fcb562/href">https://medium.com/media/6603dae6b8e9f6111c3eaa3cc2fcb562/href</a></iframe><h4>Lorem Ipsum</h4><p>Generate random lorem text by typing loremX where X is the number of words. If you use the multiply operator on a &lt;p&gt; like so p&gt;loremX*Y, it will generate a Y number of &lt;span&gt; having X number of words, if it’s an &lt;ul&gt; instead of a &lt;p&gt; ( ul&gt;loremX*Y ) this will generate Y number of &lt;li&gt; having X number of words:</p><pre>h1&gt;lorem5<br>//equivalent to<br>&lt;h1&gt;Lorem ipsum dolor sit amet&lt;/h1&gt;</pre><pre>p&gt;lorem3*3<br>//equivalent to<br>&lt;p&gt;<br>  &lt;span&gt;Lorem ipsum dolor&lt;/span&gt;<br>  &lt;span&gt;Lorem ipsum dolor&lt;/span&gt;<br>  &lt;span&gt;Lorem ipsum dolor&lt;/span&gt;<br>&lt;/p&gt;</pre><pre>ul&gt;lorem3*3<br>//equivalent to<br>&lt;p&gt;<br>  &lt;li&gt;Lorem ipsum dolor&lt;/li&gt;<br>  &lt;li&gt;Lorem ipsum dolor&lt;/li&gt;<br>  &lt;li&gt;Lorem ipsum dolor&lt;/li&gt;<br>&lt;/p&gt;</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F346752966%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F346752966&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F796901244_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/498723f463a632257bc3105df9e73193/href">https://medium.com/media/498723f463a632257bc3105df9e73193/href</a></iframe><h3>CSS With Emmet</h3><p>In CSS there’s 3 ways of adding a property and its value.</p><p>In some cases you only need to specify the first letter of the property’s name, the value then the unit:</p><pre>m10px<br>//equivalent to<br>margin: 10px</pre><pre>p10px4px10px12px<br>//equivalent to<br>padding: 10px 4px 10px 12x</pre><p>In other cases you need to use an abbreviation of the property name:</p><pre>mxh<br>//equivalent to<br>max-height:</pre><pre>miw<br>//equivalent to<br>min-width:</pre><p>And finally there is this case where you need to use an abbreviation of the property’s name and then add a colon (sometimes without the colon) and the first letter of the value name:</p><pre>pos:a<br>//equivalent to<br>position: absolute</pre><pre>df<br>//equivalent to<br>display: flex</pre><h4><strong>Height, Width, Max/Min-Height, Max/Min-Width</strong></h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F346752215%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F346752215&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F796900210_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/5eca84d69b7b85cfe343ac266248ddf8/href">https://medium.com/media/5eca84d69b7b85cfe343ac266248ddf8/href</a></iframe><h4>Display</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F346752322%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F346752322&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F796900334_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/6570da264cb2838b137fd1dce9e5b1e9/href">https://medium.com/media/6570da264cb2838b137fd1dce9e5b1e9/href</a></iframe><h4>Position</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F346752290%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F346752290&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F796900291_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/64e55f5edcf636633ec19e6519e0ca69/href">https://medium.com/media/64e55f5edcf636633ec19e6519e0ca69/href</a></iframe><h4>Padding</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F346752250%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F346752250&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F796900251_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/45284b82548e5a01c8943528df4518e0/href">https://medium.com/media/45284b82548e5a01c8943528df4518e0/href</a></iframe><p>You can check the <a href="https://docs.emmet.io/cheat-sheet/">Emmet cheat sheet</a> for all theabbreviations needed for every HTML tag and CSS property.</p><p>Thanks for reading and I wish you happy coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfcab67b0e18" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Step By Step Guide To Using Handlebars With Your Node js Application]]></title>
            <link>https://waelyasmina.medium.com/a-guide-into-using-handlebars-with-your-express-js-application-22b944443b65?source=rss-ddf22844a647------2</link>
            <guid isPermaLink="false">https://medium.com/p/22b944443b65</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[handlebars]]></category>
            <dc:creator><![CDATA[Wael Yasmina]]></dc:creator>
            <pubDate>Tue, 04 Jun 2019 12:29:53 GMT</pubDate>
            <atom:updated>2020-11-30T17:57:38.380Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Step By Step Guide To Using Handlebars With Your Node js App</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9fhMc-ea-pi0oZRUVLu3WQ.png" /></figure><p>Before we start let’s begin with a couple of definitions to give you an idea of what we will be dealing with if you’re a complete beginner.</p><p><strong>What is Handlebars?</strong></p><p>Handlebars is one of the most used templating engines for web applications “competing” with other well-known ones like Mustache js, Pug, EJS and others. It’s especially used on the server side along with the express js framework.</p><p><strong>Wait wait wait.. what on earth is a templating engine?</strong></p><blockquote>Simply said ‘Templating’ engine is an engine that can manipulate your HTML code from the server side using the server side code you use. By it’s very authentic built in syntaxes you can loop, change content dynamically, alert messages to user and etc.</blockquote><p>Answered THEWOLF to <a href="https://stackoverflow.com/questions/53960837/what-is-templating-template-engine?fbclid=IwAR1nPbSLoNe1aPoX0uVZDhnt7Wbu_BJRAQ1km9S6mEuCvu1werzRgXsHUUk">the same question on a thread on stackoverflow.com</a>.</p><p>In other words, a templating engine takes a bunch of static HTML files, fills them with the necessary data on the server side then sends them as any ordinary HTML file to the client.</p><p>So enough with these confusing terms and…</p><h3>Let’s Get Our Hands Dirty</h3><h4>Setting Up A Basic Express Server</h4><p>Let’s start by creating a folder which will contain our app and within it type the following command to create the JSON file containing all the information and dependencies:</p><pre>npm init</pre><p>After filling the necessary information, we need to install express of course by typing the express installation command:</p><pre>npm install express --save</pre><p>Now we create our main js file which will contain our application’s logic and name it “index.js” which must include these few lines to get us going:</p><pre>//Loads the express module<br>const express = require(&#39;express&#39;);</pre><pre>//Creates our express server<br>const app = express();</pre><pre>const port = 3000;</pre><pre>//Serves static files (we need it to import a css file)<br>app.use(express.static(&#39;public&#39;))</pre><pre>//Sets a basic route<br>app.get(&#39;/&#39;, (req, res) =&gt; res.send(&#39;Hello World !&#39;));</pre><pre><br>//Makes the app listen to port 3000<br>app.listen(port, () =&gt; console.log(`App listening to port ${port}`));</pre><p>Let’s test this out by typing the command below on the command prompt:</p><pre>node index.js</pre><p>If everything works fine we should be able to see the message “App listening to port 3000” on the console and if we open this URL “ <a href="http://localhost:3000/">http://localhost:3000/</a>” in the browser we should be able to see a nice shiny “Hello World !” on the page.</p><p>Finally, let’s create a folder by the name of “public” in which we create a .css file and let’s call it “style.css” and we’re good to go.</p><h4>It’s time for some Handlebars Yay!</h4><p>First off, we need to install the Handlebars dependency as follows:</p><pre>npm install express-handlebars --save</pre><p>Then we need to create a folder containing the files needed for Handlebars to work, let’s call it “views” in which we create a file called “main.handlebars” and 2 subfolders with the respective names “partials” and “layouts”. Inside the layouts folder create a file and name it “index.handlebars” and let&#39;s fill it with some HTML code:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>  &lt;head&gt;<br>    &lt;meta charset=&quot;utf-8&quot; /&gt;<br>    &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot; /&gt;  <br>    &lt;title&gt;My Awesome App&lt;/title&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0, viewport-fit=cover&quot; /&gt;<br>    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;./style.css&quot; /&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    {{{body}}}<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><p>So far our directory should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/183/1*kJCTzTrvZpbDsM2l2kg_jw.png" /><figcaption>Project’s tree</figcaption></figure><p>Now let’s move on to the code editor and type some juicy lines of Javascript:</p><pre>const express = require(&#39;express&#39;);<br>const app = express();<br>const port = 3000;</pre><pre>//Loads the handlebars module<br>const handlebars = require(&#39;express-handlebars&#39;);</pre><pre>//Sets our app to use the handlebars engine<br>app.set(&#39;view engine&#39;, &#39;handlebars&#39;);</pre><pre>//Sets handlebars configurations (we will go through them later on)<br>app.engine(&#39;handlebars&#39;, handlebars({<br>layoutsDir: __dirname + &#39;/views/layouts&#39;,<br>}));</pre><pre>app.use(express.static(&#39;public&#39;))</pre><pre>app.get(&#39;/&#39;, (req, res) =&gt; {<br>//Serves the body of the page aka &quot;main.handlebars&quot; to the container //aka &quot;index.handlebars&quot;<br>res.render(&#39;main&#39;, {layout : &#39;index&#39;});<br>});</pre><pre><br>app.listen(port, () =&gt; console.log(`App listening to port ${port}`));</pre><p>Here’s what’s going on, Handlebars takes a static template file you give it inside the layouts folder (the “index.handlebars” file), this file contains some kind of a placeholder (the {{{body}}} if you look back at the code) which will be filled with the content of another .handlebars file (“main.handlebars”). As its name suggests the “main.handlebars” contains the core of the HTML code we want it to be rendered (it’s not necessary that you name it main though).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WcYY_CqU3uKvde4TO4GEKQ.png" /></figure><p>Since our “main.handlebars” file is empty if you try to run the app and look at the result nothing will show up since neither our “main.handlebars” nor “index.handlebars”’s body contain anything, so let’s open the “main.handlebars” file and fill it with some content:</p><pre>&lt;h2&gt;Liste of my most loved League champions&lt;/h2&gt;<br>&lt;ul&gt;<br>  &lt;li class=&quot;midlaner&quot;&gt;Leblanc&lt;/li&gt;<br>  &lt;li class=&quot;midlaner&quot;&gt;Lux&lt;/li&gt;<br>  &lt;li class=&quot;toplaner&quot;&gt;Teemo&lt;/li&gt;<br>  &lt;li class=&quot;midlaner&quot;&gt;Kassadin&lt;/li&gt;<br>  &lt;li class=&quot;toplaner&quot;&gt;Jarvan IV&lt;/li&gt;<br>&lt;/ul&gt;</pre><p>Let’s add some CSS:</p><pre>li {<br>font-size: 2rem;<br>width: 300px;<br>margin: 4px;<br>padding: 4px;<br>list-style: none<br>}</pre><pre>.midlaner {background-color: #eeeeee}</pre><pre>.toplaner {background-color: #ffea00}</pre><p>By now if you refresh the page, you will see some content (probably not interesting enough to catch your eyes).</p><h4>Handlebars Configuration</h4><ul><li><strong>extname: string</strong></li></ul><p>The first thing it came to my mind and I’m pretty sure it was the same for you when you were about to create handlebars file is “Uhm that’s a heck of a big file extension” and that’s where our first configuration property comes in handy.</p><p>Let’s change the code so our file extension will take fewer characters, “.hbs” for instance looks good to me:</p><pre>//instead of app.set(&#39;view engine&#39;, &#39;handlebars&#39;); <br>app.set(&#39;view engine&#39;, &#39;hbs&#39;);</pre><pre>//instead of app.engine(&#39;handlebars&#39;, handlebars({<br>app.engine(&#39;hbs&#39;, handlebars({<br>layoutsDir: __dirname + &#39;/views/layouts&#39;,<br>//new configuration parameter<br>extname: &#39;hbs&#39;<br>}));</pre><p><strong>Don’t forget to change the extension of the files we already created (“main.handlebars” to “main.hbs” and “index.handlebars” to “index.hbs”).</strong></p><ul><li><strong>defaultLayout: string</strong></li></ul><p>By default, if you don’t tell handlebars which layout file to render, it will throw an error telling you there’s no layout file. Using this property will give you the control to what name of the file it has to look for in case you didn’t explicitly mention it in the render function.</p><p>Let’s create a file and name it “planB.hbs” and let’s fill it with something different:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>  &lt;head&gt;<br>    &lt;meta charset=&quot;utf-8&quot; /&gt;<br>    &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot; /&gt;  <br>    &lt;title&gt;My Awesome App&lt;/title&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0, viewport-fit=cover&quot; /&gt;<br>    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;./style.css&quot; /&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;h1&gt;This is the plan B page&lt;/h1&gt;<br>    {{!-- We could use the same body as the index.hbs page --}}<br>    {{!-- using the {{{body}}}, you remember it right ?--}}<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><p>Let’s add the new property to our “index.js” file:</p><pre>app.engine(&#39;hbs&#39;, handlebars({<br>layoutsDir: __dirname + &#39;/views/layouts&#39;,<br>extname: &#39;hbs&#39;,<br>//new configuration parameter<br>defaultLayout: &#39;planB&#39;,<br>}));</pre><pre>app.get(&#39;/&#39;, (req, res) =&gt; {<br>//instead of res.render(&#39;main&#39;, {layout: &#39;index&#39;});<br>res.render(&#39;main&#39;);<br>});</pre><p>I guess you predicted correctly what we will be getting after running the code, didn’t you?</p><p><strong>Keep in mind that adding the property with a name of a file let’s say “file1.hbs” as value will be overwritten if you mention explicitly another file “file2.hbs” in the render function, in other words, the file mentioned in the render function has the priority to be rendered over the one mentioned in the defaultLayout property.</strong></p><ul><li><strong>partialsDir: string</strong></li></ul><p>This property helps to make the project more organized, it takes a string path to a folder as a value, this folder will contain small chunks of code that we can use in the body of our “main.hbs”, “index.hbs” or any other partial file (a partial nested inside another one). It’s the same idea of the component-based frameworks such as React.</p><p>Let’s create two files in the subfolder named “partials” that we created earlier and call them “lovedChamps.hbs” and “hatedChamps.hbs”.</p><p>Cut the code inside the “main.hbs” file and paste it inside the “lovedChamps.hbs” and let’s create another list inside the “hatedChamps.hbs”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/165/1*RqzWZw2jG3AtvZC6UvZvEA.png" /></figure><p>“main.hbs”:</p><pre>{{&gt; lovedChamps}}<br>{{&gt; hatedChamps}}</pre><p>As you can see we’re referring to the files containing the code we want to include to our core code by this notation <strong>{{&gt; partial_name}}</strong>.</p><p>“lovedChamps.hbs”:</p><pre>&lt;h2&gt;Liste of my most loved League champions&lt;/h2&gt;<br>&lt;ul&gt;<br>  &lt;li class=&quot;midlaner&quot;&gt;Leblanc&lt;/li&gt;<br>  &lt;li class=&quot;midlaner&quot;&gt;Lux&lt;/li&gt;<br>  &lt;li class=&quot;toplaner&quot;&gt;Teemo&lt;/li&gt;<br>  &lt;li class=&quot;midlaner&quot;&gt;Kassadin&lt;/li&gt;<br>  &lt;li class=&quot;toplaner&quot;&gt;Jarvan IV&lt;/li&gt;<br>&lt;/ul&gt;</pre><p>“hatedChamps.hbs”:</p><pre>&lt;h2&gt;Liste of my most hated League champions&lt;/h2&gt;<br>&lt;ul&gt;<br>  &lt;li class=&quot;midlaner&quot;&gt;Yasuo&lt;/li&gt;<br>  &lt;li class=&quot;midlaner&quot;&gt;Zoe&lt;/li&gt;<br>  &lt;li class=&quot;toplaner&quot;&gt;Mundo&lt;/li&gt;<br>  &lt;li class=&quot;toplaner&quot;&gt;Darius&lt;/li&gt;<br>  &lt;li class=&quot;midlaner&quot;&gt;Fizz&lt;/li&gt;<br>&lt;/ul&gt;</pre><p>“index.js”:</p><pre>app.engine(&#39;hbs&#39;, handlebars({<br>layoutsDir: __dirname + &#39;/views/layouts&#39;,<br>extname: &#39;hbs&#39;,<br>defaultLayout: &#39;planB&#39;,<br>//new configuration parameter<br>partialsDir: __dirname + &#39;/views/partials/&#39;<br>}));</pre><pre>app.get(&#39;/&#39;, (req, res) =&gt; {<br>//Using the index.hbs file instead of planB<br>res.render(&#39;main&#39;, {layout: &#39;index&#39;});});</pre><p>Run this and see magic happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l08aT5WVMRwVciaHjX0K2Q.png" /></figure><h4>Dynamic Values &amp; Helpers</h4><ul><li><strong>Dynamic Values</strong></li></ul><p>Until now we have been working with static files but what if we want to add values dynamically after we get them from a certain logic inside our “index.js” (e.g. data from a Firebase database). We can do that because it’s one of the main purposes of the templating engine if not the main reason for it to exist.</p><p>Let’s say I want to make a request to a certain API to know which pro player has the same champions pool as I do and then I want Handlebars to fill the name in my HTML file automatically without me hard coding it:</p><p>“index.js”:</p><pre>//I would like to use a real api but let&#39;s use this for the sake of //the simplicity of the article<br>fakeApi = () =&gt; &#39;Faker&#39;;</pre><pre>app.get(&#39;/&#39;, (req, res) =&gt; {<br>res.render(&#39;main&#39;, {layout: &#39;index&#39;, proPlayer: fakeApi()});<br>});</pre><p>“main.hbs”:</p><pre>{{&gt; lovedChamps}}<br>{{&gt; hatedChamps}}<br>&lt;h2&gt;Similar pro player : {{proPlayer}}&lt;/h2&gt;</pre><p>Notice that we use this notation <strong>{{variable_name}}</strong> as a placeholder for the variable that contains the value from the logic inside the Javascript file in the server (“index.js”).</p><p>Another thing to mention is that we can pass as many variables as we want to the render function res.render (‘main’, {layout: ‘index’, key1: val1, key2: val2… keyn: valn});</p><ul><li><strong>Helpers</strong></li></ul><blockquote>Helper functions, or “helpers” are functions that can be registered with Handlebars and can be called within a template. Helpers can be used for transforming output, iterating over data, etc.</blockquote><p>Let’s say we requested an API and it responded with a list of champions that we need to try because they have a similar play style as the champions we love. Filling each champion name in a variable and then hard coding them one by one in a list looks like such an exhausting job, imagine a scenario of a real-world app where we have a list of thousands of clients that we need to show to user (the client side).. that would be insane to even think about, but thanks to helpers that wouldn’t take even 2 minutes to get it done and here’s how we do it:</p><p>“index.js”:</p><pre>fakeApi = () =&gt; {<br>  return [<br>    {<br>      name: &#39;Katarina&#39;,<br>      lane: &#39;midlaner&#39;<br>    },<br>    {<br>      name: &#39;Jayce&#39;,<br>      lane: &#39;toplaner&#39;<br>    },<br>    {<br>      name: &#39;Heimerdinger&#39;,<br>      lane: &#39;toplaner&#39;<br>    },<br>    {<br>      name: &#39;Zed&#39;,<br>      lane: &#39;midlaner&#39;<br>    },<br>    {<br>      name: &#39;Azir&#39;,<br>      lane: &#39;midlaner&#39;<br>    }<br>  ];<br>}</pre><pre>app.get(&#39;/&#39;, (req, res) =&gt; {<br>res.render(&#39;main&#39;, {layout: &#39;index&#39;, suggestedChamps: fakeApi(), listExists: true});<br>});</pre><p>“main.hbs”:</p><pre>{{&gt; lovedChamps}}<br>{{&gt; hatedChamps}}<br>{{!-- depending on the value of the listExists variable --}}<br>{{!-- if it’s true then the list will be rendered --}}<br>{{!-- if the value is equal to false the list will not be rendered --}}<br>{{#if listExists}} <br>  &lt;ul&gt;<br>    {{#each suggestedChamps}}<br>      &lt;li class={{this.lane}}&gt;{{this.name}}&lt;/li&gt;<br>    {{/each}}<br>  &lt;/ul&gt;<br>{{/if}}</pre><p>Notice that the keyword <strong>this</strong> here means each one of the array elements.</p><p>Also as you can see we used another helper which is the<strong> if helper </strong>to make a conditional rendering depending on the value of the listExists variable.</p><h3>Final Words</h3><p>I hope you enjoyed going through this basic guide of Handlebars, you can check their <a href="https://handlebarsjs.com/">official website</a>, <a href="https://www.npmjs.com/package/handlebars">their npm page</a> or <a href="https://github.com/wycats/handlebars.js">Github repository</a> for the documentation or more advanced stuff.</p><p>You can also find the project files here on my <a href="https://github.com/WaelYasmina/handlebars-guide">Github repository</a> and this is it, I hope you learned something new from this article and see you in future articles.</p><p>The video format of this guide: <a href="https://youtu.be/HxJzZ7fmUDQ">Get Started With Handlebars.js</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22b944443b65" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 things I learned while creating my own portfolio]]></title>
            <link>https://waelyasmina.medium.com/10-things-i-learned-while-creating-my-own-portfolio-e454083424e0?source=rss-ddf22844a647------2</link>
            <guid isPermaLink="false">https://medium.com/p/e454083424e0</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Wael Yasmina]]></dc:creator>
            <pubDate>Tue, 02 Apr 2019 18:23:27 GMT</pubDate>
            <atom:updated>2021-05-23T10:55:23.877Z</atom:updated>
            <content:encoded><![CDATA[<h3>10 Things I Learned While Creating My Own Portfolio</h3><p>As I had my mind set to start a front end development career, I needed as anybody who chose to take this path to have a personal space on the internet AKA portfolio, to showcase my work, give a solid idea about who I am and what skill set do I have for recruiters.</p><p>So like I previously mentioned, if I had to show what I’m capable of doing I needed to create some projects to include to my portfolio, so I had to think about ideas of projects, well.. it honestly didn’t take me so long to figure out a good idea for my first ever project. I needed a website, and I’m a developer hence I hired myself for this job.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fEb0ToYbmD8DGrgBoRg_2g.png" /></figure><h3>I. Technical Skills</h3><h4>1. The element:last-child and element+element Selectors</h4><p>I’ve been always confident about my knowledge about CSS but to my surprise I had to take some breaks to re-read about something basic and essential in this language which happens to be selectors.</p><ul><li><strong>element:last-child selector : </strong>I’ve been thinking that p:last-child would always refer to the last &lt;p&gt; in the parent element even if another element comes after it which is wrong (that’s actually another selector which is element:last-of-type).</li></ul><blockquote><a href="https://www.w3schools.com/cssref/sel_last-child.asp">The :last-child selector matches every element that is the last child of its parent.</a></blockquote><ul><li><strong>element+element selector : </strong>I just discovered this selector, it came in handy when I was hesitant about giving a whole class to just a single element (an &lt;h1&gt; after another &lt;h1&gt;).</li></ul><blockquote><a href="https://www.w3schools.com/cssref/sel_element_pluss.asp">The <em>element+element</em> selector is used to select elements that is placed immediately after (not inside) the first specified element.</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*OjljhojuBxDJ79OdUOPLSA.png" /><figcaption>Setting the outline effect to the second &lt;h1&gt;</figcaption></figure><h4>2. CSS Properties</h4><p>As I said, I was way underestimating how big is the CSS world and just following some online courses was not in the slightest enough to go through every part of it:</p><ul><li><strong>width: x ch : </strong>in fact it’s not the name of the property itself that I was kind of surprised about but the unity of measurement which is <strong>ch</strong>. You can set the width of an element with a number of characters, e.g width: 20ch, if you have a long paragraph that exceeds 20 character it will break the line and starts a new one.</li><li><strong>background-image : linear-gradient(<em>direction</em>, <em>color-stop1</em>, <em>color-stop2, …</em>) : </strong>I knew about this property but still never thought about using it before.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F339612832%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F339612832&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F787687581_640.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="716" height="720" frameborder="0" scrolling="no"><a href="https://medium.com/media/e0cdd28d217ee7d84ab434122256dbe3/href">https://medium.com/media/e0cdd28d217ee7d84ab434122256dbe3/href</a></iframe><p><strong>::after and ::before pseudo-elements : </strong>both of these pseudo-elements don’t work using them with a <a href="https://stackoverflow.com/questions/38779034/list-of-replaced-elements">replaced element</a> such as &lt;img&gt; or &lt;input&gt;.</p><ul><li><strong>font-variant-numeric : </strong>I actually didn’t use this property but I stumbled upon it while I was searching for something else. So basically this property deals with fonts that give different spaces to numeric characters so if you have let’s say a &lt;p&gt; that dynamically changes its value it will engender some weird space between it and the element right next to it, therefore comes this property to give an equal space for every numeric character. Check the video below.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZjAfnc7UmM4%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZjAfnc7UmM4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZjAfnc7UmM4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d22b9991a6a2654f26cf8f6ba3419c71/href">https://medium.com/media/d22b9991a6a2654f26cf8f6ba3419c71/href</a></iframe><p><strong>margin-block-start and margin-block-end : </strong>those properties get default values which I had to re-initiate as they generated some weird spacing to some elements (&lt;li&gt; and &lt;h1&gt;). check out the documentation for detailed information -I call them the hidden margins-.</p><blockquote><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-block-start">The margin-block-start CSS property defines the logical block start margin of an element, which maps to a physical margin depending on the element&#39;s writing mode, directionality, and text orientation.</a></blockquote><blockquote><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-block-end">The margin-block-end CSS property defines the logical block end margin of an element, which maps to a physical margin depending on the element&#39;s writing mode, directionality, and text orientation.</a></blockquote><h4>3. Height Matters In Certain Cases of Responsive Design</h4><p>A lot of developers would jump straight away to resize the window horizontally whenever the word “responsive” comes to their mind because of course it’s the width that matters in most cases but it wasn’t enough in mine. I designed my website in a way that the height has an important role to play and I haven’t thought about it until I resized the window vertically when I was working on the blog section which contains 6 squares including random articles and by shrinking the window up the squares didn’t look as aesthetic as they should be, same goes for elements that have a fixed position.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F339612115%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F339612115&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F787687038_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1920" height="1080" frameborder="0" scrolling="no"><a href="https://medium.com/media/81fa58919f4c9983ca5a59278a3da492/href">https://medium.com/media/81fa58919f4c9983ca5a59278a3da492/href</a></iframe><p>So it’s a rule of thumb for me now :</p><blockquote>“If height matters in my design, I should keep in mind its responsiveness vertically”.</blockquote><h4>4. Conditional Rendering In React</h4><p>A basic feature of React yet when I put my knowledge of the library into the field it gave me a better understanding of when it should be used, e.g I was creating an input component to add to my contact form and as the form had 3 types of inputs (text, email and textarea) I had to add a props to the component and depending on the value of it the component will render a different type of input.</p><pre>/* Just a very simplified version of what I meant since I had other props and event handlers for some animations in my actual code (using the &lt;p&gt; as placeholders/labels and they animate whenever the input gets focus or blur events */</pre><pre>//CustomInput.js</pre><pre>render() {<br>  const inputClass = this.props.inputClass;<br>   switch(this.props.type) {<br>     case &#39;text&#39;:<br>       return(<br>         &lt;div&gt;<br>         &lt;p&gt;{this.props.placeHolder}&lt;/p&gt;<br>         &lt;input type=&quot;text&quot; name={this.props.name} /&gt;<br>         &lt;/div&gt;<br>       );<br>       break;<br>     case &#39;mail&#39;:<br>       return(<br>         &lt;div&gt;<br>           &lt;p&gt;{this.props.placeHolder}&lt;/p&gt;<br>           &lt;input type=&quot;email&quot; name={this.props.name} /&gt;<br>         &lt;/div&gt;<br>       );<br>       break;<br>     case &#39;txtArea&#39;:<br>       return(<br>         &lt;div&gt;<br>           &lt;p&gt;{this.props.placeHolder}&lt;/p&gt;<br>           &lt;textarea type=&quot;text&quot; name={this.props.name}&gt;&lt;/textarea&gt;<br>         &lt;/div&gt;<br>       );<br>       break;<br>     default:<br>      return(&lt;div&gt;Not supported type&lt;/div&gt;);<br>    }<br>  }</pre><pre>/*ContactForm.js*/</pre><pre>&lt;form&gt;<br>  &lt;CustomInput type=&quot;text&quot; name=&quot;name&quot; placeHolder=&quot;Name&quot;/&gt;<br>  &lt;CustomInput type=&quot;mail&quot; name=&quot;email&quot; placeHolder=&quot;Mail&quot;/&gt;<br>  &lt;CustomInput type=&quot;text&quot; name=&quot;subject&quot; placeHolder=&quot;Subject&quot;/&gt;<br>  &lt;CustomInput type=&quot;txtArea&quot; name=&quot;deal&quot; placeHolder=&quot;So what&#39;s the deal ?&quot;/&gt;<br>  &lt;input type=&quot;submit&quot; value=&quot;Send&quot; /&gt;<br>&lt;/form&gt;</pre><h4>5. More Components == Cleaner Code</h4><p>My plane was to make a 5 pages portfolio and I had in mind that every page should look as simple as possible thus 5 pages means 5 simple components, however I noticed that a lot of repetitive chunks of code and it began to get messy that’s when I started decomposing every part of my pages to sub-components and the code looked way readable, cleaner and appealing to the eye of reader (Javascript and CSS codes). So it’s better for me to have 15 files with a small portions of code than only 5 files with a mess of a repetitive and complex code.</p><h4>6. Chrome’s DevTools Are Life Savers</h4><ul><li><strong>device toolbar : </strong>actually I wasn’t rich enough to buy every single gadget that had a different screen size to test the look of my website on it -I highly doubt I would even if I was rich to be honest- so here is when the device toolbar come to the rescue. Many thanks to the Chrome developers !</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SbZL7s63OXykijj5NMSEWg.png" /></figure><ul><li><strong>audits : </strong>well I just happen to discover this feature while watching a <a href="https://www.youtube.com/watch?v=xLxm9RP1GbA&amp;t=582s">Youtuber reviewing some portfolios</a>, it’s a really helpful tool to keep an eye on while developing a website because it points the developer to the weak points of the page you’re working on such as SEO and performance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cpcTMPWx6kPb-5tgDGU7HQ.png" /></figure><h3>II. Non Technical Skills</h3><h4>1. To Plan What To Do Next Right After Finishing My Daily Tasks</h4><p>I felt more organized and somehow more enthusiastic waking up knowing what I’m working on that day rather than starting it without a clear goal. The satisfaction was doubled when I had to go to bed having in mind that I’ve finished what I’ve planned the night before thus better productivity.</p><h4>2. I Better Work Only One Single Hour Per Day Rather Than Not At All</h4><p>Who hasn’t that inner voice telling them to procrastinate and take the day off and then the same thing keeps happening the day after and so on ? I’ve been telling myself to work-out in the past, but each day I kept giving myself excuses to delay and then I don’t do anything by the end of the day, I felt really bad and kind of ashamed of myself before going to sleep every night until I decided to make a change which was a deal with myself :</p><blockquote>“You’re right working out is so hard and exhausting, but let’s just do it, you don’t need to put your 100% effort on it the first time you try, you got to just start it and NOW !”</blockquote><p>Now it has been more than 4 months since I made that deal and I still didn’t skip a work-out session to this day !</p><p>Same thing has been going for the development of my website, I kept delaying then I had to try to make another deal with myself and it worked out !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*Q2zn-SdyPDXPPuzGPRRE_Q.gif" /></figure><h4>3. To Take Small Breaks</h4><p>Sometimes I had to deal with some complicated parts of code or I had some weird animation that worked but not as intended. Focusing on resolving those issues for so long was a part of the problem actually, it was so stressful and I was rather ruining the code instead of fixing it. So I had to just get off the chair and go do something else, eat some fruit, talk to family, clean my room or anything else as long as it doesn’t include coding. That helped me tremendously to feel refreshed and in a way better mood to solve my problems.</p><h4>4. To Keep Looking For Inspiration</h4><p>In the process of design I kept working on a new version of each page then modify and add on it or just completely remove something and start designing it from the start until I come with a better looking version, so by the end of this phase I thought everything was perfectly fine, I’m ready to code and I won’t get back to edit the design again. Even so starting to code and getting a taste of what it looks in the browser, I had the urge to keep looking for more inspiration because some details -small details- looked like they aren’t as good as they were on the board of my prototyping tool. So even if the design is complete there should be a window for small tweaks and research to add value to some of the details of the project.</p><p>Here are my main sources of inspiration :</p><p><a href="https://codepen.io/">https://codepen.io</a></p><p><a href="https://tympanus.net/codrops/">https://tympanus.net/codrops</a></p><p><a href="https://freefrontend.com/">https://freefrontend.com</a></p><p><a href="https://www.uplabs.com/">https://www.uplabs.com</a></p><p><a href="https://dribbble.com/">https://dribbble.com</a></p><p><a href="https://www.pinterest.com/">https://www.pinterest.com</a></p><p><a href="https://www.behance.net/">https://www.behance.net</a></p><h3>Conclusion</h3><p>Working on my first professional project was really fun, I learned a lot even if it was a simple and minimal designed portfolio. Now that it’s ready to get published I feel more enthusiastic and hungry for more creativity and productivity, it’s time to make it shine with some awesome projects.</p><p>LET’S GO !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e454083424e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>