<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Marco Agas</title>
    <description>The latest articles on Forem by Marco Agas (@marcojhb).</description>
    <link>https://forem.com/marcojhb</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F654033%2F8b6ee17c-4f4a-40c4-80ee-4ccd4dc00fab.jpeg</url>
      <title>Forem: Marco Agas</title>
      <link>https://forem.com/marcojhb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/marcojhb"/>
    <language>en</language>
    <item>
      <title>Top 5 CSS Chrome Extensions</title>
      <dc:creator>Marco Agas</dc:creator>
      <pubDate>Tue, 15 Nov 2022 08:16:43 +0000</pubDate>
      <link>https://forem.com/marcojhb/top-5-css-chrome-extensions-532i</link>
      <guid>https://forem.com/marcojhb/top-5-css-chrome-extensions-532i</guid>
      <description>&lt;p&gt;While going through my front-end journey, I realised that I have picked up quite a few useful Chrome extensions that help me understand how website are built.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://chrome.google.com/webstore/detail/whatfont/jabopobgcpjmedljpbcaablpmlmfcogm"&gt;1. WhatFont - Find fonts fast&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3DFYxa7j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rafyy6cbson2w2es4no1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3DFYxa7j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rafyy6cbson2w2es4no1.jpg" alt="WhatFont" width="640" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I use this on an almost regular basis, along with Font Ninja (see below). So often, I see a beautiful site but I don't know what font they're using. WhatFont is very basic, but there is beauty in that. Simply click on the icon and when you hover over fonts, it'll show you what they are.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://chrome.google.com/webstore/detail/fonts-ninja/eljapbgkmlngdpckoiiibecpemleclhh"&gt;2. Fonts Ninja - Save fonts you love&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IlQ9e6qq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jnbw962jixcklaiwyc1j.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IlQ9e6qq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jnbw962jixcklaiwyc1j.jpg" alt="Fonts Ninja" width="640" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Same as WhatFont, but with some added perks. These include the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lists all the fonts on a page&lt;/li&gt;
&lt;li&gt;Allows you to try out the font in a small text box&lt;/li&gt;
&lt;li&gt;Saves your favourite fonts&lt;/li&gt;
&lt;li&gt;Detailed info about the font&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Download fonts straight from your browser&lt;/strong&gt; using the Fonts Ninja application ($29/year, but allows you to download 20 fonts as a trial)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Personally, I find it a bit bulky for simple day-to-day tasks, but it's useful when you want to save a bunch of fonts to use later.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://chrome.google.com/webstore/detail/colorzilla/bhlhnicpbhignbdhedgjhgdocnmhomnp"&gt;3. ColorZilla - Find a color on a site&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--V3meFUs6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nqj4fryxjog91ftigiw6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--V3meFUs6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nqj4fryxjog91ftigiw6.jpg" alt="ColorZilla" width="640" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This was used multiple times per day, but eventually it was taken over by &lt;a href="https://www.techrepublic.com/article/how-to-activate-and-use-color-picker-in-windows-10-powertoys/#:~:text=The%20keyboard%20combination%20shortcut%20of,and%20left%20click%20your%20mouse."&gt;Microsoft's Color Picker&lt;/a&gt;. Again, simple and to the point, ColorZilla allows you to quickly find a color on a site. Clicking on the colour also copies the HEX code, so you can easily use it on another application.&lt;/p&gt;

&lt;p&gt;ColorZilla also saves all the most recently found colours, so you can always go back to find the ones you need. It also comes with a page colour analyser, so you can find all the colours used on a website. There are some other features too, however, I didn't find them to be of much use (CSS gradient generator, palette browser).&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://chrome.google.com/webstore/detail/builtwith-technology-prof/dapjbgnjinbpoindlpdmhochffioedbn"&gt;4. BuiltWith Technology Profiler - Find what's under the hood&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hyX5byzX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3r7nxc0ibyj04m1nzun4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hyX5byzX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3r7nxc0ibyj04m1nzun4.jpg" alt="BuiltWith Technology Profiler" width="640" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After finding myself continuously right-clicking to inspect various website components, I realised that there must be a quicker solution. BuiltWith does have a website, but the Chrome extension works just as well and you don't need to leave the site you are currently on.&lt;/p&gt;

&lt;p&gt;BuiltWith gives you a breakdown of the tools and technology used for the following categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Analytics and tracking&lt;/li&gt;
&lt;li&gt;Frameworks&lt;/li&gt;
&lt;li&gt;Content Delivery Network (CDN)&lt;/li&gt;
&lt;li&gt;Mobile&lt;/li&gt;
&lt;li&gt;Verified Links&lt;/li&gt;
&lt;li&gt;SSL Certificates&lt;/li&gt;
&lt;li&gt;Web Servers&lt;/li&gt;
&lt;li&gt;Document Encoding&lt;/li&gt;
&lt;li&gt;Document Standards&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also comes with a range of other features (i.e. Meta, Details, Relationships, Redirects and more), however, it requires you to be signed into their services. It's free, but, it does the job I require so I felt it wasn't necessary to be signed in.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://chrome.google.com/webstore/detail/visbug/cdockenadnadldjbbgcallicgledbeoc"&gt;5. VisBug Technology Profiler - Open source browser design tools&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lqN31QjE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mc0dy7k4ykpkf4tuediv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lqN31QjE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mc0dy7k4ykpkf4tuediv.jpg" alt="VisBug" width="556" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is almost too much to cover with this extension. It essentially allows you to open up a websites CSS and allow to edit or simply view information about it.&lt;/p&gt;

&lt;p&gt;For example, you can do the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inspect - hover over elements to view their classes and CSS properties&lt;/li&gt;
&lt;li&gt;Guides - Verify alignment and measure distances&lt;/li&gt;
&lt;li&gt;Accessibility - hover over elements to view its contrast ratio and WCAG compliance&lt;/li&gt;
&lt;li&gt;Move - click on an element and drag it around its parent container&lt;/li&gt;
&lt;li&gt;Margin / Padding - click on an element to add some margin or padding to it&lt;/li&gt;
&lt;li&gt;Flexbox Align - Create or modify flexbox direction, distribution, order and wrapping&lt;/li&gt;
&lt;li&gt;Hue Shift - Change background or foreground hue, brightness, saturation and opacity&lt;/li&gt;
&lt;li&gt;Shadow - Create and adjust position, blur and opacity of a box shadow&lt;/li&gt;
&lt;li&gt;Position - move elements around&lt;/li&gt;
&lt;li&gt;Font styles - Change the size, alignment, weight and more&lt;/li&gt;
&lt;li&gt;Edit text - edit the text within an elements&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;There are many great front-end Chrome extensions out there, and these are just a few. I be releasing more over the next few days, but if you have a favourite - let me know below!&lt;/p&gt;

</description>
      <category>css</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Improve your SEO through Google Data Studio</title>
      <dc:creator>Marco Agas</dc:creator>
      <pubDate>Mon, 10 Oct 2022 12:18:48 +0000</pubDate>
      <link>https://forem.com/marcojhb/improve-your-seo-through-google-data-studio-14oh</link>
      <guid>https://forem.com/marcojhb/improve-your-seo-through-google-data-studio-14oh</guid>
      <description>&lt;p&gt;While improving your front-end skills, a good way to collect your data is through Google Data Studio. I have been using it for a year now and I'd like to share some ideas for you to try.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Connect your Google Analytics and Google Search Console sources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gtY5ohdV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oczod7322h444wwhfqjn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gtY5ohdV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oczod7322h444wwhfqjn.jpg" alt="Google Connectors" width="880" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If SEO is a big importance to you, why not collate everything into one report? Yes, you could create an API to connect everything, but for basic reports, Google Data Studio makes it a lot easier.&lt;/p&gt;

&lt;p&gt;To connect Google Connectors, simply select Add Data from the top bar.&lt;/p&gt;

&lt;p&gt;I usually connect a variety of &lt;a href="https://thejc.co.za/blog/pros-cons-google-data-studio/"&gt;Google services to one report&lt;/a&gt;. If you created a portfolio site, you could do the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;See where people are coming from when viewing your site&lt;/li&gt;
&lt;li&gt;View top keywords people are typing in Google to be used as blog post content&lt;/li&gt;
&lt;li&gt;Set up conversion tracking through Google Tag Manager and then view those conversions within the report (e.g. how many people are contacting you each month and from which sources)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Build visualisations to help understand your website
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xQMx1my6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84xiru8q21sew8mieeun.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xQMx1my6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84xiru8q21sew8mieeun.jpg" alt="Google Data Studio Visualisations" width="880" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Often when you have built a website, it might be hard to see how people are interacting with your website. You can use services like &lt;a href="https://www.hotjar.com/"&gt;HotJar&lt;/a&gt; or &lt;a href="https://clarity.microsoft.com/"&gt;Clarity&lt;/a&gt;, but those only show some of the whole story.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://thejc.co.za/blog/pros-cons-google-data-studio/"&gt;Charts and tables&lt;/a&gt; play a great way in analysing various parts of your website. As mentioned above, connecting to Google Analytics or Google Search lead you into seeing what is happening under the service. For example, your &lt;strong&gt;engagement rate&lt;/strong&gt; can be viewed when determining how effective your pages are.&lt;/p&gt;

&lt;p&gt;You don't have to rely on one set of datasets though. Google Data Studio also allows you to blend data, which takes your analytics one step further.&lt;/p&gt;

&lt;p&gt;On-site and even Technical SEO can be measured in Google Data Studio, so playing with the various services can go a long way in improving your website.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Social Media analytics can be combined too
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5MUqfunJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7vegguk7z85p2a0ur58g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5MUqfunJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7vegguk7z85p2a0ur58g.jpg" alt="3rd party connectors" width="880" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Usually, website analytics only show off one slice of the pie. Another piece comes from your social media. For example, if you have created a blog site but get annoyed manually going to each platform, why not do it all under one roof?&lt;/p&gt;

&lt;p&gt;Google Data Studio allows you to connect to &lt;a href="https://thejc.co.za/blog/pros-cons-google-data-studio/"&gt;other 3rd party connectors&lt;/a&gt; (e.g. &lt;a href="https://www.powermyanalytics.com/"&gt;Power My Analytics&lt;/a&gt;). Although most aren't free, if you are part of an agency, you get get the clients to pay for these services.&lt;/p&gt;

&lt;p&gt;Off-site SEO can still be monitored in Google Data Studio, and services like these really help.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;I'm coming from a SEO perspective when it comes to front-end design. Therefore, services like Google Analytics, Google Tag Manager, and now Google Data Studio play a big role in improving the SEO of my websites.&lt;/p&gt;

&lt;p&gt;For any questions about Google Data Studio let me know below or read the full post about the pros and cons of using Google Data Studio &lt;a href="https://thejc.co.za/blog/pros-cons-google-data-studio"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>googlecloud</category>
      <category>seo</category>
    </item>
    <item>
      <title>What is your coding music?</title>
      <dc:creator>Marco Agas</dc:creator>
      <pubDate>Wed, 31 Aug 2022 06:14:01 +0000</pubDate>
      <link>https://forem.com/marcojhb/what-is-your-coding-music-4p6m</link>
      <guid>https://forem.com/marcojhb/what-is-your-coding-music-4p6m</guid>
      <description>&lt;p&gt;I love finding new music to code to! I usually add songs to my work/coding playlist, but enjoy finding new fresh songs.&lt;/p&gt;

&lt;p&gt;Link to my &lt;a href="https://open.spotify.com/playlist/0hDYtUHsokmvuuRNhvfTVa?si=44aee0c5e30d4ba4"&gt;main playlist&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Playlist mood&lt;/strong&gt;: Instrumental and Electronic&lt;br&gt;
&lt;strong&gt;Top Genre&lt;/strong&gt;: Dance/Electronic&lt;br&gt;
&lt;strong&gt;Top sub-genre&lt;/strong&gt;: Tech House&lt;/p&gt;

&lt;p&gt;Leave yours in the comments below!&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>music</category>
    </item>
    <item>
      <title>People who went from WordPress to HTML/CSS/JS/etc - what's your story?</title>
      <dc:creator>Marco Agas</dc:creator>
      <pubDate>Fri, 18 Feb 2022 05:05:45 +0000</pubDate>
      <link>https://forem.com/marcojhb/people-who-went-from-wordpress-to-htmlcssjsetc-whats-your-story-28pi</link>
      <guid>https://forem.com/marcojhb/people-who-went-from-wordpress-to-htmlcssjsetc-whats-your-story-28pi</guid>
      <description>&lt;p&gt;I've been building WordPress sites for around 2 years in my digital marketing agency. It helps because I can get a site up and running quickly and editing is simple. However, I've wanted to expand my web development knowledge and want to slowly move away from pure WordPress sites.&lt;/p&gt;

&lt;p&gt;Has anyone here ever done this? Or did you just get better with WordPress? Is it better to join a web development company and grow in there as a junior web developer?&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Using reduce to find the oldest age in an array</title>
      <dc:creator>Marco Agas</dc:creator>
      <pubDate>Wed, 16 Feb 2022 06:23:08 +0000</pubDate>
      <link>https://forem.com/marcojhb/using-reduce-to-find-the-oldest-age-in-an-array-18k3</link>
      <guid>https://forem.com/marcojhb/using-reduce-to-find-the-oldest-age-in-an-array-18k3</guid>
      <description>&lt;p&gt;In this post, I will explain how to find the oldest person in an array. Because it is an array, we can make use of the reduce method in order to return a single name, i.e. the oldest person.&lt;/p&gt;

&lt;p&gt;The following was taken from The Odin Project JavaScript example for &lt;a href="https://github.com/TheOdinProject/javascript-exercises/tree/main/12_findTheOldest"&gt;findTheOldest&lt;/a&gt; with help from &lt;a href="https://github.com/iVuDang/The-Odin-Project-JavaScript-Exercises/tree/main/findTheOldest"&gt;iVuDang's method&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 0 - Create the Initial Array
&lt;/h2&gt;

&lt;p&gt;Let's start with the array:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;people&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Carly&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;yearOfBirth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1942&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;yearOfDeath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1970&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Ray&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;yearOfBirth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1962&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;yearOfDeath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2011&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Jane&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;yearOfBirth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1912&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;yearOfDeath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1941&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 1 - Get Age Function
&lt;/h2&gt;

&lt;p&gt;Next, we want to work out who is the oldest year. If someone didn't have a year of death, then we would like to return the current year.&lt;/p&gt;

&lt;p&gt;We can start with a function to calculate the age of each person:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getAge&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;birth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;death&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;death&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;death&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;getFullYear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// return current year using Date()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;death&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;birth&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// else just return age using death minus birth&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2 - Find The Oldest
&lt;/h2&gt;

&lt;p&gt;Now we'd like to create a function in order to find the oldest person. We'll use &lt;code&gt;reduce&lt;/code&gt; to return a single value, i.e. the person's name.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reduce Syntax
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;array.reduce(function(total, currentValue, currentIndex, arr), initialValue)&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Find The Oldest Function
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;findTheOldest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
&lt;span class="c1"&gt;// Use reduce method to reduce the array by comparing current age with previous age&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;oldest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;currentPerson&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// oldestAge gets the age of the oldest person's year of death and birth&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;oldestAge&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getAge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;oldest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;yearOfBirth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;oldest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;yearOfDeath&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// currentAge gets the age of the current person's year of death and birth&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;currentAge&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getAge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;currentPerson&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;yearOfBirth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;currentPerson&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;yearOfDeath&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// return name if current age is older than the oldest age, else return current oldest age&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;oldestAge&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;currentAge&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;currentPerson&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;oldest&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;findTheOldest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;people&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Ray&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I'm still learning JavaScript day-by-day, but using reduce was quite tricky. I learnt that you don't need to use all the parameters for reduce if you don't need to, you can simply use the previous value and the current value.&lt;/p&gt;

&lt;p&gt;Also, you can use something like an if statement to compare the current oldest to the new oldest age, and return the oldest one from there.&lt;/p&gt;

&lt;p&gt;Hope you learnt something today, happy coding! 🎉&lt;/p&gt;

&lt;p&gt;Here's my &lt;a href="https://dev.tourl"&gt;GitHub profile&lt;/a&gt; if you'd like to follow my journey 🗺️&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@naassomz1?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Naassom Azevedo&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/group-of-people?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Create Horizontal Background Text on Scroll</title>
      <dc:creator>Marco Agas</dc:creator>
      <pubDate>Mon, 31 Jan 2022 20:14:34 +0000</pubDate>
      <link>https://forem.com/marcojhb/how-to-create-horizontal-background-text-on-scroll-3c0</link>
      <guid>https://forem.com/marcojhb/how-to-create-horizontal-background-text-on-scroll-3c0</guid>
      <description>&lt;p&gt;I was struggling to find a way to do this after seeing it in &lt;a href="http://pierregrosjean.fr/" rel="noopener noreferrer"&gt;Pierre's portfolio&lt;/a&gt; page. I really enjoyed the look of it, and wanted to try recreate it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftg7nlt3etbr2t1mmeoqr.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftg7nlt3etbr2t1mmeoqr.gif" alt="horizontal text on scroll"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm still very early in my front-end skills, but thought I'd share it anyway.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: HTML
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create a simple HTML page and add your text content
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;
This can be any text you want, can be interesting, 
fun, exciting, or just something about yourself
&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add a div beneath it, this will be your scrolling text and call it something useful like &lt;code&gt;scroll-text&lt;/code&gt;.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;
This can be any text you want, can be interesting, 
fun, exciting, or just something about yourself
&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"scroll-text"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"bg-text"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;WELCOME&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: CSS
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;For the sake of this post, I just made the body very long, so that you can see the effect of the scrolling.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5000px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#272727&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;"DM Sans"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Then I added in some elements to make the main text look better. I used min-height as to keep it in the center when full screen on desktop, but preventing it from going off screen on mobile.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;min-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;14rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;For the text, I wanted it to be quite fluid. I used this site called &lt;a href="https://utopia.fyi/type/calculator/" rel="noopener noreferrer"&gt;Utopia&lt;/a&gt; to get a fluid type scale.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;header&lt;/span&gt; &lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;clamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;2.85rem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2.18rem&lt;/span&gt; &lt;span class="err"&gt;+&lt;/span&gt; &lt;span class="m"&gt;3.37vw&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;4.58rem&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#fff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Last, I edited the &lt;code&gt;scroll-text&lt;/code&gt; container and &lt;code&gt;bg-text&lt;/code&gt; to make sure it was large and outlined. I used &lt;code&gt;white-space: nowrap&lt;/code&gt; to prevent any wrapping of the text, and &lt;code&gt;transition: all 0.5s&lt;/code&gt; to make sure it scrolled nicely. For &lt;code&gt;bg-text&lt;/code&gt;, I added in extra functionality to make sure the &lt;code&gt;fill-color&lt;/code&gt; matched the background.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.scroll-text&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;fixed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-800px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;white-space&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;nowrap&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;-1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;transition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;all&lt;/span&gt; &lt;span class="m"&gt;0.5s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.bg-text&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;40rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;122&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;122&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;122&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;-webkit-text-fill-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#272727&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* Will override color (regardless of order) */&lt;/span&gt;
  &lt;span class="nl"&gt;-webkit-text-stroke-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;-webkit-text-stroke-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;70&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;70&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;70&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: JavaScript
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;This is the easy part. I added a querySelector for the .scroll-text class.&lt;/li&gt;
&lt;li&gt;I then created an on scroll event function that checks the position of the window.&lt;/li&gt;
&lt;li&gt;Then a simple style change in JS which changes the horizontal position by x pixels depending on your preference.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;scrollText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.scroll-text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onscroll&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;scrollY&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// console.log(pos);&lt;/span&gt;
    &lt;span class="nx"&gt;scrollText&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="s2"&gt;`-&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;px`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftg7nlt3etbr2t1mmeoqr.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftg7nlt3etbr2t1mmeoqr.gif" alt="horizontal text on scroll"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And there you have it. I might have made a few errors or poor practices, but I'm still new and learning as I go. Hope you learned something at least :)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/marcojhb/pen/podvVxZ" rel="noopener noreferrer"&gt;CodePen Link&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>tutorial</category>
      <category>javascript</category>
      <category>animation</category>
    </item>
    <item>
      <title>Building Motivation through Coding Affirmations &amp; Achievement Lists</title>
      <dc:creator>Marco Agas</dc:creator>
      <pubDate>Mon, 31 Jan 2022 05:56:28 +0000</pubDate>
      <link>https://forem.com/marcojhb/building-motivation-through-coding-affirmations-achievement-lists-18b4</link>
      <guid>https://forem.com/marcojhb/building-motivation-through-coding-affirmations-achievement-lists-18b4</guid>
      <description>&lt;p&gt;I've started my front-end developer journey, and decided I'd share my way of helping get through the times I'm feeling demotivated and unsure I'm going into the right direction.&lt;/p&gt;

&lt;p&gt;I feel that affirmations and achievement awareness are a great way of helping here. It's definitely helped me realise that I'm making progress so far.&lt;/p&gt;

&lt;h2&gt;
  
  
  Affirmations
&lt;/h2&gt;

&lt;p&gt;You can write these down, just say them out loud, or put them into a spreadsheet in Notion (that's what I did).&lt;/p&gt;

&lt;h3&gt;
  
  
  How to use these affirmations
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Either say these out loud or just in your head&lt;/li&gt;
&lt;li&gt;Go through each one, think about it, and then move onto the next one. Don't rush the process&lt;/li&gt;
&lt;li&gt;Repeat each one, total time can be just 5 times each. Start slow, and then you can build up to 2-5 minutes if needed&lt;/li&gt;
&lt;li&gt;Recommended - write down how long you've spent doing your affirmations and try to slowly increase this time&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  My affirmation list - C.A.R.E
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🐢 &lt;strong&gt;C&lt;/strong&gt;onsistency - I can’t expect to rush my learning, only through consistency&lt;/li&gt;
&lt;li&gt;👀 &lt;strong&gt;A&lt;/strong&gt;lways learning - I understand that progress is always being made, even if I can’t see it&lt;/li&gt;
&lt;li&gt;🏖️ &lt;strong&gt;R&lt;/strong&gt;elax - I'm busy enjoying my life, I don’t need to stress about coding&lt;/li&gt;
&lt;li&gt;🎉 &lt;strong&gt;E&lt;/strong&gt;njoyment - The more I learn, the more I enjoy coding&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I use Notion, so here is an example below (every time I complete an affirmation I tick off a box and increment the times I've completed one).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo0b0lh0aysnontmfbdi0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo0b0lh0aysnontmfbdi0.jpg" alt="Coding affirmations"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: these can be added/edited/removed as you see fit. These are just a few simple affirmations to help get you going and motivated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Achievement List
&lt;/h2&gt;

&lt;p&gt;Another way to help keep you motivated is through an achievement list (or lists). Writing down your achievements helps you realise that you are learning and making progress, no matter how much or little it is.&lt;/p&gt;

&lt;p&gt;The process is simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Write down daily (or weekly) what you have completed in your coding journey. It can be as simple as "Writing 10 lines of code" or more complex, e.g. "Completed my to-do list app"&lt;/li&gt;
&lt;li&gt;Make sure to keep consistent and don't get discouraged if some days aren't as good as others. The point is to highlight your progress.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Below is an example of how I track it using Notion. Very simple and can be edited later.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx0a8a4sftgknhuowmlpa.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx0a8a4sftgknhuowmlpa.jpg" alt="Coding Achievements in Notion"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: don't get discouraged if you miss a day. Consistency is key, but so is not stressing if you miss a day.&lt;/p&gt;

&lt;p&gt;I usually complete my affirmations and then my achievement list afterwards every day (except maybe weekends).&lt;/p&gt;

&lt;p&gt;If you have any other tips for motivation, let me know in the comments section.&lt;/p&gt;

&lt;p&gt;Happy coding! 🎉&lt;/p&gt;

&lt;p&gt;Special thanks to &lt;a href="https://theriseapproach.com/" rel="noopener noreferrer"&gt;Camille Daligand&lt;/a&gt; for the idea and suggestions!&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>motivation</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
