<?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: Ashley Young</title>
    <description>The latest articles on Forem by Ashley Young (@messy-ashy).</description>
    <link>https://forem.com/messy-ashy</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%2F369231%2F3cb51539-0fe7-48c4-baf0-b0bbd628ef76.jpeg</url>
      <title>Forem: Ashley Young</title>
      <link>https://forem.com/messy-ashy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/messy-ashy"/>
    <language>en</language>
    <item>
      <title>50 Projects in 50 Days, 5/5 there! 🌻</title>
      <dc:creator>Ashley Young</dc:creator>
      <pubDate>Wed, 19 May 2021 14:40:17 +0000</pubDate>
      <link>https://forem.com/messy-ashy/50-projects-in-50-days-5-5-there-3fb2</link>
      <guid>https://forem.com/messy-ashy/50-projects-in-50-days-5-5-there-3fb2</guid>
      <description>&lt;p&gt;Yesssss, I made it! Not exactly 50 projects for 50 days, but almost. Doing a small or medium project a day has not only improved my DOM skills massively, but it also taught me that discipline is the only way forward, as you won't always be motivated to code, especially when days start to be a bit brighter and warmer. But let's jump into my last projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;41st Project: Validate Account&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;in this project we used Webkit, something that I had always putting off learning, probably just because I didn't fancy writing too many ---'s 😂, as at work we already use BEM (block, element, modifier) methodologies. Researching it, I discovered that is is a simple HTML and CSS web browser rendering engine (used by popular browsers such as Chrome and Safari). Also, from what I understood from a Stack Overflow answer, it is used as a prefix on CSS selectors for properties that you only want to use on a certain engine....and many hope that this specification goes away eventually.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.code::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The actual JavaScript code wasn't super hard, though I hard a rather hard time understanding why the key I needed was keydown rather than keyup. Yes, I still have some issues with some event listeners when it comes to keys events, as so much stuff has also now been deprecated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;codes.forEach((code, index) =&amp;gt; {
    code.addEventListener('keydown', (e) =&amp;gt; {
        if(e.key &amp;gt;= 0 &amp;amp;&amp;amp; e.key &amp;lt;= 9) {
            codes[index].value = '';
            setTimeout(() =&amp;gt; codes[index + 1].focus(), 10)
        } else if (e.key === 'Backspace') {
            setTimeout(() =&amp;gt; codes[index - 1].focus(), 10)
        }
    });
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;42nd Project: Live User Filter&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This project was similar to the GitHub profiles one, though in this case we query the Randomuser API instead. The aim is to have a text input where the user types either a name or a location, and then the code will filter by the inputted words, and show a picture with the related info.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function getData() {
    const res = await fetch('https://randomuser.me/api?results=50')
    const { results } = await res.json()
    result.innerHTML = ''
    results.forEach(user =&amp;gt; {
        const li = document.createElement('li');
        listItems.push(li);
        li.innerHTML = `
            &amp;lt;img src="${user.picture.large}" alt="${user.name.first}"&amp;gt;
            &amp;lt;div class="user-info"&amp;gt;
                &amp;lt;h4&amp;gt;${user.name.first} ${user.name.last}&amp;lt;/h4&amp;gt;
                &amp;lt;p&amp;gt;${user.location.city}, ${user.location.country}&amp;lt;/p&amp;gt;
            &amp;lt;/div&amp;gt;
        `
        result.appendChild(li);
    });
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;43rd Project: Feedback UI Design&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Well, this was a change! I learnt about Event Bubbling in this project, as a way to avoid another forEach loop. Event bubbling is a funny name to refer to the actual bubbling up of events from the DOM tree up. It is very interesting and also very functional, as it saves up a lot of code and repetition. Essentially, instead of targeting each child element of a parent node/element, you attach an eventListener to the &lt;strong&gt;parentNode&lt;/strong&gt; or &lt;strong&gt;parentElement&lt;/strong&gt;, so that it'll act onto how many children you set it to.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;panel.addEventListener('click', (e) =&amp;gt; {
    if (e.target.parentNode.classList.contains('rating')) {            //If the parent node contains rating class
        removeActive();
        e.target.parentNode.classList.add('active');
        defaultRating = e.target.nextElementSibling.innerHTML
    };
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;44th Project: Custom Range Slider&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This project was harder than I expected, with a lot of 'edge' cases to account for, such as using -webkit to cater for different browsers, and a couple new methods I wasn't aware of.&lt;br&gt;
The goal of the project is to move the label of a progress bar toward whichever direction I am dragging the circle towards. The two new methods I have learnt here are: the window's getComputedStyle and the CSS method getPropertyValue. The first returns all of the CSS properties applied to the element I target, and the second gets me whichever property I want from it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const range = document.getElementById('range');

range.addEventListener('input', (e) =&amp;gt; {
    const value = +e.target.value;
    const label = e.target.nextElementSibling;

    const rangeWidth = getComputedStyle(e.target).getPropertyValue('width');
    const labelWidth = getComputedStyle(label).getPropertyValue('width');

    const numRangeWidth = +rangeWidth.substring(0, rangeWidth.length - 2);
    const numLabelWidth = +rangeWidth.substring(0, labelWidth.length - 2);

    const max = e.target.max;
    const min = e.target.min;

    const left = value * (numRangeWidth / max) - numLabelWidth / 2;
    label.style.left = `${left}px`

    label.innerHTML = value;
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;45th Project: Netflix Navigation&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This mobile menu navigation reminded me of the 14th project, which was roughly the same, just with a bit less JavaScript code and a rotating effect. The aim of this project was instead to replicate Netflix's mobile menu using the burger menu icon.&lt;br&gt;
As I said previously, l have now understood the general concepts used to do the main effects, so I am focusing here on the smaller details and properties such as text-transform, which is the CSS version of the JavaScript method &lt;strong&gt;&lt;em&gt;.toUpperCase()&lt;/em&gt;&lt;/strong&gt;. I also played around with transition-delay and text-decoration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.nav-black {
    background-color: rgb(34, 31, 31);
    width: 60%;
    max-width: 480px;
    min-width: 320px;
    transition-delay: 0.3s;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;46th Project: Quiz App&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This was a fun and rather fun one. The data is in an array ready to be queried, so it makes it easier for the data to be grabbed. I got to practice my ever-lasting issues with indexes and iteration, which was good, though I think that what makes it hard for me to distinguish between indexes and variables, is that indexes (which in my mind are integers) sometimes are called with string names.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;submitBtn.addEventListener('click', () =&amp;gt; {
    const answer = getSelected();
    if (answer) {
        if (answer === quizData[currentQuiz].correct) {
            score++;
        }
        currentQuiz++;

        if (currentQuiz &amp;lt; quizData.length) {
            loadQuiz()
        } else {
            quiz.innerHTML = `&amp;lt;h2&amp;gt;You answered correctly at ${score} / ${quizData.length} questions&amp;lt;/h2&amp;gt;`
        }
    }
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, on line 4, I am checking whether the answer which I previously obtained by checking its ID, correspond to the correct one for whichever page of the quiz I am looking at. In this case, currentQuiz is the index which I use to identify which page of the quiz I am on. The index then gets increased on line 82, to move to the next quiz.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;47th Project: Testimonial Box&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cute little project to display testimonials in boxes, and with a progress bar to allow the user to see how long it takes to disappear and move to the next profile. The only new thing here was the animation of the progress bar, which we animated via CSS using a linear infinite animation of 8 seconds, which we defined in @keyframes, so that it would effectively grow from 0% to 100% in on the X (horizontal) axis, starting from the left side (if left without transform-origin, it would start from the middle of the bar and grow towards both directions).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.progress-bar {
    background-color: white;
    height: 4px;
    width: 100%;
    animation: grow 8s linear infinite;
    transform-origin: left;
}

@keyframes grow {
    0% {
        transform: scaleX(0);
    }
}

@media(max-width: 768px) {
    .fa-quote {
        display: none;
    }

    .testimonial-container {
        padding: 20px 30px;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;48th Project: Random Image Feed&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A very short and straight to the point project, not much different from what I have been doing already in the other projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;49th Project: Todo List&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Aaaaah and we eventually got there. The prettier spin-off of the notes app, but I like styling DOM elements so it was rather fulfilling in the end. The only thing that changes from a normal todo list is the fact that I am making use of contextmenu to perform the deletion operation. This simply means that I only had to right click on one item so that it disappeared from the DOM, rather handy!! On the other hand, by using the usual click event, I draw a line through, as I apply the following css: text-decoration: &lt;strong&gt;&lt;em&gt;line-through&lt;/em&gt;&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.todos li.completed {
    color: grey;
    text-decoration: line-through;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I also like that we worked a bit on the localStorage, by setting and getting the key-value pairs to and from it. After each event has ended, we update the localStorage so that it reflects the changes that we have made.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function updateLocalStorage() {
    todosElement = document.querySelectorAll('li');
    const todos = [];
    todosElement.forEach(todoElement =&amp;gt; {
        todos.push({
            text: todoElement.innerText,
            completed: todoElement.classList.contains('completed')
        });
    });
    localStorage.setItem('todos', JSON.stringify(todos));
};

function addTodo(todo) {
    let todoText = input.value;
    if (todo) {
        todoText = todo.text
    };

    if (todoText) {
        const todoElement = document.createElement('li');
        if (todo &amp;amp;&amp;amp; todo.completed) {
            todoElement.classList.add('completed')
        }
        todoElement.innerText = todoText;
        todoElement.addEventListener('click', () =&amp;gt; {
            todoElement.classList.toggle('completed');
            updateLocalStorage();
        });
        todoElement.addEventListener('contextmenu', (e) =&amp;gt; {
            e.preventDefault();
            todoElement.remove();
            updateLocalStorage();
        });
        todosUL.appendChild(todoElement);
        input.value = '';
        updateLocalStorage();
    };
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;50th Project: Insect Catch Game&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes we made it! It wasn't exactly 50 days, but almost! This last project was one of the longest ones, with a lot of DOM functionality and manipulations which I found fun, but that I think I might done with now... not sure if you noticed but toward the end of the projects, stuff got a tad repetitive, though still very useful and engaging.&lt;/p&gt;

&lt;p&gt;All in all it was a very good exercise, I learnt a lot and I am sure that after over 15/20 hours spent on this set of projects, I will not forget anything 😊&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
    </item>
    <item>
      <title>50 Projects in 50 Days, 4/5 there! 🌻</title>
      <dc:creator>Ashley Young</dc:creator>
      <pubDate>Fri, 07 May 2021 08:29:00 +0000</pubDate>
      <link>https://forem.com/messy-ashy/50-projects-in-50-days-4-5-there-2157</link>
      <guid>https://forem.com/messy-ashy/50-projects-in-50-days-4-5-there-2157</guid>
      <description>&lt;p&gt;Time flies, I have now completed 40 small projects whilst renovating a property and moving houses. Safe to say there have been hiccups along the way in both cases 😂&lt;br&gt;
I am finally much more comfortable working with the DOM and with string interpolations! Yay!&lt;br&gt;
This is what I have been to over the past 10-ish days:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;31st Project: Password Generator&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Okay, this project has been one of the best so far, because it is much more than a simply presentational effort. The aim is to build a password generator which ensures that 5 conditions are met: the password needs to be longer than 20 characters, and it needs to include both uppercase and lowercase letters, symbols and numbers.&lt;br&gt;
To generate a random element of each of these categories, we make use of the &lt;strong&gt;ASCII chart&lt;/strong&gt; and of the &lt;strong&gt;String object's 'fromCharCode'&lt;/strong&gt;'s property.&lt;br&gt;
To generate the uppercase and lowercase letters, we take a random number and multiply it by 26, due to the length of the alphabet. We then add 97 or 65, to the lower and upper case instances respectively. This is because the first lowercase letter - a -, has the symbol 97 and the first uppercase letter A has the code of 65.&lt;br&gt;
We proceed to do the same for the numbers, (though we obviously limit our random number to 10), and we use the code of 48 in this case, as 0 has the char code of 48.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flzbxgleop013kjp1aspd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flzbxgleop013kjp1aspd.png" alt="Alt Text" width="800" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even though this is not the only way to generate random characters, I think this is one of the simplest methods to do it.&lt;br&gt;
The actual function to generate the password wasn't the easiest to wrap my head round, to be fair.&lt;br&gt;
Essentially, if no condition has been checked or filled in, return nothing as a password, otherwise loop through whatever the length of the conditions is (4 + the length in my case) and for each type that is true, call the relative password to generate a random character. Though the concept is rather easy, there was a lot of looping and forEaching which I still need to work on 😊&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;32nd Project: Good, Cheap and Fast&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is so very true that a project can't be three things at the same time: good, cheap and fast. You can only pick two out of these three, like every good project manager knows. This project was a relatively simple one, though instead of using simple checkboxes, we created a rolling ball which uses an animation to be slided from left to right, and back.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtwkr7n9kkekki6ru72u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtwkr7n9kkekki6ru72u.png" alt="Alt Text" width="800" height="484"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We used two @keyframes queries to manage the slideOn and the slideOff animations. slideOn is the opposite of slideOff, and the transformations use the translateX property to slide the ball back and forth according to where within the div is placed.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx7u4o639zmbhiovdpfhg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx7u4o639zmbhiovdpfhg.png" alt="Alt Text" width="800" height="941"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;33rd Project: Notes App&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here we had yet another very useful project, a cute notes app.  It might sound as trite and overused, though this time we used a couple new things, and I did learn that I can't grab the value of a 'div' as I can do for a textarea (lol), but I can get the content of the div by looking up its innerHTML value.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flaxa9j3izs2nvkemb5gv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flaxa9j3izs2nvkemb5gv.png" alt="Alt Text" width="784" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first new thing I came across is the Marked library. &lt;a href="https://marked.js.org/" rel="noopener noreferrer"&gt;https://marked.js.org/&lt;/a&gt;&lt;br&gt;
We used it as it's rather light-weight and as it implements all markdown features from the supported flavours &amp;amp; specifications of the case. In our case we simply wrapped the text around it.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj0jj4e8psta7oqkf3lu6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj0jj4e8psta7oqkf3lu6.png" alt="Alt Text" width="800" height="269"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I use localStorage in my daily job, so I was rather comfortable using this storage for this app, as well. What is important to know about localStorage (which can be accessed in the Application tab in the Developers' Tools), is that we can only store a key-value pair of string type. Should I want to store an array or an object as a value, I would have to stringify the value (e.g. using JSON.stringify). sessionStorage is another similar way of storing data, though the data will be lost when I refresh my browser.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe6gmp0mnyn6isy53qy8f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe6gmp0mnyn6isy53qy8f.png" alt="Alt Text" width="800" height="238"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;34th Project: Animated Countdown&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Okay so I learnt another way to center a div (lol, probably my most googled CSS-related problem). Basically, just position it fixed within the page and assign a top and left 50% to it. Then, as you want to center the whole element and not just the left side of it, you will have to transform: translate(-50%, -50%), so that it actually is in center of the page (or element) itself.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1abd7ewjn9n7k0adzmwr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1abd7ewjn9n7k0adzmwr.png" alt="Alt Text" width="646" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also realised that there is an event listener called animationend, which is fired when a CSS animation has completed! Veeeery much super handy for anything DOM in my opinion. The whole animation was managed by this event listener, which allowed me to add and remove classes on the elements that I needed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh3d91qd6fumswet7o134.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh3d91qd6fumswet7o134.png" alt="Alt Text" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In my specific case, if the animation name was either goIn or goOut, the respective keyframes animations would have fired.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F04c9uagl5enakhu29bk6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F04c9uagl5enakhu29bk6.png" alt="Alt Text" width="800" height="596"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;35th Project: Image Carousel&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The project was a mix of much of the others, I think. Slightly easier than some of the others, but a bit trickier in terms of calculations on the X axis.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foucajpyzk3jnwvuiev31.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foucajpyzk3jnwvuiev31.png" alt="Alt Text" width="800" height="105"&gt;&lt;/a&gt;&lt;br&gt;
As usual, we used a mix of indexes and length to understand what to move, toward what direction and when to reset the carousel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;36th Project: Hoverboard&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I absolutely adored coding this little project because when I was little I had a T-shirt which did the same thing! I have a board made up of squares, each time I hover onto a square, the square changes colour. I did not really learn anything new in the proper sense of it, but I had loads of fun, and I was able to put into practice the majority of what I have studied so far, which was amazingly rewarding.&lt;br&gt;
The main things to keep in mind here is how &lt;strong&gt;mouseover&lt;/strong&gt; and &lt;strong&gt;mouseup&lt;/strong&gt; work: mouseover is like hovering onto an element, whereas mouseup is used when I move the focus away from the element.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhw86h2knlc9d6ikbxk4m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhw86h2knlc9d6ikbxk4m.png" alt="Alt Text" width="800" height="558"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;37th Project: Pokedex&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It was really fun to work on this project, and the PokeAPI (&lt;a href="https://pokeapi.co/" rel="noopener noreferrer"&gt;https://pokeapi.co/&lt;/a&gt;) is so easy to work with! It is incredible how we can dynamically add a new card only using variables and string interpolation in the JavaScript code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3io3ylgira08za2acb5j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3io3ylgira08za2acb5j.png" alt="Alt Text" width="800" height="184"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Quite a few JavaScript methods were used here, which gave me the chance to work on my knowledge. Namely: &lt;strong&gt;slice&lt;/strong&gt;, &lt;strong&gt;padStart&lt;/strong&gt;, &lt;strong&gt;find&lt;/strong&gt; and &lt;strong&gt;indexOf&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fujqq87v91gdpnva6ujr2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fujqq87v91gdpnva6ujr2.png" alt="Alt Text" width="800" height="119"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;38th Project: Mobile Tag Navigation&lt;/strong&gt;&lt;br&gt;
This was a simple project which simulated a phone and a mobile menu below it. It was similar to some other stuff we did earlier on. It boils down to adding and removing the classes of show/active and to show the respective image when I click on the specific buttons.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fta4jo3uu61b61fe3w2m8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fta4jo3uu61b61fe3w2m8.png" alt="Alt Text" width="800" height="749"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;39th Project: Password Strength&lt;/strong&gt;&lt;br&gt;
A functional exercise which also looks good! I had never used Tailwind CSS before, but I work with Bootstrap on a daily basis, which is rather similar I would say. It was really handy to be able to style my form already in the HTML code, without worrying too much for it in the CSS file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0um00yax3803nni2fmsr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0um00yax3803nni2fmsr.png" alt="Alt Text" width="800" height="259"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In terms of CSS itself, the fact that the filter property to blur an element is so simple yet so effective, really is telling. If you apply it to the background like in my case, it does change the whole look of the page!&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd63yin8tqbcaxw94ts2i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd63yin8tqbcaxw94ts2i.png" alt="Alt Text" width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;40th Project: 3D Boxes Background&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Okay so I realised that you need to have both your maths and logic ready when dealing with animations and transitions. This project was really cool to code, a fun exercise to practice the various transform properties.&lt;/p&gt;

&lt;p&gt;I finally got to use rotateZ! It is used to rotate an element across its z-axis without making it look funny. In my case, I used it to rotate the images by 360 degrees, so completely.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcqekbma8c7ozfwnzhh23.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcqekbma8c7ozfwnzhh23.png" alt="Alt Text" width="554" height="118"&gt;&lt;/a&gt;&lt;br&gt;
The JavaScript part of it was the most complex for me, as maths isn't really my strongest point. I used a nested loop (booo! but useful in this case) to control when and how the images would have rotated. As the container is 500x500, and there are 4 boxes on each row, for 4 rows, I had to think in terms of 125-125-125-125. That's why when I click the button, all the boxes rotate according to which index they have, alongside the Z-axis.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpwvimyr7ebsnt0hnl0hw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpwvimyr7ebsnt0hnl0hw.png" alt="Alt Text" width="800" height="243"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>html</category>
      <category>css</category>
    </item>
    <item>
      <title>50 Projects in 50 Days, 3/5 there! 🌻</title>
      <dc:creator>Ashley Young</dc:creator>
      <pubDate>Sat, 24 Apr 2021 14:53:54 +0000</pubDate>
      <link>https://forem.com/messy-ashy/50-projects-in-50-days-3-5-there-50-5bnl</link>
      <guid>https://forem.com/messy-ashy/50-projects-in-50-days-3-5-there-50-5bnl</guid>
      <description>&lt;p&gt;Back at it, back to my projects. I am finally getting the hang of the majority of stuff, especially DOM manipulation, which is getting easier and easier, but also more complex...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;21st Project: Drag and Drop&lt;/strong&gt;&lt;br&gt;
The project gave me a basic understanding of the drag and drop functionality works.&lt;br&gt;
I have been exploring the HTML Drag and Drop API, and these events specifically: &lt;strong&gt;dragover&lt;/strong&gt;, &lt;strong&gt;dragenter&lt;/strong&gt;, &lt;strong&gt;dragleave&lt;/strong&gt; and &lt;strong&gt;drop&lt;/strong&gt;. In the HTML I identified which elements are draggable, and to do so I used the 'draggable' attribute and I set it to true.&lt;br&gt;
I just need to remember next time I do something similar, to ensure that I add preventDefault() to prevent and automatic rendering. &lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2y0yade637iemmus1pb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2y0yade637iemmus1pb.png" alt="Alt Text" width="800" height="196"&gt;&lt;/a&gt; &lt;em&gt;All the events I used to make this functionality.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;22nd Project: Drawing App&lt;/strong&gt;&lt;br&gt;
This project was a fun one, I got to learn about the Canvas API which is one of those things that I just kept putting off for no apparent reason (?!). In fact, it is quite enjoyable once you get the hang of it. In the Javascript code, two main methods are used to start with: the getElementById() method to get the reference of the  HTML element, and then the getContext() method to get the element's context (that is where the canvas will be rendered onto).&lt;/p&gt;

&lt;p&gt;The methods that I have used and studied are mainly offsetX, offsetY. &lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhiovqk2ocevgvzq2a1st.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhiovqk2ocevgvzq2a1st.png" alt="Alt Text" width="800" height="788"&gt;&lt;/a&gt;&lt;em&gt;I used mouse events to manipulate the canvas HTML element.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;23rd Project: Kinetic CSS Loader&lt;/strong&gt;&lt;br&gt;
Rather a short but mesmerising one, this one here. The main events happen in the CSS styling file, where I manipulate the element's class by using @keyframes and assigning variables so that the elements I need rotate as soon as they reach a certain degree. &lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xgmkevojonlbxm0nrmd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xgmkevojonlbxm0nrmd.png" alt="Alt Text" width="728" height="1140"&gt;&lt;/a&gt;&lt;em&gt;I applied an animation to the kinetic class, and then I used @keyframes to manage when to apply it to it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;24th Project: Content Placeholder&lt;/strong&gt;&lt;br&gt;
A new CSS property has been discovered! &lt;strong&gt;object-fit&lt;/strong&gt;. According to documentation, this property sets how the content of a replaced element should be resized to fit its container. In my case I used cover. It reminds me very much of &lt;strong&gt;background-size&lt;/strong&gt;, and it's actually quite its equivalent, though with object-fit we are targeting images instead.&lt;br&gt;
I am still amazed by &lt;strong&gt;linear-gradient&lt;/strong&gt; as a property, especially when animations come into play! I used keyframes to manage the animation at different degrees in its space.&lt;br&gt;
Finally, I found out about this cool &lt;strong&gt;Random User Generator API&lt;/strong&gt; (!!!!), which makes you put a random User profile should you need some quick dummy data. A bit like the good old Lorem, but at least you can understand what's happening here haha. &lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fezczjq2albbw90tttwlc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fezczjq2albbw90tttwlc.png" alt="Alt Text" width="800" height="127"&gt;&lt;/a&gt;&lt;em&gt;The API in action.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;25th Project: Sticky Navbar&lt;/strong&gt;&lt;br&gt;
Back to something which used to be simple enough for me to be thought of as 'basic', which is now giving me a whole lotta different vibes. Apart from giving to the navbar a position of &lt;em&gt;fixed&lt;/em&gt;, I also manipulated the JavaScript so that the style was changed according to where in the window the nav bar found itself. &lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjx7s9dmusfcbl238cnlf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjx7s9dmusfcbl238cnlf.png" alt="Alt Text" width="800" height="245"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;26th Project: Vertical Slider&lt;/strong&gt;&lt;br&gt;
A lot of quirky calculations here and jumping from indexes to integers. I learnt that the &lt;em&gt;Element.clientHeight&lt;/em&gt; read-only property is zero for elements with no CSS or inline layout boxes; otherwise, it's the inner height of an element in pixels. It includes padding but excludes borders, margins, and horizontal scrollbars (if present) (thanks docs!).&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjxyoo187qfb6m4y6sz8m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjxyoo187qfb6m4y6sz8m.png" alt="Alt Text" width="800" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;27th Project: Toast Notification&lt;/strong&gt;&lt;br&gt;
When I first started at my first job, I laughed when I saw a file called toast.js! Like, what the hell does it even mean? But I quickly learnt that it's nothing but a pop-up notification which comes up when some event gets triggered. &lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fofmd9vnxs2mc5lk1y04y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fofmd9vnxs2mc5lk1y04y.png" alt="Alt Text" width="800" height="314"&gt;&lt;/a&gt;&lt;em&gt;The createNotification method creates a div of class 'toast' and it makes it appear within the div/container of class 'toasts'. It then sets an interval of 3 seconds before it removes it from the DOM (i.e. it makes it disappear).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;28th Project: GitHub Profiles&lt;/strong&gt;&lt;br&gt;
A few things of notice here in this project:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The use of Axios instead of Fetch API (for better error handling, no need to parse the response into JSON format);&lt;/li&gt;
&lt;li&gt;The destructuring of res.data into only what I need, in this case {data} and concatenating strings to go to whatever link I need;&lt;/li&gt;
&lt;li&gt;Inserting stuff into the DOM using template literals from JS;&lt;/li&gt;
&lt;li&gt;Using try/catch refresh.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgr8wzlur7xnnyl6i5fkb.png" alt="Alt Text" width="800" height="343"&gt;&lt;em&gt;The function getUser accepts the username as a parameter and then queries the GitHub API by using the axis library. As you can see, there is no need to manually parse the JSON response after the data has been fetched as the format is already in place.&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;29th Project: Double-Heart Click&lt;/strong&gt;&lt;br&gt;
A very Insta-worth project, this one! An especially good refresher in terms of coordinates, great illustration here: &lt;a href="https://images1.programmersought.com/197/16/16ee7586e072b18147a89cc2a101a44d.png" rel="noopener noreferrer"&gt;https://images1.programmersought.com/197/16/16ee7586e072b18147a89cc2a101a44d.png&lt;/a&gt; to understand the difference between pageX and clientX, and between offsetLeft and offsetTop;&lt;br&gt;
and an interesting way to recreate the 'doubleclick' event. Instead of adding an actual ready-made'doubleclick' event, we used the timestamp to figure out whether the second click in a row was quick enough for it to be considered effectively a double click.&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnvmwbnbl7iki4h2uvzcm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnvmwbnbl7iki4h2uvzcm.png" alt="Alt Text" width="700" height="214"&gt;&lt;/a&gt;&lt;em&gt;I append the heart image/icon and then I remove it quickly after from the DOM (after 1 second).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;30th Project: Auto Text Effect&lt;/strong&gt;&lt;br&gt;
Very nice and useful small project when it comes to animated websites, as it deals with animating a title (e.g. for a hero banner or similar). It took me a while to understand the maths behind this (cough cough haha) but eventually it makes sense! I create an input which allows a number between 1 and 5, and that input will regulate how fast the title auto-complete itself speed-wise. The speed is managed by a setTimeout which takes as an argument the actual writeText function and uses as an interval the speed.&lt;/p&gt;

&lt;p&gt;I didn't know that I could simply add an event listener to an input element with the name of 'input', and then as long as I have the number attribute set to 'number' in the HTML code, I can obtain the number still using the usual e.target.value.&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2qw2w49dv5reiitcs9z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2qw2w49dv5reiitcs9z.png" alt="Alt Text" width="752" height="302"&gt;&lt;/a&gt;&lt;em&gt;I manage how many letters and how fast the sentence will be written by setting a timeout which will take the function writeText and will proceed to type in the speed variable's terms.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>html</category>
      <category>css</category>
    </item>
    <item>
      <title>50 Projects in 50 Days, 2/5 there! 🌻</title>
      <dc:creator>Ashley Young</dc:creator>
      <pubDate>Wed, 14 Apr 2021 12:33:04 +0000</pubDate>
      <link>https://forem.com/messy-ashy/50-projects-in-50-days-2-5-there-50-3o1d</link>
      <guid>https://forem.com/messy-ashy/50-projects-in-50-days-2-5-there-50-3o1d</guid>
      <description>&lt;p&gt;Here I am after another ten whole days of projects! I have been thoroughly enjoying these ones, and a couple in particular. Let's dive into what I have been learning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11th Project: Event Keycodes&lt;/strong&gt;&lt;br&gt;
Two main big topics here: &lt;em&gt;CSS Specificity and calculations&lt;/em&gt; and &lt;em&gt;keyboard events&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The browser needs to be able to decide which CSS property to apply to a certain element. But what if multiple properties are applied to the same one? I found the CSS Podcast episode on the topic quite fun, as it invites listeners to think of CSS specifications as a football match: whichever element gets the most points, it's the one that wins the property! Universal selector (*) and combinators don't have any effect on specificity. By ascending order, these are the elements and their specificity: type selectors (such as div); class selectors (like .container) and finally ID selectors (#bestColour).&lt;/p&gt;

&lt;p&gt;I also learnt how to use &lt;strong&gt;KeyboardEvent&lt;/strong&gt; objects, that is how the user interacts with the keyboard! There are three event types we can work with: keydown, keyup and keypress. When console logging an event fired by, for example, keydown, the most interesting properties that I discovered are: code, keyCode and key!&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3nk811x7wt7g9mi26cu8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3nk811x7wt7g9mi26cu8.png" alt="Alt Text" width="800" height="592"&gt;&lt;/a&gt; &lt;em&gt;Example from the project, where I had to render the key, keyCode and code of the event&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12th Project: FAQs collapse&lt;/strong&gt;&lt;br&gt;
This is a very good project for a potential portfolio, and the main focus here for me was learning how to manage font-awesome icons. &lt;br&gt;
If in the HTML I can just import them and call them with the attribute set for that specific icon (e.g.:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1njko7w0ni696c8s9dmd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1njko7w0ni696c8s9dmd.png" alt="Alt Text" width="650" height="364"&gt;&lt;/a&gt;, in the CSS I have to use their unicode in the content string, once I apply ::before and ::after pseudo classes:&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcvfqe0fqhceqfwyy1njl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcvfqe0fqhceqfwyy1njl.png" alt="Alt Text" width="686" height="146"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13th Project: Random Choice Picker&lt;/strong&gt;&lt;br&gt;
Another project rather interesting to apply to your portfolio or CV! It lets you write a number of words, separated by a comma, and then the random choice picker function will select a random tag.&lt;br&gt;
I learnt that in terms of &lt;em&gt;textarea&lt;/em&gt;, if you call the focus() method on the DOM element, the focus will be there as soon as the user loads the page!&lt;br&gt;
The use of &lt;strong&gt;setInterval&lt;/strong&gt;(), &lt;strong&gt;clearInterval&lt;/strong&gt;() and &lt;strong&gt;setTimeOut&lt;/strong&gt;() is rather extensive in the Javascript but simply because there is a great deal of intervals at play here!&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3tcdqydswafb26id1v9h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3tcdqydswafb26id1v9h.png" alt="Alt Text" width="800" height="730"&gt;&lt;/a&gt;&lt;em&gt;What you can see from the screenshot is the randomSelect function, where I set two timeouts to highlight and unhighlight the random tag, and then I clear the interval after a certain amount of times, so that the highlighted tag remains&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14th Project: Animated Navigation&lt;/strong&gt;&lt;br&gt;
Overall a pretty simple but interesting project which made me finally understand that I can apply a transition to any property set within a certain element/class, so even if in e.g. transition: opacity, opacity doesn't change colour/get highlighted, I am still applying a transition to that.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frku6vx8dp9m918p6g3af.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frku6vx8dp9m918p6g3af.png" alt="Alt Text" width="800" height="152"&gt;&lt;/a&gt;&lt;em&gt;Here I am declaring a transition for two of the properties that I am styling above, that is the rotation and the opacity.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15th Project: Incrementing Counter&lt;/strong&gt;&lt;br&gt;
After this project, I started reading about the "data-target" attribute in HTML. I can assign a 'data-target- attribute to a div and then get its value in the Javascript code by using the .&lt;strong&gt;getAttribute&lt;/strong&gt;('data-target') method. I am still trying to figure out where I would use it on a day-to-day / personal project case, but at least I learnt a new method!! &lt;br&gt;
Something even cooler that I learnt here is that, if you want to make something a number instead of a string, put a &lt;strong&gt;+&lt;/strong&gt; sign in front of the variable!&lt;br&gt;
e.g. const target = &lt;strong&gt;+counter.getAttribute&lt;/strong&gt;('data-target), so to make sure that you're grabbing the numerical value of it; -- same as wrapping it around Number or using parseInt().&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz1294sagqejemswoiwwe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz1294sagqejemswoiwwe.png" alt="Alt Text" width="800" height="194"&gt;&lt;/a&gt;&lt;em&gt;Example from the project where I grab the value of target and current variables, ensuring that what I have is a numeric value.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;16th Project: Drink Water&lt;/strong&gt;&lt;br&gt;
A couple of things here: the &lt;strong&gt;nextElementSibling&lt;/strong&gt; node! It reminded me of the fact that the DOM always knows where the siblings of your elements are, and it's cool that we can use this method to grab and check the next element closest to the one I am focusing right now;&lt;br&gt;
I played around a lot with the JavaScript file and the style applied to a few elements before and after an event happened, or a condition was applied to them. I like the idea that this is not regarded so bad as pure in-line styling is.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv1au0oesa4aunxrui5k3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv1au0oesa4aunxrui5k3.png" alt="Alt Text" width="800" height="164"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;17th Project: Movie app&lt;/strong&gt;&lt;br&gt;
A classic project to learn the Rest API model, this time using movies! I added a couple more tweaks to the original one:&lt;br&gt;
1) Instead of copying and paste the API key multiple times (as it might become confusing and prone to error), I used template literals to extrapolate its value;&lt;br&gt;
2) The use of  window.location.reload(); to refresh the page in cases where there is no word matching the value inputted OR the value inputted is null/not existent.&lt;br&gt;
It was a great exercise to work with API calls (GET method mainly) plus to integrate the results into the DOM !! I'll try to do similar stuff with other and more complex API's, and different API methods as well.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvvxaycj4u1hzl34cy9aw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvvxaycj4u1hzl34cy9aw.png" alt="Alt Text" width="768" height="438"&gt;&lt;/a&gt; &lt;em&gt;Here I concatenate the search term with the fixed search API URL and if the entry is invalid/empty, I reload the page.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;18th Project: Image Slider&lt;/strong&gt;&lt;br&gt;
This project was a massive refresher for CSS syntax and implementation:&lt;br&gt;
1) &lt;strong&gt;Opacity&lt;/strong&gt;: 0 and &lt;strong&gt;background-colour&lt;/strong&gt;: transparent are exactly the opposite thing! Opacity sets the opacity of the entirety of the element we are targeting, and it is exactly the opposite of transparency. The lower the opacity, the hazier you'll see the element. On the contrary, if you set a higher opacity (up until 1), the element is more visible.&lt;br&gt;
2) CSS' &lt;strong&gt;background-size&lt;/strong&gt; allows us to set the size of an image for the background. The property I use more often is 'cover', which means that the image will occupy the space of the entire background, and if necessary it will be stretched. Another oft-used one is 'contain', where instead the image will not be stretched, with the risk of repeating itself unless otherwise specified (using no-repeat);&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkhgcmrbo58mpjg7uct08.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkhgcmrbo58mpjg7uct08.png" alt="Alt Text" width="688" height="434"&gt;&lt;/a&gt;&lt;em&gt;An example of setting the opacity and the size of the background.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;19th Project: Theme Clock&lt;/strong&gt;&lt;br&gt;
Okay, so this was a proper and full lesson on the Javascript Date() function. &lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhluxw2vmdp1dc4rit9c2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhluxw2vmdp1dc4rit9c2.png" alt="Alt Text" width="800" height="299"&gt;&lt;/a&gt; &lt;em&gt;I initialise the time variable using new Date(), and then I get access to all the other Javascript data objects as a result.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;20th Project: Button Ripple Effect&lt;/strong&gt;&lt;br&gt;
The 20th project was all about getting &lt;strong&gt;clientX&lt;/strong&gt; and &lt;strong&gt;clientY&lt;/strong&gt; and then using the event's properties to locate where within the button ton initiate the on-click ripple effect. I had never heard the name of the &lt;strong&gt;offset&lt;/strong&gt; prop (I used offsetTop and offsettLeft in the project) but that was the key to grab the distance of the outer border of the button relative to the inner border of the top of the offsetParent node. &lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foedycy15s9dplt77fu2v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foedycy15s9dplt77fu2v.png" alt="Alt Text" width="800" height="630"&gt;&lt;/a&gt;&lt;em&gt;Here I add an event listener to the button, so that some styles are applied to it when I click on a specific point within the button.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>css</category>
      <category>beginners</category>
    </item>
    <item>
      <title>50 Projects in 50 Days, 1/5 there! 🌻</title>
      <dc:creator>Ashley Young</dc:creator>
      <pubDate>Sun, 04 Apr 2021 17:22:55 +0000</pubDate>
      <link>https://forem.com/messy-ashy/50-projects-in-50-days-1-5-there-4295</link>
      <guid>https://forem.com/messy-ashy/50-projects-in-50-days-1-5-there-4295</guid>
      <description>&lt;p&gt;In an effort to improve my front-end skills, I bought and started Brad Traversy's '50 Projects in 50 Days' on Udemy.&lt;/p&gt;

&lt;p&gt;Having completed and personalised most of them, these are the things I learned during these first ten days:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First project: Expanding Cards&lt;/strong&gt;&lt;br&gt;
If you want your HTML elements to have cool effects, use &lt;strong&gt;transitions&lt;/strong&gt;!&lt;br&gt;
They really are the best way to animate something using CSS, as they enable to define the visual transition between two states of a certain element.&lt;br&gt;
I learnt that for performance reasons, it is better to avoid using 'all' in order to apply multiple properties, as they are very CPU intensive.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe3s2yfae2pvbwrsrw5bv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe3s2yfae2pvbwrsrw5bv.png" alt="Alt Text" width="646" height="146"&gt;&lt;/a&gt;&lt;em&gt;Example from the first project, where I want a smooth transition to be used to edit the opacity of an element.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second project: Progress Steps&lt;/strong&gt;&lt;br&gt;
I think that in terms of notions learnt, this project was one of the best for me. &lt;br&gt;
After a thorough refresh of how position: &lt;em&gt;relative&lt;/em&gt; and position: &lt;em&gt;absolute&lt;/em&gt; work and relate to each other, I also learnt that you can make a little forbidden sign pop up if you assign the property &lt;em&gt;not-allowed&lt;/em&gt; to the cursor!&lt;br&gt;
Learning that a simple transform: &lt;em&gt;scale&lt;/em&gt;: 09 property applied to a button makes it pop up for a split second was mind-blowing!&lt;br&gt;
Also, when using ::before and ::after selectors, don't forget to put a content property, even if you don't have anything to actually render.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl9h68b7du3fzste30xh2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl9h68b7du3fzste30xh2.png" alt="Alt Text" width="482" height="106"&gt;&lt;/a&gt;&lt;br&gt;
The main takeaway from the exercise, however, was that I can manage the &lt;em&gt;width&lt;/em&gt; of an element by getting the element from the DOM and then changing its style directly in the JavaScript code. Remember, you can apply iterative/array methods on DOM elements!&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvw6dc66uqxvmwbpv1fbc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvw6dc66uqxvmwbpv1fbc.png" alt="Alt Text" width="800" height="44"&gt;&lt;/a&gt;&lt;em&gt;Example from the second project, where I had to make a progress bar seem responsive on click. Here I increase the percentage of its width whenever the circles (buttons) are clicked&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Third project: Rotating Navigation&lt;/strong&gt;&lt;br&gt;
While coding some effects, I asked myself: what is the actual difference between &lt;em&gt;transition&lt;/em&gt; and &lt;em&gt;transform&lt;/em&gt; properties? &lt;br&gt;
The first property applies a more smooth visual change to an element, it should be rather subtle and pleasant for the eye. The second property actually transforms (e.g. moves, changes the appearance of) an element.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fht7hset11da144evo8qm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fht7hset11da144evo8qm.png" alt="Alt Text" width="560" height="248"&gt;&lt;/a&gt;&lt;em&gt;Example from the third project. Here, I make the elements move horizontally using the transform: translateX and then I apply a transition to make the change smoother.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fourth project: Hidden Search Widget&lt;/strong&gt;&lt;br&gt;
In this project, I learnt two very useful JavaScript methods which allow me to manage DOM elements.&lt;br&gt;
The &lt;strong&gt;toggle()&lt;/strong&gt; method is essentially the same as calling classList.add() and classList.remove() one after the other! Just use toggle() and every time an element is clicked, or that element has a listener, my action will toggle that element.&lt;br&gt;
Then, the &lt;strong&gt;focus()&lt;/strong&gt; method, is used to give focus to a HTML element meaning that if that element can be focussed, then a focus attributed will be applied to it. &lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv99qoswln4su13jbgy6b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv99qoswln4su13jbgy6b.png" alt="Alt Text" width="582" height="160"&gt;&lt;/a&gt;&lt;em&gt;I used both methods in the example above, from the fourth project, so that every time I clicked on the div with class 'search', the 'active' class was also applied, and for the input field to be in focus.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fifth project: Blurry Loading&lt;/strong&gt;&lt;br&gt;
While coding this project, I jumped in a rather endless rabbit hole about the &lt;strong&gt;blur&lt;/strong&gt;(radius) function, which applies a Gaussian blur to the input image. The function essentially tells you how many pixels in the screen blend into one another, meaning that a larger value will create a deeper blurring effect, whereas a value of 0px will leave the input unchanged.&lt;br&gt;
I also learned that by using a &lt;em&gt;z-index&lt;/em&gt; property, I can manage how multiple elements overlap, and I can decide which one is visible and which one should be hidden behind it.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw3136jcuaw3elyjozrru.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw3136jcuaw3elyjozrru.png" alt="Alt Text" width="486" height="290"&gt;&lt;/a&gt;&lt;em&gt;In this example from the CSS file of the fifth project, I didn't want to apply any actual blur to my image.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sixth project: Scroll Animation&lt;/strong&gt;&lt;br&gt;
This project was a good refresher when it came to the :nth-of-type() selector, I wasn't aware that I could simply write &lt;em&gt;even&lt;/em&gt; instead of complicating things with various formulas like I normally do. Hehehe.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fet7veo28zpaawzz8vbt4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fet7veo28zpaawzz8vbt4.png" alt="Alt Text" width="516" height="104"&gt;&lt;/a&gt;&lt;em&gt;For every other div, I wanted to move it horizontally to the left.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Seventh project: Split Landing Page&lt;/strong&gt;&lt;br&gt;
This was a fun one. Basically, my page is split in two parts: on the left, I have a Playstation 5 advert, whereas the Xbox one is on the right. Both pages have a 'Buy Now' button and depending on which one you click on, the page expands.&lt;br&gt;
A good recap on CSS selectors and pseudo-selectors alike and rather simple JavaScript, too. I simply apply a class of either hover-right or hover-left according to which side of the page I over onto.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo4gfy6bo61aty34b4bd5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo4gfy6bo61aty34b4bd5.png" alt="Alt Text" width="800" height="71"&gt;&lt;/a&gt;&lt;em&gt;This example from the project shows how the class of hover-left will be applied or removed when I hover or move away from the left side of the page.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Eighth project: Form Wave Animation&lt;/strong&gt;&lt;br&gt;
YAY!!! I finally understood the difference between &lt;strong&gt;display: block&lt;/strong&gt; and &lt;strong&gt;display: inline-block&lt;/strong&gt; and I didn't have to run to Google to choose which one I needed in this project. In summary, if you use &lt;em&gt;in-line block&lt;/em&gt;, you can apply a width and a height to an element, and top/bottom &amp;amp; margins &amp;amp; paddings are all respected. When using only &lt;em&gt;block&lt;/em&gt;, none of this happens as a line break appears after the element, making it unable to 'be in line' with the others.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs2noutre43qmxacwxd0l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs2noutre43qmxacwxd0l.png" alt="Alt Text" width="444" height="414"&gt;&lt;/a&gt;&lt;em&gt;Application of inline-block to a button.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ninth project: Sound Board&lt;/strong&gt;&lt;br&gt;
Did you know there was such thing as the audio tag in HTML? I was surprised and rather amused, I have to say. Basically, the Web Audio API allows you to control audio files (such as mp3 files) by adding them into your HTML file and then managing them from the script file. The JavaScript &lt;strong&gt;play&lt;/strong&gt;() and &lt;strong&gt;pause&lt;/strong&gt;() methods allow you to start and stop an audio file so that sounds don't overlap.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl0lcjlzhu984qlxuooih.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl0lcjlzhu984qlxuooih.png" alt="Alt Text" width="800" height="215"&gt;&lt;/a&gt;&lt;em&gt;HTML index file of the project, where I set six different sounds&lt;/em&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fci0bkhgg1gm0r2az21oq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fci0bkhgg1gm0r2az21oq.png" alt="Alt Text" width="800" height="488"&gt;&lt;/a&gt;&lt;em&gt;The script file allows me to loop over the sound names and for each one of them I add an event listener. Every time I click on a button, the previous sound stops playing (hence the need for the stopSounds function), and the new one starts&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tenth project: Dad Jokes&lt;/strong&gt;&lt;br&gt;
This project was more an exercise on the FetchAPI than anything else, and thankfully I feel rather confident using it (though I should mention I prefer to use Axios normally).&lt;br&gt;
There are two main ways to use fetch, you can either use the async/await syntax, or the .then.&lt;br&gt;
Something cool which I had never thought of before, was to create a variable to store the headers and the acceptation criteria.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc9x6g7c0mal8cbirgwbx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc9x6g7c0mal8cbirgwbx.png" alt="Alt Text" width="800" height="202"&gt;&lt;/a&gt;&lt;em&gt;This is an example of using fetch with the async/await functionality, arguably a bit more clear and neater.&lt;/em&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnztjbztr8pg74rp0u43v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnztjbztr8pg74rp0u43v.png" alt="Alt Text" width="800" height="236"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;And this is instead an example using the more basic .then syntax.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;See you when I reach 2/5 of the course ❤️🌻😻&lt;br&gt;
Chiara&lt;/p&gt;

</description>
      <category>html</category>
      <category>javascript</category>
      <category>css</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
