<?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: Devang Saklani</title>
    <description>The latest articles on Forem by Devang Saklani (@devang).</description>
    <link>https://forem.com/devang</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%2F642577%2Fa6f5b7ca-2a24-4ca3-b076-218800a2d301.jpg</url>
      <title>Forem: Devang Saklani</title>
      <link>https://forem.com/devang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/devang"/>
    <language>en</language>
    <item>
      <title>Create your first 3d scene with Three.js 🪄</title>
      <dc:creator>Devang Saklani</dc:creator>
      <pubDate>Sat, 18 Sep 2021 01:13:40 +0000</pubDate>
      <link>https://forem.com/devang/create-your-first-3d-scene-with-three-js-59kf</link>
      <guid>https://forem.com/devang/create-your-first-3d-scene-with-three-js-59kf</guid>
      <description>&lt;p&gt;Hi Everyone, my name is Devang Saklani and Today I'm going to teach you how you can create your first 3d scene with the help of &lt;strong&gt;Threejs&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  First of all, What is Threejs?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1400%2F1%2AaDcnXab1QC_5KF8JUxDEYA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F1400%2F1%2AaDcnXab1QC_5KF8JUxDEYA.png" alt="Threejs logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three. js&lt;/strong&gt; is a JavaScript library used to create and run / display animated &lt;strong&gt;3D graphics in a web browser using WebGL&lt;/strong&gt;. It also acts as an Api for WebGL.&lt;br&gt;
It uses &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; element to display the scene.&lt;/p&gt;

&lt;p&gt;It has made displaying 3d objects in Web browsers far easy. As compared to writing native WebGL, ThreeJS is super easy as well as performant.&lt;/p&gt;
&lt;h2&gt;
  
  
  Setting up the Basic Environment
&lt;/h2&gt;

&lt;p&gt;Our first step would be to setup a basic environment for our website. We will use ThreeJS npm package and Webpack to bundle it, but you can also use the cdn link for the package.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I won't tell you how to use Threejs with CDN in this project but you can read &lt;a href="https://threejs.org/docs/#manual/en/introduction/Installation" rel="noopener noreferrer"&gt;official installation docs&lt;/a&gt; to use this method&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Clone this starter webpack template: &lt;a href="https://github.com/Devang47/webpack-starter-for-blog-post" rel="noopener noreferrer"&gt;Github link&lt;/a&gt;&lt;br&gt;
and run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
or
yarn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The cloned repo folder structure should be like this:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D1RZ83rRXLdEPZGF-EsBCNjCF28-GBPmLY" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D1RZ83rRXLdEPZGF-EsBCNjCF28-GBPmLY" alt="Folder structure"&gt;&lt;/a&gt;&lt;br&gt;
To start webpack server run &lt;code&gt;npm run dev&lt;/code&gt; or &lt;code&gt;yarn dev&lt;/code&gt; &lt;/p&gt;
&lt;h2&gt;
  
  
  Creating Basic Scene
&lt;/h2&gt;

&lt;p&gt;First let's discuss what are we going to do: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Firstly we will import &lt;code&gt;three&lt;/code&gt; from the package&lt;/li&gt;
&lt;li&gt;Then we will initialize a new ThreeJS Scene&lt;/li&gt;
&lt;li&gt;A new camera (for viewing the scene)&lt;/li&gt;
&lt;li&gt;Creating a 3d cube (our 3d object)&lt;/li&gt;
&lt;li&gt;Setting up the renderer and the animate function&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It is as easy as it sounds! &lt;strong&gt;Let's start&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Installation:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i three
or 
yarn add three
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now, in script.js&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Import Threejs:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt;  &lt;span class="o"&gt;*&lt;/span&gt;  &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt;  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;three&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Create a new ThreeJS Scene
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;scene&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Scene&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt; Camera for viewing scene
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;camera&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PerspectiveCamera&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="mi"&gt;75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// field of view&lt;/span&gt;
    &lt;span class="nx"&gt;innerWidth&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// aspect ratio of the canvas / screen&lt;/span&gt;
    &lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;  &lt;span class="c1"&gt;// near and far clipping plane respectively&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;camera&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;position&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Changing the default position of the camera&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;To know more about these properties follow the &lt;a href="https://threejs.org/docs/#api/en/cameras/PerspectiveCamera" rel="noopener noreferrer"&gt;official docs&lt;/a&gt; &lt;br&gt;
or read &lt;a href="https://threejs.org/docs/#manual/en/introduction/Creating-a-scene" rel="noopener noreferrer"&gt;this guide&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setting up our cube object
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;geometry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;BoxGeometry&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Creating a new Geometry&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;material&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;MeshBasicMaterial&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;0x00ff00&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// Giving it a material&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cube&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Mesh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;geometry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;material&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Combining both things&lt;/span&gt;

&lt;span class="nx"&gt;scene&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cube&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// adding it to the scene&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;by this time nothing will appear on the screen because nothing is rendered yet, So let's initiate a renderer&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating a renderer
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;renderer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WebGL1Renderer&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;   &lt;span class="c1"&gt;// Creating renderer&lt;/span&gt;
&lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setSize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;innerWidth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;innerHeight&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Size of canvas element&lt;/span&gt;
&lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setPixelRatio&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;devicePixelRatio&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Yes pixel-ratio of the screen&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domElement&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Adding canvas element to the html &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Now comes the final step: &lt;strong&gt;Rendering!!&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt;  &lt;span class="nf"&gt;animate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;scene&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;camera&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Rendering single frame&lt;/span&gt;
&lt;span class="nx"&gt;cube&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rotation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt;  &lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;       &lt;span class="c1"&gt;// Rotating on the x and y axis&lt;/span&gt;
&lt;span class="nx"&gt;cube&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rotation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt;  &lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;       &lt;span class="c1"&gt;// Adding simple animation to our object&lt;/span&gt;
&lt;span class="nx"&gt;controls&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// Required for smooth camera movement&lt;/span&gt;
&lt;span class="nf"&gt;requestAnimationFrame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;animate&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Calling this function again to repeat the process &lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;animate&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;What's happening is we are creating a self-calling function that will call itself around 60 times a second (depends on the user's Screen and CPU) and will create and display a frame on each render.&lt;br&gt;
In the third line we will rotate the cube to get some simple animations on the scene.&lt;/p&gt;

&lt;p&gt;The  screen should look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D1x5HJKRJOSJ5YlCIy3TsT_oPvEbno3Gc_" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D1x5HJKRJOSJ5YlCIy3TsT_oPvEbno3Gc_" alt="cube"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Wanna add controls to the scene? 
In order to add Mouse Controls to the Scene we will use OrbitControls
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;OrbitControls&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;  &lt;span class="k"&gt;from&lt;/span&gt;  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;three/examples/jsm/controls/OrbitControls&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="c1"&gt;// import at the top&lt;/span&gt;

&lt;span class="c1"&gt;//  ... camera, renderer&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;controls&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="k"&gt;new&lt;/span&gt;  &lt;span class="nc"&gt;OrbitControls&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;camera&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domElement&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Creating controls&lt;/span&gt;
&lt;span class="nx"&gt;controls&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;enableDamping&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Enabling the smooth camera movement effect&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If any error occurs just leave a comment below I'll surely try to reply ASAP.&lt;/p&gt;

&lt;p&gt;That's it, You've finally created your first ThreeJS scene! Congratulations! 🎉&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.giphy.com%2Fmedia%2FxT0xezQGU5xCDJuCPe%2F200w.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.giphy.com%2Fmedia%2FxT0xezQGU5xCDJuCPe%2F200w.webp" alt="Congratulations"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well this was pretty basic, Now lets add something interesting!&lt;/p&gt;

&lt;p&gt;Change &lt;code&gt;MeshBasicMaterial&lt;/code&gt; to &lt;code&gt;MeshNormalMaterial&lt;/code&gt;. &lt;br&gt;
The screen should look like this:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D1lWGP4PdNqf2R8wdw1LmDeJjjdxqT8zst" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D1lWGP4PdNqf2R8wdw1LmDeJjjdxqT8zst" alt="cube with colors"&gt;&lt;/a&gt;&lt;br&gt;
Read more about materials here: &lt;a href="https://threejs.org/docs/#api/en/materials/MeshNormalMaterial" rel="noopener noreferrer"&gt;Official docs&lt;/a&gt; or &lt;a href="https://threejsfundamentals.org/threejs/lessons/threejs-materials.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The final script should look like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
Check it live here: &lt;a href="https://basic-3d-scene-with-threejs.netlify.app/" rel="noopener noreferrer"&gt;click here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can add more cubes, spheres, triangles as well as your Custom bleder models! in ThreeJS.&lt;/p&gt;

&lt;p&gt;This is the most recent website I build using ThreeJS: &lt;a href="https://threejs-portfolio-website.netlify.app" rel="noopener noreferrer"&gt;click here&lt;/a&gt; and TBH it's pretty basic and easy.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D1ylKSd1_zmpdMPEiLxRoRxSIp1LpbG62Y" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D1ylKSd1_zmpdMPEiLxRoRxSIp1LpbG62Y" alt="scene"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are interested in learning ThreeJS I'd recommend reading the &lt;a href="https://threejs.org/docs/index.html#manual/en/introduction/Creating-a-scene" rel="noopener noreferrer"&gt;official docs&lt;/a&gt; or  going to &lt;a href="https://threejsfundamentals.org/" rel="noopener noreferrer"&gt;Threejs Fundamentals&lt;/a&gt; and if you're really interested in WebGL and ThreeJS I'd recommend you to watch &lt;a href="https://threejs-journey.xyz/" rel="noopener noreferrer"&gt;this course&lt;/a&gt; by &lt;a href="https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=&amp;amp;ved=2ahUKEwiHndLlmobzAhXVH7cAHRJGCs0QFnoECA4QAQ&amp;amp;url=https://threejs-journey.xyz/&amp;amp;usg=AOvVaw3_Q2G5Wfctal9GtickWuz6" rel="noopener noreferrer"&gt;Bruno Simon&lt;/a&gt;. He is one of the finest ThreeJS developers.&lt;/p&gt;

&lt;p&gt;Thanks for reading this post and if you got any errors, just leave a comment below or &lt;a href="//mailto:devangsaklani@gmail.com"&gt;mail me&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A post by &lt;a href="https://twitter.com/DevangSaklani" rel="noopener noreferrer"&gt;Devang Saklani&lt;/a&gt;. Hope my efforts were of any help.😇&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Simple but Minimal Portfolio template</title>
      <dc:creator>Devang Saklani</dc:creator>
      <pubDate>Tue, 14 Sep 2021 15:51:45 +0000</pubDate>
      <link>https://forem.com/devang/yet-another-minimal-portfolio-template-2e9e</link>
      <guid>https://forem.com/devang/yet-another-minimal-portfolio-template-2e9e</guid>
      <description>&lt;h2&gt;
  
  
  Simple but minimal Portfolio Website using React and GSAP
&lt;/h2&gt;

&lt;p&gt;Hi everyone, my name is Devang Saklani. I'm a Front-end Developer from India and I've recently built a &lt;em&gt;Simple portfolio website&lt;/em&gt;  using React and GSAP.&lt;br&gt;
Everyone can use this website and modify it in which ever way they want (no attributions necessary).&lt;/p&gt;

&lt;p&gt;Check it out live: &lt;a href="https://devang47.github.io/simple-portfolio/"&gt;https://devang47.github.io/simple-portfolio/&lt;/a&gt;&lt;br&gt;
check out the Particle-js version here: &lt;a href="https://devang47.github.io/simple-portfolio-with-particlejs/"&gt;https://devang47.github.io/simple-portfolio-with-particlejs/&lt;/a&gt;&lt;br&gt;
(Feedbacks will be appreciated) &lt;br&gt;
Github repo: &lt;a href="https://github.com/Devang47/simple-portfolio"&gt;here&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Lighthouse score:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4JsuG0MC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8g2wd6hb4dl5wo61my87.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4JsuG0MC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8g2wd6hb4dl5wo61my87.png" alt="Lighthouse score"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've also added few default themes but You can also make and add your own theme by making a simple CSS Class like:&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="nc"&gt;.unique_theme&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="py"&gt;--bg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#0c0f0a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f8f8f8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--secondary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#d1d1d1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--highlight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#41ead4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--card&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff08&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--icon-bg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#9e6e6e1&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--icon-bg-hover&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff1&lt;/span&gt;&lt;span class="n"&gt;c&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;and then add this Class to &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag in &lt;code&gt;index.html&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Available default themes:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Dark theme&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SrCGPNBC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://drive.google.com/uc%3Fid%3D19KnTSs3TE5Md9dgR_qy5-quKHl2EU1Bq" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SrCGPNBC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://drive.google.com/uc%3Fid%3D19KnTSs3TE5Md9dgR_qy5-quKHl2EU1Bq" alt="Dark theme"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;White theme&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b8Gew_o3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://drive.google.com/uc%3Fid%3D1FxtgVYUmxu5kSuqQ9M-RPwr4rRBhNXgq" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b8Gew_o3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://drive.google.com/uc%3Fid%3D1FxtgVYUmxu5kSuqQ9M-RPwr4rRBhNXgq" alt="White theme"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Blue theme&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iBTQCAbu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://drive.google.com/uc%3Fid%3D1XxR9CQdua3AK9FlCgF80VqIieIZ7rQuU" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iBTQCAbu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://drive.google.com/uc%3Fid%3D1XxR9CQdua3AK9FlCgF80VqIieIZ7rQuU" alt="Blue theme"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Green theme&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X6DnGwXd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://drive.google.com/uc%3Fid%3D1i_4D5OsP6Ls_9PDuiZqR9SR8ESI0s4Zu" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X6DnGwXd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://drive.google.com/uc%3Fid%3D1i_4D5OsP6Ls_9PDuiZqR9SR8ESI0s4Zu" alt="Green theme"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to change themes
&lt;/h2&gt;

&lt;p&gt;To change themes go to &lt;code&gt;index.html&lt;/code&gt; file and change the class of body tag to the theme name like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&lt;/span&gt;  &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"green"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&lt;/span&gt;  &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"dark"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Update&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Particle JS is also now integrated in a clone of this project 🤩 and it is looking really good: &lt;br&gt;
Check it out live here: &lt;a href="https://devang47.github.io/simple-portfolio-with-particlejs/"&gt;here&lt;/a&gt;&lt;br&gt;
Github repo: &lt;a href="https://devang47.github.io/simple-portfolio-with-particlejs/"&gt;here&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dQTsMfrM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uizx33vysq87h70qwoks.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dQTsMfrM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uizx33vysq87h70qwoks.png" alt="Partile js integrated"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have any feedback please add a Comment below and Contribute in this project.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Add a 'Slider' to your Website using CSS and Javascript</title>
      <dc:creator>Devang Saklani</dc:creator>
      <pubDate>Sun, 27 Jun 2021 13:38:11 +0000</pubDate>
      <link>https://forem.com/devang/add-a-slider-to-your-website-using-css-and-javascript-238e</link>
      <guid>https://forem.com/devang/add-a-slider-to-your-website-using-css-and-javascript-238e</guid>
      <description>&lt;p&gt;In this article I will tell you several ways to &lt;strong&gt;add a Slider to your website&lt;/strong&gt; and how you can use these sliders to make your website look more Attractive and more Functional.&lt;/p&gt;

&lt;h2&gt;
  
  
  First of all, What is meant by slider?
&lt;/h2&gt;

&lt;p&gt;A slider is a term that refers to a slideshow on a website. An example of a slider can be a revolving carousel that displays products or photos.&lt;/p&gt;

&lt;p&gt;Types of Sliders we are going to build:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;With plain CSS and JS (not recommended)&lt;/li&gt;
&lt;li&gt;Using CSS frameworks (like Bootstrap)&lt;/li&gt;
&lt;li&gt;Using JS libraries (best way)&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Slider using plain CSS and JS
&lt;/h1&gt;

&lt;p&gt;In this method we will use only CSS and a little bit of JS for making a slider. This is a simple demo of it :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F64rqh5qsc01hqumylg56.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F64rqh5qsc01hqumylg56.png" alt="W3Scchools slider example"&gt;&lt;/a&gt;&lt;br&gt;
Codepen example: &lt;a href="https://codepen.io/devang47/pen/OJmLELR" rel="noopener noreferrer"&gt;click here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also customize it as much as you want (if you know how to).&lt;br&gt;
I won't do deeper into its working as it is already full explained by W3Schools in &lt;a href="https://www.w3schools.com/howto/howto_js_slideshow.asp" rel="noopener noreferrer"&gt;this article.&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;And a person Named &lt;a href="https://www.toptal.com/css/full-page-slider-css-and-javascript" rel="noopener noreferrer"&gt;Stefan Vitasovic&lt;/a&gt; has made  a cool slider using plain CSS and JS. I would recommened you to check-out his method, If you are making it with plain JS. Check out what he made &lt;a href="http://stefan.lynxdev.io/projects/fullscreen-slider/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I would suggest not to use this method if you are a beginner as this method is most complicated. But it can be really helpful to you in some way! i.e. you will get deeper knowledge of It's working and I am sure you will learn many things from it.&lt;/p&gt;
&lt;h1&gt;
  
  
  Using CSS libraries (Bootstrap)
&lt;/h1&gt;

&lt;p&gt;In this method we will use &lt;strong&gt;Bootstrap&lt;/strong&gt; to make a Image slider.&lt;br&gt;
&lt;a href="https://media.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%2Fs48fjyhnt26vb5dc8gh0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fs48fjyhnt26vb5dc8gh0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First of all, import bootstrap CSS and JS files from any CDN network (for a quick setup).&lt;br&gt;
Then go to &lt;a href="https://getbootstrap.com/docs/5.0/components/carousel/" rel="noopener noreferrer"&gt;this page&lt;/a&gt; to get the HTML Markup or just copy this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div id="carouselExampleControls" class="carousel slide" data-bs-ride="carousel"&amp;gt;
  &amp;lt;div class="carousel-inner"&amp;gt;
    &amp;lt;div class="carousel-item active"&amp;gt;
      &amp;lt;img src="https://images.unsplash.com/photo-1623646230868-48e8e88b38e4?crop=entropy&amp;amp;cs=tinysrgb&amp;amp;fit=crop&amp;amp;fm=jpg&amp;amp;h=720&amp;amp;ixlib=rb-1.2.1&amp;amp;q=80&amp;amp;w=1280" class="d-block w-100" alt="..."&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div class="carousel-item"&amp;gt;
      &amp;lt;img src="https://images.unsplash.com/photo-1599636647429-8cbd70bead58?crop=entropy&amp;amp;cs=tinysrgb&amp;amp;fit=crop&amp;amp;fm=jpg&amp;amp;h=720&amp;amp;ixlib=rb-1.2.1&amp;amp;q=80&amp;amp;w=1280" class="d-block w-100" alt="..."&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div class="carousel-item"&amp;gt;
      &amp;lt;img src="https://images.unsplash.com/photo-1622556474520-59904a30f654?crop=entropy&amp;amp;cs=tinysrgb&amp;amp;fit=crop&amp;amp;fm=jpg&amp;amp;h=720&amp;amp;ixlib=rb-1.2.1&amp;amp;q=80&amp;amp;w=1280" class="d-block w-100" alt="..."&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="prev"&amp;gt;
    &amp;lt;span class="carousel-control-prev-icon" aria-hidden="true"&amp;gt;&amp;lt;/span&amp;gt;
    &amp;lt;span class="visually-hidden"&amp;gt;Previous&amp;lt;/span&amp;gt;
  &amp;lt;/button&amp;gt;
  &amp;lt;button class="carousel-control-next" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="next"&amp;gt;
    &amp;lt;span class="carousel-control-next-icon" aria-hidden="true"&amp;gt;&amp;lt;/span&amp;gt;
    &amp;lt;span class="visually-hidden"&amp;gt;Next&amp;lt;/span&amp;gt;
  &amp;lt;/button&amp;gt;
&amp;lt;/div&amp;gt;

// Bootstrap CSS and JS files 
&amp;lt;link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"&amp;gt;
&amp;lt;script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Codepen example: &lt;a href="https://codepen.io/devang47/pen/vYmBrXN" rel="noopener noreferrer"&gt;click here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can do many customizations like: add Controls, Indicators, Captions, Custom Transition effects etc. by reading their documentation &lt;a href="https://getbootstrap.com/docs/5.0/components/carousel/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;All I have to say about this is that this is a really easy and fast way to add/make a slider in your Website without compromising anything. &lt;/p&gt;

&lt;h1&gt;
  
  
  Using Javascript library to add a slider
&lt;/h1&gt;

&lt;p&gt;This is (according to me) the best way to add a Image/Normal Slider with good Animations in your website.&lt;br&gt;
&lt;a href="https://media.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%2F3g4i3ntecjr5k8uubjur.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F3g4i3ntecjr5k8uubjur.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
 In this we will use a JS library called &lt;strong&gt;&lt;a href="https://swiperjs.com/" rel="noopener noreferrer"&gt;SwiperJS&lt;/a&gt;&lt;/strong&gt;. You can use others too, but this one is &lt;strong&gt;maintained&lt;/strong&gt; and really popular among developers. Also the things and customizations you can do with it are just Amazing.&lt;/p&gt;

&lt;p&gt;Also, This library has support for Swipe gestures (which is a really difficult thing to make with plain JS). Check example &lt;a href="https://swiperjs.com/demos" rel="noopener noreferrer"&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;But, How to make it work?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;First of all import it's CSS and JS files from any CDN network, or just copy these links:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;// Both are same (import any one)
&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/swiper/swiper-bundle.css"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/swiper/swiper-bundle.min.css"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

// Same here (import any one)
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/swiper/swiper-bundle.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/swiper/swiper-bundle.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Basic HTML markup:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="swiper-container"&amp;gt;
  &amp;lt;!-- Additional required wrapper --&amp;gt;
  &amp;lt;div class="swiper-wrapper"&amp;gt;
    &amp;lt;!-- Slides --&amp;gt;
    &amp;lt;div class="swiper-slide"&amp;gt;  &amp;lt;img src="https://images.unsplash.com/photo-1623646230868-48e8e88b38e4?crop=entropy&amp;amp;cs=tinysrgb&amp;amp;fit=crop&amp;amp;fm=jpg&amp;amp;h=720&amp;amp;ixlib=rb-1.2.1&amp;amp;q=80&amp;amp;w=1280" style="width:100%"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class="swiper-slide"&amp;gt;  &amp;lt;img src="https://images.unsplash.com/photo-1599636647429-8cbd70bead58?crop=entropy&amp;amp;cs=tinysrgb&amp;amp;fit=crop&amp;amp;fm=jpg&amp;amp;h=720&amp;amp;ixlib=rb-1.2.1&amp;amp;q=80&amp;amp;w=1280" style="width:100%"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class="swiper-slide"&amp;gt;  &amp;lt;img src="https://images.unsplash.com/photo-1622556474520-59904a30f654?crop=entropy&amp;amp;cs=tinysrgb&amp;amp;fit=crop&amp;amp;fm=jpg&amp;amp;h=720&amp;amp;ixlib=rb-1.2.1&amp;amp;q=80&amp;amp;w=1280" style="width:100%"&amp;gt;&amp;lt;/div&amp;gt;
    ...
  &amp;lt;/div&amp;gt;
  &amp;lt;!-- If we need pagination --&amp;gt;
  &amp;lt;div class="swiper-pagination"&amp;gt;&amp;lt;/div&amp;gt;

  &amp;lt;!-- If we need navigation buttons --&amp;gt;
  &amp;lt;div class="swiper-button-prev"&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class="swiper-button-next"&amp;gt;&amp;lt;/div&amp;gt;

  &amp;lt;!-- If we need scrollbar --&amp;gt;
  &amp;lt;div class="swiper-scrollbar"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;These images in &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; are placeholders, you can change these.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basic CSS:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
.swiper-container {
  width: calc(1280px/2);
  height: calc(720px/2);
}


//buttons
.swiper-button-next, .swiper-container-rtl .swiper-button-prev {
  color: white;
}
.swiper-button-prev, .swiper-container-rtl .swiper-button-next{
  color: white;
}

//swiper bullets
.swiper-pagination-bullet-active{
  background-color: white;
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Basic JS:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const swiper = new Swiper('.swiper-container', {
  // Optional parameters
  direction: 'horizontal',
  loop: true,

  // If we need pagination
  pagination: {
    el: '.swiper-pagination',
  },

  // Navigation arrows
  navigation: {
    nextEl: '.swiper-button-next',
    prevEl: '.swiper-button-prev',
  },

  // And if we need scrollbar
  scrollbar: {
    el: '.swiper-scrollbar',
  },
});

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

&lt;/div&gt;



&lt;p&gt;This is really Easy to setup and it is highly maintained library. You can do many customizations in this library such as: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;turn off Preloading Images to get Lazyload&lt;/li&gt;
&lt;li&gt;use &lt;code&gt;swiper.activeIndex&lt;/code&gt; in JS to get current index of frame&lt;/li&gt;
&lt;li&gt;Add a slider inside a Slider and many more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I would recommened you to read their &lt;strong&gt;Official Documentation&lt;/strong&gt; &lt;a href="https://github.com/nolimits4web/swiper" rel="noopener noreferrer"&gt;here&lt;/a&gt; or Check out some &lt;strong&gt;Examples&lt;/strong&gt; &lt;a href="https://swiperjs.com/demos" rel="noopener noreferrer"&gt;here&lt;/a&gt; to get more information about this Library.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Implement these Sliders for better UI/UX:
&lt;/h2&gt;

&lt;p&gt;TBH I don't know much about Design, so I would recommened you to read these articles to get proper information about &lt;strong&gt;Where/How to use Sliders for better UI and UX&lt;/strong&gt; : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://blog.shift4shop.com/sliders-web-design" rel="noopener noreferrer"&gt;https://blog.shift4shop.com/sliders-web-design&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://smartslider3.com/blog/homepage-slider-examples/" rel="noopener noreferrer"&gt;https://smartslider3.com/blog/homepage-slider-examples/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A post by Devang. Hope it helps!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>html</category>
    </item>
    <item>
      <title>Making a URL Shortener website using Axios</title>
      <dc:creator>Devang Saklani</dc:creator>
      <pubDate>Thu, 24 Jun 2021 08:17:14 +0000</pubDate>
      <link>https://forem.com/devang/making-a-url-shortener-website-using-axios-4agf</link>
      <guid>https://forem.com/devang/making-a-url-shortener-website-using-axios-4agf</guid>
      <description>&lt;p&gt;In this article I will tell you how I made and you can also make a &lt;strong&gt;URL shortener Website&lt;/strong&gt;. Check out the result of what we are gonna make: &lt;a href="https://vigilant-jepsen-777fa0.netlify.app/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

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

&lt;p&gt;First we will talk about the requirements and dependencies of this project.&lt;br&gt;
In this project we will use &lt;strong&gt;&lt;a href="https://github.com/axios/axios" rel="noopener noreferrer"&gt;Axios&lt;/a&gt;&lt;/strong&gt; to make a HTTP request (you can also use XML request for Fetch api to do the same),   and &lt;a href="https://kushagra.dev/lab/hint/" rel="noopener noreferrer"&gt;&lt;strong&gt;Hint.css&lt;/strong&gt;&lt;/a&gt; for hints (not necessary).&lt;/p&gt;

&lt;p&gt;Well basically no library mentioned above was &lt;strong&gt;necessary&lt;/strong&gt; for this project,  they are here just cause they will make our work easier and will save a lot of time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Logic/Working:&lt;/strong&gt;&lt;br&gt;
We will add a input tag in which the user will be able to paste his link and a 'Shorten' button. On click of that button a AXIOS request will be fired and then we will pass the  response to the output box. However this seems easy and it is! for a person who knows how to handle API'S response, JSON data and manage errors for multiple cases.&lt;br&gt;
As a beginner you don't have to worry I have covered each and every step mentioned above with good examples.&lt;/p&gt;
&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;First of all what we need is a Good Design so that it will also look good. I have already designed a Website for this project here it is:&lt;br&gt;
&lt;a href="https://media.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%2Fdx7jboacyambeea1fkmb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fdx7jboacyambeea1fkmb.png" alt="design"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(However I am not a designer so sorry if the design is bad)&lt;br&gt;
In this design there is a heading, a sub-heading,  a input tag for pasting link, a convert button and three boxes for displaying result.&lt;br&gt;
I've used button tags for displaying output (You can also use Input tag).&lt;/p&gt;

&lt;p&gt;If you want, you can make the whole website from starting or if you want to follow along or save some time &lt;strong&gt;start with this &lt;a href="https://codepen.io/devang47/pen/OJpeGMM?editors=1100" rel="noopener noreferrer"&gt;codepen&lt;/a&gt;&lt;/strong&gt; (for basic HTML and CSS) :&lt;/p&gt;
&lt;h2&gt;
  
  
  Adding onclick event
&lt;/h2&gt;

&lt;p&gt;First of all we will add a event to 'convert' button i.e. &lt;strong&gt;onclick&lt;/strong&gt; and pass a function which will execute when the button is clicked:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// function name is 'shorten'
&amp;lt;button type="submit" class="shorten-button font-2" onclick="shorten()"&amp;gt;
    Convert
&amp;lt;/button&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;Then we will define this function in JS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const shorten = () =&amp;gt; {
    console.log('button clicked')
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't forget to link the JS file if you are editing outside of codepen.&lt;br&gt;
Then when the button is clicked a message should appear on console.&lt;/p&gt;
&lt;h2&gt;
  
  
  Making a request with Axios
&lt;/h2&gt;

&lt;p&gt;Now we will work on the Axios request when  the button is clicked.&lt;br&gt;
Don't know Axios here's a quick intro:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Axios&lt;/strong&gt; is a popular, promise-based HTTP client that sports an easy-to-use API and can be used in both the browser and Node.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It's syntax is super simple and beginner friendly.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Basic Axios syntax:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;axios.get('API url')
.then((response) =&amp;gt; {
    // if the request was Sucessful and no errors were caught
    console.log(response)
})
.catch((error) =&amp;gt; {
    // if errors were there.
    console.log(error)
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before using Axios don't forget to link the Axios package to your HTML file&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.1/axios.min.js" integrity="sha512-bZS47S7sPOxkjU/4Bt0zrhEtWx0y0CRkhEp8IckzK+ltifIIE9EMIMTuT/mEzoIMewUINruDBIR/jJnbguonqQ==" crossorigin="anonymous" referrerpolicy="no-referrer"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Making API call
&lt;/h2&gt;

&lt;p&gt;For the URL shortening we will use a free URl shortening api provider &lt;a href="https://shrtco.de/docs/" rel="noopener noreferrer"&gt;SHRTCODE&lt;/a&gt;. You can visit the website and read the docs for more info.&lt;/p&gt;

&lt;p&gt;This is the main link for calling the 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.shrtco.de/v2/shorten?url=YOUR_URL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we will just add the link to our Axios request in the 'get' method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let longUrl = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals'

axios
.get(`https://api.shrtco.de/v2/shorten?url=${longUrl}`)
.then((responseData) =&amp;gt; {
    console.log(responseData);
})
.catch((err)=&amp;gt; {
    alert('Error check your connectivity or link')
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here I am using template strings to add the URL to the get method so that we will be able to change it later. &lt;br&gt;
As this api is free it will take some time to give the response (5 - 10sec), just wait until then. Here is a &lt;strong&gt;&lt;a href="https://codepen.io/devang47/pen/MWpMZLq?editors=1010" rel="noopener noreferrer"&gt;Codepen Example&lt;/a&gt;&lt;/strong&gt; of a working API call.&lt;/p&gt;

&lt;p&gt;After some time we will have the response in the form of &lt;strong&gt;JSON data&lt;/strong&gt;, we will store it in a variable for later use or if a Error is caught we will simply alert 'Error check your connectivity or link'.&lt;/p&gt;

&lt;p&gt;However we will not give the same link everytime or will change the JS everytime we have  a new link, so we fetch the link from the input tag by value attribute.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let  longUrl  =  document.querySelector("#url-box").value;
// we will also declare a variable for later storage of processed url
let shortUrl; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Till now we have the full URL, working JSON request, and processed data.&lt;br&gt;
Now we will get the main Information from that JSON data which is something like this:&lt;br&gt;
&lt;a href="https://media.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%2F7s7lfxdockt1d57z31ba.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F7s7lfxdockt1d57z31ba.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The processed URL is &lt;code&gt;full_short_link&lt;/code&gt; which is inside &lt;code&gt;result&lt;/code&gt; which is inside of &lt;code&gt;data&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Well, how to get this URL?&lt;/strong&gt;&lt;br&gt;
 We will simple do  &lt;code&gt;resdata.data.result.full_short_link&lt;/code&gt; to get Processed link  inside of &lt;code&gt;then&lt;/code&gt;. Here &lt;code&gt;resdata&lt;/code&gt; is response data from API.&lt;br&gt;
 for ex:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;axios .get(`https://api.shrtco.de/v2/shorten?url=${longUrl}`)
    .then((resdata) =&amp;gt; {
        //storing Processed URL in already declared variable
        shortUrl  =  resdata.data.result.full_short_link;
        console.log(shortUrl)
        //check console for Processed URL or errors
    })
    .catch((err) =&amp;gt; {
        alert("Error check your connectivity or link");
    });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now half of the work is Done! Congratulations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding URL display box to HTML
&lt;/h2&gt;

&lt;p&gt;What is left is we have to display it to screen which is not a  big deal.&lt;/p&gt;

&lt;p&gt;First of all &lt;strong&gt;Logic&lt;/strong&gt;:&lt;br&gt;
We will make a function which will create a element (a div tag) and store it in a variable  then through &lt;code&gt;.innerHtml&lt;/code&gt; property, We will pass this Markup (as a string) and pass variables (&lt;code&gt;longUrl&lt;/code&gt; , &lt;code&gt;shortUrl&lt;/code&gt;) using template strings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;` &amp;lt;div class="item"&amp;gt;
    &amp;lt;div class="long-url"&amp;gt;
        &amp;lt;div class="title font-1"&amp;gt;
            Long URL
        &amp;lt;/div&amp;gt;
        &amp;lt;button id="long-url" class="font-2"&amp;gt;
            ${longUrl} 
         &amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div class="short-url"&amp;gt;
        &amp;lt;div class="title font-1"&amp;gt;
            Short URL
        &amp;lt;/div&amp;gt; 

        // providing shortUrl variable in value attribute for the copy function⏬
        &amp;lt;button id="short-url" class="font-2" value='${shortUrl}' onclick='copyLink(this)'&amp;gt;
            ${shortUrl}
        &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;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// compressed version (spaces and tabs removed) because JS will
// give errors on 'tab' and 'enter'

&amp;lt;div class="item"&amp;gt;&amp;lt;div class="long-url"&amp;gt;&amp;lt;div class="title font-1"&amp;gt;Long URL&amp;lt;/div&amp;gt; &amp;lt;button id="long-url" class="font-2"&amp;gt; ${longUrl} &amp;lt;/button&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class="short-url"&amp;gt;&amp;lt;div class="title font-1"&amp;gt;Short URL&amp;lt;/div&amp;gt; &amp;lt;button id="short-url" class="font-2 hint--bottom" aria-label="Click link to Copy" onclick='copy(this)' value='${shortUrl}' onclick='copyLink(this)'&amp;gt;${shortUrl}&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;and then finally this tag will append to the Parent link container. I know this is kinda complicated but this will help you get clear:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//Final working:
function  addResult(longUrl, shortUrl) {
    let parentEle = document.querySelector("#shortened-links");
    let data = `&amp;lt;div class="item"&amp;gt;&amp;lt;div class="long-url"&amp;gt;&amp;lt;div class="title font-1"&amp;gt;Long URL&amp;lt;/div&amp;gt; &amp;lt;button id="long-url" class="font-2"&amp;gt; ${longUrl} &amp;lt;/button&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class="short-url"&amp;gt;&amp;lt;div class="title font-1"&amp;gt;Short URL&amp;lt;/div&amp;gt; &amp;lt;button id="short-url" class="font-2" value='${shortUrl}' onclick='copyLink(this)'&amp;gt;${shortUrl}&amp;lt;/button&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;`;

    let  newEle  =  document.createElement("div");
    newEle.innerHTML  =  data;
    parentEle.appendChild(newEle);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will pass &lt;code&gt;longUrl&lt;/code&gt; and &lt;code&gt;shortUrl&lt;/code&gt; as parameters.&lt;/p&gt;

&lt;p&gt;Now we will pass this function in &lt;code&gt;then&lt;/code&gt; method, which will execute when data is Fetched from API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.then((resdata) =&amp;gt; {
    shortUrl  =  resdata.data.result.full_short_link;
    addResult(longUrl, shortUrl);
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and What will happen is this markup will be added to the Html when the data is fetched and as we have already styled their 'class' attributes in CSS, the markup will execute and a processed &lt;code&gt;item&lt;/code&gt; will show up on the screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  CopyLink function
&lt;/h2&gt;

&lt;p&gt;The copyLink function will execute when the short Url box is clicked i.e.&lt;br&gt;
&lt;a href="https://media.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%2Ffofxstx32oa7f1pxsfpj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Ffofxstx32oa7f1pxsfpj.png" alt="Copy button"&gt;&lt;/a&gt;&lt;br&gt;
The function will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function  copyLink(tag){
    let  text  =  tag.value;
    // copy link to clipboard
    navigator.clipboard.writeText(text);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The parameter of this function will be the &lt;strong&gt;Tag&lt;/strong&gt; and the argument will be &lt;code&gt;this&lt;/code&gt; keyword. for ex:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// usage of this function:
onclick='copyLink(this)'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;this&lt;/code&gt; keyword will pass the full button tag through an argument so that we will later be able to use value property in CopyLink func.&lt;br&gt;
&lt;strong&gt;Thats why i've used Button tags for displaying Output&lt;/strong&gt; and added value attribute to &lt;code&gt;shortUrl&lt;/code&gt; tag. &lt;br&gt;
(you can use input tag also)&lt;/p&gt;

&lt;p&gt;Now the Basic working is done and till now this much is done: &lt;a href="https://codepen.io/devang47/pen/PoprXOG" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;br&gt;
I have added a Hint using &lt;a href="https://github.com/chinchang/hint.css" rel="noopener noreferrer"&gt;Hint.css&lt;/a&gt; (just read the documentation it's pretty easy).&lt;/p&gt;
&lt;h2&gt;
  
  
  Now about Error Handling and Animations
&lt;/h2&gt;

&lt;p&gt;Now it is upto you how much animations you want to add in this site.&lt;br&gt;
As for error handling we can suppose certain situations in which a Error will occour like &lt;br&gt;
'What if the input tag is empty and button is clicked' :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// we can do something like this:
if (longUrl){
    //if their is value in input tag then only Axios request is sent 
    axios.get()....
}else{
    alert('Enter some data first!!')
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now If you want to do more customizations in this project that is totally upto you.&lt;/p&gt;

&lt;p&gt;If you have any questions ask them in the Comment section and don't forget to leave a like If this post helped you.😊&lt;/p&gt;

&lt;p&gt;A post by Devang. Hope it helps!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>webdev</category>
      <category>html</category>
    </item>
    <item>
      <title>The master guide to smooth, realistic shadows in CSS</title>
      <dc:creator>Devang Saklani</dc:creator>
      <pubDate>Tue, 22 Jun 2021 12:06:02 +0000</pubDate>
      <link>https://forem.com/devang/the-master-guide-to-smooth-realistic-shadows-in-css-463p</link>
      <guid>https://forem.com/devang/the-master-guide-to-smooth-realistic-shadows-in-css-463p</guid>
      <description>&lt;p&gt;In this article you will get to know about smooth CSS Shadows and a easy way to use them. But first of all&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are shadows?&lt;/strong&gt;&lt;br&gt;
When light falls upon an object shadow is formed. The shadows we see around us works on the same principle but they are really complex and realistic as they are not in a specific shape or length or size. They can take any shape and can fall in any direction. In order to create shadows in websites using CSS we use &lt;code&gt;box-shadow&lt;/code&gt; property.&lt;/p&gt;

&lt;p&gt;for ex.  &lt;code&gt;box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media.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%2F9mvryge2upd8fw0h7d9e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F9mvryge2upd8fw0h7d9e.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But if you are trying to create real shadows through &lt;code&gt;box-shadow&lt;/code&gt; property, well, You can't.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt;&lt;br&gt;
In order to know 'Why?' you have to understand how box-shadow property works.&lt;br&gt;
&lt;code&gt;box-shadow&lt;/code&gt; property simply produces a blurred silhouette of an object. You can change its length, color, blur, spread and offset nothing more. Then there's probably no way to create the &lt;em&gt;Natural Super complex real Shadows&lt;/em&gt; through &lt;code&gt;box-shadow&lt;/code&gt; property.&lt;/p&gt;

&lt;p&gt;But unexpectedly &lt;strong&gt;there's a way!&lt;/strong&gt;&lt;br&gt;
If we will use a simple technique, we will be able to get more controls and expand our range of options. This technique is using 'layered shadows'. We can define multiple shadows in a simple &lt;code&gt;box-shadow&lt;/code&gt; property by using commas and gradually increasing the blur-radius, offset to make shadows more realistic. Here's an example:&lt;/p&gt;

&lt;p&gt;Normal &lt;code&gt;box-shadow&lt;/code&gt;⏬&lt;br&gt;
&lt;a href="https://media.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%2Fyk6h7s1l9c761ejrr0sk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fyk6h7s1l9c761ejrr0sk.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Layered &lt;code&gt;box-shadow&lt;/code&gt;⏬&lt;br&gt;
&lt;a href="https://media.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%2Fh5vpeig144z3a8l6tk9n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fh5vpeig144z3a8l6tk9n.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see the difference in shadows. You can customize it more to generate more variants of shadows i.e. Sharp shadows, Dreamy shadows, long shadows etc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
/* Normal box-shadow */
.box {
    box-shadow: 0 3px 3px rgba(0,0,0,0.2);
}

/* Layered Box-shadow */
box-shadow:
     0 3.9px 4.6px rgba(0, 0, 0, 0.08),
     0 12.3px 8.4px rgba(0, 0, 0, 0.056),
     0 18.8px 19.2px rgba(0, 0, 0, 0.037),
     0 22px 40px rgba(0, 0, 0, 0.019)
;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;More Layers  ==  More Customization ==  More Realistic shadows&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can also generate Sharp shadows by gradually decreasing the alpha values (opacity) and increasing the blur strength to create Sharp shadows. You can use the same principle to create Diffused shadows.&lt;/p&gt;

&lt;p&gt;Sharp shadow⏬&lt;br&gt;
&lt;a href="https://media.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%2Fjqk3t4etzhniybmwb2hm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fjqk3t4etzhniybmwb2hm.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Diffused shadow⏬&lt;br&gt;
&lt;a href="https://media.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%2F1435fhbc1lu7gu8dgib3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1435fhbc1lu7gu8dgib3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can also create Short as well as long shadows by just playing with opacity and spread. To create long shadows we can gradually increase the y-offset values. &lt;/p&gt;

&lt;p&gt;Short shadow⏬&lt;br&gt;
&lt;a href="https://media.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%2Fu1id3lesijkwm6yny80p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fu1id3lesijkwm6yny80p.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Long shadow⏬&lt;br&gt;
&lt;a href="https://media.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%2Fgsa0ennf7divwfxqu4gs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fgsa0ennf7divwfxqu4gs.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However creating these kind of shadows is a &lt;em&gt;real mess&lt;/em&gt; for some people, specifically for those people and for making our life more easy there is &lt;strong&gt;website&lt;/strong&gt; which can help them in &lt;strong&gt;Creating realistic shadows&lt;/strong&gt; i.e. &lt;a href="https://shadows.brumm.af/" rel="noopener noreferrer"&gt;https://shadows.brumm.af/&lt;/a&gt; by &lt;a href="https://brumm.af/" rel="noopener noreferrer"&gt;Philipp&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fr4nqc3bjfkpoznueintl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fr4nqc3bjfkpoznueintl.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Through this website you can create as many layers as you want and edit them in real time, Saving a lot of time and efforts.&lt;/p&gt;

&lt;p&gt;A post by Devang. Hope it helps!&lt;br&gt;
Check out my portfolio: &lt;a href="https://devang-saklani.web.app/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>html</category>
    </item>
    <item>
      <title>New Javascript (AnimeJS) spinners for website (examples &amp; source code)</title>
      <dc:creator>Devang Saklani</dc:creator>
      <pubDate>Mon, 21 Jun 2021 03:13:41 +0000</pubDate>
      <link>https://forem.com/devang/new-javascript-animejs-spinners-for-website-examples-source-code-4j8e</link>
      <guid>https://forem.com/devang/new-javascript-animejs-spinners-for-website-examples-source-code-4j8e</guid>
      <description>&lt;h2&gt;
  
  
  Hello everyone
&lt;/h2&gt;

&lt;p&gt;My name is &lt;strong&gt;Devang Saklani&lt;/strong&gt; and I am a freelance &lt;strong&gt;Front-end Web developer&lt;/strong&gt; from INDIA. I like creating things like websites, animations and writing blogs (however this is my first blog let's see how it goes😅). &lt;/p&gt;

&lt;p&gt;I have been learning JS from few months and in first sight i loved it it's syntax, power and it's  uses. Then I got into touch with JS libraries for extra functionality like ReactJS and then I came across &lt;strong&gt;AnimeJS&lt;/strong&gt;. I was amazed at first by it's syntax and it's power, it's a amazing animation library through which you can do simple as well as super complex animations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't know Anime JS? here's a quick intro!
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ILoY91ZF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.pinimg.com/564x/61/4d/c4/614dc4940d8d2e4a517b1045615eaec3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ILoY91ZF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.pinimg.com/564x/61/4d/c4/614dc4940d8d2e4a517b1045615eaec3.jpg" alt="AnimeJS logo" width="564" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://animejs.com/"&gt;Anime.js&lt;/a&gt;&lt;/strong&gt; is a small, lightweight JavaScript library with a simple and small powerful API.&lt;/li&gt;
&lt;li&gt;It works with the DOM element, CSS, and JavaScript object.&lt;/li&gt;
&lt;li&gt;and the final thing is It's really &lt;strong&gt;Underrated&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to use AnimeJS?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;First of all Install it. The installation steps are quite simple as we can use either a CDN network to use it or can directly install it through NPM. See official installation details &lt;a href="https://github.com/juliangarnier/anime#getting-started"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Basic usage:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;I would 
recommend you to go to the &lt;a href="https://animejs.com/documentation/"&gt;official documentation&lt;/a&gt; for instructions because it is Super &lt;strong&gt;simple&lt;/strong&gt; and Super &lt;strong&gt;interactive&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Now what I  made using it:
&lt;/h2&gt;

&lt;p&gt;I have made Some loading spinners using AnimeJS. These are some images/gifs:&lt;/p&gt;

&lt;p&gt;This one is a really viral animation called B&amp;amp;W loading animation 9 by Lilian Tedone:⏬&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NYnu3mfh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/de87afx0qy4gddl3gzcc.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NYnu3mfh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/de87afx0qy4gddl3gzcc.gif" alt="animations" width="600" height="336"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--21YutPK1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5wsouijbxufa8cdad7kp.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--21YutPK1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5wsouijbxufa8cdad7kp.gif" alt="animations" width="600" height="336"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sPwt9NkE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w1a04f1tqdjfrgrflsxf.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sPwt9NkE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w1a04f1tqdjfrgrflsxf.gif" alt="animations" width="600" height="336"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gRRBKVoV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/084hcoojnj0xknedabql.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gRRBKVoV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/084hcoojnj0xknedabql.gif" alt="animations" width="600" height="336"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--peIB0tjo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/paop6iy9h90ld394dw86.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--peIB0tjo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/paop6iy9h90ld394dw86.gif" alt="animations" width="600" height="336"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t8Z5suvT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j5fk1ah0x99doff3cfh6.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t8Z5suvT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j5fk1ah0x99doff3cfh6.gif" alt="animations" width="600" height="336"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8mB8SqaU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kbgtlu3zbig8iddec70u.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8mB8SqaU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kbgtlu3zbig8iddec70u.gif" alt="animations" width="600" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check out these &lt;strong&gt;animations live&lt;/strong&gt; at &lt;a href="https://devang47.github.io/Animated-Spinners/"&gt;this website&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features (highlights):
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Easy to use (simply copy &amp;amp; paste).&lt;/li&gt;
&lt;li&gt;Source code is already &lt;strong&gt;minified&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Awesome animations&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;2 &lt;strong&gt;themes&lt;/strong&gt; till now (stroked and filled) and a theme switch button.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;automation theme save&lt;/strong&gt; feature which saves your theme &lt;strong&gt;even after page reload&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;Slider&lt;/strong&gt; for better UX and &lt;strong&gt;keyboard compatible&lt;/strong&gt; (use arrow keys to navigate).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Known issues
&lt;/h2&gt;

&lt;p&gt;I know these animations are sick but this seriously needs some &lt;em&gt;improvement&lt;/em&gt; and &lt;em&gt;optimizations&lt;/em&gt;.. That's why I need your help in solving these bugs* and make some performance improvements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Known bugs:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Sometimes the code source viewer does'nt shows anything.&lt;/li&gt;
&lt;li&gt;The CPU also gets 100% used when using a old computer and causing &lt;strong&gt;frame drops&lt;/strong&gt; 😥.&lt;/li&gt;
&lt;li&gt;and Many other small bugs that haven't discovered yet.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the &lt;a href="https://github.com/Devang47/Animated-Spinners/"&gt;Github URL&lt;/a&gt; of this repo. You can help me by contributing here also If you want to contact me this is my email (&lt;a href="mailto:devangsaklani@gmail.com"&gt;devangsaklani@gmail.com&lt;/a&gt;) I'll surely reply you. &lt;/p&gt;

&lt;p&gt;Thanks for reading and I would love to read your thoughts on this in comment section😁.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>animation</category>
      <category>website</category>
      <category>animejs</category>
    </item>
  </channel>
</rss>
