<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: prince-joel</title>
    <description>The latest articles on Forem by prince-joel (@princejoel).</description>
    <link>https://forem.com/princejoel</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%2F593290%2F79538479-e2e1-40a7-9d32-a817cd460e8f.jpeg</url>
      <title>Forem: prince-joel</title>
      <link>https://forem.com/princejoel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/princejoel"/>
    <language>en</language>
    <item>
      <title>SQL for Data Analysis: A Step-by-Step Guide</title>
      <dc:creator>prince-joel</dc:creator>
      <pubDate>Wed, 11 Oct 2023 01:02:00 +0000</pubDate>
      <link>https://forem.com/princejoel/sql-for-data-analysis-a-step-by-step-guide-3c6j</link>
      <guid>https://forem.com/princejoel/sql-for-data-analysis-a-step-by-step-guide-3c6j</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;As an aspiring data analyst or a seasoned data analyst, you recognize the pivotal role that data analysis plays in today's information-driven landscape. In a world overflowing with data, the ability to transform raw information into actionable insights is a skill of immeasurable value. This article is your gateway to mastering SQL, a fundamental tool in the data analyst's toolkit. Whether you're just starting your journey or looking to enhance your existing skills, this comprehensive guide will lead you through the intricate world of SQL, equipping you with the expertise to navigate, query, and analyze data with precision and confidence.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Role of SQL in Data Analysis
&lt;/h3&gt;

&lt;p&gt;Data analysis, an essential process involving the examination, cleansing, transformation, and interpretation of data to unearth valuable insights, holds a central position in decision-making across various industries, spanning finance, healthcare, marketing, and e-commerce. SQL, as the universal language of databases, stands as the foundational pillar of modern data analytics, offering data scientists and analysts a structured and systematic approach to interacting with data. SQL empowers them to efficiently retrieve precise data subsets, conduct intricate calculations, and unveil concealed patterns, ultimately converting raw data into actionable intelligence that drives data-driven decision-making in today's data-centric world.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Basics of SQL for Data Analysis
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What Is SQL?
&lt;/h3&gt;

&lt;p&gt;SQL, or Structured Query Language, is a domain-specific language at its core, tailored for the management and querying of relational databases. This language is particularly adept at handling structured data, making it the go-to choice for scenarios involving organized tables with predefined relationships.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Data Analysts Turn to SQL
&lt;/h3&gt;

&lt;p&gt;Data Analysts reap several benefits from SQL:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Extraction:&lt;/strong&gt; SQL efficiently retrieves pertinent information from large databases, allowing Data Analysts to customize data selection, combine multiple data sources, explore and sample datasets, access historical records, transform and cleanse data, provide real-time data access, and seamlessly integrate with data visualization tools for effective communication of findings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Transformation:&lt;/strong&gt; SQL's robust data manipulation capabilities are central to the data analysis workflow, enabling the efficient cleaning, restructuring, and preprocessing of data. This ensures that Data Analysts work with well-prepared datasets, facilitating in-depth analysis and modeling for more informed decision-making and insights extraction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Analysis:&lt;/strong&gt; SQL's versatility extends beyond basic queries, empowering Data Analysts to perform advanced analytical operations. This capability allows them to uncover intricate patterns, discern trends, and extract valuable insights from datasets, thereby enriching their data exploration endeavors with depth and breadth.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fundamental SQL Concepts
&lt;/h3&gt;

&lt;p&gt;Before diving into practical examples, let's cover some foundational SQL concepts:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tables:&lt;/strong&gt; In SQL, data is organized into tables, which consist of rows and columns.&lt;br&gt;
&lt;strong&gt;SELECT Statement:&lt;/strong&gt; The SELECT statement retrieves data from one or more tables.&lt;br&gt;
&lt;strong&gt;WHERE Clause:&lt;/strong&gt; This clause filters data based on specified conditions.&lt;br&gt;
&lt;strong&gt;GROUP BY and HAVING:&lt;/strong&gt; GROUP BY groups rows by a specified column, while HAVING filters grouped data.&lt;br&gt;
&lt;strong&gt;JOINs:&lt;/strong&gt; JOINs combine data from multiple tables based on related columns.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up Your Environment
&lt;/h2&gt;

&lt;p&gt;When setting up your environment here are things you need to do:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Choose Your Database:&lt;/strong&gt;&lt;br&gt;
The first step in using SQL for data analysis is selecting a database system. Common options include MySQL, PostgreSQL, SQL Server, and SQLite. Alternatively, you can use cloud-based databases like Google BigQuery, Amazon Redshift, or Microsoft Azure SQL Database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installation and Configuration&lt;/strong&gt;&lt;br&gt;
Once you've chosen a database, follow your selected system's installation and configuration instructions. Most databases offer detailed setup guides and user-friendly interfaces to get you started.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQL Data Querying: A Step-by-Step Walkthrough
&lt;/h2&gt;

&lt;p&gt;To query data using SQL here are some things you need to learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Basic SELECT Statements:&lt;/strong&gt; Let's begin with the cornerstone of SQL SELECT statements. Suppose we have a database called "Sales" with a table "Orders." To retrieve all order details, you can use:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This query returns all rows and columns from the "Orders" table.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Filtering Data with WHERE Clause:&lt;/strong&gt; To filter data effectively, SQL provides the WHERE clause, which acts as a powerful filter mechanism, allowing you to refine your queries with precision; for example, you can use it to retrieve specific orders made by a particular customer, enabling targeted data retrieval tailored to your analytical needs.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;CustomerName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'John Smith'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This query retrieves rows where the 'CustomerName' column matches 'John Smith.'&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Grouping and Aggregation:&lt;/strong&gt; SQL empowers you to conduct aggregate calculations, a fundamental feature that facilitates advanced data analysis; for instance, you can leverage this capability to determine the total sales per customer, providing essential insights into revenue distribution and customer behavior.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;CustomerName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;OrderAmount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;TotalSales&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;CustomerName&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This query groups data by the customer and calculates the total sales amount.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mastering JOINs:&lt;/strong&gt; JOIN operations in SQL play a crucial role in data integration by seamlessly merging information from multiple tables; for example, consider a scenario where there's an "OrderDetails" table containing product information. SQL's JOIN capabilities allow you to effortlessly retrieve comprehensive data, including orders and associated product details, facilitating in-depth analysis and reporting.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;OrderID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;OrderDetails&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ProductName&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt;
&lt;span class="k"&gt;INNER&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;OrderDetails&lt;/span&gt;
&lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;OrderID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;OrderDetails&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;OrderID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This query uses an INNER JOIN to merge data from the "Orders" and "OrderDetails" tables based on the 'OrderID' column.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advanced SQL Techniques for Data Analysis
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Subqueries:&lt;/strong&gt; Unlocking Complex Data Analysis Potential
Subqueries, or nested queries, are used to embed one query within another, allowing for more nuanced data extraction, filtering, and aggregation. Here's an example of a subquery to retrieve data:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Example: Find the average salary of employees in each department&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;DepartmentName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Salary&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;AvgSalary&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Employee&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;Salary&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Salary&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Employee&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;DepartmentName&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the subquery &lt;code&gt;(SELECT AVG(Salary) FROM Employee)&lt;/code&gt; calculates the average salary, which is then used in the outer query to filter employees with salaries greater than the overall average.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Window Functions:&lt;/strong&gt; Empowering In-Depth Analysis
Window functions enable advanced analytical operations, such as running totals, rankings, and moving averages. Here's an example of calculating a moving average:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Example: Calculate a 3-day moving average of daily sales&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Sales&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="k"&gt;AVG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Sales&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;OVER&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt; &lt;span class="k"&gt;ROWS&lt;/span&gt; &lt;span class="k"&gt;BETWEEN&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="k"&gt;PRECEDING&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="k"&gt;CURRENT&lt;/span&gt; &lt;span class="k"&gt;ROW&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;MovingAvg&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;DailySales&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this query, the &lt;code&gt;AVG&lt;/code&gt; function with the &lt;code&gt;OVER&lt;/code&gt; clause defines a window that calculates a moving average for each row, considering the current row and the two preceding rows in the specified order.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Temporary Tables and Views:&lt;/strong&gt; Managing Complexity Seamlessly
Temporary tables and views help break down complex analysis into manageable steps. Here's an example of creating and using a temporary table:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Example: Create a temporary table to store intermediate results&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TEMPORARY&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;TempResults&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;Product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Sales&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;TotalSales&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;SalesData&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;Product&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Query the temporary table&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;TempResults&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we first create a temporary table &lt;code&gt;TempResults&lt;/code&gt; to store the total sales for each product. Later, we query this temporary table to retrieve the results.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Query Optimization:&lt;/strong&gt; Elevating Performance in Complex Analysis
Query optimization is crucial for improving the performance of SQL queries, especially with large datasets. Here's an example of optimizing a query using an index:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Example: Query optimization using an index&lt;/span&gt;
&lt;span class="c1"&gt;-- Before optimization&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;LastName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Smith'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- After optimization&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;idx_LastName&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;LastName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;LastName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Smith'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we first create an index on the &lt;code&gt;LastName&lt;/code&gt; column, which improves the query's performance when searching for customers with the last name 'Smith'. Indexes are a fundamental technique for query optimization.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Use Cases: Leveraging SQL for Practical Insights
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Customer Segmentation:&lt;/strong&gt; Targeting with Precision&lt;br&gt;
SQL-driven analysis enhances customer segmentation. It helps businesses identify distinct customer groups based on intricate purchase history and behavior patterns. Precise targeting in marketing campaigns is enabled, tailoring outreach efforts for better engagement and optimized marketing investments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Time Series Analysis:&lt;/strong&gt; Unveiling Temporal Trends&lt;br&gt;
SQL's analytical power extends to time series analysis, ideal for uncovering temporal insights. Analysts can use SQL to scrutinize time-stamped data, and discover trends, patterns, and seasonality. This aids businesses in understanding variable changes over time, facilitating proactive responses to evolving market dynamics.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fraud Detection:&lt;/strong&gt; Safeguarding Transactions&lt;br&gt;
SQL is a formidable tool for fraud prevention and detection. It allows businesses to scrutinize transaction data, identify anomalies, and preserve trust among customers. SQL-based analytical methods serve as crucial defenses against fraudulent activities, safeguarding financial transactions.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Best Practices for SQL Data Analysis: Ensuring Quality and Reliability
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Efficient Query Writing:&lt;/strong&gt;&lt;br&gt;
Efficient query writing is foundational for SQL data analysis. It involves crafting queries that fetch data while maximizing performance. Best practices include proper indexing, avoiding "SELECT * " statements, and using subqueries judiciously, ensuring responsive and reliable queries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Hygiene and Validation:&lt;/strong&gt;&lt;br&gt;
Data hygiene and validation maintain analytical accuracy and reliability. Analysts implement meticulous data validation checks to verify data integrity, rectifying anomalies promptly. Data cleansing procedures ensure consistent, error-free data, enhancing analysis quality and trust in findings.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Documentation and Version Control:&lt;/strong&gt;&lt;br&gt;
Documentation and version control are crucial for transparency and reproducibility. Comprehensive query documentation fosters clarity and collaboration, while version control systems track query changes systematically. This commitment empowers data analysts to maintain clear audit trails, reproduce analyses, and share insights confidently, promoting accountability and knowledge sharing.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;SQL is an indispensable tool for data scientists and analysts, providing the means to extract, manipulate, and analyze data effectively. By mastering SQL's core concepts, advanced techniques, and best practices, you'll be well-equipped to navigate the world of data analysis. Start your journey today and unlock the insights hidden in your data.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>SQL Best Practices: A Guide for Beginners and Experts</title>
      <dc:creator>prince-joel</dc:creator>
      <pubDate>Tue, 10 Oct 2023 23:40:00 +0000</pubDate>
      <link>https://forem.com/princejoel/sql-best-practices-a-guide-for-beginners-and-experts-58ah</link>
      <guid>https://forem.com/princejoel/sql-best-practices-a-guide-for-beginners-and-experts-58ah</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Structured Query Language (SQL) is the universal language for managing and manipulating data in modern databases. Whether you're just starting your journey in the world of SQL or you're an experienced database administrator, adhering to SQL best practices is essential. In this article, we will explore SQL best practices, from the basics to advanced strategies, to help both beginners and experts harness the full power of SQL.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQL Basics
&lt;/h2&gt;

&lt;p&gt;Let's begin with the fundamental building blocks of SQL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A. Understanding SQL Syntax&lt;/strong&gt;&lt;br&gt;
SQL queries are essential for interacting with databases, with the SELECT statement used to retrieve data, INSERT to add new records, UPDATE to modify existing ones, and DELETE to remove data.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT FirstName, LastName FROM Customers WHERE Country = 'USA';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This SQL query retrieves the first and last names of customers from a database table where the country is the USA.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;B. Data Types in SQL&lt;/strong&gt;&lt;br&gt;
In SQL, data types play a crucial role as they determine the format and range of values that can be stored in a database column, with options like INT allowing for whole numbers, VARCHAR enabling flexible character storage, and DATE facilitating the storage of date and time information.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;Employees&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;EmployeeID&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;FirstName&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;HireDate&lt;/span&gt; &lt;span class="nb"&gt;DATE&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This SQL code creates a table named "Employees" with columns for employee ID, first name, and hire date, each having a specific data type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;C. Creating and Managing Tables&lt;/strong&gt;&lt;br&gt;
Tables serve as the bedrock of relational databases, and their meticulous design is pivotal in ensuring the efficiency and integrity of data storage, making them a fundamental aspect of database management.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;OrderID&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;CustomerID&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;OrderDate&lt;/span&gt; &lt;span class="nb"&gt;DATE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;TotalAmount&lt;/span&gt; &lt;span class="nb"&gt;DECIMAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This SQL script creates a table named "Orders" with columns for order ID, customer ID, order date, and total amount. The PRIMARY KEY constraint ensures each order has a unique identifier.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQL Best Practices for Database Design
&lt;/h2&gt;

&lt;p&gt;Here are some best practices to follow while using SQL:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A. Normalization&lt;/strong&gt;&lt;br&gt;
Normalization, a cornerstone of effective database design, entails a systematic approach to organizing data within a database, with the primary objectives being the eradication of data redundancy and the safeguarding of data integrity, accomplished through the careful decomposition of large tables into smaller, interrelated ones, resulting in more efficient data storage and retrieval.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;CustomerID&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;FirstName&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;LastName&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;Email&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;Phone&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this SQL code, the "Customers" table is normalized, with customer information stored in a separate table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;B. Indexing&lt;/strong&gt;&lt;br&gt;
Indexing is a vital technique within SQL best practices, significantly enhancing query performance by swiftly granting access to specific rows within a table through the creation of data structures that serve as pointers or guides, thus reducing the time and resources required for data retrieval operations.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;idx_CustomerID&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This SQL statement creates an index on the "CustomerID" column of the "Customers" table, making queries involving this column faster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;C. Using Constraints&lt;/strong&gt;&lt;br&gt;
Constraints are rules that enforce data integrity in SQL tables.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;OrderID&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;CustomerID&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;OrderDate&lt;/span&gt; &lt;span class="nb"&gt;DATE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;TotalAmount&lt;/span&gt; &lt;span class="nb"&gt;DECIMAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="k"&gt;FOREIGN&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this SQL code, the FOREIGN KEY constraint ensures that the "CustomerID" in the "Orders" table references a valid "CustomerID" in the "Customers" table.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQL Best Practices for Query Optimization
&lt;/h2&gt;

&lt;p&gt;Optimizing SQL queries is crucial for efficient database operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A. Writing Efficient SQL Queries&lt;/strong&gt;&lt;br&gt;
Efficient query composition forms a cornerstone of SQL best practices, as well-crafted queries not only alleviate the database's load but also expedite response times, resulting in optimized database performance and enhanced user experiences.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Avoid SELECT *; specify the columns needed&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;FirstName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LastName&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;Country&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'USA'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By explicitly listing the required columns, you reduce the amount of data retrieved, leading to faster query execution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;B. Index Optimization&lt;/strong&gt;&lt;br&gt;
Index optimization plays a pivotal role by necessitating a comprehensive grasp of query execution plans and meticulous tuning to achieve optimal database performance, ensuring that queries are executed swiftly and resource-efficiently.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Rebuild index to improve performance&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;idx_CustomerID&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt; &lt;span class="n"&gt;REBUILD&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rebuilding indexes helps maintain their efficiency, especially in tables with frequent data changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;C. Avoiding Subqueries&lt;/strong&gt;&lt;br&gt;
subqueries can often prove inefficient, and instead, opting for JOINs or alternative techniques is encouraged to streamline query execution, thereby enhancing overall database performance and responsiveness.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Instead of a subquery&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;FirstName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LastName&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;CustomerID&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;CustomerID&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;-- Use a JOIN&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;C&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FirstName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;C&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;LastName&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Customers&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="k"&gt;C&lt;/span&gt;
&lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;Orders&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;O&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;C&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;O&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CustomerID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using JOINs often results in more efficient queries than subqueries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
SQL best practices are vital for maintaining efficient, secure, and scalable databases. Whether you're a beginner or an expert, following these guidelines will help you optimize your SQL operations and ensure the reliability of your database systems. As technology evolves, staying up-to-date with SQL best practices is crucial to remain competitive and deliver high-performance database solutions in today's data-driven world.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>MedusaJS Explained to a 5-Year-Old</title>
      <dc:creator>prince-joel</dc:creator>
      <pubDate>Fri, 17 Mar 2023 01:24:49 +0000</pubDate>
      <link>https://forem.com/princejoel/medusajs-explained-to-a-5-year-old-1kc6</link>
      <guid>https://forem.com/princejoel/medusajs-explained-to-a-5-year-old-1kc6</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Tools exist in every industry and for all tasks that, when used properly, increase productivity and make life easier. Have you ever heard of Medusa, a magical tool that facilitates the creation of user-friendly, high-quality, and appealing e-commerce websites? If you are interested in learning more about this great tool,  you are in the right place!&lt;/p&gt;

&lt;p&gt;In this article, we will explore the wonderful world of Medusa and how it makes websites more interactive and informative. You will get the opportunity to understand how it works, its unique features, and the benefits of using it for building e-commerce applications. And the best part? We will be explaining it all in a way that even a 5-year-old can understand!&lt;/p&gt;

&lt;p&gt;By the end of this article, you will learn about the benefits of using Medusa, how it can make a website work better and faster, and how it can help developers save time and effort.&lt;/p&gt;

&lt;p&gt;So, if you're ready to dive into the exciting world of Medusa, led&lt;/p&gt;

&lt;h3&gt;
  
  
  What is e-commerce
&lt;/h3&gt;

&lt;p&gt;In its simplest form, E-commerce is a way of buying and selling things online, like at a store but without going to the store. It's like a virtual store where you can browse products, add items to your cart, and pay with your parent's credit card or other online payment methods. All from your comfort zone.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Medusa?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://medusajs.com/"&gt;MedusaJS&lt;/a&gt; is a Node.js framework designed to help developers quickly build scalable, high-performance APIs and web applications.&lt;/p&gt;

&lt;p&gt;Medusa is used to create online stores. It is a computer program that helps users build e-commerce websites or apps. It helps users design e-commerce websites and applications with a few simple steps. It also helps users manage the content on their e-commerce websites or applications. It makes sure that the content is organized and easy to find. It can also help people add pictures and videos to their websites and apps. It is like a toolbox that web developers use to make e-commerce applications do amazing things.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Does Medusa Work?
&lt;/h3&gt;

&lt;p&gt;The features of Medusa make building websites and applications much simpler just by following a few steps.&lt;/p&gt;

&lt;p&gt;Aside from being a tool for building an e-commerce application, medusa helps websites work faster and better. It works like this, when you visit a website, your computer sends a message to this website's server, the server reads this message, and then sends back the needed information. Medusa helps make this process faster.&lt;/p&gt;

&lt;p&gt;When your computer sends the message, Medusa sends it to a server. This server stores all the information about the website. So instead of waiting for the website's server to respond, Medusa can immediately give your computer the information. It's like getting a package from the store. Instead of going to the store to pick it up, Medusa will bring it to you. That way, you don't have to wait for the store to open and get the package.&lt;/p&gt;

&lt;p&gt;Medusa also helps keep websites safe. It ensures that no one can get access to the website's information unless they should. That way, customer information is safe. So, Medusa helps make websites faster and more secure. That way, everyone can enjoy the websites they visit.&lt;/p&gt;

&lt;h3&gt;
  
  
  Common Features of Medusa
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://docs.medusajs.com/user-guide/price-lists/"&gt;PriceList&lt;/a&gt; and &lt;a href="https://docs.medusajs.com/user-guide/discounts/"&gt;Discount&lt;/a&gt;: Medusa Payment and Discount feature automate discount and sales processes for customers. The pricelist features override the original price of a product during sales. This discount can be a percentage discount, fixed discount, or free shipping. This feature is a way to make shopping fun and encouraging for customers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.medusajs.com/user-guide/regions/"&gt;Regions and Currencies&lt;/a&gt;: Medusa Regions and Currencies is a feature that allows you to store and use different currencies depending on your location. It also helps you to organize your money in any region. For example, if you live in the United States, you can use US dollars, but if you travel to France, you can also use Euros. This feature helps you keep track of all the different currencies you use and ensures that you are using the right one in the right place.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.medusajs.com/user-guide/taxes/"&gt;Taxes&lt;/a&gt;: Medusa Taxes feature helps to ensure that everyone pays their fair share when they buy things. It works like this: when you buy something, the store adds a small amount of money to the price depending on your region. That money helps pay for things like schools, roads, and parks. So, when you buy something, you're helping to improve your community!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.medusajs.com/advanced/backend/plugins/overview/"&gt;Plugins&lt;/a&gt;: Using plugins in medusa, developers can add unique features or incorporate services from outside sources into Medusa. Medusa Plugins are like special tools that add extra features to your website. They are like pieces of a jigsaw puzzle that fit together to create a bigger and better website. For example, you can add a plugin to your website that will help you show pictures or videos, or you can add one that will help you create a shopping cart so visitors can purchase items on your website.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pros of Medusa to e-commerce
&lt;/h3&gt;

&lt;p&gt;Easy to use: With Medusa, you can create applications rapidly without learning a complex language because it is easy to use. You can use medusa by simply following a few simple instructions.&lt;/p&gt;

&lt;p&gt;Secure: Medusa helps keep your information safe and secure, so you can use websites without worrying. Therefore, you need not fear if you shop on a medusa-powered application because your details are safe.&lt;/p&gt;

&lt;p&gt;Open Source: Medusa is an open-source tool, meaning you can use it for free and contribute to the project.&lt;/p&gt;

&lt;p&gt;Cross-Platform Support: Applications for several platforms, including iOS (iPhone and MacBook), Android (for example, Samsung), and Windows, can be made using Medusa.&lt;/p&gt;

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

&lt;p&gt;We have learned what medusa is, how it functions, its advantages, and more in this article. It's critical to understand medusa because it can increase productivity, particularly for developers and e-commerce businesses.&lt;/p&gt;

&lt;p&gt;Medusa is a JavaScript library that helps make websites and web apps more interactive. Understanding Medusa allows developers to write code that makes websites and apps look better and respond to user input faster. It also helps save time and money by reducing the amount of code to be written. Understanding Medusa can help developers create better websites and apps with fewer resources.&lt;/p&gt;

&lt;p&gt;Great job on learning about Medusa! You're off to a great start and should be proud of yourself! As you continue learning, remember to take your time and don't be afraid to ask questions. There are helpful resources out there to help you learn more about this topic. Keep researching, exploring, and asking questions!&lt;/p&gt;

</description>
      <category>ecommerce</category>
      <category>node</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Borderless E-commerce Explained to a 5-year-old</title>
      <dc:creator>prince-joel</dc:creator>
      <pubDate>Wed, 15 Mar 2023 14:38:32 +0000</pubDate>
      <link>https://forem.com/princejoel/borderless-e-commerce-explained-to-a-5-year-old-3oll</link>
      <guid>https://forem.com/princejoel/borderless-e-commerce-explained-to-a-5-year-old-3oll</guid>
      <description>&lt;h2&gt;
  
  
  The Power of Borderless E-commerce
&lt;/h2&gt;

&lt;p&gt;Learn about the functionality of borderless e-commerce and how it's changing the way we shop online.&lt;/p&gt;

&lt;p&gt;Borderless e-commerce allows people to buy and sell things online without worrying about geographical or national borders. It means you can buy this from people worldwide, no matter where you are. This makes getting the things you need easier and faster, and it also helps people in different countries connect.&lt;/p&gt;

&lt;p&gt;Borderless e-commerce is important because it helps people find the things they need more easily, allows businesses to reach more customers, and helps countries to work together.&lt;/p&gt;

&lt;p&gt;If we were to explain borderless e-commerce to a five-year-old, we would say that it’s like a big online store where people from all over the world can buy and sell things online. No matter where you live, you can purchase stuff from anyone, anywhere. This article will explain what is borderless e-commerce in a simple way that is easy for everyone to understand. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Explaining Borderless E-commerce to a Five-Year-Old&lt;/strong&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is a Border?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A border is like a line that separates two different places. It can be a line between two countries, states, towns, or cities. Borders are like invisible walls that tell us where one place stops and another starts. People use borders to ensure we know who lives in one place and who lives in another.&lt;br&gt;
Some examples are the fence separating your home and your neighbor's home. Or your room or classroom doors that restrict it from the other part of the building.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;How Borderless E-commerce Works?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Borderless e-commerce is a type of online shopping that allows people to buy and sell things from anywhere in the world. It is different from traditional e-commerce because it doesn’t limit you to shopping in your country. With borderless e-commerce, you can buy and sell things from any country without worrying about handling shipping, customs, or other international issues.&lt;/p&gt;

&lt;p&gt;This means you can find and buy things that you might not be able to find in your town or country. For example, if you live in the United States and want to buy a toy from a store in France. All you need to do is visit the store's website and look at the available products. If you like something, add it to your cart and check it out. The store will then calculate the cost of shipping, taxes, and any other fees associated with the purchase and you can pay using your credit card or other payment methods.&lt;/p&gt;

&lt;p&gt;After you have paid for the item, the store will package it and ship it to your home. The store will also handle customs paperwork or other international regulations, so you don't have to worry about it. When the item arrives, you can then enjoy your purchase!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Benefits of a Borderless E-commerce to Businesses and Customers&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Borderless e-commerce is like a big online store with no walls and anyone from anywhere can shop there. It's like a store that never closes and you can buy things from all over the world without leaving your home.&lt;br&gt;
For businesses, that means they can reach more customers, sell to people in many different countries, and make more money.&lt;br&gt;
And for consumers, that means they can shop for things from all over the world, like special foods, unique clothes, or cool toys they can't find in their own country. But they can buy from the comfort of their own homes.&lt;br&gt;
So borderless e-commerce is like a big store that never closes, and it helps businesses make more money while helping consumers get things they can't find anywhere else.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;How Medusa Allows Businesses to Build Borderless E-commerce?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://medusajs.com/"&gt;Medusa&lt;/a&gt; is an open-source composable e-commerce engine built on top of Node.js that provides an easily extendable framework for developing e-commerce websites and applications. It offers many features, including product catalogs, payment gateways, shopping cart solutions, order tracking, user accounts, and more. It also enables developers to extend the functionality of their website or application with a wide range of plugins and extensions to customize and improve the e-commerce experience.&lt;/p&gt;

&lt;p&gt;Medusa comprises three components: the headless built-on Node.js server, the admin dashboard, and the storefront.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.medusajs.com/usage/create-medusa-app"&gt;&lt;strong&gt;Medusa Server&lt;/strong&gt;&lt;/a&gt;: The Medusa server is like a special brain that helps your store remember all the important information it needs. It enables you to keep track of what products you have in your store, how much they cost, and how many customers you have. It also helps your store make sure everything runs smoothly.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.medusajs.com/admin/quickstart"&gt;&lt;strong&gt;Admin Dashboard&lt;/strong&gt;&lt;/a&gt;: Medusa admin dashboard is like a special tool that you can use to manage your store. It helps you keep track of orders, products, and your customers. It's like a big board that makes it easier to stay organized and keep your store running smoothly.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.medusajs.com/starters/gatsby-medusa-starter"&gt;&lt;strong&gt;Storefront&lt;/strong&gt;&lt;/a&gt;: Medusa storefront helps you create a website with products that customers can look at and buy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Medusa makes it easy for businesses to build borderless e-commerce stores. It enables businesses to create their online store without writing code, supporting multiple currencies and payment gateways.&lt;/p&gt;

&lt;p&gt;Businesses can accept payments in different currencies, offer localized products, and provide customers with a better online shopping experience. Medusa also allows businesses to access additional analytics, marketing, and customer service services. This makes it easier for businesses to manage their e-commerce operations and grow their business.&lt;/p&gt;

&lt;p&gt;Medusa is like a magic bridge that helps businesses build stores and sell their products to people worldwide. Businesses can create stores that people can see from different countries, even if they're far away. And they can reach out to customers thousands of miles away without worrying about borders. It's like a way of connecting everyone, no matter where they are!&lt;/p&gt;

&lt;p&gt;Medusa provides cool features that help e-commerce be borderless:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.medusajs.com/advanced/backend/regions/overview"&gt;&lt;strong&gt;Medusa regions&lt;/strong&gt;&lt;/a&gt;: This feature helps businesses customize their store for different countries to provide customers with the best experience based on location.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.medusajs.com/advanced/backend/customer-groups/"&gt;&lt;strong&gt;Customer groups&lt;/strong&gt;&lt;/a&gt;: The customer groups feature allows businesses to group people who like the same things together or group regular customers and give them special discounts.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.medusajs.com/advanced/backend/price-lists/"&gt;&lt;strong&gt;Price lists&lt;/strong&gt;&lt;/a&gt;: Medusa’s price list feature helps businesses run sales and promos. A good example is the buy two and gets one extra promo or Christmas discount sales.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.medusajs.com/advanced/backend/sales-channels/"&gt;&lt;strong&gt;Sales channels&lt;/strong&gt;&lt;/a&gt;: These are like stores that you can create to sell products. You decide which products to have in each store and track orders and carts to each store.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Benefits of Using Medusa&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Medusa provides a powerful set of tools for creating custom e-commerce. Here are some benefits of using Medusa:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Improved Scalability: Developers can create scalable applications with ease. It can be used to build applications that require high availability and can handle large amounts of traffic.&lt;/li&gt;
&lt;li&gt;Reduced Development Time: Developers can create and deploy applications quickly, reducing the time it takes to develop and maintain applications.&lt;/li&gt;
&lt;li&gt;Easy Maintenance: Medusa has built-in tools and features that make it easy to maintain applications. It provides a unified structure that allows developers to make changes and updates to their applications quickly.&lt;/li&gt;
&lt;li&gt;Security: It is secure and provides protection against malicious attacks. It also provides encryption and authorization support.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;In this article, we learned that borderless e-commerce is a way of online shopping that allows people to buy items from countries around the world without worrying about borders or other obstacles. It makes it easier and more convenient for shoppers to find and purchase goods from international sellers. Borderless e-commerce also makes it easier for sellers to expand their customer base, offering their products to more people in more places.&lt;/p&gt;

&lt;p&gt;We also highlighted how Medusa allows businesses to build borderless e-commerce and the benefit of using it in an e-commerce application.&lt;br&gt;
There are many excellent resources to help you learn more about this topic. I will recommend you start with Medusa with these resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check out &lt;a href="https://medusajs.com/"&gt;&lt;strong&gt;Medusa’s&lt;/strong&gt;&lt;/a&gt; documentation.&lt;/li&gt;
&lt;li&gt;Learn &lt;a href="https://aviyel.com/post/2887/how-to-get-started-with-medusa"&gt;how to build a product with Medusa&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Read the &lt;a href="https://medusajs.com/blog/beginner-guide-to-node-js-e-commerce-platform-understanding-the-medusa-server/"&gt;beginner's guide to learn more about Medusa’s server&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;If you want to know how to build a full-stack headless e-commerce application with Medusa using just one command, read &lt;a href="https://medusajs.com/blog/ecommerce-backend/"&gt;this article&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Great job on learning about borderless e-commerce! You're off to a wonderful start and should be proud of yourself. As you continue learning, remember to take your time and not be afraid to ask questions.&lt;/p&gt;

&lt;p&gt;If you have any issues or questions related to Medusa, reach out to the Medusa team and the community via &lt;a href="https://discord.gg/medusajs"&gt;&lt;strong&gt;Discord&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>node</category>
      <category>ecommerce</category>
      <category>medusa</category>
    </item>
    <item>
      <title>Building a piggy bank smart contract with solidity</title>
      <dc:creator>prince-joel</dc:creator>
      <pubDate>Wed, 22 Jun 2022 14:49:33 +0000</pubDate>
      <link>https://forem.com/princejoel/building-a-piggy-bank-smart-contract-with-solidity-hka</link>
      <guid>https://forem.com/princejoel/building-a-piggy-bank-smart-contract-with-solidity-hka</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;The piggy bank concept has been around for a long time; it's been a method of saving from the days of continuously putting coins in a box until you've saved up your desired amount and then breaking the box to get your money to now, where mobile and web apps are built to save money that can't be withdrawn until the stated date before it's broken.&lt;/p&gt;

&lt;p&gt;Currently, most fintech projects using web2 languages are now built using web3 languages, with the increase in demand for web3 and blockchain developers, it is necessary as a Solidity developer to learn methods that are useful in the field.&lt;/p&gt;

&lt;p&gt;In this article, you'll learn how to use Solidity to create a simple smart contract that accomplishes the aforementioned task. Anyone can transfer tokens to the bank, but only the owner can withdraw from it, and this withdrawal will terminate the contract by calling the self-destruct method.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;To successfully write a smart contract that allows anyone to send in a token, only the owner can withdraw and destroy itself after withdrawal. This article is the perfect guide for you.&lt;/p&gt;

&lt;p&gt;Construct a &lt;code&gt;.sol&lt;/code&gt; file using the Remix IDE and set it up by mentioning the licensing identification and version, then create your contract with the name you want.&lt;br&gt;
The next step is to create an event. This contract has two events a withdrawal, and a deposit event.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

contract Pbank{
    event deposit(uint amount);
    event withdraw(uint amount);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code will trigger the receive function and the withdraw function you will create later.&lt;/p&gt;

&lt;p&gt;Next, you declare your state variable and modifier. modifiers are code that are run before or after a function call. They are used to modify the behavior of a function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;address public owner;

    modifier onlyowner(){
        require(msg.sender == owner, "not the owner");
        _;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll declare your state variable, which will serve as the contract's owner, and then use the modifier method to create an &lt;code&gt;onlyowner&lt;/code&gt; that will alter the behavior of the function you'll write.&lt;/p&gt;

&lt;p&gt;After that, you must allow this contract to accept tokens. This can be accomplished by using the receive function and ensuring that it is a payable function. The contract will then be able to accept tokens from anyone in this method.&lt;/p&gt;

&lt;p&gt;Let’s implement this functionality in Solidity.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;receive() external payable{
        emit deposit(msg.value);
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we get a token in this function, the event deposit is emitted with the amount sent.&lt;/p&gt;

&lt;p&gt;Next, the most important function in this contract, the withdrawal function, must be created. Imagine saving money and then being unable to withdraw it when the time comes. Scary right?. Luckily, we can avoid this nightmare and give owners the access they deserve.&lt;/p&gt;

&lt;p&gt;Using the &lt;code&gt;onlyowner&lt;/code&gt; modifier we developed, you can design a withdrawal function that only allows the owner to withdraw from the contract. When this withdrawal event is then emitted, all tokens in the address. &lt;/p&gt;

&lt;p&gt;Finally, we need to destroy our piggy bank by starting the self-destruct method. What is a piggy bank that does not destroy itself after withdrawal? We must only trigger the self-destruct method when all tokens have been given to the owner, then the contract can be terminated&lt;br&gt;
Take a look at the implementation of the function in Solidity&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Withdraw() external onlyowner {
        emit withdraw(address(this).balance);
        selfdestruct(payable(msg.sender));
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Depositing, withdrawing, and destroying your piggy bank are all important parts of saving with it. This article showed you how to write a simple smart contract that accepts tokens from anyone, allows only the owner of the contract to withdraw from it, and self-destructs when it’s empty.&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>solidity</category>
    </item>
    <item>
      <title>Building a Speech to Text App with JavaScript</title>
      <dc:creator>prince-joel</dc:creator>
      <pubDate>Sun, 12 Sep 2021 15:56:36 +0000</pubDate>
      <link>https://forem.com/princejoel/building-a-speech-to-text-app-with-javascript-4a4d</link>
      <guid>https://forem.com/princejoel/building-a-speech-to-text-app-with-javascript-4a4d</guid>
      <description>&lt;p&gt;Learn how to build a speech-to-text application in JavaScript using the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API" rel="noopener noreferrer"&gt;Web Speech Recognition&lt;/a&gt; API. This guide will walk you through each step to implement a speech-to-text feature that can convert spoken words into written text, enhancing accessibility and capturing information easily.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Building the User Interface
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Create a file named 'speech.html'.&lt;/li&gt;
&lt;li&gt;Add the following HTML code to design the UI for the speech-to-text app:
&lt;/li&gt;
&lt;/ol&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" dir="ltr"&amp;gt;

&amp;lt;head&amp;gt;

 &amp;lt;meta charset="utf-8"&amp;gt;

 &amp;lt;title&amp;gt;speech to text in javascript&amp;lt;/title&amp;gt;

 &amp;lt;link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css"&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;

 &amp;lt;div class="container"&amp;gt;

 &amp;lt;h1 class="text-center mt-5"&amp;gt;

 Speech to Text in JavaScript

 &amp;lt;/h1&amp;gt;

 &amp;lt;div class="form-group"&amp;gt;

 &amp;lt;textarea id="textbox" rows="6" class="form-control"&amp;gt;&amp;lt;/textarea&amp;gt;

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

 &amp;lt;div class="form-group"&amp;gt;

 &amp;lt;button id="start-btn" class="btn btn-danger btn-block"&amp;gt;

 Start

 &amp;lt;/button&amp;gt;

 &amp;lt;p id="instructions"&amp;gt;Press the Start button&amp;lt;/p&amp;gt;

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

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

 &amp;lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;

 &amp;lt;script src="script.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;In the code above, We used HTML and Bootstrap for a simple, responsive layout. The Start button triggers speech recognition, and the &lt;code&gt;textarea&lt;/code&gt; displays the transcribed text.&lt;/p&gt;

&lt;p&gt;Your UI should look like this:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhgeblyeu31ghpaxifbft.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhgeblyeu31ghpaxifbft.png" alt="UI Image" width="800" height="213"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Writing the JavaScript Code
&lt;/h3&gt;

&lt;p&gt;Create a file named &lt;code&gt;script.js&lt;/code&gt; and paste the following code inside:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;speechRecognition&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;webkitSpeechRecognition&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;recognition&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;speechRecognition&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;textbox&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#textbox&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;instructions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#instructions&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;

&lt;span class="nx"&gt;recognition&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;continuous&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="c1"&gt;// recognition is started&lt;/span&gt;

&lt;span class="nx"&gt;recognition&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onstart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

 &lt;span class="nx"&gt;instructions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Voice Recognition is On&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

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

&lt;span class="nx"&gt;recognition&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onspeechend&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

 &lt;span class="nx"&gt;instructions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;No Activity&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

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

&lt;span class="nx"&gt;recognition&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onerror&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

 &lt;span class="nx"&gt;instruction&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Try Again&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

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

&lt;span class="nx"&gt;recognition&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onresult&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

 &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resultIndex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

 &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;transcript&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;transcript&lt;/span&gt;



 &lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;transcript&lt;/span&gt;

 &lt;span class="nx"&gt;textbox&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;val&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

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

&lt;span class="nf"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#start-btn&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

 &lt;span class="nx"&gt;recognition&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

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

&lt;span class="nx"&gt;textbox&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;input&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

 &lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;val&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

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

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

&lt;/div&gt;



&lt;p&gt;In the code above, we invoked the &lt;code&gt;Web Speech Recognition&lt;/code&gt; API and initialized an instance stored in the &lt;code&gt;recognition&lt;/code&gt; variable.&lt;/p&gt;

&lt;p&gt;After this, we made references to our &lt;code&gt;#textbox&lt;/code&gt; and &lt;code&gt;#instructions&lt;/code&gt; elements we defined in the HTML using JQuery to control them from our code.&lt;/p&gt;

&lt;p&gt;We also created a &lt;code&gt;content&lt;/code&gt; variable that keeps track of text the application has converted and displayed in the &lt;code&gt;textarea&lt;/code&gt; from the HTML file. We are initializing it to an empty string because we have not converted anything yet.&lt;/p&gt;

&lt;p&gt;We then set the continuous variable of the &lt;code&gt;recognition&lt;/code&gt; object to &lt;code&gt;true&lt;/code&gt;. Thus, we are making the API continuously listen for input from the user’s microphone.&lt;/p&gt;

&lt;p&gt;We created an event handler triggered whenever the user clicks on the &lt;code&gt;Start&lt;/code&gt; button to start recognizing. When this happens, the recognition API is begun and will listen for input from the user.&lt;/p&gt;

&lt;p&gt;When you press the button, your browser will request permission to use your microphone, as shown in the image below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh5.googleusercontent.com%2F0PYbwJjTJR4uUm37IAXa2_tGgn8N8CCUfpE5ZsK3wqO9KNzYmAH_jeJRyom1OIeTJOL1s9Vt8P5nPm_hogYKWxTDIKOxyzv1wuO5Gkm8eKnnNolKIQqq9VBXz7_Fg_r-5g%3Ds0" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh5.googleusercontent.com%2F0PYbwJjTJR4uUm37IAXa2_tGgn8N8CCUfpE5ZsK3wqO9KNzYmAH_jeJRyom1OIeTJOL1s9Vt8P5nPm_hogYKWxTDIKOxyzv1wuO5Gkm8eKnnNolKIQqq9VBXz7_Fg_r-5g%3Ds0" alt="Permission Image" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We also added a couple of event handlers to the &lt;code&gt;recognition&lt;/code&gt; object to bring our application to life. They are onstart, onspeechend, onerror, and onresult.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;onstart&lt;/code&gt; event handler is triggered when the recognition API starts and has microphone access. Here, we programmed our application to inform the user that voice recognition is on and converts speech to text.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh3.googleusercontent.com%2FMHYnhlvk0t_zk4yG8OC-tStguNhp8S-8WEmCVUuoh0C_m0H_qVNZjtZ-rChw0hpamvOhknt0twdfHXNLgoUPfSpmHdgNe3-aCxtcNRXmqGXgk3JEAjSAVSwFRTDix3zjEQ%3Ds0" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh3.googleusercontent.com%2FMHYnhlvk0t_zk4yG8OC-tStguNhp8S-8WEmCVUuoh0C_m0H_qVNZjtZ-rChw0hpamvOhknt0twdfHXNLgoUPfSpmHdgNe3-aCxtcNRXmqGXgk3JEAjSAVSwFRTDix3zjEQ%3Ds0" alt="Event Holder" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we will write code for the &lt;code&gt;onresult&lt;/code&gt; event handler. This event is triggered when the recognition API has successfully converted speech from the user’s microphone to text, and the data is made available via the &lt;code&gt;event.results&lt;/code&gt; variable.&lt;/p&gt;

&lt;p&gt;In this function, we will fetch the transcript of the speech given to us by the &lt;code&gt;event.results&lt;/code&gt; variable, then update our previous &lt;code&gt;content&lt;/code&gt; variable and &lt;code&gt;textarea&lt;/code&gt; with the new results.&lt;/p&gt;

&lt;p&gt;Now, the application is complete. If you click the &lt;code&gt;Start&lt;/code&gt; button, you will see that it will automatically convert whatever you speak into text and fill in the transcribed text inside the textbox.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh5.googleusercontent.com%2F3QRpYQnuwfjmihvToITGyA-BUTyLHslKZKP_23-vjkYThE1vsbZqFuJl-4edOZItnuVcZCgo2glMm2HrMCRJYy-D5A1-6JkvknMuTZrCSdsVqgdWxCYpFd5tOTlEhTalMw%3Ds0" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh5.googleusercontent.com%2F3QRpYQnuwfjmihvToITGyA-BUTyLHslKZKP_23-vjkYThE1vsbZqFuJl-4edOZItnuVcZCgo2glMm2HrMCRJYy-D5A1-6JkvknMuTZrCSdsVqgdWxCYpFd5tOTlEhTalMw%3Ds0" alt="Start Button" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We also created the &lt;code&gt;onerror&lt;/code&gt; event handler triggered when an error occurs while transcribing the speech. If any error occurs during this process, our application will inform the user via the instruction box.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh3.googleusercontent.com%2FT2Q_uaci2aWX6_8NiXNUdARD-r5MS6gane9pE1s73rXcMAGVAYb781s6AnJ2JwTgj3W1WBdtDoodMTreeNn879u-MbFmnCUS7WABgJNIodCHfS6ANLamMSG_FBECfbZ1bA%3Ds0" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh3.googleusercontent.com%2FT2Q_uaci2aWX6_8NiXNUdARD-r5MS6gane9pE1s73rXcMAGVAYb781s6AnJ2JwTgj3W1WBdtDoodMTreeNn879u-MbFmnCUS7WABgJNIodCHfS6ANLamMSG_FBECfbZ1bA%3Ds0" alt="Onerror Image" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We also created the &lt;code&gt;onspeechend&lt;/code&gt; event handler triggered when there is no input from the microphone, and the application is in an idle state. When this happens, our application will inform the user via the instruction box.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh3.googleusercontent.com%2Fbz3oUX28Efo9Ppr2Rbw51Ys-ig7A81VA6ZQr0CUJyRvV018gNyQq9MSKiYLQCDRHfWx-Y6xrVKsocmIsOZRY-ksYBYtoi6jf8ouE2ugkMtdX6j2fVbTYlQUoL-p8fj4NwA%3Ds0" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Flh3.googleusercontent.com%2Fbz3oUX28Efo9Ppr2Rbw51Ys-ig7A81VA6ZQr0CUJyRvV018gNyQq9MSKiYLQCDRHfWx-Y6xrVKsocmIsOZRY-ksYBYtoi6jf8ouE2ugkMtdX6j2fVbTYlQUoL-p8fj4NwA%3Ds0" alt="onspeechend Image" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;In this article, you learned how to build a JavaScript-based speech-to-text application using the Web Speech Recognition API. You built a simple UI, connected event handlers, and used the API to convert speech into text in real time. This project demonstrates how JavaScript, HTML, and CSS can work together to create accessible, interactive web applications.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Animation in CSS</title>
      <dc:creator>prince-joel</dc:creator>
      <pubDate>Sun, 02 May 2021 17:29:33 +0000</pubDate>
      <link>https://forem.com/princejoel/animation-in-css-3bpb</link>
      <guid>https://forem.com/princejoel/animation-in-css-3bpb</guid>
      <description>&lt;p&gt;In this article, you will learn about animations in CSS, their properties, and how they can be integrated into websites with sample codes.&lt;/p&gt;

&lt;p&gt;Animation is used to manipulate images, texts, and characters to move and style them. CSS can be used to animate HTML elements and other CSS properties using animation properties.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is CSS animation?
&lt;/h1&gt;

&lt;p&gt;CSS animation is the method of animating HTML elements using CSS animation properties.&lt;/p&gt;

&lt;h2&gt;
  
  
  CSS Animation Properties.
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;@Keyframes&lt;/li&gt;
&lt;li&gt;animation-name&lt;/li&gt;
&lt;li&gt;animation-duration&lt;/li&gt;
&lt;li&gt;animation-delay&lt;/li&gt;
&lt;li&gt;animation-iteration-count&lt;/li&gt;
&lt;li&gt;animation-direction&lt;/li&gt;
&lt;li&gt;animation-timing-function&lt;/li&gt;
&lt;li&gt;animation-fill-mode&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  @Keyframes:
&lt;/h2&gt;

&lt;p&gt;Keyframes are used to state the animating properties in all stages of the animation. To use animations in CSS, keyframes must be stated out. Keyframes determine what style an element will have.&lt;/p&gt;

&lt;p&gt;NOTE: There must be an element to apply an animation to.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@Keyframe&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;25&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;50&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;yellow&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;100&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c"&gt;/* The element*/&lt;/span&gt;
&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;50px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Animation-name:
&lt;/h2&gt;

&lt;p&gt;This is a CSS animation property that states the name of the @Keyframes at-rule to be animated.&lt;br&gt;
in the following example, the animation names shapes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@Keyframe&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;25&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt; 
 &lt;span class="err"&gt;50&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;yellow&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;100&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c"&gt;/* The element*/&lt;/span&gt;
&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:;&lt;/span&gt;
 &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Animation-duration:
&lt;/h2&gt;

&lt;p&gt;This states how long an animation takes to complete its cycle, if not stated it will be set to default which is 0s(0 seconds) which mean no animation will occur.&lt;br&gt;
In the example below that animation-duration is set to 5s.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@Keyframe&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;25&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;50&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;yellow&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;100&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c"&gt;/* The element*/&lt;/span&gt;
&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:;&lt;/span&gt;
 &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;5s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Animation-delay:
&lt;/h2&gt;

&lt;p&gt;This is the number of waiting times before animation begins. It is usually in seconds. &lt;br&gt;
The example below delays the animation for 3s.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@Keyframe&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;25&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;50&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;yellow&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;100&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c"&gt;/* The element*/&lt;/span&gt;
&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:;&lt;/span&gt;
 &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;5s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-delay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;3s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Animation-iteration-count:
&lt;/h2&gt;

&lt;p&gt;This is a CSS animation property, that sets how many times the animation should run before stopping.&lt;br&gt;
NOTE: Multiple values can be set.&lt;br&gt;
In the example below the animation-iteration-count is 4.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@Keyframe&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;25&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;50&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;yellow&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;100&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c"&gt;/* The element*/&lt;/span&gt;
&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:;&lt;/span&gt;
 &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;5s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-delay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;3s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-iteration-count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Animation-direction:
&lt;/h2&gt;

&lt;p&gt;CSS  animation-direction states the pattern in which the animation should be played, it can be forward, backward, or in a different direction.&lt;/p&gt;

&lt;h4&gt;
  
  
  The ideal values for animation-direction are:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Normal: This is the default direction, it is played forward.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reverse: This is the opposite of the default, it is played backward.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Alternate: The animation plays from normal then continues in the reverse direction, which is played forward then backward.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Alternate-reverse: This is played backward to forward.&lt;br&gt;
The example below the animation direction is played in the normal direction(forward):&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@Keyframe&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;25&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;50&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;yellow&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;100&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c"&gt;/* The element*/&lt;/span&gt;
&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:;&lt;/span&gt;
 &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;5s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-delay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;3s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-iteration-count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nb"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Animation-timing-function:
&lt;/h2&gt;

&lt;p&gt;This is a CSS property that states the speed at which the animation flows, i.e the speed curve of the animation.&lt;/p&gt;

&lt;h4&gt;
  
  
  It has the following values:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Linear: Has the same speed from start to end.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ease: This is the default value, it starts slow then graduates too fast, and then ends slow.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ease-in: this has a slow start.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ease-out: this has a slow end.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ease-in-out: This starts slow and ends slow.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;cubic-bezier(0,0,0,0): with the cubic-bezier function you can state your own value.&lt;br&gt;
In the example below the animation-timing-function is ease-in-out.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@Keyframe&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;25&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;50&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;yellow&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;100&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c"&gt;/* The element*/&lt;/span&gt;
&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:;&lt;/span&gt;
 &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;5s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-delay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;3s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-iteration-count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nb"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-timing-function&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ease-in-out&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Animation-fill-mode:
&lt;/h2&gt;

&lt;p&gt;This states what happens when the animation is not playing (before it starts and after it stops).&lt;/p&gt;

&lt;h4&gt;
  
  
  CSS animation-fill-mode values are:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Forward: The &lt;/p&gt; element retain the style values from the last keyframe when the animation ends.
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Backward:  The &lt;/p&gt; element retain the style values from the last keyframe before the animation starts.
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Both: Animation uses the forward and backward values.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;None: This is the default value, animation remains the same.&lt;br&gt;
IN the example below the animation-fill-mode is set as both:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@Keyframe&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;25&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;50&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;yellow&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
 &lt;span class="err"&gt;100&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c"&gt;/* The element*/&lt;/span&gt;
&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:;&lt;/span&gt;
 &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;5s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-delay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;3s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-iteration-count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nb"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-timing-function&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ease-in-out&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="nl"&gt;animation-fill-mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nb"&gt;both&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;





</description>
      <category>beginners</category>
      <category>css</category>
      <category>html</category>
    </item>
  </channel>
</rss>
