<?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>DEV Community: Tracy | Software Engineer</title>
    <description>The latest articles on DEV Community by Tracy | Software Engineer (@tracy4code).</description>
    <link>https://dev.to/tracy4code</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%2F1079439%2F1c1c0508-601a-4d3f-af88-5ff49135b0fd.jpg</url>
      <title>DEV Community: Tracy | Software Engineer</title>
      <link>https://dev.to/tracy4code</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tracy4code"/>
    <language>en</language>
    <item>
      <title>Building A Serverless React App With AWS Lambda And API Gateway</title>
      <dc:creator>Tracy | Software Engineer</dc:creator>
      <pubDate>Thu, 14 Dec 2023 04:57:50 +0000</pubDate>
      <link>https://dev.to/tracy4code/building-a-serverless-react-app-with-aws-lambda-and-api-gateway-28b6</link>
      <guid>https://dev.to/tracy4code/building-a-serverless-react-app-with-aws-lambda-and-api-gateway-28b6</guid>
      <description>&lt;p&gt;The serverless architecture involves the steps and processes of managing server infrastructure and scaling resources shifted from the developer to the cloud provider. In a traditional server-based model, developers have to provision, manage, and scale servers to handle incoming requests. However, in a serverless architecture, developers focus solely on writing and deploying code without worrying about the underlying infrastructure.&lt;/p&gt;

&lt;p&gt;By the end of this article, you will learn the following concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What a serverless architecture is.&lt;/li&gt;
&lt;li&gt;Navigating and using AWS services (e.g., API Gateway, Lambda function, and DynamoDB).&lt;/li&gt;
&lt;li&gt;Build a serverless blog application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is the link to the article: &lt;a href="https://blog.openreplay.com/serverless-blog-with-aws-lambda-and-api-gateway/"&gt;https://blog.openreplay.com/serverless-blog-with-aws-lambda-and-api-gateway/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>aws</category>
      <category>web</category>
    </item>
    <item>
      <title>Building Live Search Functionality with JavaScript</title>
      <dc:creator>Tracy | Software Engineer</dc:creator>
      <pubDate>Sun, 06 Aug 2023 08:31:35 +0000</pubDate>
      <link>https://dev.to/tracy4code/building-live-search-functionality-with-javascript-23e9</link>
      <guid>https://dev.to/tracy4code/building-live-search-functionality-with-javascript-23e9</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;The live search function is an important tool in modern websites that filters results based on a user's preference. This improves customers' experience and saves users the stress of navigating through hundreds of results to find a specific item.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A live search bar is an important tool for enhancing user experience, boosting engagement, and giving website administrators useful insights. It can increase traffic, boost conversion rates, and ultimately result in more success for a website or application by making it simpler for people to locate what they're looking for.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Overview
&lt;/h2&gt;

&lt;p&gt;In this article, you will build a search bar that gives you the result for movies when you search for a particular movie. You will build this project with the use of HTML, CSS, and JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;The prerequisites for following along with this project include the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Knowledge of &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/HTML_basics"&gt;HTML&lt;/a&gt;, &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/CSS_basics"&gt;CSS&lt;/a&gt;, and &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript"&gt;JavaScript&lt;/a&gt;. This article is neither an introduction to HTML, CSS, or JavaScript.&lt;/li&gt;
&lt;li&gt;Knowledge of &lt;a href="https://en.wikipedia.org/wiki/API"&gt;Application Programming Interface&lt;/a&gt; (API)&lt;/li&gt;
&lt;li&gt;An account with &lt;a href="https://developer.themoviedb.org/reference/intro/getting-started"&gt;The Movie Database (TMDB)&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  HTML - Create the UI
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;meta charset="UTF-8"&amp;gt;
  &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
   &amp;lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" /&amp;gt;
  &amp;lt;title&amp;gt;Searchbar&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;form action="/" class="search-btn"&amp;gt;
    &amp;lt;i class="fa fa-search searchIcon" aria-hidden="true"&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;input type="text" placeholder="search for a movie..."&amp;gt;
  &amp;lt;/form&amp;gt;

  &amp;lt;div class="search-results"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The above line of code above contains an HTML boilerplate with HTML code that creates a search form with a text input field for entering movie titles, and a container for displaying the search results.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;link&lt;/code&gt; tag in the head content is a font icon link that will display a search bar icon.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;form action="/" class="search-btn"&amp;gt;
    &amp;lt;i class="searchIcon" aria-hidden="true"&amp;gt;&amp;lt;/i&amp;gt;
    &amp;lt;input type="text" placeholder="search for a movie..."&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;&amp;lt;form&amp;gt;&lt;/code&gt; element is used to create a container for the &lt;code&gt;input&lt;/code&gt; field with an action of &lt;code&gt;/&lt;/code&gt;, which means it will submit to the current page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;&amp;lt;i class="searchIcon" aria-hidden="true"&amp;gt;&amp;lt;/i&amp;gt;&lt;/code&gt; is a search bar icon tag from font-awesome which will display movie results when clicked.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;input&lt;/code&gt; field is where users will enter search queries. The &lt;code&gt;placeholder&lt;/code&gt; attribute indicates the kind of input expected in the field.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="search-results"&amp;gt;&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;div&lt;/code&gt; with a class of &lt;code&gt;search-result&lt;/code&gt; is a container that will display the results.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  CSS - Style the UI
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.form{
  width: 70%;
  margin: 25px auto;
}

input{
  width: 80%;
  height: 28px;
  font-size: 1.1rem;
  padding-left: 40px;
}

.searchIcon{
  position: relative;
  left: 30px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;.form&lt;/code&gt; class set the width container to &lt;code&gt;70%&lt;/code&gt; of its parent element and the &lt;code&gt;margin&lt;/code&gt; element is set to &lt;code&gt;25px&lt;/code&gt; for the top and bottom. And auto margin on the left and right which centers the form element horizontally.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;input&lt;/code&gt; field has a width of &lt;code&gt;80%&lt;/code&gt; of its parent element, a height of &lt;code&gt;28px&lt;/code&gt;, and a font size of &lt;code&gt;1.1rem&lt;/code&gt; which is relative to the root font size.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  JavaScript
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const form = document.querySelector('.form');
const input = form.querySelector('input');
const searchResults = document.querySelector('.search-results');
const searchIcon = document.querySelector('.searchIcon')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Each of the elements is given a variable using the &lt;code&gt;const&lt;/code&gt; type. These variables are used to reference elements in the HTML document using the &lt;code&gt;document.querySelector()&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const searchMovies = async (query) =&amp;gt; {
  const apiKey = 'apiKey'; // replace this part with your actual API key
  const apiUrl = `https://api.themoviedb.org/3/search/movie?api_key=${apiKey}&amp;amp;query=${query}`;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;A function called &lt;code&gt;searchMovies&lt;/code&gt; is defined using the async keyword to indicate that takes a query parameter and uses it to construct an API URL that queries T&lt;a href="https://developer.themoviedb.org/reference/intro/getting-started"&gt;he movie database (TMDB) API &lt;/a&gt;for movie results.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;try {
    const response = await fetch(apiUrl);
    const data = await response.json();
    const movies = data.results;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The function &lt;code&gt;try&lt;/code&gt; block executes an asynchronous fetch request to retrieve data from the API URL. The response is then parsed into JSON format using the &lt;code&gt;json()&lt;/code&gt; method, and saved into a data variable.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;searchResults.innerHTML = '';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;innerHTML&lt;/code&gt; of the movie result is set to an empty variable. This means that whenever you make a new search, the page will research to show the new research result.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;movies.forEach((movie) =&amp;gt; {
      const { poster_path, title, release_date, vote_average } = movie;

      const movieContainer = document.createElement('div');
      movieContainer.classList.add('movie');

      const posterUrl = poster_path
        ? `https://image.tmdb.org/t/p/w500/${poster_path}`
        : 'https://via.placeholder.com/500x750?text=No+poster';

      movieContainer.innerHTML = `
        &amp;lt;img src="${posterUrl}" alt="${title}" /&amp;gt;
        &amp;lt;div class="movie-info"&amp;gt;
            &amp;lt;h3&amp;gt;${title}&amp;lt;/h3&amp;gt;
            &amp;lt;small&amp;gt;Released on ${release_date}&amp;lt;/small&amp;gt;
            &amp;lt;span class="rating"&amp;gt;${vote_average}&amp;lt;/span&amp;gt;
        &amp;lt;/div&amp;gt;
      `;

      searchResults.appendChild(movieContainer);
    });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The function uses &lt;code&gt;forEach&lt;/code&gt; loop to iterate through each movie object in the array, and extracts several properties from each movie, including the poster image URL, title, release date, and vote average.&lt;/li&gt;
&lt;li&gt;It also creates a new &lt;code&gt;div&lt;/code&gt; element to represent each movie and sets the &lt;code&gt;innerHTML&lt;/code&gt; of the element to a string of HTML code that includes an &lt;code&gt;img&lt;/code&gt; for the movie poster, &lt;code&gt;span&lt;/code&gt; for the rating, &lt;code&gt;h3&lt;/code&gt; for the movie title, and release date.&lt;/li&gt;
&lt;li&gt;The function then appends the new movie div element to the &lt;code&gt;searchResults&lt;/code&gt; container.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;catch (error) {
    console.error(error);
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The above code will log any errors that may occur during the API request or movie data processing.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;form.addEventListener('submit', async (event) =&amp;gt; {
  event.preventDefault();
  const query = input.value;
  searchMovies(query);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;EventListener&lt;/code&gt; listens for a click event when the form is submitted and displays the result.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;searchIcon.addEventListener('click', async () =&amp;gt; {
  const query = input.value;
  searchMovies(query);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;An &lt;code&gt;EventListener&lt;/code&gt; is added to the search bar icon so that when the icon is clicked, the event listener calls the &lt;code&gt;searchMovies&lt;/code&gt; function, passing in the current value of the input field as the query parameter.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;A functional search is implemented in almost modern websites to ease the stress of users who visit the website. Knowing how to implement one will improve one's skill as a developer.&lt;/p&gt;

&lt;p&gt;I hope you found this article useful, please like, follow, and share with your friends. I post content on web development.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Introduction To Technical Writing: A beginner's guide</title>
      <dc:creator>Tracy | Software Engineer</dc:creator>
      <pubDate>Fri, 23 Jun 2023 18:50:34 +0000</pubDate>
      <link>https://dev.to/tracy4code/introduction-to-technical-writing-a-beginners-guide-1d95</link>
      <guid>https://dev.to/tracy4code/introduction-to-technical-writing-a-beginners-guide-1d95</guid>
      <description>&lt;p&gt;&lt;strong&gt;Are you new to Technical writing? Never written an article before? Well, it's fine! By the end of this article, it will provide you with enough materials to get you started on your technical writing journey.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I will be sharing material courses on technical writing, where you can publish your articles and apply for jobs. I will also share how I got accepted to write for two companies. I hope all your questions will be answered by the end of this article.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Technical Writing?
&lt;/h2&gt;

&lt;p&gt;Technical writing is a type of writing that communicates complex and specialized information to a specific audience clearly and concisely.&lt;/p&gt;

&lt;p&gt;It aims to explain technical concepts, procedures, and instructions to readers who may not have a technical background, expertise, and practitioners.&lt;/p&gt;

&lt;p&gt;Technical writing includes user manuals, instruction guides, reports, and more. It often involves breaking down complex technical information into simpler terms, using diagrams, charts, and other visual aids to help readers understand the material.&lt;/p&gt;

&lt;h2&gt;
  
  
  Importance Technical Writing
&lt;/h2&gt;

&lt;p&gt;Let's say the company you work for develops a new software product. The product was innovative and had the potential to revolutionize the market. However, the company didn't invest much time in documenting the technical aspects of the product.&lt;/p&gt;

&lt;p&gt;As a result, the product was difficult to use, and customers were frustrated when they encountered problems.&lt;/p&gt;

&lt;p&gt;Realizing their mistake, the company hired a technical writer to create comprehensive documentation for their product. The technical writer worked closely with the developers and created user manuals, online help files, and other types of documentation to assist customers.&lt;/p&gt;

&lt;p&gt;With the new documentation in place, customers were able to use the product more easily and had fewer problems.&lt;/p&gt;

&lt;p&gt;You can see how Technical writing played a crucial role in assisting customers in understanding the company's products. It's like when you buy an electronic gadget and you find a manual inside to help you understand how to use the product.&lt;/p&gt;

&lt;p&gt;Technical writers are employed in many industries, such as engineering, software development, healthcare, and more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technical Writing Materials
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/tech-writing"&gt;Google Technical Writing Courses&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://startuptrybe.trainercentralsite.com/course/techwriteearn#/home"&gt;Tech: Write and Earn&lt;/a&gt; - (Highly recommended)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.pluralsight.com/courses/technical-writing-software-documentation"&gt;Technical Writing&lt;/a&gt; - Documentation on software products&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://idratherbewriting.com/learnapidoc/"&gt;Documenting APIs&lt;/a&gt;: A Guide for Technical Writer&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learntechwriting.co/index.html"&gt;Learn Tech Writing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.udemy.com/course/coding-for-writers-1-basic-programming/"&gt;Coding for writers&lt;/a&gt; - Basic programming&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.udemy.com/course/technical-writing-and-editing/"&gt;Professional Technical Writing&lt;/a&gt;: Advance writing skills&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Books For Technical Writers
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.developersguidetocontent.com/"&gt;The Developer's Guide to Content Creation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.amazon.com/Technical-Writing-101-Real-World-Planning/dp/0970473362"&gt;Technical Writing 101&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.amazon.com/Elements-Technical-Writing-3rd/dp/0205583814"&gt;Technical Writing Essentials&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where To Get Technical Writing Gigs
&lt;/h2&gt;

&lt;p&gt;Several companies pay writers to write for them. Most times, these companies require you to send a proposal. If your proposal is accepted, you get to write on the topic you proposed and get paid. These companies have been compiled in a GitHub repository for easy access.&lt;/p&gt;

&lt;p&gt;I will be dropping different GitHub links, some might contain the same companies but with the addition of&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/malgamves/CommunityWriterPrograms"&gt;Malgamves Community Writer Program&lt;/a&gt; - This contains a list of companies that hire Technical writers.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/Bennykillua/Getting-started-in-Technical-Writing"&gt;Getting Started With Technical Writing&lt;/a&gt; - This is a list of technical writing material with companies included where you can apply for technical writing jobs.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://whopaystechnicalwriters.com/?"&gt;Who pays Technical writers&lt;/a&gt; - A list of Technical writing agencies and the amount they pay.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Technical Writing Tools
&lt;/h2&gt;

&lt;p&gt;I will be dropping tools you can make use of to make your technical writing journey easier.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/BolajiAyodeji/technical-writing-template"&gt;Technical-writing-template&lt;/a&gt; - A sample template with guidelines for writing technical articles.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://hackmd.io/"&gt;HackMD&lt;/a&gt; - You can collaborate on technical documentation in markdown. It provides you with great writing tools so you get to see the code you document alongside your writing.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.canva.com/"&gt;Canva&lt;/a&gt; - Create cover images for your articles and blog posts.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://annotely.com/"&gt;Annotely&lt;/a&gt; - Make drawings, highlights, blurs, and screenshots&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://mermaid.js.org/#/README"&gt;Mermaid&lt;/a&gt; - Create diagrams and visualizations using text and code.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.notion.so/"&gt;Notion&lt;/a&gt; - I personally make use of notion to write out my blogging ideas. The all-in-one workspace for your notes, tasks, wikis, and databases.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://app.grammarly.com/"&gt;Grammarly&lt;/a&gt; - Grammarly is a writing assistant that goes deeper than grammar to offer you comprehensive writing feedback.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/kefranabg/readme-md-generator"&gt;README Markdown generator&lt;/a&gt; - CLI that generates beautiful README.md files.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Technical Writing Guide
&lt;/h2&gt;

&lt;p&gt;When deciding how to create content, it is important to pay attention to some companies that already have amazing style guides to guide you. Here is a list of them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://learn.microsoft.com/en-us/style-guide/welcome/"&gt;Microsoft style guide&lt;/a&gt; - Microsoft manual style guide.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developers.google.com/style"&gt;Google style guide&lt;/a&gt; - provides editorial guidelines for writing clear and consistent Google-related developer documentation.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://diataxis.fr/"&gt;Diataxis&lt;/a&gt; - A systematic framework for technical documentation authoring&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.gitlab.com/ee/development/documentation/styleguide/"&gt;GitLab&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://ptgmedia.pearsoncmg.com/images/9780132101301/samplepages/0132101300.pdf"&gt;IBM style guide&lt;/a&gt; - IBM editorial style guide.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.freecodecamp.org/news/developer-news-style-guide/"&gt;Freecodecamp style guide&lt;/a&gt; - Their publication style guide.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Build Your Portfolio
&lt;/h2&gt;

&lt;p&gt;One of the fastest ways of getting a response from a company you mailed for a job application is by showing them samples of your work. The two companies I work with got back to me with job offers because I showed them samples of my work - articles.&lt;/p&gt;

&lt;p&gt;Having a blog where you post your writing will give you a high advantage and connect you to potential recruiters. Below is the list of platforms where you can post your articles.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://hashnode.com/"&gt;Hashnode&lt;/a&gt; - A community for developers and technical writers.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/"&gt;Dev&lt;/a&gt; - A platform for writers and developers&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://medium.com/"&gt;Medium &lt;/a&gt;- A platform for writers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;NOTE: You can also get paid on these platforms though they have rules and requirements.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another important thing you should note is that the article you intend to show to any company matters! Don't send an article on JavaScript when the company only deals with the topic of AI. Also ensure, you present your best articles.&lt;/p&gt;

&lt;p&gt;When you write, ensure your work is clean, understandable, and readable. That is another trait companies look out for.&lt;/p&gt;

&lt;p&gt;Let me know if you have any questions in the comment section and if you found this article useful, please like, follow, and share with your friends.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Form Validation with JavaScript</title>
      <dc:creator>Tracy | Software Engineer</dc:creator>
      <pubDate>Sat, 03 Jun 2023 17:44:54 +0000</pubDate>
      <link>https://dev.to/tracy4code/form-validation-with-javascript-21l6</link>
      <guid>https://dev.to/tracy4code/form-validation-with-javascript-21l6</guid>
      <description>&lt;p&gt;&lt;strong&gt;Before submitting data to the server, It is important to ensure all required form controls are filled out, in the correct format. This is called client-side form validation and helps ensure data submitted matches the requirements set forth in the various form controls.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  HTML Validation
&lt;/h2&gt;

&lt;p&gt;Although validation can also be done with HTML attributes like - &lt;code&gt;required&lt;/code&gt;, &lt;code&gt;minlength&lt;/code&gt;, &lt;code&gt;maxlength&lt;/code&gt;, &lt;code&gt;min&lt;/code&gt;, &lt;code&gt;max&lt;/code&gt;, &lt;code&gt;type&lt;/code&gt;, and &lt;code&gt;pattern&lt;/code&gt;. The downside of it is that you can't customize it to fit your requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Form Validation?
&lt;/h2&gt;

&lt;p&gt;Have you ever tried to sign up on a website where they had certain requirements? Like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensuring your password is between 8 to 30 characters or making sure your password is mixed between letters, numbers, and asterisks.&lt;/li&gt;
&lt;li&gt;Or ensure you include the @ for the email input field by popping messages like "Please enter a valid email address".&lt;/li&gt;
&lt;li&gt;"This field is required" (You can't leave this field blank)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is called Validation. When you enter your details on a form website, the browser and/or the web server will check to see that the data is in the correct format and within the constraints set by the application.&lt;/p&gt;

&lt;p&gt;Form validation is the process of verifying that the data entered into an HTML form is accurate, complete, and meets the specified criteria before it is submitted to the server.&lt;/p&gt;

&lt;p&gt;The application allows the data to be submitted to the server if the information is correctly formatted. If the information is not correctly formatted, it gives the user an error message explaining what needs to be corrected.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building A Form
&lt;/h2&gt;

&lt;p&gt;Let's build a form webpage in order to solidify our understanding of form validation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The HTML Code
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="formContainer"&amp;gt;
        &amp;lt;header&amp;gt;
            &amp;lt;h1&amp;gt;Sign In&amp;lt;/h1&amp;gt;
            &amp;lt;a href="test1.html"&amp;gt;CHECK&amp;lt;/a&amp;gt;
        &amp;lt;/header&amp;gt;

        &amp;lt;form id="myForm"&amp;gt;
            &amp;lt;div class="formDetails"&amp;gt;
                &amp;lt;label for="name"&amp;gt;Name:&amp;lt;/label&amp;gt;
                &amp;lt;input type="text" id="name" name="name"&amp;gt;
                &amp;lt;div class="errorMessage"&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;

            &amp;lt;div class="formDetails"&amp;gt;
                &amp;lt;label for="email"&amp;gt;Email:&amp;lt;/label&amp;gt;
                &amp;lt;input type="email" id="email" name="email"&amp;gt;
                &amp;lt;div class="errorMessage"&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;

            &amp;lt;div class="formDetails"&amp;gt;
                &amp;lt;label for="password"&amp;gt;Password:&amp;lt;/label&amp;gt;
                &amp;lt;input type="password" id="password" name="password"&amp;gt;
                &amp;lt;div class="errorMessage"&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;

            &amp;lt;div class="formDetails"&amp;gt;
                &amp;lt;label for="confirmpassword"&amp;gt;Confirm Password:&amp;lt;/label&amp;gt;
                &amp;lt;input type="password" id="confirmPassword" name="confirmpassword"&amp;gt;
                &amp;lt;div class="errorMessage"&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;

            &amp;lt;button id="button" type="submit"&amp;gt;Submit&amp;lt;/button&amp;gt;
          &amp;lt;/form&amp;gt;
    &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The HTML code defines a form with four input fields: &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;email&lt;/code&gt;, &lt;code&gt;password&lt;/code&gt;, and &lt;code&gt;confirm password&lt;/code&gt;. Each input field is wrapped in a div element with a class of &lt;code&gt;formDetails&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Below each input field, there is a &lt;code&gt;div&lt;/code&gt; element with a class of &lt;code&gt;errorMessage&lt;/code&gt;. This is where any error messages related to the corresponding input field will be displayed.&lt;/li&gt;
&lt;li&gt;The form also has a submit button with an id of button. This button triggers the form submission when clicked.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The CSS Code
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    background-color: #021012;
    font-family: sans-serif;
}

.formContainer{
    width: 80%;
    height: 85vh;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: #E2F4FD;
}
header{
    text-align: center;
    margin: 2rem 0;
    font-weight: 600;
}

#myForm{
    width: 90%;
    margin: 1rem auto;
}

.formDetails{
    margin: 1rem 0;
}

label{
    display: block;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .4rem;
}

input{
    width: 100%;
    padding: .6rem 0;
    outline: none;
    font-size: 1rem;
}

input:focus{
    outline: 1px solid #064247;
}
button{
    margin: 1.1rem 0;
    background-color: #053135;
    color: #fff;
    font-weight: 600;
    border: none;
    padding: .8rem 0;
    width: 100%;
}
.errorMessage{
    margin-top: .3rem;
    font-size: .9rem;
    font-weight: 600;
    font-family: monospace;
}
.formDetails.success input {
    border-color: #09c372;
    outline: none;
  }

  .formDetails.error input {
    border-color: #f2070e;
  }

@media screen and (min-width: 1024px) {
    .formContainer{
        width: 30%;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;.formContainer&lt;/code&gt; selector sets the &lt;code&gt;width&lt;/code&gt; of the form container to &lt;code&gt;80%&lt;/code&gt; of the parent element, and the &lt;code&gt;height&lt;/code&gt; to &lt;code&gt;85%&lt;/code&gt; of the viewport height, and positions it in the center of the screen using &lt;code&gt;absolute&lt;/code&gt; positioning and the &lt;code&gt;transform&lt;/code&gt; property - &lt;code&gt;transform: translate(-50%, -50%)&lt;/code&gt;. The background color is set to a light shade of blue - &lt;code&gt;#021012&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;input&lt;/code&gt; and &lt;code&gt;button&lt;/code&gt; selectors set the width to &lt;code&gt;100%&lt;/code&gt; of the parent container, padding to &lt;code&gt;0.6rem&lt;/code&gt; at the top and bottom of the &lt;code&gt;input&lt;/code&gt; selector, &lt;code&gt;outline&lt;/code&gt; to &lt;code&gt;none&lt;/code&gt;, and font size to &lt;code&gt;1rem&lt;/code&gt;. There is also a focus state added to the input selector that outlines the input with a &lt;code&gt;1px solid&lt;/code&gt; border in a different color.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;.formDetails.success&lt;/code&gt; input selector applies the styles to the input element when the &lt;code&gt;.formDetails&lt;/code&gt; container has a class of &lt;code&gt;success&lt;/code&gt;. It sets the border color to a light shade of green and the outline to none.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;.formDetails.error&lt;/code&gt; input selector applies the styles to the input element when the &lt;code&gt;.formDetails&lt;/code&gt; container has a class of &lt;code&gt;error&lt;/code&gt;. It sets the border color to a dark shade of red.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@media screen and (min-width: 1024px) {
    .formContainer{
        width: 30%;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;@media&lt;/code&gt; rule creates a media query that applies styles when the screen width is above 1024px. In this case, the width of the &lt;code&gt;.formContainer&lt;/code&gt; is set to 30% of the parent element. This makes the form container smaller when viewed on larger screens.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  JavaScript For Validation
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The code listens for the form submission event and prevents the form from submitting by default. It then performs validations on each input field and displays appropriate error messages in the &lt;code&gt;errorMessage&lt;/code&gt; divs and applies the success and error classes to the parent &lt;code&gt;formDetails&lt;/code&gt; divs based on the validation result.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const myForm = document.getElementById('myForm');
myForm.addEventListener('submit', (event) =&amp;gt; {
    event.preventDefault(); 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For each &lt;code&gt;input&lt;/code&gt; field, the code first gets the input value and trims any whitespace. It then gets the corresponding &lt;code&gt;errorMessage&lt;/code&gt; div and input element using the &lt;code&gt;querySelector&lt;/code&gt; method. If the input value is empty, the code sets the error message to a relevant message and applies the error class to the parent &lt;code&gt;formDetails&lt;/code&gt; div. If the input value is not empty, the code clears the error message and applies the success class to the parent &lt;code&gt;formDetails&lt;/code&gt; div.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const name = myForm.elements.name.value.trim();
const nameError = document.querySelector('#name + .errorMessage');
const nameInput = document.getElementById('name');
if (name === '') {
    nameError.textContent = 'Name is required.';
      nameInput.parentNode.classList.add('error');
      nameInput.parentNode.classList.remove('success');
    } else {
      nameError.textContent = '';
      nameInput.parentNode.classList.add('success');
      nameInput.parentNode.classList.remove('error');
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For the email input field, the code also checks if the email is in a valid format using a regular expression. If the email is invalid, the code sets the error message to a relevant message and applies the error class to the parent &lt;code&gt;formDetails&lt;/code&gt; div.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const email = myForm.elements.email.value.trim();
    const emailError = document.querySelector('#email + .errorMessage');
    const emailInput = document.getElementById('email');
    if (email === '') {
      emailError.textContent = 'Email is required.';
      emailInput.parentNode.classList.add('error');
      emailInput.parentNode.classList.remove('success');
    } else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
      emailError.textContent = 'Please enter a valid email address.';
      emailInput.parentNode.classList.add('error');
      emailInput.parentNode.classList.remove('success');
    } else {
      emailError.textContent = '';
      emailInput.parentNode.classList.add('success');
      emailInput.parentNode.classList.remove('error');
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For the password input field, the code also checks if the password is at least 8 characters long. If the password is less than 8 characters, the code sets the error message to a relevant message and applies the error class to the parent &lt;code&gt;formDetails&lt;/code&gt; div.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const password = myForm.elements.password.value.trim();
    const passwordError = document.querySelector('#password + .errorMessage');
    const passwordInput = document.getElementById('password');
    if (password === '') {
      passwordError.textContent = 'Password is required.';
      passwordInput.parentNode.classList.add('error');
      passwordInput.parentNode.classList.remove('success');
    } else if (password.length &amp;lt; 8) {
      passwordError.textContent = 'Password is expected to be 8 characters.';
      passwordInput.parentNode.classList.add('error');
      passwordInput.parentNode.classList.remove('success');
    } else {
      passwordError.textContent = '';
      passwordInput.parentNode.classList.add('success');
      passwordInput.parentNode.classList.remove('error');
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For the confirm password input field, the code also checks if the confirm password matches the password. If the &lt;code&gt;confirm&lt;/code&gt; password does not match, the code sets the error message to a relevant message and applies the error class to the parent &lt;code&gt;formDetails&lt;/code&gt; div.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const confirmPassword = myForm.elements.confirmpassword.value.trim();
    const confirmPasswordError = document.querySelector('#confirmPassword + .errorMessage');
    const confirmPasswordInput = document.getElementById('confirmPassword');
    if (confirmPassword === '') {
      confirmPasswordError.textContent = 'Confirm Password is required.';
      confirmPasswordInput.parentNode.classList.add('error');
      confirmPasswordInput.parentNode.classList.remove('success');
    } else if (confirmPassword !== password) {
      confirmPasswordError.textContent = 'Passwords do not match.';
      confirmPasswordInput.parentNode.classList.add('error');
      confirmPasswordInput.parentNode.classList.remove('success');
    } else {
      confirmPasswordError.textContent = '';
      confirmPasswordInput.parentNode.classList.add('success');
      confirmPasswordInput.parentNode.classList.remove('error');
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;In the final step, the code checks if there are any error messages displayed. If there are no error messages, the code submits the form. Otherwise, it prevents the form from submitting.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (nameError.textContent === '' &amp;amp;&amp;amp; emailError.textContent === '' &amp;amp;&amp;amp; passwordError.textContent === '' &amp;amp;&amp;amp; confirmPasswordError.textContent === '') {
        myForm.submit();
      }
    });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Final Result
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://codepen.io/Tracy4work/pen/BaqGgqm?editors=1000"&gt;Check it out on Codepen&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you found this article helpful, please ensure you follow for more helpful posts. I would also appreciate your ideas on what you would be interested in learning,&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Mastering API Fetch: How to Build a Movie Website with Real-Time Data Updates</title>
      <dc:creator>Tracy | Software Engineer</dc:creator>
      <pubDate>Fri, 02 Jun 2023 21:58:33 +0000</pubDate>
      <link>https://dev.to/tracy4code/mastering-api-fetch-how-to-build-a-movie-website-with-real-time-data-updates-30ob</link>
      <guid>https://dev.to/tracy4code/mastering-api-fetch-how-to-build-a-movie-website-with-real-time-data-updates-30ob</guid>
      <description>&lt;p&gt;&lt;strong&gt;Learn how to use the Fetch API to asynchronously request data from an external API and dynamically build a movie website. This beginner-friendly tutorial is great for learning about APIs, async JS, and building dynamic front-end applications.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This article will explore how API fetch works while building a movie website.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Fetch?
&lt;/h2&gt;

&lt;p&gt;Fetch is a web API provided by modern browsers that allow developers to make HTTP requests to servers and retrieve data or resources from them.&lt;/p&gt;

&lt;p&gt;If you have worked with XMLHttpRequest (XHR) object, the Fetch API can perform all the tasks as the XHR object does.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using the Fetch API
&lt;/h2&gt;

&lt;p&gt;To use Fetch, developers can call the global &lt;code&gt;fetch()&lt;/code&gt; function and pass in a URL to the resource they want to fetch.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch('https://apiexample.com/data')
  .then(response =&amp;gt; response.json())
  .then(data =&amp;gt; console.log(data))
  .catch(error =&amp;gt; console.error(error));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The above code retrieves JSON data from a URL called &lt;strong&gt;&lt;a href="https://apiexample.com/data"&gt;https://apiexample.com/data&lt;/a&gt;&lt;/strong&gt; and parses it as JSON using the .json() method, If an error occurs during the fetch, the catch() method logs an error message to the console.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Features of the movie website
&lt;/h2&gt;

&lt;p&gt;Using TMDB API to display movie posters and information on the movie card.&lt;/p&gt;

&lt;p&gt;Building a functional search bar to search for any movie and display results.&lt;/p&gt;

&lt;p&gt;A modal box that displays details of the movie when you click on the movie card.&lt;/p&gt;

&lt;h2&gt;
  
  
  The layout of the website
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The website would have a header, main, and footer.&lt;/li&gt;
&lt;li&gt;The Header consists of the movie title and a search bar to search for movies.&lt;/li&gt;
&lt;li&gt;The Search Bar&lt;/li&gt;
&lt;li&gt;Main - This is where the movie card will be displayed.&lt;/li&gt;
&lt;li&gt;Footer - The footer will carry copyright text along with the name of the developer.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Header
&lt;/h2&gt;

&lt;p&gt;Copy and paste this code into your code editor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;header class="header"&amp;gt;
        &amp;lt;div class="movieheader"&amp;gt;
            &amp;lt;p style="display: flex; align-items: center;"&amp;gt;🎥any&amp;lt;span style="color: hsla(349, 69%, 51%, 1);"&amp;gt;movie&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;

        &amp;lt;form action="/" class="search-btn"&amp;gt;
            &amp;lt;input type="text" placeholder="search for a movie..."&amp;gt;
        &amp;lt;/form&amp;gt;
    &amp;lt;/header&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The HTML tag consists of the movie title with the class name "movie header" and a search bar &lt;code&gt;"search-btn"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The input field for the search bar is wrapped up in a form container because it provides a way to submit data to a server for processing. When a user enters a movie query into the search bar and hits &lt;code&gt;"Enter"&lt;/code&gt;, the data entered into the input field is packaged into an HTTP request and sent to a server for processing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;*,
*::before,
*::after{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body{
    font-family: 'Ubuntu', sans-serif;
    background-color: rgb(11, 12, 13);
}

.movieheader{
    font-size: 1.2rem;
    color: hsla(200, 100%, 95%, 1);
}
.movieheader p{
    font-size: 1.2rem;
    font-weight: 600;
}

.header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 95%;
    margin: 1.4rem auto;
}
.search-btn{
    align-items: center;
    border-radius: 5px;
}
.search-btn input{
    outline: none;
    border: none;
    padding: .5rem .3rem;
    font-size: .9rem;
    background-color: hsla(250, 6%, 20%, 1);
    color: hsla(200, 100%, 95%, 1);
    border-radius: 5px;
}


@media screen and (min-width: 750px) {
    .header{
        width: 90%;
        padding: 1rem 0;
    }
    .movieheader p{
        font-size: 1.7rem;
    }
    .search-btn input{
        width: 50vh;
    }
    .sm-search{
        display: none;
    }
    .search-btn input{
        padding: .8rem .5rem;
        font-size: 1rem;
    }
}



@media screen and (min-width: 1024px) {
    .header{
        width: 90%;
        padding: 1rem 0;
    }
    .movieheader p{
        font-size: 1.7rem;
    }
    .search-btn input{
        width: 50vh;
    }
    .sm-search{
        display: none;
    }
    .search-btn input{
        padding: .8rem .5rem;
        font-size: 1rem;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;It has a dark background color of &lt;code&gt;rgb(11, 12, 13)&lt;/code&gt;. On the Desktop screen, the font size of the movie title is &lt;code&gt;font-size: 1.7rem;&lt;/code&gt; and on a mobile screen, the font size is &lt;code&gt;1.2rem&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;I added a media query for responsiveness.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Search Bar Functionality
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;form action="/" class="search-btn"&amp;gt;
   &amp;lt;input type="text" placeholder="search for a movie..."&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;I used the &lt;code&gt;&amp;lt;form&amp;gt;&lt;/code&gt; tag as a container for the search bar input field because it provides a way to submit the search query to a server for processing.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const form = document.querySelector('.search-btn');
const movieCon = document.querySelector('.movieContainer');
const input = form.querySelector('input');
const searchResults = document.querySelector('.search-result');
const searchResultContainer = document.querySelector('.searchResultContainer');


form.addEventListener('submit', async (event) =&amp;gt; {
  event.preventDefault();
  const query = input.value;
  const apiKey = 'YOUR_API_KEY'; // replace with your actual API key
  const apiUrl = `https://api.themoviedb.org/3/search/movie?api_key=${apiKey}&amp;amp;query=${query}`;

  try {
    const response = await fetch(apiUrl);
    const data = await response.json();
    const movies = data.results;

    searchResults.innerHTML = '';
    movieCon.innerHTML = '';


    movies.forEach((movie) =&amp;gt; {
      const { poster_path, title, release_date, vote_average } = movie;

      const movieContainer = document.createElement('div');
      movieContainer.classList.add('movieCard');

      const posterUrl = poster_path
        ? `https://image.tmdb.org/t/p/w500/${poster_path}`
        : 'https://via.placeholder.com/500x750?text=No+poster';

      movieContainer.innerHTML = `
        &amp;lt;img src="${posterUrl}" alt="${title}" class="moviePoster"&amp;gt;
        &amp;lt;div class="movieTitle"&amp;gt;${title}&amp;lt;/div&amp;gt;
        &amp;lt;div class="rating"&amp;gt;
          &amp;lt;span class="rate"&amp;gt;${vote_average}&amp;lt;/span&amp;gt;
          &amp;lt;span class="year"&amp;gt;${release_date ? release_date.slice(0, 4) : ''}&amp;lt;/span&amp;gt;
        &amp;lt;/div&amp;gt;
      `;

      searchResults.appendChild(movieContainer);
    });

    const header = searchResultContainer.querySelector('header');
    if (!header) {
      const header = document.createElement('header');
      header.innerHTML = `&amp;lt;h1&amp;gt;Search Results: ${query}&amp;lt;/h1&amp;gt;`;
      searchResultContainer.insertBefore(header, searchResults);
    } else {
      header.innerHTML = `&amp;lt;h1&amp;gt;Search Results: ${query}&amp;lt;/h1&amp;gt;`;
    }
  } catch (error) {
    console.error(error);
  }

});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This above code sets up a search feature for movies using The Movie Database TMDB API. It starts by selecting relevant elements from the HTML document using their class names (&lt;code&gt;form&lt;/code&gt;, &lt;code&gt;movieCon&lt;/code&gt;, &lt;code&gt;input&lt;/code&gt;, &lt;code&gt;searchResults&lt;/code&gt;, and &lt;code&gt;searchResultContainer&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The code then adds an event listener to the form element for the &lt;code&gt;submit&lt;/code&gt; event. When the user submits the form, the event listener function is called. The function first prevents the default form submission behavior with &lt;code&gt;event.preventDefault()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;It then retrieves the value of the user's search query from the input element and constructs the API endpoint URL with the query and the TMDB API key.&lt;/li&gt;
&lt;li&gt;The code then sends a request to the TMDB API using &lt;code&gt;fetch()&lt;/code&gt;. When the response is received, it is converted from JSON format to a JavaScript object using &lt;code&gt;response.json()&lt;/code&gt;. The object is then processed to extract an array of movies matching the search query.&lt;/li&gt;
&lt;li&gt;The movies array is then looped over using &lt;code&gt;forEach()&lt;/code&gt;, and for each movie, a &lt;code&gt;div&lt;/code&gt; element with the movie details is created using &lt;code&gt;document.createElement()&lt;/code&gt;. The &lt;code&gt;div&lt;/code&gt; element is then populated with movie data and appended to the &lt;code&gt;searchResults&lt;/code&gt; element.&lt;/li&gt;
&lt;li&gt;The code then checks if there is already a header element in the &lt;code&gt;searchResultContainer&lt;/code&gt;. If there isn't, a new header element is created and inserted before the &lt;code&gt;searchResults&lt;/code&gt; element. If there is, the &lt;code&gt;h1&lt;/code&gt; element of the header is updated with the new search query.&lt;/li&gt;
&lt;li&gt;If any errors occur during the API request and response process, they are logged to the console using &lt;code&gt;console.error()&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Displaying the Movies - The Main
&lt;/h2&gt;

&lt;p&gt;I will be using TMDB API to display movies on the website. Before that, create a movie container in the HTML body for the movie card and details.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="movieContainer"&amp;gt;
        &amp;lt;div class="movieCard"&amp;gt;
            &amp;lt;img src="" alt="" class="moviePoster"&amp;gt;
            &amp;lt;div class="movieTitle"&amp;gt;John Wick&amp;lt;/div&amp;gt;

            &amp;lt;div class="rating"&amp;gt;
                &amp;lt;span class="rate"&amp;gt;&amp;lt;/span&amp;gt;
                &amp;lt;span class="year"&amp;gt;&amp;lt;/span&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;NOTE: If you don't have an API Key, you would be required to sign up on the TMDB website.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Styling The Movie Container&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;/*Movie container for mobile screen*/
.movieContainer{
    display: flex;
    justify-content: center;
    flex-direction: column;
    width: 90%;
    margin: auto;
    margin-bottom: 5rem;
    padding-bottom: 2rem;
}
.movieCard{
    margin: .5rem 0;
}

.moviePoster{
    width: 100%;
    height: 40vh;
    object-fit: cover;
}

.movieTitle{
    font-size: 1rem;
    font-weight: 600;
    margin: .6rem 0;
}

.rating{
    display: flex;
    justify-content: space-between;
    color: gray;
    font-weight: 600;
}

@media screen and (min-width: 1024px) {
.movieContainer{
    flex-direction: row;
    flex-wrap: wrap;
}

.movieCard{
    margin: .6rem;
    width: 200px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;On mobile screen. the flex-direction of the movie container is set to &lt;code&gt;column&lt;/code&gt;. So it displays one movie per column. While on the Desktop, it displays 6 movie cards per row.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Javascript Functionality For API Call To Display Movies&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;const apiKey = 'YOUR_API_KEY';

fetch(`https://api.themoviedb.org/3/movie/popular?api_key=${apiKey}`)
  .then(response =&amp;gt; response.json())
  .then(data =&amp;gt; {
    console.log(data)
    const movies = data.results;
    const movieContainer = document.querySelector('.movieContainer');

    movies.forEach(movie =&amp;gt; {
      const movieCard = document.createElement('div');
      movieCard.classList.add('movieCard');

      const moviePoster = document.createElement('img');
      moviePoster.classList.add('moviePoster');
      moviePoster.src = `https://image.tmdb.org/t/p/w500${movie.poster_path}`;
      moviePoster.alt = movie.title;

      const movieTitle = document.createElement('div');
      movieTitle.classList.add('movieTitle');
      movieTitle.innerText = movie.title;

      const rating = document.createElement('div');
      rating.classList.add('rating');

      const rate = document.createElement('span');
      rate.classList.add('rate');
      rate.innerText = `${movie.vote_average}/10`;

      const year = document.createElement('span');
      year.classList.add('year');
      year.innerText = movie.release_date.split('-')[0];

      rating.appendChild(rate);
      rating.appendChild(year);

      movieCard.appendChild(moviePoster);
      movieCard.appendChild(movieTitle);
      movieCard.appendChild(rating);

      movieContainer.appendChild(movieCard);
    });
  })
  .catch(error =&amp;gt; {
    console.error('Error fetching movies:', error);
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code will display popular movies including movie images, title, rating, and year of release. Here is how I went about it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The line defines a variable to store your API Key.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const apiKey = 'YOUR_API_KEY';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The fetch function calls the URL of the API endpoint as a parameter, with the &lt;code&gt;apiKey&lt;/code&gt; variable inserted into the URL string using template literals - &lt;code&gt;{apiKey}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The fetch function returns a Promise, which is resolved with the response data obtained from the API. The response is then parsed as JSON using the &lt;code&gt;json()&lt;/code&gt; method, which also returns a Promise.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch(`https://api.themoviedb.org/3/movie/popular?api_key=${apiKey}`)
    .then(response =&amp;gt; response.json())
    .then(data =&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The container element for the movies is obtained using &lt;code&gt;document.querySelector()&lt;/code&gt;, and then a loop is used to iterate over each movie in the list.
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For each movie, a new &lt;code&gt;div&lt;/code&gt; element is created using &lt;code&gt;document.createElement()&lt;/code&gt;, with a class of &lt;code&gt;movieCard&lt;/code&gt;. An &lt;code&gt;img&lt;/code&gt; element is also created for the movie poster, with a class of &lt;code&gt;moviePoster&lt;/code&gt; and an alt attribute set to the movie title.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;movies.forEach(movie =&amp;gt; {
      const movieCard = document.createElement('div');
      movieCard.classList.add('movieCard');

      const moviePoster = document.createElement('img');
      moviePoster.classList.add('moviePoster');
      moviePoster.src = `https://image.tmdb.org/t/p/w500${movie.poster_path}`;
      moviePoster.alt = movie.title;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two additional elements are created for the movie title and its rating, with classes of &lt;code&gt;movieTitle&lt;/code&gt; and &lt;code&gt;rating&lt;/code&gt;, respectively. The rating element contains two child &lt;code&gt;span&lt;/code&gt; elements for the rating and year of release, with classes of rate and year, respectively. The movie &lt;code&gt;poster&lt;/code&gt;, &lt;code&gt;title&lt;/code&gt;, and &lt;code&gt;rating&lt;/code&gt; elements are then added as child elements of the &lt;code&gt;movieCard&lt;/code&gt; div. Finally, the &lt;code&gt;movieCard&lt;/code&gt; div is added as a child element of the movie container element obtained earlier.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const movieTitle = document.createElement('div');
      movieTitle.classList.add('movieTitle');
      movieTitle.innerText = movie.title;

      const rating = document.createElement('div');
      rating.classList.add('rating');

      const rate = document.createElement('span');
      rate.classList.add('rate');
      rate.innerText = `${movie.vote_average}/10`;

      const year = document.createElement('span');
      year.classList.add('year');
      year.innerText = movie.release_date.split('-')[0];

      rating.appendChild(rate);
      rating.appendChild(year);

      movieCard.appendChild(moviePoster);
      movieCard.appendChild(movieTitle);
      movieCard.appendChild(rating);

      movieContainer.appendChild(movieCard);
    });
  })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Building A Box Modal To display Movie details
&lt;/h2&gt;

&lt;p&gt;*&lt;em&gt;I thought about creating a modal box to display the movie details, what is your thought about doing in another article? Let me know what you think about that.&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
If you have a question, do let me know in the comment section. Also like and follow me if you found this article helpful.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Footer
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;footer&amp;gt;
   &amp;lt;div class="footerContainer"&amp;gt;
    &amp;lt;p&amp;gt;Copyright 2023&amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;Created By Tracy&amp;lt;/p&amp;gt;            
    &amp;lt;/div&amp;gt;     
&amp;lt;/footer&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;footer&lt;/code&gt; tag contains two paragraph tags stating the name of the developer and a copyright text.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;footer{
    background-color: #A01D1E;
    font-weight: 600;
    margin-top: 1rem;
    padding: 1rem 1.1rem;
}
.footerContainer{
    display: flex;
    justify-content: space-between;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;@media screen and (min-width: 1024px){&lt;br&gt;
    .footerContainer{&lt;br&gt;
    justify-content: space-around;&lt;br&gt;
}&lt;br&gt;
}&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On a mobile screen, the spacing of the paragraph tag is set to space-between, while on a desktop, it is set to space-around.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Final Result
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://codepen.io/Tracy4work/pen/vYVqowB"&gt;The final result on Codepen&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>api</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Git and GitHub Simplified</title>
      <dc:creator>Tracy | Software Engineer</dc:creator>
      <pubDate>Tue, 16 May 2023 18:49:44 +0000</pubDate>
      <link>https://dev.to/tracy4code/git-and-github-simplified-1le1</link>
      <guid>https://dev.to/tracy4code/git-and-github-simplified-1le1</guid>
      <description>&lt;p&gt;&lt;strong&gt;Git is a modern and widely used distributed version control system in the world. The version control system allows us to monitor and work with our team members in the same workspace.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This tutorial doesn't cover every aspect of git and GitHub but will provide you with enough knowledge to be comfortable using git and GitHub.&lt;/p&gt;

&lt;p&gt;If you're a beginner developer, you might think that these two terms mean the same thing – but they're different.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;In order to complete this tutorial, you'll need the following:&lt;/p&gt;

&lt;p&gt;• A command line interface.&lt;/p&gt;

&lt;p&gt;• A text editor of your choice (I will be using Ubuntu).&lt;/p&gt;

&lt;p&gt;• A GitHub account.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Git?
&lt;/h2&gt;

&lt;p&gt;Git is a version control system that allows you to keep track of your codes and makes changes to your files.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Version Control System?
&lt;/h2&gt;

&lt;p&gt;A version control system is basically software that helps developers to work together and maintain a complete history of their work. You can think of it as a digital time machine that allows you to go back to previous versions of your code and make changes as needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Does Git Do?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Save Time&lt;/strong&gt; - Each command takes only a few seconds to execute so we can save a lot of time compared to logging in to a GitHub account.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offline Working&lt;/strong&gt; - Git supports offline working which is crucial especially when facing internet connectivity issues, it will not affect one's work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Undo Mistakes&lt;/strong&gt; - You're able to undo any mistakes made during your coding session using the "git restore" command.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Track the Changes&lt;/strong&gt; - You can track your codes and make changes to them using the git commands.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Used By Multiple People&lt;/strong&gt; - When a team works on real-life projects, git helps ensure no code conflicts between the developers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How To Configure Git
&lt;/h2&gt;

&lt;p&gt;To configure git, you need to follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install git on your computer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You need to install git on your computer in order to use it. To verify if you have git on your system, you can run this command on the command line: &lt;code&gt;git --version&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set up your identity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After installation, open a command line or terminal and run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global user.name "Your Name"
git config --global user.email "youremail@domain.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;NOTE: Replace "&lt;strong&gt;Your Name&lt;/strong&gt;" with your own name and email.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configure your text editor&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Git uses a text editor to prompt you for commit messages and other input. paste this code to configure your text editor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global core.editor nano
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;NOTE: &lt;strong&gt;You can replace "nano" with the name of your preferred editor&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating A File
&lt;/h2&gt;

&lt;p&gt;We use the &lt;code&gt;touch&lt;/code&gt; command to create a file in git, you type &lt;code&gt;touch&lt;/code&gt; followed by the name of the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Cloning a repository
&lt;/h2&gt;

&lt;p&gt;After creating the repository on your GitHub, click on '&lt;strong&gt;code&lt;/strong&gt;' and copy the HTTPS URL.&lt;/p&gt;

&lt;p&gt;Type &lt;code&gt;git clone&lt;/code&gt; on your code editor and paste the URL.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/Tra-G/anymovie.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to add files in git
&lt;/h2&gt;

&lt;p&gt;After cloning the repository and working on the files, your work is not being tracked by Git. To track your work, you will make use of the &lt;code&gt;git add&lt;/code&gt; command. There are two methods of adding files on git:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add .&lt;/code&gt; - The dot that comes after "git" means all the files that exist in the repository. So when you use git add ., it will add all the files in that repository.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add file&lt;/code&gt; - This is used to add specific file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add filename
git add .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to commit files in Git
&lt;/h2&gt;

&lt;p&gt;Git commit is used to save changes made to a project and record them in the project repository. It is the next stage after git add. To commit files of a project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -m "the commit message goes here"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;git commit&lt;/code&gt; tells Git that all the files staged are ready to be committed so it is time to take a snapshot. &lt;code&gt;-m&lt;/code&gt; stands for message and &lt;code&gt;-m "the commit message goes here"&lt;/code&gt; is the commit message.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to push your project  to GitHub
&lt;/h2&gt;

&lt;p&gt;After committing your project changes, the next step is pushing your work to your GitHub. If you don't have a GitHub repository, don't worry. I will explain the process.&lt;/p&gt;

&lt;p&gt;To push your work, type &lt;code&gt;git push&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;git push&lt;/code&gt; command is used to upload the committed changes to a remote repository - GitHub where you will be able to see all the changes you have made so far.&lt;/p&gt;

&lt;h2&gt;
  
  
  Navigating your way on GitHub
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;To get started on Git, you need a GitHub account where you will upload all committed changes.&lt;/p&gt;
&lt;h2&gt;
  
  
  Creating a GitHub account
&lt;/h2&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go to the GitHub website and create an account&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Creating a repository
&lt;/h2&gt;

&lt;p&gt;After creating an account, to get started with working on a project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on new and create a repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Deleting a repository
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;To delete a repository on GitHub, go to the specific repository you want to delete.&lt;/li&gt;
&lt;li&gt;Click on settings and scroll down to the bottom of the page where you will see "&lt;strong&gt;Danger Zone&lt;/strong&gt;".&lt;/li&gt;
&lt;li&gt;Click on the last option at the bottom which says &lt;strong&gt;Delete this repository&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;NOTE: It is not advisable to delete a repository unless it is necessary.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Collaborating with people on GitHub
&lt;/h2&gt;

&lt;p&gt;There are times when you will be required to collaborate with people in building projects and knowing how to collaborate with people on GitHub will help you a long way even while working.&lt;/p&gt;

&lt;p&gt;To collaborate with people on GitHub:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to the repository you intend to work on.&lt;/li&gt;
&lt;li&gt;Click on settings and on the left side, click on Collaborators and you can start adding people you want to collaborate with.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Knowing how to make use of these commands will make your job as a software developer easier and increase your experience.&lt;/p&gt;

&lt;p&gt;If you found this article helpful, like and follow for more helpful content on web development.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>git</category>
      <category>softwareengineering</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Building An Image Slider With Swiper Js</title>
      <dc:creator>Tracy | Software Engineer</dc:creator>
      <pubDate>Thu, 11 May 2023 16:37:08 +0000</pubDate>
      <link>https://dev.to/tracy4code/building-an-image-slider-with-swiper-js-39ng</link>
      <guid>https://dev.to/tracy4code/building-an-image-slider-with-swiper-js-39ng</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;Swiper JS is a popular open-source library for creating responsive and mobile-friendly touch sliders, and carousel components for websites and web applications.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It provides a range of options for customizing the appearance and behavior of the slider, including navigation buttons, pagination, autoplay, and more. I will be going over the steps to use Swiper Js in building an image slider.&lt;/p&gt;

&lt;p&gt;The image slider will contain a navigation for users to navigate back and forth in order to view different images. It will also contain a clickable pagination so you can click to view a particular image.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Google &lt;a href="https://swiperjs.com/"&gt;https://swiperjs.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;demo&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You will be provided with samples of various Swiper demos when you click on "Demos".&lt;/p&gt;

&lt;p&gt;Scroll down and click on navigation-per-view; above it, click on &lt;strong&gt;element&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The element page contains the sample code files and a live view of the project. Copy the whole HTML code and paste it into your code editor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;

&amp;lt;head&amp;gt;
  &amp;lt;meta charset="utf-8" /&amp;gt;
  &amp;lt;title&amp;gt;Swiper demo&amp;lt;/title&amp;gt;
  &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" /&amp;gt;

  &amp;lt;style&amp;gt;
    html,
    body {
      position: relative;
      height: 100%;
    }

    body {
      background: #eee;
      font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
      font-size: 14px;
      color: #000;
      margin: 0;
      padding: 0;
    }

    swiper-container {
      width: 100%;
      height: 100%;
    }

    swiper-slide {
      text-align: center;
      font-size: 18px;
      background: #fff;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    swiper-slide img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  &amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;

  &amp;lt;swiper-container class="mySwiper" pagination="true" pagination-clickable="true" space-between="30"
    slides-per-view="3"&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 1&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 2&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 3&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 4&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 5&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 6&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 7&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 8&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 9&amp;lt;/swiper-slide&amp;gt;
  &amp;lt;/swiper-container&amp;gt;

  &amp;lt;script src="https://cdn.jsdelivr.net/npm/swiper@9/swiper-element-bundle.min.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If you already have an HTML boilerplate, then you will need the Swiper link, HTML, and CSS code:&lt;/li&gt;
&lt;li&gt;Scroll down the element page&lt;/li&gt;
&lt;li&gt;Copy the link on the script tag and paste it into your HTML boilerplate below all HTML tags.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script src="https://cdn.jsdelivr.net/npm/swiper@9/swiper-element-bundle.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Swiper link is necessary to make any logic you add functional. Without the link tag, the slider wouldn't work.&lt;/p&gt;

&lt;p&gt;The next step is to copy the HTML code and paste it into my code editor&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;swiper-container class="mySwiper" pagination="true" pagination-clickable="true" space-between="30"
    slides-per-view="3"&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 1&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 2&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 3&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 4&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 5&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 6&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 7&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 8&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 9&amp;lt;/swiper-slide&amp;gt;
  &amp;lt;/swiper-container&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I will be replacing the &lt;strong&gt;slide 1&lt;/strong&gt; text with an image tag containing some images for each &lt;code&gt;swiper-slide&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="slide-container"&amp;gt;
        &amp;lt;swiper-container class="mySwiper" pagination="true" navigation="true" loop="true" pagination-clickable="true" space-between="30"
            slides-per-view="3"&amp;gt;
            &amp;lt;swiper-slide&amp;gt;
            &amp;lt;img src="https://thegadgetflow.com/wp-content/uploads/2020/04/10-gadgets-for-a-futuristic-home-office-1200x675.jpg"&amp;gt;
            &amp;lt;/swiper-slide&amp;gt;

            &amp;lt;swiper-slide&amp;gt;
            &amp;lt;img src="https://resources.owllabs.com/hubfs/uneebo-office-design-yNtCxu4kJXk-unsplash.jpg"&amp;gt;
            &amp;lt;/swiper-slide&amp;gt;

            &amp;lt;swiper-slide&amp;gt;
            &amp;lt;img src="https://cdn.bisnow.net/resize?type=jpeg&amp;amp;url=https%3A%2F%2Fs3.amazonaws.com%2Fcdn.bisnow.net%2Fcontent%2Fimages%2F2019%2F03%2F5ca121a2f2118-20180520_venture_arch_opentable_0002_screenres-copy.jpeg&amp;amp;width=2160&amp;amp;sign=0OQSfq1SFkLDAMZhNvFNGDfDgR7LLrpgTkBcab8_tqc"&amp;gt;
            &amp;lt;/swiper-slide&amp;gt;

            &amp;lt;swiper-slide&amp;gt;
            &amp;lt;img src="https://www.hpe.com/content/dam/hpe/insights/articles/2021/09/how-technology-is-enabling-the-new-hybrid-workspace/How-technology-is-enabling-the-new-hyrbid-workspace.jpg.transform/nxt-original/image.jpeg"&amp;gt;
            &amp;lt;/swiper-slide&amp;gt;

            &amp;lt;swiper-slide&amp;gt;
            &amp;lt;img src="https://cdna.artstation.com/p/assets/images/images/049/563/806/large/amy-colored.jpg?1652793049"&amp;gt;
            &amp;lt;/swiper-slide&amp;gt;

            &amp;lt;swiper-slide&amp;gt;
            &amp;lt;img src="https://cdn.oneesports.gg/cdn-data/2022/02/Anime_HimoutoUmaruChanR-1024x576.webp"&amp;gt;
            &amp;lt;/swiper-slide&amp;gt;

            &amp;lt;swiper-slide&amp;gt;
            &amp;lt;img src="https://i.pinimg.com/550x/f5/a3/85/f5a385e2976b8d378a55cfa04396315a.jpg"&amp;gt;
            &amp;lt;/swiper-slide&amp;gt;

            &amp;lt;swiper-slide&amp;gt;&amp;lt;img src="https://www.cnet.com/a/img/resize/69256d2623afcbaa911f08edc45fb2d3f6a8e172/hub/2023/02/03/afedd3ee-671d-4189-bf39-4f312248fb27/gettyimages-1042132904.jpg?auto=webp&amp;amp;fit=crop&amp;amp;height=675&amp;amp;width=1200"&amp;gt;&amp;lt;/swiper-slide&amp;gt;

            &amp;lt;swiper-slide&amp;gt;&amp;lt;img src="https://imageio.forbes.com/specials-images/imageserve/5f962df3991e5636a2f68758/0x0.jpg?format=jpg&amp;amp;crop=812,457,x89,y103,safe&amp;amp;width=1200"&amp;gt;&amp;lt;/swiper-slide&amp;gt;
        &amp;lt;/swiper-container&amp;gt;

    &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The JavaScript Logic
&lt;/h2&gt;

&lt;p&gt;Inside the &lt;code&gt;swiper-container&lt;/code&gt;, the JavaScript code for the slider is included and you can add or remove any of them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;swiper-container class="mySwiper" pagination="true" navigation="true" loop="true" pagination-clickable="true" space-between="30"
            slides-per-view="3"&amp;gt;&amp;lt;/swiper-container&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;navigation="true"&lt;/code&gt; - provided for two arrows with a default color of blue to go to the next image or the previous image.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pagination="true"&lt;/code&gt; and &lt;code&gt;pagination-clickable="true"&lt;/code&gt; provides for pagination below the images with a default color of blue. Since I set &lt;code&gt;pagination-clickable="true"&lt;/code&gt;, It allows users to click on the pagination to view a particular image. If not set, it won't be clickable.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;slides-per-view="3"&lt;/code&gt; ensures only three images can be viewed on screen. To view more, you would need to use the navigation icon. So if I make it 4, It will set the images on view to be 4.&lt;/p&gt;

&lt;h2&gt;
  
  
  CSS Styling
&lt;/h2&gt;

&lt;p&gt;The styling of a slider is important because it determines the look. This is why I will be giving a short explanation of the styling I used.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.slide-container{
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
    }

    body {
      background: #1F1F1F;
    }

    swiper-container {
      width: 80%;
      height: 60%;
    }

    swiper-slide img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Styling
&lt;/h2&gt;

&lt;p&gt;I gave the HTML body a dark grey background color of &lt;code&gt;background: #1F1F1F;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The container holding the Swiper container slide-container is displayed &lt;code&gt;flex&lt;/code&gt; allowing for flexible sizing and positioning of elements within a container. so it can be aligned to the center of the webpage using &lt;code&gt;justify-content: center;&lt;/code&gt; &lt;code&gt;align-items-center;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The "&lt;code&gt;height&lt;/code&gt;" property is set to "&lt;code&gt;100vh&lt;/code&gt;", which means the height of the container will be equal to the height of the viewport, ensuring that the image slider takes up the entire screen.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.slide-container{
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Swiper container &lt;code&gt;swiper-container&lt;/code&gt; sets the width and height of the image slider to 80% and 60%, respectively. This means that the slider will take up 80% of the width of its container and 60% of the height, leaving some space around the edges for other content. This is a good practice to ensure that the slider is not too large or too small on the page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;swiper-container {
      width: 80%;
      height: 60%;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last section, &lt;code&gt;swiper-slide img&lt;/code&gt;, styles the individual images within the slider. The display property is set to &lt;code&gt;block&lt;/code&gt; to ensure that each image takes up its own space within the slider. The &lt;code&gt;width&lt;/code&gt; and &lt;code&gt;height&lt;/code&gt; properties are set to &lt;code&gt;100%&lt;/code&gt; to ensure that each image takes up the full width and height of its container. The object-fit set to cover, which means that each image will be scaled to cover the entire container while maintaining its aspect ratio.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Final Result
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://codepen.io/Tracy4work/pen/ExdNOGG"&gt;https://codepen.io/Tracy4work/pen/ExdNOGG&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE: You can change the color of the navigation and pagination depending on your preference.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you found this article helpful, do like and follow for more helpful tips on web development. If there's anything you need an explanation on, be sure to reach out. I will always be active to provide an explanation.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Tackling Browser Compatibility Issues: Tips for Web Developers</title>
      <dc:creator>Tracy | Software Engineer</dc:creator>
      <pubDate>Thu, 11 May 2023 00:24:39 +0000</pubDate>
      <link>https://dev.to/tracy4code/tackling-browser-compatibility-issues-tips-for-web-developers-19lk</link>
      <guid>https://dev.to/tracy4code/tackling-browser-compatibility-issues-tips-for-web-developers-19lk</guid>
      <description>&lt;p&gt;&lt;strong&gt;As a web developer, ensuring your website performs well on all major web browsers is one of your biggest hurdles. Numerous web browsers are available, each with its own peculiarities and subtleties, making it challenging to create a website that appears and functions uniformly across all platforms.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This article discusses some of the typical browser compatibility issues developers face and offers suggestions on how to handle them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why does Browser compatibility matter?
&lt;/h2&gt;

&lt;p&gt;It's important to note that browser compatibility refers to a website's ability to operate and appear the same across various web browsers.&lt;/p&gt;

&lt;p&gt;Different web browsers interpret HTML, CSS, and JavaScript code differently, which can result in inconsistencies in website design and functionality. This can lead to a poor user experience, potentially causing users to abandon the site. Consequently, ensuring browser compatibility is critical for creating a website that is accessible to as many users as possible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Browser Compatibility Issues
&lt;/h2&gt;

&lt;p&gt;Here are some of the most common browser compatibility issues that web developers may face:&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Layout and Design Inconsistencies
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
Inconsistencies in layout and design can occur when different web browsers interpret CSS code differently. This means that a website can look great on one browser, but appear distorted or misaligned on another. For example, a website that looks great on Google Chrome may appear distorted or misaligned on Mozilla Firefox.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;
&lt;h2&gt;
  
  
  JavaScript Compatibility Issues
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
JavaScript is an essential programming language for creating interactive websites. However, JavaScript compatibility issues can also arise, as different browsers may interpret the code in different ways. This can lead to broken functionality or even crashes.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;
&lt;h2&gt;
  
  
  Font Rendering Issues
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
Different web browsers may render fonts differently, resulting in inconsistencies in typography across different platforms. This can make websites look unprofessional and may even affect readability.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;
&lt;h2&gt;
  
  
  Cross-Browser Compatibility Issues
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
Cross-browser compatibility refers to the ability of a website to function correctly across different web browsers. This can be challenging, as different browsers may have different interpretations of HTML, CSS, and JavaScript code.&lt;/p&gt;

&lt;p&gt;As a web developer, ensuring that your website displays properly across different browsers and browser versions is crucial. Browser compatibility issues can frustrate users and reflect poorly on your skills. However, by following some best practices, you can minimize compatibility problems.&lt;/p&gt;

&lt;p&gt;Tips for Tackling Browser Compatibility Issues&lt;br&gt;
Here are some tips that web developers can follow to tackle browser compatibility issues:&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;
&lt;h2&gt;
  
  
  Test Your Website on Multiple Browsers
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
The first step in tackling browser compatibility issues is to test your website on as many browsers as possible. This will help you identify any issues or inconsistencies that may arise when your website is viewed on different platforms.&lt;br&gt;
There are several tools available that can help you test your website on different browsers, such as BrowserStack and Sauce Labs. These tools allow you to simulate different browsers and operating systems to see how your website looks and functions on each platform.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;
&lt;h2&gt;
  
  
  Use Vendor Prefixes
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
Vendor prefixes are a way to add specific CSS properties to your website that are only recognized by certain browsers. For example, the &lt;code&gt;"-webkit-"&lt;/code&gt; prefix is used for properties that are only recognized by the Chrome and Safari browsers.&lt;br&gt;
By using vendor prefixes, you can ensure that your website looks and functions correctly on different browsers, without having to create separate CSS files for each platform.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;
&lt;h2&gt;
  
  
  Use a CSS Reset
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
Different browsers have different default styles for HTML elements, which can lead to inconsistencies in website design and layout. To avoid this, you can use a CSS reset, which is a set of styles that "reset" the default styles for HTML elements to a consistent baseline.&lt;br&gt;
There are several CSS reset libraries available, such as Normalize.css and Reset.css, that you can use to ensure that your website looks consistent across all browsers.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;
&lt;h2&gt;
  
  
  Avoid Browser-Specific Code
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
One of the biggest mistakes you can make as a web developer is to write browser-specific code. This means writing code that only works on certain browsers, and not on others.&lt;br&gt;
To avoid this, you should always use standardized HTML, CSS, and JavaScript code that is recognized by all major browsers. This will help ensure that your website works well on all platforms and that you don't inadvertently exclude users on certain browsers.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;
&lt;h2&gt;
  
  
  Check CanIUse
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
The website CanIUse.com is an excellent resource for checking browser support for web technologies. You can view support tables for HTML elements, CSS rules, and JavaScript features across desktop and mobile browsers. Consult CanIUse to determine the workarounds you might need for older browser versions. You may need to use polyfill scripts to patch unsupported features.&lt;/p&gt;

&lt;p&gt;For example, to check if browsers support Flexbox layout, you can use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@supports (display: flexbox) {
    /* CSS rules for browsers that support Flexbox */
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Polyfills
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
Polyfills are snippets of code that add support for newer features in older browsers that don't natively support them. For example, you can use a polyfill library like Polyfill Service to add support for Flexbox in older IE browsers.&lt;/p&gt;

&lt;p&gt;Keep Your Code Simple&lt;br&gt;
Finally, it's important to keep your code as simple as possible. Complex code can be difficult to debug and can lead to compatibility issues on different browsers.&lt;br&gt;
To keep your code simple, you should avoid using unnecessary code and focus on creating clean, efficient code that is easy to read and understand. This will help ensure that your website works well on all platforms and that you can quickly identify and fix any compatibility issues that arise.&lt;/p&gt;

&lt;p&gt;For browsers that don't support a feature, provide a fallback option. For example, for Flexbox you can use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  display: flex;
}

@supports not (display: flex) {
  .container {
    /* Fallback CSS rules */ 
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;**&lt;/p&gt;

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

&lt;p&gt;**&lt;br&gt;
Tackling browser compatibility issues is an essential part of web development. By following these tips and best practices, you can ensure that your website looks and functions consistently across all major browsers and that you provide a great user experience for all your visitors. Remember to test your website on multiple browsers, use vendor prefixes, use a CSS reset, avoid browser-specific code, and keep your code simple. With these tips in mind, you can create a website that is accessible to as many users as possible, regardless of the browser they use.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>frontend</category>
    </item>
    <item>
      <title>How to create a pop-up: JavaScript Modal</title>
      <dc:creator>Tracy | Software Engineer</dc:creator>
      <pubDate>Tue, 09 May 2023 23:38:47 +0000</pubDate>
      <link>https://dev.to/tracy4code/how-to-create-a-pop-up-javascript-modal-3652</link>
      <guid>https://dev.to/tracy4code/how-to-create-a-pop-up-javascript-modal-3652</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Modal is a way for a browser to display important information on a website. Some of its used cases are highlighting an important notice to a user, confirming, or providing additional information. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;JavaScript modal also known as a pop-up window is a user interface that displays content on top of the current webpage. Modals are used to provide additional information for user input and confirm an action, you can also use it to create a dynamic page or dashboard with a single HTML file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Overview
&lt;/h2&gt;

&lt;p&gt;I will be using a user Dashboard and a form website to explain how modal works. To create a modal, I will be using HTML, CSS, and JavaScript. HTML and CSS are used to build the modal box while JavaScript handles the behavior of the modal so that when clicked, the pop-up window will be displayed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 - The HTML
&lt;/h2&gt;

&lt;p&gt;You will begin with creating the HTML structure for the project using the form tag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
      &amp;lt;html&amp;gt;
      &amp;lt;head&amp;gt;
        &amp;lt;meta charset="UTF-8"&amp;gt;
        &amp;lt;title&amp;gt;Modal Example&amp;lt;/title&amp;gt;

      &amp;lt;/head&amp;gt;
      &amp;lt;body&amp;gt;
        &amp;lt;h1&amp;gt;Modal Example&amp;lt;/h1&amp;gt;

        &amp;lt;!-- Button to open the modal --&amp;gt;
        &amp;lt;button class="btn-open"&amp;gt;Open Modal&amp;lt;/button&amp;gt;

        &amp;lt;!-- The modal --&amp;gt;
        &amp;lt;div class="modal-background"&amp;gt;
          &amp;lt;div class="modal-content"&amp;gt;
            &amp;lt;h2&amp;gt;Modal Title&amp;lt;/h2&amp;gt;
            &amp;lt;p&amp;gt;Modal message goes here.&amp;lt;/p&amp;gt;

            &amp;lt;!--Button to close the modal content--&amp;gt;
            &amp;lt;button class="close-btn"&amp;gt;Close Modal&amp;lt;/button&amp;gt;
          &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;

      &amp;lt;/body&amp;gt;
      &amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The HTML code contains a button &lt;code&gt;&amp;lt;button class="btn-open"&amp;gt;Open Modal&amp;lt;/button&amp;gt;&lt;/code&gt; that would be clicked to view the pop-up and the content, &lt;code&gt;&amp;lt;div class="modal-content"&amp;gt;&lt;/code&gt; that would display when the button is clicked.&lt;/li&gt;
&lt;li&gt;A second button is included with the class &lt;code&gt;&amp;lt;button class="close-btn"&amp;gt;Close Modal&amp;lt;/button&amp;gt;&lt;/code&gt; which closes the content when clicked on.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 2 - The CSS Styling
&lt;/h2&gt;

&lt;p&gt;CSS is necessary to define the box modal and make the project more presentable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/* Style the modal background */
    .modal-background {
      display: none;
      position: fixed;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      background-color: rgba(0, 0, 0, 0.5);
      z-index: 999;
    }

    /* Style the modal content */
    .modal-content {
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      padding: 20px;
      background-color: white;
      border-radius: 5px;
      z-index: 1000;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.modal-background&lt;/code&gt; gives the body container a gray background color which is positioned &lt;code&gt;fixed&lt;/code&gt; and placed on the top - &lt;code&gt;top: 0;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.modal-content&lt;/code&gt; is the container for the modal content. &lt;code&gt;top: 50%;&lt;/code&gt; sets the top edge of the modal to be at &lt;code&gt;50%&lt;/code&gt; of the height of the screen (viewport). This means that the top of the modal will be halfway down the screen, vertically centered.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;left: 50%;&lt;/code&gt; sets the left edge of the modal to be at &lt;code&gt;50%&lt;/code&gt; of the width of the screen. This means that the left edge of the modal will be halfway across the screen, horizontally centered.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;transform: translate(-50%, -50%);&lt;/code&gt; moves the modal back up by &lt;code&gt;50%&lt;/code&gt; of its own height (to counteract the &lt;code&gt;top: 50%;&lt;/code&gt; setting) and back left by &lt;code&gt;50%&lt;/code&gt; of its own width (to counteract the left: 50%; setting). This centers the modal perfectly both horizontally and vertically.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;The JavaScript code would ensure the modal box is displayed by responding to a click event.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let modalBG = document.querySelector('.modal-background');
let modalContent = document.querySelector('.modal-content');
let closemodal = document.querySelector('.closebtn');
let openmodal = document.querySelector('.openbtn');

function openModal() {
  modalBG.style.display = 'block';
  modalContent.style.display = 'block';
}

function closeModal() {
  modalBG.style.display = 'none';
  modalContent.style.display = 'none';
}

openmodal.onclick = openModal;
closemodal.onclick = closeModal;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The first part created a variable for each of the class container &lt;code&gt;let modalBG = document.querySelector('.modal-background');&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The second part created a function that would be executed when the button is clicked &lt;code&gt;function openModal() { modalBG.style.display = 'block'; modalContent.style.display = 'block'; }&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Initially, the &lt;code&gt;modal-background&lt;/code&gt; is set to a &lt;code&gt;display: none;&lt;/code&gt; on the CSS, but I created a function that sets the modal-background &lt;code&gt;display: block;&lt;/code&gt; when the button &lt;code&gt;&amp;lt;button class="btn-open"&amp;gt;Open Modal&amp;lt;/button&amp;gt;&lt;/code&gt; is clicked.&lt;/p&gt;

&lt;h2&gt;
  
  
  The result
&lt;/h2&gt;

&lt;p&gt;Codepen Link: &lt;a href="https://codepen.io/Tracy4work/pen/bGmvLqO"&gt;https://codepen.io/Tracy4work/pen/bGmvLqO&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Do Check it out, try it, and let me know your thoughts. Also like and follow for more helpful articles on web development.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Building An Image Slider With Swiper Js</title>
      <dc:creator>Tracy | Software Engineer</dc:creator>
      <pubDate>Tue, 09 May 2023 08:53:06 +0000</pubDate>
      <link>https://dev.to/tracy4code/building-an-image-slider-with-swiper-js-l4o</link>
      <guid>https://dev.to/tracy4code/building-an-image-slider-with-swiper-js-l4o</guid>
      <description>&lt;p&gt;&lt;strong&gt;Swiper JS is a popular open-source library for creating responsive and mobile-friendly touch sliders, and carousel components for websites and web applications.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It provides a range of options for customizing the appearance and behavior of the slider, including &lt;strong&gt;navigation buttons&lt;/strong&gt;, &lt;strong&gt;pagination&lt;/strong&gt;, &lt;strong&gt;autoplay&lt;/strong&gt;, and more. I will be going over the steps to use Swiper Js in building an image slider.&lt;/p&gt;

&lt;p&gt;The image slider will contain a navigation for users to navigate back and forth in order to view different images. It will also contain a clickable pagination so you can click to view a particular image.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

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

&lt;p&gt;**&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google &lt;a href="https://swiperjs.com/"&gt;https://swiperjs.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;&lt;code&gt;demo&lt;/code&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You will be provided with samples of various Swiper demos when you click on "Demos".&lt;/p&gt;

&lt;p&gt;Scroll down and click on &lt;strong&gt;&lt;code&gt;navigation-per-view&lt;/code&gt;&lt;/strong&gt;; above it, click on &lt;code&gt;element&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The element page contains the sample code files and a live view of the project. Copy the whole HTML code and paste it into your code editor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;

&amp;lt;head&amp;gt;
  &amp;lt;meta charset="utf-8" /&amp;gt;
  &amp;lt;title&amp;gt;Swiper demo&amp;lt;/title&amp;gt;
  &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" /&amp;gt;

  &amp;lt;style&amp;gt;
    html,
    body {
      position: relative;
      height: 100%;
    }

    body {
      background: #eee;
      font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
      font-size: 14px;
      color: #000;
      margin: 0;
      padding: 0;
    }

    swiper-container {
      width: 100%;
      height: 100%;
    }

    swiper-slide {
      text-align: center;
      font-size: 18px;
      background: #fff;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    swiper-slide img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  &amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;

  &amp;lt;swiper-container class="mySwiper" pagination="true" pagination-clickable="true" space-between="30"
    slides-per-view="3"&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 1&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 2&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 3&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 4&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 5&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 6&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 7&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 8&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 9&amp;lt;/swiper-slide&amp;gt;
  &amp;lt;/swiper-container&amp;gt;

  &amp;lt;script src="https://cdn.jsdelivr.net/npm/swiper@9/swiper-element-bundle.min.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;If you already have an HTML boilerplate, then you will need the Swiper link, HTML, and CSS code:&lt;/p&gt;

&lt;p&gt;Scroll down the element page&lt;/p&gt;

&lt;p&gt;Copy the link on the script tag and paste it into your HTML boilerplate below all HTML tags.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script src="https://cdn.jsdelivr.net/npm/swiper@9/swiper-element-bundle.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Swiper link is necessary to make any logic you add functional. Without the link tag, the slider wouldn't work.&lt;/p&gt;

&lt;p&gt;The next step is to copy the HTML code and paste into my code editor&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;swiper-container class="mySwiper" pagination="true" pagination-clickable="true" space-between="30"
    slides-per-view="3"&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 1&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 2&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 3&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 4&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 5&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 6&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 7&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 8&amp;lt;/swiper-slide&amp;gt;
    &amp;lt;swiper-slide&amp;gt;Slide 9&amp;lt;/swiper-slide&amp;gt;
  &amp;lt;/swiper-container&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I will be replacing the slide 1 text with an image tag containing some images for each &lt;code&gt;swiper-slide&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="slide-container"&amp;gt;
        &amp;lt;swiper-container class="mySwiper" pagination="true" navigation="true" loop="true" pagination-clickable="true" space-between="30"
            slides-per-view="3"&amp;gt;
            &amp;lt;swiper-slide&amp;gt;
            &amp;lt;img src="https://thegadgetflow.com/wp-content/uploads/2020/04/10-gadgets-for-a-futuristic-home-office-1200x675.jpg"&amp;gt;
            &amp;lt;/swiper-slide&amp;gt;

            &amp;lt;swiper-slide&amp;gt;
            &amp;lt;img src="https://resources.owllabs.com/hubfs/uneebo-office-design-yNtCxu4kJXk-unsplash.jpg"&amp;gt;
            &amp;lt;/swiper-slide&amp;gt;

            &amp;lt;swiper-slide&amp;gt;
            &amp;lt;img src="https://cdn.bisnow.net/resize?type=jpeg&amp;amp;url=https%3A%2F%2Fs3.amazonaws.com%2Fcdn.bisnow.net%2Fcontent%2Fimages%2F2019%2F03%2F5ca121a2f2118-20180520_venture_arch_opentable_0002_screenres-copy.jpeg&amp;amp;width=2160&amp;amp;sign=0OQSfq1SFkLDAMZhNvFNGDfDgR7LLrpgTkBcab8_tqc"&amp;gt;
            &amp;lt;/swiper-slide&amp;gt;

            &amp;lt;swiper-slide&amp;gt;
            &amp;lt;img src="https://www.hpe.com/content/dam/hpe/insights/articles/2021/09/how-technology-is-enabling-the-new-hybrid-workspace/How-technology-is-enabling-the-new-hyrbid-workspace.jpg.transform/nxt-original/image.jpeg"&amp;gt;
            &amp;lt;/swiper-slide&amp;gt;

            &amp;lt;swiper-slide&amp;gt;
            &amp;lt;img src="https://cdna.artstation.com/p/assets/images/images/049/563/806/large/amy-colored.jpg?1652793049"&amp;gt;
            &amp;lt;/swiper-slide&amp;gt;

            &amp;lt;swiper-slide&amp;gt;
            &amp;lt;img src="https://cdn.oneesports.gg/cdn-data/2022/02/Anime_HimoutoUmaruChanR-1024x576.webp"&amp;gt;
            &amp;lt;/swiper-slide&amp;gt;

            &amp;lt;swiper-slide&amp;gt;
            &amp;lt;img src="https://i.pinimg.com/550x/f5/a3/85/f5a385e2976b8d378a55cfa04396315a.jpg"&amp;gt;
            &amp;lt;/swiper-slide&amp;gt;

            &amp;lt;swiper-slide&amp;gt;&amp;lt;img src="https://www.cnet.com/a/img/resize/69256d2623afcbaa911f08edc45fb2d3f6a8e172/hub/2023/02/03/afedd3ee-671d-4189-bf39-4f312248fb27/gettyimages-1042132904.jpg?auto=webp&amp;amp;fit=crop&amp;amp;height=675&amp;amp;width=1200"&amp;gt;&amp;lt;/swiper-slide&amp;gt;

            &amp;lt;swiper-slide&amp;gt;&amp;lt;img src="https://imageio.forbes.com/specials-images/imageserve/5f962df3991e5636a2f68758/0x0.jpg?format=jpg&amp;amp;crop=812,457,x89,y103,safe&amp;amp;width=1200"&amp;gt;&amp;lt;/swiper-slide&amp;gt;
        &amp;lt;/swiper-container&amp;gt;

    &amp;lt;/div&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  The JavaScript Logic
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
Inside the swiper-container, the JavaScript code for the slider is included and you can add or remove any of them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;swiper-container class="mySwiper" pagination="true" navigation="true" loop="true" pagination-clickable="true" space-between="30"
            slides-per-view="3"&amp;gt;&amp;lt;/swiper-container&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;navigation="true"&lt;/code&gt; - provided for two arrows with a default color of blue to go to the next image or the previous image.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pagination="true"&lt;/code&gt; and &lt;code&gt;pagination-clickable="true"&lt;/code&gt; provides for pagination below the images with a default color of blue. Since I set &lt;code&gt;pagination-clickable="true"&lt;/code&gt;, It allows users to click on the pagination to view a particular image. If not set, it won't be clickable.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;slides-per-view="3"&lt;/code&gt; ensures only three images can be viewed on screen. To view more, you would need to use the navigation icon. So if I make it 4, It will set the images on view to be 4.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  CSS Styling
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
The styling of a slider is important because it determines the look. This is why I will be giving a short explanation of the styling I used.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.slide-container{
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
    }

    body {
      background: #1F1F1F;
    }

    swiper-container {
      width: 80%;
      height: 60%;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; swiper-slide img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  The Styling
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
I gave the HTML body a dark grey background color of &lt;code&gt;background: #1F1F1F;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The container holding the Swiper container slide-container is displayed flex allowing for flexible sizing and positioning of elements within a container. so it can be aligned to the center of the webpage using &lt;code&gt;justify-content: center; align-items-center;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The "&lt;code&gt;height&lt;/code&gt;" property is set to "&lt;code&gt;100vh&lt;/code&gt;", which means the height of the container will be equal to the height of the viewport, ensuring that the image slider takes up the entire screen.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.slide-container{
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Swiper container swiper-container sets the width and height of the image slider to 80% and 60%, respectively. This means that the slider will take up 80% of the width of its container and 60% of the height, leaving some space around the edges for other content. This is a good practice to ensure that the slider is not too large or too small on the page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;swiper-container {
      width: 80%;
      height: 60%;
    }

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

&lt;/div&gt;



&lt;p&gt;The last section, &lt;code&gt;swiper-slide img&lt;/code&gt;, styles the individual images within the &lt;code&gt;slider&lt;/code&gt;. The display property is set to block to ensure that each image takes up its own space within the slider. The width and height properties are set to 100% to ensure that each image takes up the full width and height of its container. The &lt;code&gt;object-fit&lt;/code&gt; set to &lt;code&gt;cover&lt;/code&gt;, which means that each image will be scaled to cover the entire container while maintaining its aspect ratio.&lt;br&gt;
The final Result&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE: You can change the color of the navigation and pagination depending on your preference.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you found this article helpful, do like and follow for more helpful tips on web development. If there's anything you need an explanation on, be sure to reach out. I will always be active to provide an explanation.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>frontend</category>
    </item>
    <item>
      <title>How To Center An Element With CSS</title>
      <dc:creator>Tracy | Software Engineer</dc:creator>
      <pubDate>Tue, 09 May 2023 08:37:17 +0000</pubDate>
      <link>https://dev.to/tracy4code/how-to-center-an-element-with-css-4h7g</link>
      <guid>https://dev.to/tracy4code/how-to-center-an-element-with-css-4h7g</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;CSS is an important asset to structure a page in the right direction. Even though HTML is the building block of a website, without the use of CSS, it will be difficult to navigate through the website.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this article, you will be taken through four processes to center an element with CSS using a login page. This is important because most times, people find it challenging to center an element and the process they take might be a long and stressful one.&lt;/p&gt;

&lt;p&gt;The four methods to center an element are as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;- Flexbox&lt;/li&gt;
&lt;li&gt;- Grid&lt;/li&gt;
&lt;li&gt;- Margin&lt;/li&gt;
&lt;li&gt;- positioning&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For the sake of this article, I will use a form page to show the results of using these methods.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flexbox
&lt;/h2&gt;

&lt;p&gt;Flexbox provides an efficient way to align items in a container. The main idea behind Flexbox is to enable a container element to change the size and position of its child elements to fill the available space and create a responsive layout.&lt;/p&gt;

&lt;p&gt;To center the Login page, I need three elements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;display: flex;&lt;/code&gt; - This CSS element will set the display of the form container to a flexible module which would give the container the ability to alter its height, width, and position.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;justify-content: center;&lt;/code&gt; - This element will define the alignment of the container on the main axis.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;align-items: center;&lt;/code&gt; - The align-item defines how items are laid out along the cross-axis. By setting it to center, the form container would be centered horizontally.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These three elements will be used in the body content of the HTML form tag to center the container vertically and horizontally:&lt;/p&gt;

&lt;h3&gt;
  
  
  The HTML Code
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="container"&amp;gt;
  &amp;lt;form&amp;gt;
    &amp;lt;label for="name"&amp;gt;Name:&amp;lt;/label&amp;gt;
    &amp;lt;input type="text" id="name" name="name"&amp;gt;
    &amp;lt;label for="email"&amp;gt;Email:&amp;lt;/label&amp;gt;
    &amp;lt;input type="email" id="email" name="email"&amp;gt;
    &amp;lt;label for="message"&amp;gt;Message:&amp;lt;/label&amp;gt;
    &amp;lt;textarea id="message" name="message"&amp;gt;&amp;lt;/textarea&amp;gt;
    &amp;lt;button type="submit"&amp;gt;Submit&amp;lt;/button&amp;gt;
  &amp;lt;/form&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The CSS Styling
&lt;/h3&gt;

&lt;p&gt;The "&lt;strong&gt;container&lt;/strong&gt;" element is the parent element of the form tag and any style given to it will have an effect on the form.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We have a container element with a height of 100vh, which makes it take up the full height of the viewport - the webpage. The display: flex property is used to make the container a flex container, and justify-content: center and align-items: center is used to center the form both horizontally and vertically within the container.&lt;/p&gt;

&lt;h2&gt;
  
  
  Grid
&lt;/h2&gt;

&lt;p&gt;Grid provides a powerful way to create layouts. One of the common use cases of CSS Grid is to center an object within a container. CSS grid uses two elements to center an object and they are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;display: grid&lt;/li&gt;
&lt;li&gt;place-items: center &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  To center an object with Grid
&lt;/h3&gt;

&lt;p&gt;Create a container element and apply the display: grid property to it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  display: grid;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Set the &lt;code&gt;place-items&lt;/code&gt; property to the center place. This will place the object in the center.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  display: grid;
  place-items: center;
  height: 100vh;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This will center the object both horizontally and vertically within the container.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Margin
&lt;/h2&gt;

&lt;p&gt;To center an object with a margin using CSS, you can use the margin property along with the &lt;code&gt;auto&lt;/code&gt; value. Here's how:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  width: 40%;
  margin: 3rem auto;
  height: 100vh;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The width of the container is important and will determine the width of the form container. If the width of the form container is not set, the &lt;code&gt;margin: auto;&lt;/code&gt; property will NOT be effective.&lt;/li&gt;
&lt;li&gt;The margin property is set to &lt;code&gt;0 auto&lt;/code&gt;. This tells the browser to automatically calculate and evenly distribute the left and right margins of the &lt;code&gt;div&lt;/code&gt;, thus centering it horizontally.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  positioning
&lt;/h2&gt;

&lt;p&gt;Positioning is a CSS concept that allows you to control the placement of an element on a web page. It is often used to center an element horizontally or vertically within its parent container.&lt;/p&gt;

&lt;p&gt;To center an object with position using CSS, you can use the position and transform properties. Here are the steps to follow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  width: 40%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;In the code above, the &lt;code&gt;position&lt;/code&gt; is set to &lt;code&gt;absolute&lt;/code&gt; which allows us to position it relative to its nearest positioned ancestor, which is usually the body element.&lt;/li&gt;
&lt;li&gt;Next, we set the &lt;code&gt;top&lt;/code&gt; and &lt;code&gt;left&lt;/code&gt; properties to &lt;code&gt;50%&lt;/code&gt;. This positions the top-left corner of the container at the center of its nearest-positioned ancestor.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;transform&lt;/code&gt; property to moves the container up and left by half its width and height, respectively. The &lt;code&gt;translate(-50%, -50%)&lt;/code&gt; value does exactly that, by moving the container left by &lt;code&gt;50%&lt;/code&gt; of its width and up by &lt;code&gt;50%&lt;/code&gt; of its height.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Centering an element on a web page is a common task in web development. There are various techniques to achieve this, including using CSS properties such as margin, position, and transform. These techniques can be used to center an element horizontally and/or vertically within its parent container, depending on the specific requirements of the project.&lt;/p&gt;

&lt;p&gt;If you found this article helpful, like and follow for more useful tips. Also, share with your friends.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>css</category>
    </item>
  </channel>
</rss>
