<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ishraq Tanvir</title>
    <description>The latest articles on DEV Community by Ishraq Tanvir (@ishraq-89).</description>
    <link>https://dev.to/ishraq-89</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%2F829699%2F3057d2ee-7e89-4737-8dd8-53b051c4f453.jpg</url>
      <title>DEV Community: Ishraq Tanvir</title>
      <link>https://dev.to/ishraq-89</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ishraq-89"/>
    <language>en</language>
    <item>
      <title>Simple React Project: Quotes generator.</title>
      <dc:creator>Ishraq Tanvir</dc:creator>
      <pubDate>Mon, 12 Jun 2023 12:28:10 +0000</pubDate>
      <link>https://dev.to/ishraq-89/simple-react-project-quotes-generator-3dkp</link>
      <guid>https://dev.to/ishraq-89/simple-react-project-quotes-generator-3dkp</guid>
      <description>&lt;p&gt;Are you ready to dive into the world of React.js? In this step-by-step tutorial, I'll walk you through building an interactive Quotes Generator using React.js and Vite. I'll highlight the importance of integrating an API and fetch data using axios&lt;/p&gt;

&lt;h1&gt;
  
  
  Preview:
&lt;/h1&gt;

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

&lt;p&gt;&lt;u&gt;&lt;strong&gt;&lt;a href="https://github.com/devishraq/quotes-generator-react" rel="noopener noreferrer"&gt;Github respository(Give a star✨)&lt;/a&gt;&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Setting up the Project with Vite
&lt;/h2&gt;

&lt;p&gt;we need to set up a new React.js project using Vite. By following these steps:&lt;/p&gt;

&lt;p&gt;Open your terminal and navigate to the desired directory where you'd like to create your project.&lt;/p&gt;

&lt;p&gt;Run the following command to create a new Vite project called "quotes-generator-react":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init vite@latest quotes-generator --template react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the project is created, navigate into the project folder using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd quotes-generator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  Step 2: Editing the React App:
&lt;/h2&gt;

&lt;p&gt;Edit the src folder of your project.&lt;br&gt;
In the folder Create App.jsx file and add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useState, useEffect } from "react";
import "./App.css";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will import necessary react modules which are gonna used in this project and css styles.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: CSS Implementation
&lt;/h2&gt;

&lt;p&gt;Delete the index.css file and edit App.css.Delete all the styles in that styles and edit the css file and add following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@import url("https://fonts.googleapis.com/css2?family=Ubuntu&amp;amp;display=swap");
root,
html,
body {
  margin: 0;
  padding: 0;
  font-family: "Ubuntu", sans-serif;
}

.app {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: rgb(173, 200, 255);
}

.card {
  transition: opacity 0.5s;

  display: grid;
  place-content: center;
  margin: 20px;
  color: #fff;
  max-width: 450px;
  padding: 0px 20px 20px 20px;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    rgb(63, 124, 255) 0%,
    rgb(17, 52, 123) 100%
  );
}

.heading {
  font-size: 40px;
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: 2px;
  word-spacing: 1px;
  line-height: 1.3;
}

.button {
  border-radius: 7px;
  cursor: pointer;
  padding: 13px 20px;
  opacity: 1;
  background-color: #ffffff;
  border: none;
  outline: none;
}

.button span {
  color: #1d5dcc;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.7px;
}
.button:hover {
  background-color: #ececec;
  transition: ease-in-out 0.1s;
}

.card.fetching {
  opacity: 0.5;
  pointer-events: none;
}

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

&lt;/div&gt;





&lt;h2&gt;
  
  
  Step 3: Editing the main.jsx file:
&lt;/h2&gt;

&lt;p&gt;edit main.jsx file and add the following code which will render your App.jsx file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { createRoot } from 'react-dom/client';
import App from './App'
const domNode = document.querySelector('#root');
const root = createRoot(domNode);
root.render(&amp;lt;App /&amp;gt;)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  Step 4: Fetching data using Axios:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const [advice, setAdvice] = useState({
        advice: "",
        isFetching: false, // Removed initial fetching state
    });

    useEffect(() =&amp;gt; {
        fetchAdvice();
    }, []);

    const fetchAdvice = () =&amp;gt; {
        setAdvice((prevState) =&amp;gt; ({ ...prevState, isFetching: true }));
        axios
            .get("https://api.adviceslip.com/advice")
            .then((res) =&amp;gt; {
                const { advice } = res.data.slip;
                setAdvice({ advice: advice, isFetching: false });
            })
            .catch((error) =&amp;gt; {
                console.log("Error occurred", error);
                setAdvice((prevState) =&amp;gt; ({ ...prevState, isFetching: false }));
            });
    };

    const rawAdvice = advice.advice.slice(0, -1);

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

&lt;/div&gt;



&lt;p&gt;paste the code in the curlibrackets &lt;code&gt;export default () =&amp;gt; {}&lt;/code&gt;&lt;br&gt;
this code will fetch data from the following api using axois:&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://api.adviceslip.com/advice
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sample JSON Data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "slip": {
    "id": 122,
    "advice": "You spend half your life asleep or in bed. It's worth spending money on a good mattress, decent pillows and a comfy duvet."
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 5: Showing the data in dom:
&lt;/h2&gt;

&lt;p&gt;Just paste the following code which will render the data. the main data is stored int the &lt;code&gt;rawAdvice&lt;/code&gt; which just return the &lt;code&gt;advice:'......'&lt;/code&gt; but cut the fullstop that will make the advice text node more good to look.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return (
        &amp;lt;div className="app"&amp;gt;
            &amp;lt;div className={`card ${advice.isFetching ? "fetching" : ""}`}&amp;gt;
                &amp;lt;h1 className="heading"&amp;gt;&amp;lt;span&amp;gt;' &amp;lt;/span&amp;gt;{rawAdvice}&amp;lt;span&amp;gt; '&amp;lt;/span&amp;gt;&amp;lt;/h1&amp;gt;
                &amp;lt;button onClick={fetchAdvice} className="button"&amp;gt;
                    &amp;lt;span&amp;gt;Generate!&amp;lt;/span&amp;gt;
                &amp;lt;/button&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;now paste the code at the end of &lt;code&gt;export default () =&amp;gt; {}&lt;/code&gt; brackets.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 6: Running the file
&lt;/h2&gt;

&lt;p&gt;In the terminal paste this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Woohhh!This your quotoes generator app using react and vite&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;br&gt; 
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Preview Section(Source code and browser)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Main:-
&lt;/h4&gt;

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

&lt;h4&gt;
  
  
  App.jsx:-
&lt;/h4&gt;

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

&lt;h4&gt;
  
  
  main.jsx:-
&lt;/h4&gt;

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

&lt;h4&gt;
  
  
  index.html:-
&lt;/h4&gt;

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

&lt;h2&gt;
  
  
  Final Preview along with code editor:-
&lt;/h2&gt;

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

&lt;h1&gt;
  
  
  Links:-
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/devishraq/quotes-generator-react" rel="noopener noreferrer"&gt;github repository(Give a star)&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://api.adviceslip.com/advice" rel="noopener noreferrer"&gt;JSON API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://axios-http.com/" rel="noopener noreferrer"&gt;axios&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>react</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Gradient Color Collection by tishraq28</title>
      <dc:creator>Ishraq Tanvir</dc:creator>
      <pubDate>Fri, 06 May 2022 06:36:51 +0000</pubDate>
      <link>https://dev.to/ishraq-89/gradient-color-collection-by-tishraq28-43c9</link>
      <guid>https://dev.to/ishraq-89/gradient-color-collection-by-tishraq28-43c9</guid>
      <description>&lt;p&gt;`&lt;/p&gt;
&lt;h1&gt;Gradiesh - A Small Collection of Gradients&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--piqWR7JL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://user-images.githubusercontent.com/101325013/166917764-59f3135f-c09a-4b5b-ae43-3d95ada3ac4d.png" class="article-body-image-wrapper"&gt;&lt;img alt="Gradiesh" src="https://res.cloudinary.com/practicaldev/image/fetch/s--piqWR7JL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://user-images.githubusercontent.com/101325013/166917764-59f3135f-c09a-4b5b-ae43-3d95ada3ac4d.png" width="800" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Intro&lt;/h2&gt;

&lt;p&gt;
Gradiesh mainly a site of a small collection of gradients. It is built for both designers and developers. They can use gradients from the site. In the main, site there are only 24 gradients but all of these are most used in the web 3.0 era. Sometimes, it is hard to make common gradients with CSS. For this, Gradiesh is a easy solution. All can use it without any hassle. 
&lt;/p&gt;

&lt;h2&gt;Usages&lt;/h2&gt;

&lt;h5&gt;1. Open the main site
&lt;/h5&gt;
&lt;img alt="Screenshot_28" src="https://res.cloudinary.com/practicaldev/image/fetch/s--rnC2DB43--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://user-images.githubusercontent.com/101325013/166919786-7b36f760-f617-4662-b4d5-6dc4ffe76d94.png" width="800" height="379"&gt;

&lt;h3&gt;2. Choose your gradients
&lt;/h3&gt;
&lt;img alt="Screenshot_29" src="https://res.cloudinary.com/practicaldev/image/fetch/s--0uh0kZg2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://user-images.githubusercontent.com/101325013/166920035-9bfb9aff-d5b6-4d4e-961f-49908feb5d37.png" width="800" height="392"&gt;
&lt;p&gt;I am choosing second one. You can choose any one.&lt;/p&gt;

&lt;h3&gt;3. After choosing, Click on your choosed gradient box.&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--s-TJEDZJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://user-images.githubusercontent.com/101325013/166920672-1a20432a-3f81-4fb2-a0fd-786fe18872cc.png" class="article-body-image-wrapper"&gt;&lt;img alt="Screenshot_30" src="https://res.cloudinary.com/practicaldev/image/fetch/s--s-TJEDZJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://user-images.githubusercontent.com/101325013/166920672-1a20432a-3f81-4fb2-a0fd-786fe18872cc.png" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you Click on your choose gradient box, you will see that a success message has opened and gradient code has successfully copied on your clipboard. You can use it in your code. Click ok&lt;/p&gt;

&lt;h2&gt;Meet the Creator&lt;/h2&gt;


&lt;p&gt;Hey that's Ishraq. I have built this happy project for you.&lt;/p&gt;

&lt;h3&gt;Follow Me:-&lt;/h3&gt; 

&lt;p&gt;twitter : &lt;a href="https://twitter.com/tishraq28" rel="noopener noreferrer"&gt;https://twitter.com/tishraq28&lt;/a&gt;&lt;br&gt;
Facebook :&lt;a href="https://facebook.com/tishraq28" rel="noopener noreferrer"&gt;https://facebook.com/tishraq28&lt;/a&gt;&lt;br&gt;
GitHub : &lt;a href="https://github.com/tishraq28" rel="noopener noreferrer"&gt;https://github.com/tishraq28&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Don't forget to give me a GitHub star✨✨✨✨✨
&lt;/h2&gt;

&lt;p&gt;Thanks You very much🙏🙏🙏🙏🙏&lt;br&gt;
`&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
