<?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: Losalini Rokocakau</title>
    <description>The latest articles on Forem by Losalini Rokocakau (@chelmerrox).</description>
    <link>https://forem.com/chelmerrox</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%2F967002%2F411999b7-645c-4d4d-96ca-538c30c8e045.jpg</url>
      <title>Forem: Losalini Rokocakau</title>
      <link>https://forem.com/chelmerrox</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/chelmerrox"/>
    <language>en</language>
    <item>
      <title>Mastering React: A Mindset for Component-Centric Development</title>
      <dc:creator>Losalini Rokocakau</dc:creator>
      <pubDate>Tue, 28 May 2024 22:55:00 +0000</pubDate>
      <link>https://forem.com/chelmerrox/mastering-react-a-mindset-for-component-centric-development-d76</link>
      <guid>https://forem.com/chelmerrox/mastering-react-a-mindset-for-component-centric-development-d76</guid>
      <description>&lt;p&gt;React is a widely embraced front-end library renowned for crafting intuitive UI/UX experiences. However, there is a necessary fundamental shift in mindset to have a mastery of React. As opposed to the instruction-based way of building in JavaScript, React apps have a component-based architecture. To learn &amp;amp; eventually build with it requires a complete change of perception.&lt;/p&gt;

&lt;p&gt;This article will dive into how you can think &amp;amp; view sites in React before building in it. It draws parallels to the semantics &amp;amp; layout of a site and explores the advantages of adopting a component-based architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Layout of a web page
&lt;/h2&gt;

&lt;p&gt;The layout of a web page is quite simple. There is a header or a navbar, followed by the other parts such as the sidebars, main sections in the middle &amp;amp; the footer at the bottom.&lt;/p&gt;

&lt;p&gt;This image exemplified by &lt;a href="https://www.w3schools.com/"&gt;W3Schools&lt;/a&gt; gives the best perspective of its layout.&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%2F9w6t2qlbtlb7qg3eetmh.gif" 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%2F9w6t2qlbtlb7qg3eetmh.gif" alt="The layout of a site with semantics." width="219" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this overview, we can also view React apps in a similar model &amp;amp; conceptualize each segment as a component.&lt;/p&gt;

&lt;p&gt;Deconstructing this model into components, we identify elements such as a Header or a Navbar component, a Hero section component, the second section which can be for advertisements called an advertisement component, a side-bar component &amp;amp; a footer component.&lt;/p&gt;

&lt;p&gt;Thinking of components as Lego building blocks helps as each piece is fitted together through interlocking to create a cohesive whole.&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%2Ffqmr71c0ayajm7mytf6b.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%2Ffqmr71c0ayajm7mytf6b.png" alt="Dividing &amp;amp; deconstructing a site’s layout into React components." width="800" height="1120"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now these components can even be broken down further into smaller components and so on. We will keep it quite simple for now.&lt;/p&gt;

&lt;h2&gt;
  
  
  A real-life example using W3School’s home page
&lt;/h2&gt;

&lt;p&gt;Let’s take a look at the W3School’s homepage. We will focus on the main parts for brevity &amp;amp; in this case, will make it simpler to understand how it could be broken down into components. This means that the other sections (except for the footer) after the second section is excluded.&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%2Fehnhvgopwpagw6t4i955.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%2Fehnhvgopwpagw6t4i955.png" alt="A shortened version (not the complete page) of W3School’s webpage in the desktop view." width="800" height="670"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Clearly we see that there are 5 main components — a header, a navbar, the hero component, the HTML markup component and the footer.&lt;/p&gt;

&lt;p&gt;This is how the page is broken down:&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%2Fagtumrdcgru1baq773z0.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%2Fagtumrdcgru1baq773z0.png" alt="Deconstructing the W3School’s homepage into React components; visualizing &amp;amp; conceptualizing this abstraction." width="800" height="670"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As explained earlier, there can also be further breakdowns of the page into much smaller components making things much more modular &amp;amp; maintainable in the long run.&lt;/p&gt;

&lt;p&gt;Take the footer for example. It can be broken down into 5 more components as seen in the image below.&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%2Fzcqt23hsn2ifdkkgg4pl.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%2Fzcqt23hsn2ifdkkgg4pl.png" alt="The footer component broken down further into smaller components." width="800" height="670"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This can also be done on other components such as the header or even the hero component. How you would like to break down your applications into components is entirely dependent on how you want it to be. As long as they are re-usable and fits seamlessly with the other components to reach your desired result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of deconstructing a site’s layout into components
&lt;/h2&gt;

&lt;p&gt;There are several reasons why using components is beneficial, especially during development.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Re-usable components
&lt;/h2&gt;

&lt;p&gt;Components can effortlessly be re-used across various pages or even on another site.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Separation of concerns
&lt;/h2&gt;

&lt;p&gt;This is a great way to keep the problems of a component isolated from every other component. It‘s encapsulated within a particular component but not in the others.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Isolation of logic
&lt;/h2&gt;

&lt;p&gt;Speaking of isolation, the logic behind these components remains within the component.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Modularity
&lt;/h2&gt;

&lt;p&gt;The components are just JavaScript modules (ES6 modules). Having these modular building blocks encapsulates specific functionalities which makes it easier to maintain &amp;amp; test through testing frameworks such as Jest.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Easier for Maintainability
&lt;/h2&gt;

&lt;p&gt;The component-based architecture gives a more structured &amp;amp; clear flow of how these building blocks fit together. It’s easier to maintain, refactor &amp;amp; debug.&lt;/p&gt;

&lt;p&gt;Adding a new feature/component becomes even easier too.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Consistency
&lt;/h2&gt;

&lt;p&gt;The architecture also provides consistency in the design &amp;amp; eventual behaviour of the app.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Performance Optimization
&lt;/h2&gt;

&lt;p&gt;The application’s performance is optimized since we can render the parts that need to be rendered onto the UI. Ultimately, this prevents any unnecessary re-renders of components that are not used.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Scalability
&lt;/h2&gt;

&lt;p&gt;The scalability of the app is more efficient as complex UI becomes more manageable once it is broken down into smaller parts.&lt;/p&gt;

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

&lt;p&gt;React empowers developers to construct robust and scalable applications. This means there is a paradigm shift in perception to a component-based approach. It is akin to compartmentalization and is a high-level abstraction.&lt;/p&gt;

&lt;p&gt;With this altered mindset, we can easily map out what parts we need, the parts that can be re-used &amp;amp; the ones that need to be rendered conditionally, and so on.&lt;/p&gt;

&lt;p&gt;Re-thinking application building in this way helps in understanding React before you will even learn it. In fact, this will also be a great introduction if you will dive into other technologies such as no-code tools that uses this conceptualization.&lt;/p&gt;

&lt;h2&gt;
  
  
  📝 Additional Resources
&lt;/h2&gt;

&lt;p&gt;For further insights, refer to the &lt;a href="https://www.react.dev/"&gt;React&lt;/a&gt; documentation to learn more about the library.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔍 Connect with me!
&lt;/h2&gt;

&lt;p&gt;Follow me on &lt;a href="https://x.com/chelmerrox"&gt;X&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/losalini-rokocakau"&gt;LinkedIn&lt;/a&gt; if you like my work and want to stay updated for more.&lt;/p&gt;

&lt;h2&gt;
  
  
  🙏🏽 Support
&lt;/h2&gt;

&lt;p&gt;If you’ve found my work helpful &amp;amp; want to support it, you can do so &lt;a href="https://beacons.ai/chelmerrox"&gt;here&lt;/a&gt; &amp;amp; it’s greatly appreciated!&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>softwareengineering</category>
      <category>frontend</category>
    </item>
    <item>
      <title>CSS Animations: Create Bouncing Ball Animation From Scratch</title>
      <dc:creator>Losalini Rokocakau</dc:creator>
      <pubDate>Sun, 13 Nov 2022 16:52:44 +0000</pubDate>
      <link>https://forem.com/chelmerrox/css-animations-create-bouncing-ball-animation-from-scratch-a0a</link>
      <guid>https://forem.com/chelmerrox/css-animations-create-bouncing-ball-animation-from-scratch-a0a</guid>
      <description>&lt;p&gt;One of the things that I had always wanted to do with projects' I've worked on during my ongoing journey as an aspiring software developer was to make my website's UI a lot more appealing &amp;amp; less boring to look at.&lt;/p&gt;

&lt;p&gt;This isn't to say that the color schemes &amp;amp; design specifications I had to abide by weren't perfect for this. Instead, it is to make it…well….more appealing. Or at least to be quite frank…not static.&lt;/p&gt;

&lt;p&gt;It created a nagging thought in mind every time I worked on a project. Browsing through the beautiful designs on Dribbble for an hour every day didn't help either (or so I thought). Eventually, I came across one of the coolest CSS properties I believed solved this for me (all thanks to one of my previous projects!): the CSS Animation.&lt;/p&gt;

&lt;p&gt;This article will be a step-by-step tutorial guide on using the CSS Animation property to create an animation. The animation will be of a ball bouncing infinitely in a confined space when dropped from above. Before we 'bounce' into it, you may need to have at least a beginner to advanced beginner level of understanding of HTML5 and CSS3. Like I've said, I found this CSS property to be useful for some of my project's UI &amp;amp; you'd probably find it useful too! Let's get right into it!&lt;/p&gt;

&lt;p&gt;(&lt;strong&gt;NOTE&lt;/strong&gt;: You will need a text editor for this whether it's Visual Studio Code or Atom etc.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Create your folder with the following files &amp;amp; folder in it.
&lt;/h2&gt;

&lt;p&gt;Open your text editor and create your folder as seen below:&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%2F27vgy4b2h5l1l1zqgovs.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%2F27vgy4b2h5l1l1zqgovs.PNG" alt="Step 1" width="800" height="471"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Fig. 1.0 Create the folder for this tutorial.&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;I've created a folder called 'animations-article-tutorial'. Within it, I have created:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;an index.html file&lt;/li&gt;
&lt;li&gt;a styles folder that has:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;a) a CSS-Resets.css file&lt;/p&gt;

&lt;p&gt;b) a style.css file&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Paste &amp;amp; save the CSS Resets code from Eric Meyer's CSS Resets file into the CSS-Resets.css file.
&lt;/h2&gt;

&lt;p&gt;This is to reset/remove any default CSS stylings of any web browser you'd use to view your work.&lt;/p&gt;

&lt;p&gt;If you need to read more about this, visit &lt;a href="https://meyerweb.com/eric/tools/css/reset/"&gt;Eric Meyer's website&lt;/a&gt; where he explains more about this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Copy &amp;amp; paste the code below into your index.html file and your style.css file
&lt;/h2&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%2F689cccn1sw7bfqhvfvc1.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%2F689cccn1sw7bfqhvfvc1.PNG" alt="Step 3" width="800" height="471"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Fig. 1.1 Create the files for the web page.&lt;/em&gt;
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Step 4: Create a ball.
&lt;/h2&gt;

&lt;p&gt;Now, we can't bounce a ball if it doesn't even exist! Let's create one using the HTML &amp;amp; CSS code below.&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%2Fdnfa96wnz15bwp06k6ex.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%2Fdnfa96wnz15bwp06k6ex.PNG" alt="Step 4" width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Fig. 1.2 Creating the container in which the ball is going to be bouncing in &amp;amp; the ball itself.&lt;/em&gt;
&lt;/h3&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%2Fp8rxjly9ntxp9l6lecsz.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%2Fp8rxjly9ntxp9l6lecsz.PNG" alt="Step 4-1" width="800" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Fig. 1.3 The bouncing-ball-container &amp;amp; the ball contained in it.&lt;/em&gt;
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Step 5: Name your animation &amp;amp; store it as a value for the animation-name property
&lt;/h2&gt;

&lt;p&gt;This is where the real fun begins - the nitty-gritty!&lt;/p&gt;

&lt;p&gt;An animation would need a name whether the animation is a rotating square when hovering your cursor over it or a constantly color-changing (chameleon) rectangle. This name will then be the value of the animation-name property in the CSS code.&lt;/p&gt;

&lt;p&gt;In our case, our animation is a bouncing ball. To keep animation names clear &amp;amp; concise, I've made up the 3 rules below for good naming conventions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;name the animation to be exactly what it is doing &amp;amp;/or what it &lt;br&gt;
is being applied to (for simplicity's sake)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;keep the alphabet letters to lower case&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;hyphenate each word in the animation-name&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To put all this together, I've come up with this animation name for our animation: &lt;strong&gt;&lt;em&gt;bouncing-ball&lt;/em&gt;&lt;/strong&gt;. This is the value for the animation-name property.&lt;/p&gt;

&lt;p&gt;Back to your text editor, you will place the property and its value as such in your style.css stylesheet:&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%2Fi1rkin3hs1qpkj268bvy.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%2Fi1rkin3hs1qpkj268bvy.PNG" alt="Step 5" width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Fig. 1.4 Creating the animations' name and placing it as a value for the animation-name property&lt;/em&gt;
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Step 6: Create an animation!
&lt;/h2&gt;

&lt;p&gt;From Step 5, we've named our animation to bouncing-ball. We'll also need this value to create the animation.&lt;/p&gt;

&lt;p&gt;To create the animation, we'll be using the @keyframes animation-name {} rule. In place of the animation-name in the @keyframes rule, put your animation-name property's value there:&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%2Ft1o5p74agbv1cj8x4m5b.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%2Ft1o5p74agbv1cj8x4m5b.PNG" alt="Step 6-1" width="249" height="70"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Fig. 1.5 The keyframes rule&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;There are two ways in which you can create the animation 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%2Fvbvaso5sddlwye9kn01c.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%2Fvbvaso5sddlwye9kn01c.PNG" alt="Step 6-2" width="230" height="95"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Fig. 1.6 The first way to create the animation code&lt;/em&gt;
&lt;/h3&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%2Fa77y4rnxo27x4sin0d3x.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%2Fa77y4rnxo27x4sin0d3x.PNG" alt="Step 6-3" width="223" height="127"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Fig. 1.7 The second way to create the animation code&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;For the first keyframe seen in Fig. 1.6, we are creating some animation code from:&lt;/p&gt;

&lt;p&gt;a. the initial state (0%) using the 'from' rule and;&lt;/p&gt;

&lt;p&gt;b. then the final state (100%) using the 'to' rule.&lt;/p&gt;

&lt;p&gt;The second keyframe in Fig. 1.7, we are creating an animation code from its:&lt;/p&gt;

&lt;p&gt;a. initial state (0%);&lt;/p&gt;

&lt;p&gt;b. to 25%;&lt;/p&gt;

&lt;p&gt;c. to 75% and;&lt;/p&gt;

&lt;p&gt;d. its final state (100%).&lt;/p&gt;

&lt;p&gt;Keep in mind that the percentage values of the different states can change to fit into the animation you are trying to create. You can even add more percentage values for different states.&lt;/p&gt;

&lt;p&gt;Within the curly braces of the rules at different states, this is where you'd specify the CSS properties of the element you're targeting and the different values you'd want it to change to.&lt;/p&gt;

&lt;p&gt;We will be using the second keyframe to create our bouncing ball animation.&lt;br&gt;
Place the code below for the animation within the curly braces of the @keyframes rule:&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%2F69o87wzbm9zp08v2z5va.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%2F69o87wzbm9zp08v2z5va.PNG" alt="Step 6-4" width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Fig. 1.8 The animation code for the bouncing ball animation&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;For a brief explanation of the animation code in Fig. 1.8, our animation begins from the initial state (0%) with our helper properties (top property &amp;amp; left property for our animation) both at values where the ball is at the top-left corner of the container.&lt;/p&gt;

&lt;p&gt;Since we are dropping the ball from a height &amp;amp; the ball has to bounce from left to right, the left property has an absolute-length value of 0px, and the top property has an absolute-length value of 0px for the container we have created.&lt;/p&gt;

&lt;p&gt;The value of the top &amp;amp; left properties are the only things we would change for each state to make it bounce from left to right.&lt;/p&gt;

&lt;p&gt;At 2%, we would expect the ball to be hitting the bottom of the container &amp;amp; moving to the right. The left property will then have a value of 75px, and the top property has a value of 290px. Then, at 4% we would expect the ball to bounce &amp;amp; still move further to the right. Hence, the left value is 116px and top value is 100px. From here, it keeps alternating between values from when it hits the bottom of the container &amp;amp; when it bounces back up into the air (and of course, the left value keeps increasing since it's moving to the right). These values and the states' percentage values can definitely change for however you like it to be for your animation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Make the animation work!
&lt;/h2&gt;

&lt;p&gt;Still here? Phew! Ok, great! And awesome job so far!&lt;/p&gt;

&lt;p&gt;Now, we've created the animation and have named it to what the animation is about. But, it's not working for some reason?!&lt;/p&gt;

&lt;p&gt;That's because we aren't done yet! We need to set a few more properties to get it to work. To get the ball bouncing.&lt;/p&gt;

&lt;p&gt;This brings us to the following animation properties listed below and the different accepted values for each property:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;animation-duration: time in seconds;&lt;/li&gt;
&lt;li&gt;animation-iteration-count: positive integer value | infinite;&lt;/li&gt;
&lt;li&gt;animation-direction: normal | reverse | alternate | alternate-reverse;&lt;/li&gt;
&lt;li&gt;animation-timing-function: ease | ease-in | ease-out | ease-in-out | linear | cubic-bezier(a,b,c,d);&lt;/li&gt;
&lt;li&gt;animation-fill-mode: none | forwards | backwards | both ;&lt;/li&gt;
&lt;li&gt;animation-delay: positive value for time in seconds | negative value for time in seconds ;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We want the ball to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;bounce &amp;amp; keep bouncing for a longer time till it stops bouncing for e.g for 15 seconds.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;bounce infinitely.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;bounce in only one direction (from left to right)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;have an almost natural bounce from beginning to end.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;have no other CSS styles for the ball at the initial state &amp;amp; final state.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;start bouncing for at most 1 second.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The great thing is….these are achievable!&lt;/p&gt;

&lt;p&gt;Let's go right back to the text editor at lines 39–44 and type down the code for the ball class as we see below:&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%2F1810w1xwugztkwhw1i3q.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%2F1810w1xwugztkwhw1i3q.PNG" alt="Step 7-1" width="800" height="465"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Fig. 1.9 The animation properties and values to use at lines 39–44&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Alright, now you can view your work on the browser again and it should look a lot like the one in this &lt;a href="https://www.loom.com/share/24d390b8aad64029a650422e3fda71b9"&gt;video&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If your animation looks like the one in the video, great job! If it doesn't, don't worry….just go back to the top of this article &amp;amp; follow the same steps.&lt;/p&gt;

&lt;p&gt;Feel free to change the values of the properties or even add more to the keyframes! There's so much more you can do with animations &amp;amp; it will make your websites a whole lot cooler than ever before! This simple animation is just the beginning of taking your websites to a whole new level.&lt;/p&gt;

&lt;p&gt;If you want to see the files for this tutorial, you can find them &lt;a href="https://github.com/chelmerrox/Animations-Article-Tutorial/tree/master"&gt;here&lt;/a&gt;. If you need extra &amp;amp; simpler readings on CSS Animations, you can find it &lt;a href="https://www.w3schools.com/css/css3_animations.asp"&gt;here&lt;/a&gt; on W3Schools which is what I found helpful for me. There is also an Animation Cheat Sheet provided &lt;a href="http://www.justinaguilar.com/animations/"&gt;here&lt;/a&gt; that might be helpful in your projects.&lt;/p&gt;

&lt;p&gt;I hope that you have found this article useful &amp;amp; will even begin using animations in your projects as I did. Also, feel free to add any comments, etc that you have for my article. You can surely reach out to me on my LinkedIn, GitHub &amp;amp; Twitter. And please don't forget to share my article! Vinaka!&lt;/p&gt;

&lt;p&gt;This article is also published on &lt;a href="https://hackernoon.com/css-animations-creating-bouncing-ball-animation-from-scratch-qe103tpm"&gt;HackerNoon&lt;/a&gt; and &lt;a href="https://medium.com/@losalini.rokocakau/css-animations-a-step-by-step-tutorial-guide-to-create-a-simple-bouncing-ball-animation-9c5deb1ea28d"&gt;Medium&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>css</category>
      <category>animation</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>A Beginner’s Guide to Understanding &amp; Recognizing Different Cyber Threats</title>
      <dc:creator>Losalini Rokocakau</dc:creator>
      <pubDate>Mon, 07 Nov 2022 15:25:36 +0000</pubDate>
      <link>https://forem.com/chelmerrox/a-beginners-guide-to-understanding-recognizing-different-cyber-threats-3pmn</link>
      <guid>https://forem.com/chelmerrox/a-beginners-guide-to-understanding-recognizing-different-cyber-threats-3pmn</guid>
      <description>&lt;p&gt;With technology being so ever-evolving, it also presents a whole bucket of snakes to many users and particularly the most vulnerable. Many companies &amp;amp; innocent individuals have been affected by this bucket of snakes — both old &amp;amp; new snakes. Some even lose their life savings or sensitive information over some hackers’ self-acclaimed “curiosity”. Having a basic understanding of these attacks can help a great deal in recognizing &amp;amp; potentially saving your company, yourself &amp;amp; many others from these threats. Awareness is vital. Knowledge is key.&lt;/p&gt;

&lt;p&gt;This article will dive into understanding &amp;amp; recognizing some cyber threats. It will not cover every example for each attack or every attack. Neither will it be an in-depth coverage as it will only cover a few commons one you or your company need to look out for.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Malware
&lt;/h2&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%2Fsv81b4gvp1w8tuu2imlu.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%2Fsv81b4gvp1w8tuu2imlu.PNG" alt="An illustration of a few types of malware." width="758" height="636"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Simply put malware is some malicious hardware, software, or firmware that is being inserted into a system to gain unauthorized access to it &amp;amp; to cause damage.&lt;/p&gt;

&lt;p&gt;There are several types of common malware:&lt;/p&gt;

&lt;h3&gt;
  
  
  Virus
&lt;/h3&gt;

&lt;p&gt;An application that attaches itself (like a leech) to programs in order to alter the data or even delete it. And usually without the user’s permission.&lt;/p&gt;

&lt;p&gt;This can be downloaded by clicking a link sent to you by a foreign email or one you’ve found &amp;amp; clicked on from someplace else on the web.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adware
&lt;/h3&gt;

&lt;p&gt;Software that shows advertisements on your web browser &amp;amp; causes performance issues.&lt;/p&gt;

&lt;p&gt;You’ve noticed that a website you’ve visited has been projecting lots of ads &amp;amp; it’s also starting to slow down the page, then most likely the computer or device has been affected by &lt;em&gt;adware&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Spyware
&lt;/h3&gt;

&lt;p&gt;It is code that is downloaded without user authorization that, as the name suggests, spies on any information or data the user has or types in on their computer. This sensitive data can then be relayed to a third party &amp;amp; used by them to harm the data owner.&lt;/p&gt;

&lt;p&gt;If you type something on your computer &amp;amp; it takes a while for it to display on your screen, it’s probably due to &lt;em&gt;spyware&lt;/em&gt;. Now, this works in conjunction with a &lt;em&gt;keylogger&lt;/em&gt; being embedded into it that essentially records whatever you type in including your passwords.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ransomware
&lt;/h3&gt;

&lt;p&gt;Maybe you aren’t allowed access to your data. Or perhaps the hackers are threatening to publish your sensitive information online under one condition — that you pay them whatever amount they tell you to pay.&lt;/p&gt;

&lt;p&gt;This is a case of &lt;em&gt;ransomware&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Worms
&lt;/h3&gt;

&lt;p&gt;Unlike a &lt;em&gt;virus&lt;/em&gt;, a &lt;em&gt;worm&lt;/em&gt; is some code that makes copies of itself from one device to another without human interference which is exactly how it spreads.&lt;/p&gt;

&lt;p&gt;Perhaps someone at work sent the same email to everyone in their contact list that also has the same subject line as the foreign, malicious email that they’ve received — this is an example of a &lt;em&gt;worm&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Trojan Horses
&lt;/h3&gt;

&lt;p&gt;Similar to &lt;em&gt;spyware&lt;/em&gt;, it disguises itself as legit software so that the user downloads it and allows hackers access to the user’s system.&lt;/p&gt;

&lt;p&gt;A common way hackers disguise themselves &amp;amp; their intentions is by masquerading as legitimate anti-virus software.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Phishing
&lt;/h2&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%2Fbh3ired7kvqypw5dj2n1.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%2Fbh3ired7kvqypw5dj2n1.PNG" alt="*An illustration of phishing." width="760" height="641"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This has total reliance on social engineering. That is to say, the hacker relies on what is seemingly a normal human interaction with the user to extract critical information. The attack usually starts off directly on the user.&lt;/p&gt;

&lt;p&gt;There are several types of phishing attacks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Vishing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Smishing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Spear Fishing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Whaling&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This attack could be through an email with a malicious link included in it, calling the user as a banker from the user’s bank to ask for this information, or sending a text message instead with the malicious link in it.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. SQL Injection
&lt;/h2&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%2Fu1iqx4x4epoa4pz0dids.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%2Fu1iqx4x4epoa4pz0dids.png" alt="An illustration of SQL Injections." width="800" height="670"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SQL injections&lt;/strong&gt; are the type of attacks that use the SQL database language to extract information &amp;amp; manipulate data from an application’s database. Ultimately, it also damages the database. This will actually be a query that is injected when a user inputs their data in the application that has to be processed &amp;amp; saved in the database.&lt;/p&gt;

&lt;p&gt;There are several types of SQL Injection attacks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Union-Based Injections&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Boolean-Based Injections&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Error-Based Injections&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Out-of-Band Injections&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Time-Based Injections&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One tell-tale sign of SQL Injections is the application continuously behaving differently than what is expected or content being changed than expected.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Cross-Site Scripting (XSS)
&lt;/h2&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%2Fyubkeo2zgbc0tc77kt4a.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%2Fyubkeo2zgbc0tc77kt4a.PNG" alt="An illustration of a Cross-Site Scripting (XSS) attack." width="759" height="639"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This deals with a security vulnerability in the web application &amp;amp; sites, especially the ones in which the user interactions involve user inputs (e.g forums &amp;amp; commenting). The attacker can enter malicious code into the web application using a browser-side script. When a user visits the web app &amp;amp; puts in their input (e.g login credentials), the malicious code executes giving the hacker control of the user’s browser &amp;amp; system or stealing sensitive information.&lt;/p&gt;

&lt;p&gt;Here are the types of XSS attacks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;DOM-based XSS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reflected XSS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stored XSS&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One example is if you notice that you can’t seem to control your browser when visiting a website, then this is an XSS attack being deployed. And of course, this is just one of many signs.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Cross-Site Request Forgery (CSRF)
&lt;/h2&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%2F4wldegatoxgbwae7qy1c.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%2F4wldegatoxgbwae7qy1c.PNG" alt="An illustration of a Cross-Site Request Forgery (CSRF) attack." width="800" height="674"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is another web security vulnerability where a user of a site visits it through a link sent by the attacker who hopes that the user is logged into their account on the site.&lt;/p&gt;

&lt;p&gt;During this session, a user under their authenticated account can do all sorts of things such as change their password, interact with other features of their account &amp;amp; transfer funds. In which the site will validate their request and sends all of that data, access, funds, etc back to the attacker.&lt;/p&gt;

&lt;p&gt;This link can be sent to a user through malicious emails, blogs, or websites to name a few.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. DDoS Attacks
&lt;/h2&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%2F2de76pgm0y8p83e1j9ec.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%2F2de76pgm0y8p83e1j9ec.PNG" alt="An illustration of a DDoS (Distributed Denial of Service) attack." width="800" height="672"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DDoS (Distributed Denial of Service)&lt;/strong&gt; attacks target a network in order to ‘deny’ services to its users. It basically denies users of the network access to resources provided by it.&lt;/p&gt;

&lt;p&gt;The attacker uses multiple remote locations (usually with the help of botnets) in order to execute the attack on the network. They would flood the network with so much internet traffic that the network will in a sense, collapse &amp;amp; shut down. A network can only take in so much traffic at a time.&lt;/p&gt;

&lt;p&gt;The common sign of a DDoS attack is when a site becomes unavailable or resources are unavailable. Especially, when it is down for a period of time.&lt;/p&gt;

&lt;p&gt;These are just some bare-bone examples of these cyber crimes along with what these attacks comprise. There are also attacks where most of these threats are combined or layered together. So it is a good headstart to be informed of what they are and the many clever ways that cybercriminals use to trap their victims.&lt;/p&gt;

&lt;p&gt;I hope that you’ve found this article informative enough. Not only for yourself but many others who may be easy targets for these attacks.&lt;/p&gt;

&lt;p&gt;If you have any comments or suggestions, please feel free to do so. You can find me on &lt;a href="https://github.com/chelmerrox"&gt;GitHub&lt;/a&gt; &amp;amp; &lt;a href="//www.linkedin.com/in/losalini-rokocakau"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Also published on &lt;a href="https://hackernoon.com/understanding-and-recognizing-different-cyber-threats-what-to-look-out-for"&gt;HackerNoon&lt;/a&gt;, &lt;a href="https://medium.com/@losalini.rokocakau/a-beginners-guide-to-understanding-recognizing-different-cyber-threats-69572fe73ca1"&gt;Medium&lt;/a&gt; &amp;amp; &lt;a href="https://losalini-rokocakau.hashnode.dev/a-beginners-guide-to-understanding-recognizing-different-cyber-threats"&gt;Hashnode&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>cybersecurity</category>
      <category>infosec</category>
      <category>informationsecurity</category>
    </item>
    <item>
      <title>How to Temporarily Resolve CORS Error in the Console</title>
      <dc:creator>Losalini Rokocakau</dc:creator>
      <pubDate>Mon, 07 Nov 2022 12:03:25 +0000</pubDate>
      <link>https://forem.com/chelmerrox/how-to-temporarily-resolve-cors-error-in-the-console-5dfe</link>
      <guid>https://forem.com/chelmerrox/how-to-temporarily-resolve-cors-error-in-the-console-5dfe</guid>
      <description>&lt;p&gt;You may have exhausted all solutions to make your site render on the browser but nothing seems to work. Then, you’ve checked the developer tools console only to get an error saying that CORS is blocking your API requests.&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%2Fgw1tnpjn8ty1rjq9kpah.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%2Fgw1tnpjn8ty1rjq9kpah.PNG" alt="A preflight request error on the console." width="800" height="89"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Fig. 1 A preflight request error on the console.&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;You’ve probably scoured the internet &amp;amp; found possible solutions to the problem only to find out they don’t work for you. For instance, you may have done these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Enabled Google Chrome CORS extension&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Disabled web security of the browser by changing the file path in the Target property&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Installed CORS package &amp;amp; re-writing your JavaScript code to suit it&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Endless changing of the specific API you’d use&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Changing the API endpoints endlessly too&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A rabbit hole of more readings, forum discussions &amp;amp; videos&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If this sounds like you, then you’re reading the right article!&lt;/p&gt;

&lt;p&gt;This article will delve into a simple &amp;amp; temporary fix for this problem. You will need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Windows OS (I’m sure the steps may be similar for other OS but uses OS specific commands)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Windows Command Prompt (CMD)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This list of &lt;a href="https://www.thomas-krenn.com/en/wiki/Cmd_commands_under_Windows"&gt;Windows CMD Commands&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Open Windows CMD
&lt;/h2&gt;

&lt;p&gt;Open the Windows command prompt.&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%2Fj5gry9okfvkwwk1b415v.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%2Fj5gry9okfvkwwk1b415v.PNG" alt="The Windows CMD" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Fig. 2 The Windows CMD&lt;/em&gt;
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Step 2: Navigate out to the C:// drive
&lt;/h2&gt;

&lt;p&gt;Similar to Linux commands for navigating to or out of a folder, navigate to C:// drive.&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%2Fyxz2n5vkk4qlphivfayc.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%2Fyxz2n5vkk4qlphivfayc.PNG" alt="Navigate to C:// drive using the cd command" width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Fig. 3 Navigate to C:// drive using the cd command&lt;/em&gt;
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Step 3: Navigate to the file path where the ‘chrome.exe’ executable file exists
&lt;/h2&gt;

&lt;p&gt;There are two possible file paths for this. You will need to navigate to the folder where it exists:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1st file path&lt;/strong&gt;: C:\Program Files (x86)\Google\Chrome\Application&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2nd file path&lt;/strong&gt;: C:\Program Files\Google\Chrome\Application&lt;/p&gt;

&lt;p&gt;On my machine, it exists in the 1st file path as seen below.&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%2Fzw5ac199izz6sartptu7.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%2Fzw5ac199izz6sartptu7.PNG" alt="The folder where chrome.exe is" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Fig. 4 Navigate to the folder where chrome.exe is using the cd command. &lt;strong&gt;dir&lt;/strong&gt; command is to list all files &amp;amp; folders in the current directory you’re in&lt;/em&gt;
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Step 4: Disable web security on a new instance of the Google Chrome browser
&lt;/h2&gt;

&lt;p&gt;Use the command below to disable web security.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Command&lt;/strong&gt;: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;chrome.exe --user-data-dir=”C:/Chrome dev session” --disable-web-security&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
It simply creates a new unsecured window (instance) for Google Chrome.&lt;/p&gt;

&lt;p&gt;Rest assured that only this newly created instance/window of Chrome is unsecured. Any other open windows of Chrome are still secure &amp;amp; not affected by this disabling.&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%2Fm134cwqn1oahkzyog8d6.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%2Fm134cwqn1oahkzyog8d6.PNG" alt="A new unsecured window for Chrome" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Fig 5 Using the command in the prompt automatically creates a new unsecured window for Chrome. This doesn’t affect all other open Chrome browsers.&lt;/em&gt;
&lt;/h3&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%2Fcj7700jdu5ew7ebv1kal.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%2Fcj7700jdu5ew7ebv1kal.PNG" alt="The newly created window." width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Fig 6 The newly created window. Notice in the red border that it notifies you that it’s an unsecure instance&lt;/em&gt;
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Step 5: Use the browser to see your site &amp;amp; to temporarily resolve the CORS issue
&lt;/h2&gt;

&lt;p&gt;Whether you’re deploying your site using a live server extension in VSCode, localhost URL when using webpack, or maybe a live demo version, just paste that URL in the browser (where it’s supposed to be) and you’re done!&lt;/p&gt;

&lt;p&gt;You’ll see the site render on the page &amp;amp; the CORS issue is resolved for now so you can get back to coding.&lt;/p&gt;

&lt;p&gt;I hope this helps you out if you’re encountering this problem &amp;amp; the process is not tiresome. You can further explore this solution &lt;a href="https://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome"&gt;here&lt;/a&gt; which helped me. A wonderful explanation of CORS can also be found in this &lt;a href="https://www.youtube.com/watch?v=tcLW5d0KAYE&amp;amp;t=677s"&gt;video&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks for making it through this article &amp;amp; I hope you’ve also enjoyed it. Follow the steps of this article diligently, then you’ll be fine.&lt;/p&gt;

&lt;p&gt;Feel free to reach out to me for suggestions or comments &amp;amp; please share this article with those who might need it! You can find me on &lt;a href="https://github.com/chelmerrox"&gt;GitHub&lt;/a&gt; &amp;amp; &lt;a href="https://fj.linkedin.com/in/losalini-rokocakau"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This article is also published on &lt;a href="https://medium.com/@losalini.rokocakau/a-basic-how-to-on-temporarily-resolving-cors-response-to-pre-flight-request-error-in-the-console-3513d230b5b4"&gt;Medium&lt;/a&gt;, &lt;a href="https://hackernoon.com/how-to-temporarily-resolve-cors-error-in-the-console"&gt;HackerNoon&lt;/a&gt; &amp;amp; &lt;a href="https://losalini-rokocakau.hashnode.dev/how-to-temporarily-resolve-cors-error-in-the-console"&gt;Hashnode&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>api</category>
      <category>security</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
