<?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: Jaagrav</title>
    <description>The latest articles on DEV Community by Jaagrav (@jaagrav).</description>
    <link>https://dev.to/jaagrav</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%2F476574%2F48acbd2a-9d68-4c01-abbe-790be4365a63.jpeg</url>
      <title>DEV Community: Jaagrav</title>
      <link>https://dev.to/jaagrav</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jaagrav"/>
    <language>en</language>
    <item>
      <title>Drive a Tesla Cybertruck or literally any car on your browser with Threejs</title>
      <dc:creator>Jaagrav</dc:creator>
      <pubDate>Tue, 22 Feb 2022 19:38:51 +0000</pubDate>
      <link>https://dev.to/jaagrav/drive-a-tesla-cybertruck-or-literally-any-car-on-your-browser-with-threejs-4ila</link>
      <guid>https://dev.to/jaagrav/drive-a-tesla-cybertruck-or-literally-any-car-on-your-browser-with-threejs-4ila</guid>
      <description>&lt;h2&gt;
  
  
  Before we begin
&lt;/h2&gt;

&lt;p&gt;In this article, we would be building &lt;a href="https://cybertruck-rv.vercel.app/" rel="noopener noreferrer"&gt;this&lt;/a&gt;, a 3D Tesla Cybertruck that can be driven with your arrow keys and WASD keys on your browser. We would be building this project with the help of &lt;a href="https://rv-engine.vercel.app/" rel="noopener noreferrer"&gt;RV-Engine&lt;/a&gt;, which is a browser based Raycast Vehicle Engine. &lt;br&gt;
&lt;a href="https://rv-engine.vercel.app/" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F52719271%2F128848701-ccee33e9-4958-4c59-b8ac-92b3bd3a1e45.gif" alt="Image of Raycast Vehicle Engine"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This project will require you to have some knowledge in both &lt;a href="https://github.com/mrdoob/three.js/" rel="noopener noreferrer"&gt;Threejs&lt;/a&gt; and &lt;a href="https://github.com/pmndrs/cannon-es" rel="noopener noreferrer"&gt;Cannon-ES&lt;/a&gt;. Although since what we're building here would built on a browser-based engine, you don't need extreme knowledge about these libraries, cause you can simply download all the car code that you tweak on the engine and install it using &lt;code&gt;npm i&lt;/code&gt; on your computer. Read this article carefully to understand how to drive your 3D 4-wheeler vehicle model on the browser. &lt;/p&gt;
&lt;h2&gt;
  
  
  Don't want to read this article?
&lt;/h2&gt;

&lt;p&gt;Check out the video version for this article on my youtube channel!&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/o_Uf6blOQFg"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Alright, so were to begin. You all must have seen developers all around the world making some really awesome projects with threejs. Now these projects have something pretty magnificent which we call &lt;strong&gt;Physics&lt;/strong&gt;. Some examples for 3D physics projects would be, &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://bruno-simon.com/" rel="noopener noreferrer"&gt;Bruno Simon&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The legendary &lt;a href="https://github.com/brunosimon" rel="noopener noreferrer"&gt;Bruno Simon&lt;/a&gt;'s portfolio, which features a 3D car that the user can drive around this 3D world, run into bricks and knock stuff off. This project uses &lt;a href="https://schteppe.github.io/cannon.js/" rel="noopener noreferrer"&gt;CannonJS&lt;/a&gt; by &lt;a href="https://github.com/schteppe" rel="noopener noreferrer"&gt;Stefan Hedman&lt;/a&gt; for physics support.&lt;br&gt;
&lt;a href="https://bruno-simon.com/" rel="noopener noreferrer"&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%2Frpr1nuli1eqdxtauwf9u.png" alt="Image of Bruno Simon's Portfolio"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Bruno has an awesome course called &lt;a href="https://threejs-journey.com/" rel="noopener noreferrer"&gt;ThreeJS Journey&lt;/a&gt; which helped me out personally in understanding the basics of threejs and build this project all by myself. I'd suggest you to definitely consider checking out his course, cause it's the best threejs course you will find out there for Javascript beginners.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  &lt;a href="https://racing.pmnd.rs/" rel="noopener noreferrer"&gt;Racing Game&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The open sourced racing game developed by &lt;a href="https://github.com/pmndrs" rel="noopener noreferrer"&gt;Poimandres&lt;/a&gt; and other contributors on &lt;a href="https://github.com/pmndrs/racing-game" rel="noopener noreferrer"&gt;Github&lt;/a&gt;. The game features a 3D car in a track, and the user is supposed to reach the end of the track by driving the car to the end of the track as soon as possible. This project uses &lt;a href="https://github.com/pmndrs/cannon-es" rel="noopener noreferrer"&gt;Cannon-ES&lt;/a&gt;, a physics library which is a fork of the original &lt;a href="https://schteppe.github.io/cannon.js/" rel="noopener noreferrer"&gt;CannonJS&lt;/a&gt; by &lt;a href="https://github.com/schteppe" rel="noopener noreferrer"&gt;Stefan Hedman&lt;/a&gt;, currently being developed in house by the developers and other contributors of &lt;a href="https://github.com/pmndrs" rel="noopener noreferrer"&gt;Poimandres&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://racing.pmnd.rs/" rel="noopener noreferrer"&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%2Fklh194r0i3q6j2c4rnau.png" alt="Image of Racing Game by Poimandres"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  About
&lt;/h2&gt;

&lt;p&gt;Now enough of showing other physics based 3D projects. You might be wondering what is this article exactly about? &lt;/p&gt;

&lt;p&gt;Well in both of the above projects as you might have noticed, one thing is common and is also the MC of the games, A CAR! Or as we, the developers like to call it, a Raycast Vehicle. Now building a raycast vehicle is super difficult cause it's one of the most complex features of a physics library. Although there are courses on how you can create a raycast vehicle, most of them are paid or they just don't make sense. Although I would say, that &lt;a href="https://github.com/pmndrs/cannon-es" rel="noopener noreferrer"&gt;Cannon-ES&lt;/a&gt; has got a pretty dynamite documentation but it took me almost a week to create my first raycast vehicle and drive it on my browser. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In fact, &lt;a href="https://bruno-simon.com/" rel="noopener noreferrer"&gt;Bruno Simon's Portfolio&lt;/a&gt; took him about 3 months to develop before he released it to the public.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Physics in itself is pretty hard to understand when you're trying to make it work on your browser, and when you're adding some threejs magic to it, well it just makes everything a little bit more harder.&lt;/p&gt;

&lt;p&gt;Everybody hates going through the docs, well at least most of the developers I know do hate reading docs quite a lot, but threejs, although it is very popular and the community using it is constantly growing, there is not much information on how to build certain things online, unless you're figuring out things by yourself. I had to go through that painful journey of trying to figure out, how to get a raycast vehicle up and running on my browser. There's a &lt;a href="https://www.udemy.com/course/create-a-3d-car-racing-game-with-threejs-and-cannonjs" rel="noopener noreferrer"&gt;course&lt;/a&gt; by &lt;a href="https://github.com/NikLever" rel="noopener noreferrer"&gt;Nik Lever&lt;/a&gt; on how to create a 3D car racing game with threejs and cannonjs. I almost got to a point where I was about to buy his course, which I am sure is excellent, but again it's not free. After going through the docs a little bit more harder and with the help of Poimandres' developers on Discord and going through &lt;a href="https://github.com/brunosimon/folio-2019" rel="noopener noreferrer"&gt;Bruno's code for his portfolio&lt;/a&gt;, I finally figured out how to get a raycast vehicle up and running on my browser. Boy did it feel good, but it took a lot of effort since the docs aren't that helpful, and the best way to get something working on your computer is to basically play with a project which is already built using the same technology you're trying to implement and trying to reproduce it for your project.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is Raycast Vehicle Engine?
&lt;/h2&gt;

&lt;p&gt;Once I was done with setting up my first raycast vehicle, I was quite proud of myself. Although, I did wish that there was a website where I could upload my car model, and with some tweaks, generate all the code required to build a raycast vehicle. Now generating code on the browser and downloading it as files and folders is something which is not very easy to develop IRL, but is a very fun and plausible problem to solve. And that's how the idea for the &lt;a href="https://rv-engine.vercel.app/" rel="noopener noreferrer"&gt;Raycast Vehicle Engine&lt;/a&gt; took birth. A browser based engine, where a developer can upload a car model, make some tweaks in the code for the vehicle with the help of a GUI, and when satisfied with the tweaks, easily download the code, install using &lt;code&gt;npm i&lt;/code&gt; and run using &lt;code&gt;npm start&lt;/code&gt;. Sounds pretty interesting, right? Well that's just the beginning.&lt;/p&gt;
&lt;h2&gt;
  
  
  Let's build a Cybertruck!
&lt;/h2&gt;

&lt;p&gt;In order to build a Cybertruck which can be driven with your arrow keys on your browser, first we need a Cybertruck! More specifically a chassis model and a wheel model for a Cybertruck. You might be wondering, where am I supposed to get a 3D Cybertruck model from, well you can easily download it from the link given below.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://mega.nz/folder/bsxEETwS#RfiiE-kyKvBJBO2qEFNg5w" rel="noopener noreferrer"&gt;Cybertruck Model&lt;/a&gt;&lt;br&gt;
&lt;a href="https://mega.nz/folder/bsxEETwS#RfiiE-kyKvBJBO2qEFNg5w" rel="noopener noreferrer"&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%2Fbwy81myis71rjf7k3zdt.png" alt="Image of the original Cybertruck model by Polyducky"&gt;&lt;/a&gt;&lt;br&gt;
I had found this model on Sketchfab and would also like to thank it's creator, &lt;a href="https://sketchfab.com/salphytheunemployed" rel="noopener noreferrer"&gt;PolyDucky&lt;/a&gt; who made the &lt;a href="https://skfb.ly/6QWrS" rel="noopener noreferrer"&gt;original model of the cybertruck&lt;/a&gt;, you should definitely go check out his other amazing 3D models on Sketchfab!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Moving on, the next thing you're supposed to do is simply drag and drop the chassis and wheel models to the respective upload inputs. &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%2Fhk9mywsqu56bnzzmzlmp.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%2Fhk9mywsqu56bnzzmzlmp.png" alt="Image of model upload input boxes where 3D model GLTF files can be dragged and dropped into"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now if you're trying to build using some other car model, keep these few things in mind,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The model cannot be a single car file, you will have to separately upload the chassis and the wheel or else the RV engine won't work and have weird issues. You can again use blender in order to separate the chassis from the wheels like I did for the Cybertruck by myself on blender.&lt;/li&gt;
&lt;li&gt;The models you upload must be GLTFs. If you don't know how to convert your model to GLTF, I would recommend you to &lt;a href="https://youtu.be/9GDQqP4is_U" rel="noopener noreferrer"&gt;watch this youtube video&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you're done uploading your 3D models, watch the following youtube video that I have created in order to better understand how you can create a 3D Cybertruck on your browser.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/dQw4w9WgXcQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;And voila that's it! I am pretty sure you have understood on how you can create your own cybertruck on the web browser by watching the above video. Pretty simple right? What took me 2-3 days to develop will take you only 10-20 minutes with the help of the &lt;a href="https://rv-engine.vercel.app/" rel="noopener noreferrer"&gt;Raycast Vehicle Engine&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next?
&lt;/h2&gt;

&lt;p&gt;Well now that you've finally made a 3D car which can be driven with the help of arrow keys on your web browser. You might be wondering, well what do I do next? You can build an entire world around your car model, a world where you can have more 3D objects everywhere, where your users can easily drive around, knock stuff around and basically play around to explore more like Bruno's portfolio. There's unlimited amount of things you can build with physics and threejs, and I am sure you will make something that would be super creative and mind-blowing because that's how threejs and webgl is. If you're reading this article and you don't have any idea on how to add more and modify the 3D world and add some more physics based 3D objects, I would recommend you to definitely check out Bruno's Course, &lt;a href="https://threejs-journey.com/" rel="noopener noreferrer"&gt;Threejs Journey&lt;/a&gt; to better understand not only this article but also threejs and cannonjs in all.&lt;/p&gt;

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

&lt;p&gt;RV engine is free and open source, you should definitely check it out on github and don't forget to leave a star cause it would really mean a lot to me.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Jaagrav" rel="noopener noreferrer"&gt;
        Jaagrav
      &lt;/a&gt; / &lt;a href="https://github.com/Jaagrav/raycast-vehicle-engine" rel="noopener noreferrer"&gt;
        raycast-vehicle-engine
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Drive your favorite 3D car in your threejs world just by uploading the GLTF Model and generating code all on the browser itself!
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Raycast Vehicle Engine&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://rv-engine.vercel.app/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F52719271%2F128848701-ccee33e9-4958-4c59-b8ac-92b3bd3a1e45.gif" alt="rv-engine-gif"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Simply upload your favourite car's chassis model and car's wheel model and the RV Engine would automatically create a car with the same look and feel. It would also be able to control the car's movement and rotation. Add physics and everything else you want to the car and you're good to go
After that you can simply download it as a zip file. Follow the same setup procedure, and you have a new raycast vehicle generated.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Vehicle physics&lt;/li&gt;
&lt;li&gt;Change Vehicle Mass, Suspension Strength, Suspension Damping, etc.&lt;/li&gt;
&lt;li&gt;Change the position of each wheel, set the size of each wheel and have all the controls to yourself.&lt;/li&gt;
&lt;li&gt;Change the max speed of the car, movement controls etc directly from the GUI.&lt;/li&gt;
&lt;li&gt;Position the chassis from GUI, see helper to view the chassis in the physics world. Same goes for all of the wheels.&lt;/li&gt;
&lt;li&gt;Generate code, simply either…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Jaagrav/raycast-vehicle-engine" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Don't forget to &lt;a href="https://github.com/Jaagrav" rel="noopener noreferrer"&gt;follow me on Github&lt;/a&gt; to see the stuff I create and star. I really enjoy web development and webgl to create interactive and immersive experiences. This project took me in overall a month to develop, and would not be possible without the following awesome opensource projects,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://threejs.org/" rel="noopener noreferrer"&gt;ThreeJS&lt;/a&gt; - JavaScript 3D library&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://webpack.js.org/" rel="noopener noreferrer"&gt;Webpack&lt;/a&gt; - Module bundler&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://babeljs.io/" rel="noopener noreferrer"&gt;Babel&lt;/a&gt; - ES6 to ES5 transpiler&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pmndrs.github.io/cannon-es/" rel="noopener noreferrer"&gt;Cannon-ES&lt;/a&gt; - 3D physics engine&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/colejd/guify" rel="noopener noreferrer"&gt;Guify&lt;/a&gt; - GUI framework&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://stuk.github.io/jszip/" rel="noopener noreferrer"&gt;JSZip&lt;/a&gt; - JSZip is a javascript library for creating, reading and editing .zip files, with a lovely and simple API.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/mrdoob/stats.js/" rel="noopener noreferrer"&gt;Stats.JS&lt;/a&gt; - JavaScript Performance Monitor&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.npmjs.com/package/file-saver" rel="noopener noreferrer"&gt;File Saver&lt;/a&gt; - Save files to disk&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are many more awesome features that I am planning to add to the engine, and you can help me out with it too. So do &lt;a href="https://github.com/Jaagrav/raycast-vehicle-engine" rel="noopener noreferrer"&gt;fork it on github&lt;/a&gt;. Thanks to everyone that contributed to this project and made it possible and thanks to you for reading this article.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>showdev</category>
      <category>threejs</category>
    </item>
    <item>
      <title>Create beautiful carousels or Image Sliders on React with this framework</title>
      <dc:creator>Jaagrav</dc:creator>
      <pubDate>Mon, 01 Mar 2021 21:19:48 +0000</pubDate>
      <link>https://dev.to/jaagrav/create-beautiful-carousels-or-image-sliders-on-react-with-this-framework-4hm1</link>
      <guid>https://dev.to/jaagrav/create-beautiful-carousels-or-image-sliders-on-react-with-this-framework-4hm1</guid>
      <description>&lt;h2&gt;
  
  
  Library used in this article:
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Jaagrav" rel="noopener noreferrer"&gt;
        Jaagrav
      &lt;/a&gt; / &lt;a href="https://github.com/Jaagrav/react-pretty-carousel" rel="noopener noreferrer"&gt;
        react-pretty-carousel
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Easily add beautiful carousels to your website in no time!
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;React-Pretty-Carousel&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;Easily add beautiful carousels to your website in no time!&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/52719271/107816979-7f6adb80-6d9b-11eb-8535-2c8ccf4bb865.gif"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F52719271%2F107816979-7f6adb80-6d9b-11eb-8535-2c8ccf4bb865.gif" alt="React Pretty Carousel"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Check out the Demo on the docs &lt;a href="https://react-pretty-carousel.herokuapp.com/" rel="nofollow noopener noreferrer"&gt;website&lt;/a&gt;!&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Installation&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;In order to install &lt;code&gt;react-pretty-carousel&lt;/code&gt;, run this command in your terminal.&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;npm i react-pretty-carousel --save
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Or&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;yarn add react-pretty-carousel
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Usage&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/b4bf22a3658fd14f1cc398efaeaf04544e2a1a767c4a8d5cec633c46b298c0b3/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f692f7075637465346b6d773573736e6562706170796a2e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/b4bf22a3658fd14f1cc398efaeaf04544e2a1a767c4a8d5cec633c46b298c0b3/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f692f7075637465346b6d773573736e6562706170796a2e706e67" alt="Usage"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;code&gt;Props&lt;/code&gt;&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Prop&lt;/th&gt;
&lt;th&gt;DataType&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;items&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;integer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Number of items to display at once&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mode&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;string&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Style of the carousel, can be either &lt;code&gt;normal&lt;/code&gt; or &lt;code&gt;gallery&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;showControls&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;boolean&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show the dots and navigation buttons if &lt;code&gt;true&lt;/code&gt;, and otherwise if &lt;code&gt;false&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;code&gt;External Functions and Values&lt;/code&gt;&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;You can summon and move/navigate through the carousel by importing and using the following functions:&lt;/p&gt;
&lt;div class="highlight highlight-source-js notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
  &lt;span class="pl-v"&gt;CarouselWrapper&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
  &lt;span class="pl-s1"&gt;prev&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
  &lt;span class="pl-s1"&gt;next&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
  &lt;span class="pl-s1"&gt;moveTo&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
  &lt;span class="pl-s1"&gt;switchTo&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
  &lt;span class="pl-s1"&gt;presentIndex&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
&lt;span class="pl-kos"&gt;}&lt;/span&gt; &lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s"&gt;"react-pretty-carousel"&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Parameters&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;prev()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Move to the previous slide&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;next()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Move to the next slide&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;moveTo(5)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Move to a certain index/object with smooth animation&lt;/td&gt;
&lt;td&gt;integer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;switchTo(5)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Abruptly move to&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;…&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Jaagrav/react-pretty-carousel" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Just like I do in my other articles, I am gonna leave the link to what we are about to develop this time, Check this out working live on the &lt;a href="https://react-pretty-carousel.herokuapp.com/" rel="noopener noreferrer"&gt;docs&lt;/a&gt; of the library.&lt;/p&gt;

&lt;h2&gt;
  
  
  Story
&lt;/h2&gt;

&lt;p&gt;So recently I joined this organization called &lt;a href="https://twitter.com/WebDevGoa" rel="noopener noreferrer"&gt;WebDevGoa&lt;/a&gt; where we have to develop this website that includes this interactive carousel that looks pretty awesome and at the same time it also is pretty complex. Now of course there are many other react frameworks that also provide carousels that are very interactive but the thing is there are way too ordinary. And the one that our designers at the organization wanted was pretty complex and none of us found a proper open-source library or framework that we exactly needed. And that's when it came to my mind that instead of wasting time in looking for a framework, why not make one by myself, right? And guess what, I definitely did.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1360489333627650050-304" src="https://platform.twitter.com/embed/Tweet.html?id=1360489333627650050"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1360489333627650050-304');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1360489333627650050&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;h2&gt;
  
  
  How does it look?
&lt;/h2&gt;

&lt;p&gt;Well too much talkie now let's showie what I made (yeah Idk why I wrote that)&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/xulxf"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Yeah exactly, so when you move the carousel, the size of the images also changes, just the way we wanted it to be like. Well I hope you're reading this article on your computer, no don't worry it is responsive and it definitely works on mobile phones, but to experience the real effect that is created on movement of the carousel is achieved better when you're using it on a computer. You can actually check it out working on a better scale here on the &lt;a href="https://react-pretty-carousel.herokuapp.com/" rel="noopener noreferrer"&gt;docs&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Check it out in full screen mode and then continue reading this article.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to add it to my React Website?
&lt;/h2&gt;

&lt;p&gt;Yep, I've got you covered on that as well, you can either watch this YouTube video to learn how to use this framework,&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/oE97LMjPz5I"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Or you can continue reading this article to read and learn how you can add it to your website in just 4 steps!&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Install react-pretty-carousel
&lt;/h3&gt;

&lt;p&gt;Just copy and paste the command, depending on the package installer you use, in your bash or CMD and it will install the package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i react-pretty-carousel --save
&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 plaintext"&gt;&lt;code&gt;yarn add react-pretty-carousel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Step 2: Import the package to your code
&lt;/h3&gt;

&lt;p&gt;If you know react, even if you're a beginner, you probably know how to import a package but anyway just to make it easy for you, I am mentioning the code to import the package down below!&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&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;CarouselWrapper&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;react-pretty-carousel&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;p&gt;Here's a list of stuff you can import from the package, you might need it once you want to control the carousel from custom buttons or programmatically.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&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;CarouselWrapper&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;prev&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;moveTo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;switchTo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;presentIndex&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;react-pretty-carousel&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;h3&gt;
  
  
  Step 3: Add the Carousel Component to your JSX code
&lt;/h3&gt;

&lt;p&gt;Finally, add this carousel to your react JSX code, if you just want to do this in order to test the framework locally on your machine, you can simply copy and paste all the code that I have written here, although you can check it out working on the &lt;a href="https://react-pretty-carousel.herokuapp.com/" rel="noopener noreferrer"&gt;docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So this is what I wrote in App.js&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;CarouselWrapper&lt;/span&gt; &lt;span class="na"&gt;items&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"gallery"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"image image1"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"image image2"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"image image3"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"image image4"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"image image5"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"image image6"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;CarouselWrapper&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Yeah don't be confused by the code I wrote, I just want to add the image as background to these divs, I know it would make our work more complicated but just to resize the images properly, I am using this method. &lt;/p&gt;

&lt;p&gt;And then I wrote this in index.css&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="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;34&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;68&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.App&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.image&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20pc&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.image.image1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sx"&gt;url("https://react-pretty-carousel.herokuapp.com/static/media/photo-1.da31d5ae.jfif")&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cover&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.image.image2&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sx"&gt;url("https://react-pretty-carousel.herokuapp.com/static/media/photo-2.6932e41c.jfif")&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cover&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.image.image3&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sx"&gt;url("https://react-pretty-carousel.herokuapp.com/static/media/photo-3.3cf50746.jfif")&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cover&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.image.image4&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sx"&gt;url("https://react-pretty-carousel.herokuapp.com/static/media/photo-4.e7eeb637.jfif")&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cover&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.image.image5&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sx"&gt;url("https://react-pretty-carousel.herokuapp.com/static/media/photo-5.903bd4b4.jfif")&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cover&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.image.image6&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sx"&gt;url("https://react-pretty-carousel.herokuapp.com/static/media/photo-6.402110ff.jfif")&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cover&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;Here I am just assigning a specific image to each &lt;code&gt;div&lt;/code&gt; and then setting it's &lt;code&gt;background-size&lt;/code&gt; to &lt;code&gt;cover&lt;/code&gt; so that the image's width would be set to the &lt;code&gt;div&lt;/code&gt;'s width automatically. &lt;/p&gt;

&lt;p&gt;If you need the whole code, with the files and everything literally then visit this &lt;a href="https://codesandbox.io/s/react-pretty-carousel-xulxf?file=/src/App.js" rel="noopener noreferrer"&gt;sandbox on CodeSandbox&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 4: Voila!&lt;/p&gt;

&lt;p&gt;That's it, yeah literally, that's how easy it was to add this beautiful carousel to your website! You can now simply run the code using &lt;code&gt;npm run start&lt;/code&gt; or &lt;code&gt;yarn start&lt;/code&gt; and see the carousel added to your website. You can use this framework to show image sliders and testimonials that most portfolios have these days, it will look epic on your website!&lt;/p&gt;

&lt;p&gt;Now again the whole code of whatever I taught you until now is available right &lt;a href="https://codesandbox.io/s/react-pretty-carousel-xulxf?file=/src/App.js" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/xulxf"&gt;
&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2&gt;
  
  
  How do I contribute?
&lt;/h2&gt;

&lt;p&gt;Oh so you're one of those people who love contributing huh? Well you can simply then contribute by visiting the Github repo!&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Jaagrav" rel="noopener noreferrer"&gt;
        Jaagrav
      &lt;/a&gt; / &lt;a href="https://github.com/Jaagrav/react-pretty-carousel" rel="noopener noreferrer"&gt;
        react-pretty-carousel
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Easily add beautiful carousels to your website in no time!
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;React-Pretty-Carousel&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;Easily add beautiful carousels to your website in no time!&lt;/p&gt;

&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/52719271/107816979-7f6adb80-6d9b-11eb-8535-2c8ccf4bb865.gif"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F52719271%2F107816979-7f6adb80-6d9b-11eb-8535-2c8ccf4bb865.gif" alt="React Pretty Carousel"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check out the Demo on the docs &lt;a href="https://react-pretty-carousel.herokuapp.com/" rel="nofollow noopener noreferrer"&gt;website&lt;/a&gt;!&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Installation&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;In order to install &lt;code&gt;react-pretty-carousel&lt;/code&gt;, run this command in your terminal.&lt;/p&gt;

&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;npm i react-pretty-carousel --save
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Or&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;yarn add react-pretty-carousel
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Usage&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/b4bf22a3658fd14f1cc398efaeaf04544e2a1a767c4a8d5cec633c46b298c0b3/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f692f7075637465346b6d773573736e6562706170796a2e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/b4bf22a3658fd14f1cc398efaeaf04544e2a1a767c4a8d5cec633c46b298c0b3/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f692f7075637465346b6d773573736e6562706170796a2e706e67" alt="Usage"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;code&gt;Props&lt;/code&gt;&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;br&gt;
&lt;thead&gt;
&lt;br&gt;
&lt;tr&gt;
&lt;br&gt;
&lt;th&gt;Prop&lt;/th&gt;
&lt;br&gt;
&lt;th&gt;DataType&lt;/th&gt;
&lt;br&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;br&gt;
&lt;/tr&gt;
&lt;br&gt;
&lt;/thead&gt;
&lt;br&gt;
&lt;tbody&gt;
&lt;br&gt;
&lt;tr&gt;
&lt;br&gt;
&lt;td&gt;&lt;code&gt;items&lt;/code&gt;&lt;/td&gt;
&lt;br&gt;
&lt;td&gt;&lt;code&gt;integer&lt;/code&gt;&lt;/td&gt;
&lt;br&gt;
&lt;td&gt;Number of items to display at once&lt;/td&gt;
&lt;br&gt;
&lt;/tr&gt;
&lt;br&gt;
&lt;tr&gt;
&lt;br&gt;
&lt;td&gt;&lt;code&gt;mode&lt;/code&gt;&lt;/td&gt;
&lt;br&gt;
&lt;td&gt;&lt;code&gt;string&lt;/code&gt;&lt;/td&gt;
&lt;br&gt;
&lt;td&gt;Style of the carousel, can be either &lt;code&gt;normal&lt;/code&gt; or &lt;code&gt;gallery&lt;/code&gt;&lt;br&gt;
&lt;/td&gt;
&lt;br&gt;
&lt;/tr&gt;
&lt;br&gt;
&lt;tr&gt;
&lt;br&gt;
&lt;td&gt;&lt;code&gt;showControls&lt;/code&gt;&lt;/td&gt;
&lt;br&gt;
&lt;td&gt;&lt;code&gt;boolean&lt;/code&gt;&lt;/td&gt;
&lt;br&gt;
&lt;td&gt;Show the dots and navigation buttons if &lt;code&gt;true&lt;/code&gt;, and otherwise if &lt;code&gt;false&lt;/code&gt;&lt;br&gt;
&lt;/td&gt;
&lt;br&gt;
&lt;/tr&gt;
&lt;br&gt;
&lt;/tbody&gt;
&lt;br&gt;
&lt;/table&gt;&lt;/div&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;&lt;code&gt;External Functions and Values&lt;/code&gt;&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;You can summon and move/navigate through the carousel by importing and using the following functions:&lt;/p&gt;

&lt;div class="highlight highlight-source-js notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
  &lt;span class="pl-v"&gt;CarouselWrapper&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
  &lt;span class="pl-s1"&gt;prev&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
  &lt;span class="pl-s1"&gt;next&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
  &lt;span class="pl-s1"&gt;moveTo&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
  &lt;span class="pl-s1"&gt;switchTo&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
  &lt;span class="pl-s1"&gt;presentIndex&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt;
&lt;span class="pl-kos"&gt;}&lt;/span&gt; &lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s"&gt;"react-pretty-carousel"&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Parameters&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;prev()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Move to the previous slide&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;next()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Move to the next slide&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;moveTo(5)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Move to a certain index/object with smooth animation&lt;/td&gt;
&lt;td&gt;integer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;switchTo(5)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Abruptly move to&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;…&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Jaagrav/react-pretty-carousel" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;You can star the repo of course and if you face any issues or problems, you can simply &lt;a href="https://github.com/Jaagrav/react-pretty-carousel/issues" rel="noopener noreferrer"&gt;create an issue&lt;/a&gt; or &lt;a href="https://github.com/Jaagrav/react-pretty-carousel/pulls" rel="noopener noreferrer"&gt;make a PR&lt;/a&gt; in order to contribute.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is there a video tutorial?
&lt;/h2&gt;

&lt;p&gt;Yeah definitely there is, I always make video tutorials so users and developers both understand how to use what I made,&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/oE97LMjPz5I"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Do check it out and let me know if you liked the carousel or not! If you did, did you end up adding it to your project?&lt;/p&gt;

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

&lt;p&gt;Now to be honest, creating react-pretty-carousel wasn't actually as easy as I anticipated before finally starting to work on it, it took me about two hours to get to the point where I could make the normal carousel by dragging it with the help of my pointer, I also tried my best to not break any React rules which thankfully I didn't but in the end it all works! And that's what matters the most, right? 😂&lt;/p&gt;

&lt;p&gt;I really look forward to what you create with this carousel and how you implement it to your website, I am actually pretty curious to find out, feel frr to &lt;a href="https://twitter.com/xJaagrav/" rel="noopener noreferrer"&gt;DM me on Twitter&lt;/a&gt; in case of any issues that you might face, I am there to help you, 87% of the time.&lt;/p&gt;

&lt;p&gt;Stay tuned because in my next article I'll be creating something with an arduino, with which you'll be able to control your TV with your feet, here's a sneak peek!&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1365263983435898881-301" src="https://platform.twitter.com/embed/Tweet.html?id=1365263983435898881"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1365263983435898881-301');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1365263983435898881&amp;amp;theme=dark"
  }



&lt;/p&gt;

</description>
    </item>
    <item>
      <title>5 APIs to inspire you for your next project</title>
      <dc:creator>Jaagrav</dc:creator>
      <pubDate>Sun, 13 Dec 2020 07:14:55 +0000</pubDate>
      <link>https://dev.to/jaagrav/5-apis-to-inspire-you-for-your-next-project-1g8b</link>
      <guid>https://dev.to/jaagrav/5-apis-to-inspire-you-for-your-next-project-1g8b</guid>
      <description>&lt;p&gt;Confused? About what you should make as your next project? Here are 5 Awesome APIs that you guys would thank me for mentioning here. Check them out, you might discover some new APIs which might help you to not only get ideas but also implement them in your next project.&lt;/p&gt;

&lt;p&gt;All of the APIs that I have mentioned down below are REST APIs that you can run using simple &lt;code&gt;POST&lt;/code&gt; and &lt;code&gt;GET&lt;/code&gt; methods.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Click on the API names/headers in order to go to their docs&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  #1 &lt;a href="https://github.com/Jaagrav/CodeX#something-special-for-other-developers" rel="noopener noreferrer"&gt;CodeX Code Compiler API&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/jaagrav/embed/LYRxWBR?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Ever thought of building a website from where you could compile and execute Java, C++, Swift, Python code? Well that's where the CodeX API comes in use, now there are various APIs on the market to compile and execute code but none of them are completely free unlike the CodeX API. It is dead easy to compile and execute code and fetch the output. In this codepen, you can compile and execute and store your code just by clicking on New Class! The CodeX API currently supports upto 8 languages that you can compile and execute, know more about it down below!&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Jaagrav" rel="noopener noreferrer"&gt;
        Jaagrav
      &lt;/a&gt; / &lt;a href="https://github.com/Jaagrav/CodeX" rel="noopener noreferrer"&gt;
        CodeX
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      CodeX is an online compiler for various languages like Java, C++, Python, etc. Execute code in various languages on your own website for free with the CodeX API!!! 
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;&lt;a href="https://codex.jaagrav.in" rel="nofollow noopener noreferrer"&gt;CodeX&lt;/a&gt;&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;CodeX is an online compiler for various languages like Java, C++, Python, etc.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codex.jaagrav.in" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/34506a3b77db9ae6b7b46843e2aa65b80bc6e9c2f30aa990bbd034de77b24cd0/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f692f3666306c37306437337366376d3772617a786d742e706e67" alt="CodeX Editor"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;CodeX has a simple UI in order to store all your codes written in various languages easily at one place.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codex.jaagrav.in" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/fd0668e6ef23455c0b6b0928064d73051734027d622706a9b9acdaf4f97bf0ac/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f692f303761346e61786561763175756e7a3962386e652e706e67" alt="CodeX Home"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can share the codes' links that you write with your friends without being worried about them making any changes
CodeX stores all your code details on your device, which means every code that you write will only be editable on the
device where you write you code in. Every Code shares a key that only your device and CodeX's backend know, so don't
fear about others making any changes. Although there are ways to hack into others code and make changes but that's for
you to find out. Once you find it out simply create an issue reporting the bug.&lt;/p&gt;
&lt;p&gt;No need to Sign In / Sign Up in order to execute and save your…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Jaagrav/CodeX" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h1&gt;
  
  
  #2 &lt;a href="https://responsivevoice.org/api/" rel="noopener noreferrer"&gt;Responsive Voice TTS API&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/jaagrav/embed/YzGNVqe?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can change the text in the input above, try putting your name&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now you're gonna fall in love with this API. This API is too good to not talk about. Haven't you always wanted that if your chatbot/website could literally speak!! That's when we talk about the Responsive Voice API which is super easy to use, it is a Text-To-Speech API where you can even change the speaker's accent, language, gender, etc. Isn't this API awesome go check out it's docs by clicking on it's title above.&lt;/p&gt;

&lt;h1&gt;
  
  
  #3 &lt;a href="https://rapidapi.com/Acobot/api/brainshop-ai" rel="noopener noreferrer"&gt;AcoBot AI ChatBot API&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/jaagrav/embed/qBaRrQa?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Every developer has always dreamed of creating something with AI. Be it a robot or just a chatbot that gives mature replies to your questions. Now whenever we've made a chatbot, it's always been a bunch of if-else clauses that could return replies to only specific questions that we would train it for. But with the AcoBot API you can easily add a smart AI chatbot to your website to whom your users can converse with for fun, try out the codepen example to get a glimpse of what it can do.&lt;/p&gt;

&lt;h1&gt;
  
  
  #4 &lt;a href="https://developers.facebook.com/blog/post/2018/10/31/instagram-graph-api-hashtag-search-launch/" rel="noopener noreferrer"&gt;Instagram Accounts Search API&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/jaagrav/embed/MWjJpMg?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Imagine making a website where you could look up your crush's instagram/twitter/linkedin accounts all in one place, you could make something like that, and make it easy for other people to find their friends' accounts on different platforms all at one place. Here's the Instagram Search API, you can use it to search people on Instagram, it's fast, reliable and very easy to use, check the codepen in order to understand how the API works and click on the header link in order to read the docs.&lt;/p&gt;

&lt;h1&gt;
  
  
  #5 &lt;a href="https://free.currencyconverterapi.com" rel="noopener noreferrer"&gt;Currency Convertor API&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/jaagrav/embed/GRjrmRd?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;If you're a beginner, I am pretty sure you like to challenge yourself and push yourself to build complex projects and that's why building something like a currency convertor is gonna be very beneficial for you. Hence here's the free currency convertor API that you can use in order to convert various currencies to various other currencies!&lt;/p&gt;

&lt;p&gt;And those were the APIs folks! Comment down below your favourite API(s), you may also mention any unique/awesome API that you want others to know in the comments down below!&lt;/p&gt;

&lt;p&gt;Here's a video by Zeno Rocha that I found where he has mentioned some HTML5, JavaScript Navigator APIs and many more that you might not have ever heard about. These APIs are stupid easy to use and too awesome to not be used in your next project, I would really suggest you to watch this whole video and not skip a part of it because you might miss out on some very exciting APIs.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/EZpdEljk5dY"&gt;
&lt;/iframe&gt;
 &lt;/p&gt;

&lt;p&gt;Now one last thing, for those who are interested in using the &lt;a href="https://github.com/Jaagrav/CodeX" rel="noopener noreferrer"&gt;CodeX API&lt;/a&gt;, I recently built this API after a lot of hardwork that you guys can use for free in order to compile and execute in languages like Java, C++, C#, C, Swift, Python, Kotlin and Ruby!!! You can check out this video in order to know in detail on how you can implement the &lt;a href="https://github.com/Jaagrav/CodeX" rel="noopener noreferrer"&gt;CodeX API&lt;/a&gt; in your next project.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/bkwLETA1rKQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Here's the docs for the &lt;a href="https://github.com/Jaagrav/CodeX" rel="noopener noreferrer"&gt;CodeX API&lt;/a&gt;,&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Jaagrav" rel="noopener noreferrer"&gt;
        Jaagrav
      &lt;/a&gt; / &lt;a href="https://github.com/Jaagrav/CodeX" rel="noopener noreferrer"&gt;
        CodeX
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      CodeX is an online compiler for various languages like Java, C++, Python, etc. Execute code in various languages on your own website for free with the CodeX API!!! 
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;&lt;a href="https://codex.jaagrav.in" rel="nofollow noopener noreferrer"&gt;CodeX&lt;/a&gt;&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;CodeX is an online compiler for various languages like Java, C++, Python, etc.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codex.jaagrav.in" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/34506a3b77db9ae6b7b46843e2aa65b80bc6e9c2f30aa990bbd034de77b24cd0/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f692f3666306c37306437337366376d3772617a786d742e706e67" alt="CodeX Editor"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;CodeX has a simple UI in order to store all your codes written in various languages easily at one place.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://codex.jaagrav.in" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/fd0668e6ef23455c0b6b0928064d73051734027d622706a9b9acdaf4f97bf0ac/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f692f303761346e61786561763175756e7a3962386e652e706e67" alt="CodeX Home"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can share the codes' links that you write with your friends without being worried about them making any changes
CodeX stores all your code details on your device, which means every code that you write will only be editable on the
device where you write you code in. Every Code shares a key that only your device and CodeX's backend know, so don't
fear about others making any changes. Although there are ways to hack into others code and make changes but that's for
you to find out. Once you find it out simply create an issue reporting the bug.&lt;/p&gt;
&lt;p&gt;No need to Sign In / Sign Up in order to execute and save your…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Jaagrav/CodeX" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;You can also check out the demo live by click on this &lt;a href="https://codexweb.netlify.app" rel="noopener noreferrer"&gt;link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Follow &lt;a href="https://twitter.com/WebDevGoa" rel="noopener noreferrer"&gt;WebDevGoa&lt;/a&gt; on Twitter in order to participate in contests and workshops that we conduct for you to get better at coding, follow now!! You can also win cool prizes!!!&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1306852980549758976-372" src="https://platform.twitter.com/embed/Tweet.html?id=1306852980549758976"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1306852980549758976-372');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1306852980549758976&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;Happy Coding!&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to build your portfolio/blog like a pro!!</title>
      <dc:creator>Jaagrav</dc:creator>
      <pubDate>Wed, 25 Nov 2020 17:15:18 +0000</pubDate>
      <link>https://dev.to/jaagrav/how-to-build-your-portfolio-blog-like-a-pro-4kbn</link>
      <guid>https://dev.to/jaagrav/how-to-build-your-portfolio-blog-like-a-pro-4kbn</guid>
      <description>&lt;p&gt;Before I begin, check out this list of 5 Really Cool Portfolios that I have ever seen!! Read the description because I've written the facts that a recruiter looks for in your Portfolio.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Click on the images to visit the respective websites&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  #1 Bruno Simon
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://bruno-simon.com" rel="noopener noreferrer"&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%2Fi%2Fi7yml1ymp7vc16gkmz69.png" alt="Bruno Simon"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Developed in WebGL Studio, &lt;a href="http://www.bruno-simon.com" rel="noopener noreferrer"&gt;www.bruno-simon.com&lt;/a&gt; is probably the best portfolio that I have seen. His portfolio and projects have always inspired me to learn 3D Web Dev. And who doesn't love 3D? Although it feels like a 3D video game, Simon has done a really great job in showing off his skills and side-projects.&lt;/p&gt;

&lt;h1&gt;
  
  
  #2 Rally
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://rallyinteractive.com" rel="noopener noreferrer"&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%2Fi%2Fxfp8f04eejg9dqv3s064.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The only thing that is missing in the above image are the animations. That ribbon that you see behind the text actually transforms into the side menu!! UNBELIEVABLE right? I love it how they kept the website design so simple yet so sexy.&lt;/p&gt;

&lt;h1&gt;
  
  
  #3 Antoni
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://antoni.de" rel="noopener noreferrer"&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%2Fi%2F7oynzxycydxfx2ajttpd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This website left me speechless, it's not only responsive but also it has really cool interactive features that will leave you in awe.  There's a video running behind in the background that makes it look even more beautiful. Visit the website to experience the animations and the beauty of the website.&lt;/p&gt;

&lt;h1&gt;
  
  
  #4 Love For Iceland
&lt;/h1&gt;

&lt;p&gt;&lt;a href="http://loveforiceland.com" rel="noopener noreferrer"&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%2Fi%2Frxlhw3q4odscespzttln.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One very important thing that recruiters look for in your portfolio websites are blogs. They want to see articles that you've written, public talks you've given and hackathons you've participated in. Having a blog in your personal website makes it 10x more attractive and useful, because in order to create a blogging website, you require basic skills related to both backend and frontend. Love For Iceland is the most beautiful blogging website that I have ever seen.&lt;/p&gt;

&lt;h1&gt;
  
  
  #5 Uruoi
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://uruoiskincare.com" rel="noopener noreferrer"&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%2Fi%2Fh1iucr4ubd36sm527sx5.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're here on Dev.to, I consider you to be extremely creative. Because Creative People love to explore, love to learn. That's what recruiters look for in your portfolio, they need to know how creative you are. No matter how good of a developer you are, even the simplest of website designs also end up looking super attractive. Like Uruoi's Website itself, if you look closely you'd notice there's not many elements in the picture, all that the website has is some soothing animations and a huge background image. Other than that it's literally a regular website, but just the background and the animations make it the Website of the day.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can check out more such websites on &lt;a href="https://awwwards.com" rel="noopener noreferrer"&gt;Awwwards&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Things to keep in mind
&lt;/h2&gt;

&lt;p&gt;You might have noticed in the above websites, they are literally award winning websites, however if you visit them, you'll notice the key ingredient that makes them so attractive is their animations and their simplicity. In all of the above websites notice how less text they have written? Most of it comprises media like images and videos. And that's what makes them award-winning.&lt;/p&gt;

&lt;p&gt;Now to get a job at one of your dream companies DOES NOT require you to become an award-winning developer, but if you are then that's awesome!! It's literally just another advantage, which would of course make it easier to get a job at your dream company. However, if you are a beginner, and you also want to make super attractive portfolios, which let's say would atleast grab you a job then take a look at these three fundamental tips:&lt;/p&gt;

&lt;h1&gt;
  
  
  Tip 1 - Choose a Color Palette
&lt;/h1&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%2Fi%2Fgz8tue3g8v4b85496fyk.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%2Fi%2Fgz8tue3g8v4b85496fyk.png" alt="Bad UI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;center&gt;V/S&lt;/center&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%2Fi%2Fn8y1x5hfy7p18w8y4ty5.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%2Fi%2Fn8y1x5hfy7p18w8y4ty5.png" alt="dev.to"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Above as you can see their are two blogging websites with two UIs. Now of course just by seeing your face I can tell you did not like the first images. If you're a regular visitor here on Dev, you might have enabled the dark mode, because of how cool it looks. Well we all love Dev's UI because they used less colors, rather the designers of Dev worked according to a color palette which is basically a bunch of colors of either the same shade or they look good in contrast. Like the background of Dev is a shade of dark grey, the blog posts are a bit lighter, and finally in order to attract users into writing more posts, they made the &lt;strong&gt;WRITE A POST&lt;/strong&gt; button in a calm indigo color. Whenever you are working on your portfolio or any kind of website, make sure to use calm colors instead of aggressive primary colors like Red, Blue, Yellow or Black, calm colors are basically a lighter or better shade of these primary colors. &lt;strong&gt;There's a reason why girls prefer nude colored lipsticks over blood red ones&lt;/strong&gt;. And if you don't follow a proper color palette then you might end up with something like the first image.&lt;/p&gt;

&lt;h1&gt;
  
  
  Tip 2 - Website Responsiveness
&lt;/h1&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%2Fi%2Fzhga58rfqf4qmrtwx384.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%2Fi%2Fzhga58rfqf4qmrtwx384.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;center&gt;My School's Website UI, computer and mobile&lt;/center&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%2Fi%2Fadzx1yqmhgupq9pbq0lo.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%2Fi%2Fadzx1yqmhgupq9pbq0lo.png" alt="Ugly Green Campus"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I know I know, you must be like &lt;strong&gt;OH COME ON JAAGRAV!! NOW YOU ARE HURTING MY EYES&lt;/strong&gt; I am sorry but let me explain first, oh wait I have nothing to explain, we already can see what makes the website's UX so poor. It is it's responsiveness, I have seen so many portfolios that are not responsive which is like the nightmare for web developers. Always remember when designing an awesome UI, you always need to worry about the UX (User-Experience), that is more important. You need to follow the accessibility rules, and everything in order to become a good developer. You see, Google or Facebook could have had a UI like one of the five best websites I showed you above. But still they follow the rules because even after having a great UI, those websites don't have a good UX. Now look, we are web developers, that's why we always care about UI design but always keep in mind, most users care about the UX of the website i.e. how simple it is to use rather than the UI of the website. Did your dad ever day while using Google Maps that, Google Maps has such a great interface, instead he'd probably just reply that Google Maps is very &lt;strong&gt;easy&lt;/strong&gt; to use. That's because of the great UX criteria that every Google Developers and Designers follow when they are working on the next big thing by Google. However my school's website lacks both the UI and the UX.&lt;/p&gt;

&lt;h1&gt;
  
  
  Tip 3 - Only Add Content that matters
&lt;/h1&gt;

&lt;p&gt;Before I made my own portfolio, I had gathered a lot of inspirations from Dribbble and Awwwards, I wanted to make a website which would be as beautiful in design and also be able to say a lot about me, however after I made a design that fancy I realised that my portfolio did not look professional enough because it was too fancy. Though it had a lot of animations and the design was also pretty cool, I did not like the UX. The website was not simple enough. When a recruiter visits your portfolio always remember that he wants to get a quick look at your skills, projects, experience and talks in public. Because the recruiter has thousand other applications that he/she needs to go through before/after yours. Try to show your work to the recruiter as fast as possible, put content that you think is more useful over the others which are probably not so much. Show off the projects you have worked on, show off the articles you have written, your social media accounts and of course your experience. That's what matters the most. Here are some professional yet simple websites that I feel are an eye-catcher and life saver for the recruiters.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Click on the images to visit their websites!!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://aleksandarpopovic.com" rel="noopener noreferrer"&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%2Fi%2Fyq1zre1r5ygyludtrtdw.png" alt="Aleks Popovic"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aleksandarpopovic.com" rel="noopener noreferrer"&gt;aleksandarpopovic.com&lt;/a&gt; by Aleks Popovic&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.haxzie.com" rel="noopener noreferrer"&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%2Fi%2F795muihx5ttks1ofdx5d.png" alt="Musthaq Ahamad"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://haxzie.com" rel="noopener noreferrer"&gt;haxzie.com&lt;/a&gt; by Musthaq Ahamad&lt;/p&gt;

&lt;p&gt;&lt;a href="https://devraj-chatribin.netlify.app" rel="noopener noreferrer"&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%2Fi%2Fax64c7ot633lbr59e94n.png" alt="Devraj Chatribin"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://devraj-chatribin.netlify.app" rel="noopener noreferrer"&gt;devraj-chatribin.netlify.app&lt;/a&gt; by Devraj Chatribin&lt;/p&gt;

&lt;h3&gt;
  
  
  And finally,
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://xjaagrav.netlify.app/stories" rel="noopener noreferrer"&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%2Fi%2F3nf8l93ikp3w6dfb2a9t.png" alt="Jaagrav Seal"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://xjaagrav.netlify.app/stories" rel="noopener noreferrer"&gt;Book Of Jaagrav&lt;/a&gt; by me!!&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Now I know many of you may not like any of our designs or any one of our designs but with this article I basically want to say one thing, whatever design you make, KEEP IT SIMPLE. Do not go too fancy, maybe a little, but try to keep it the best of both worlds. Also if you like writing articles, you can create a personal blog for yourself, there are so many tools like FirebaseJS for Database, MarkedJS to add markdown to your website, ReactJS to have a great User Experience and also SendGrid which you can use in order to notify your readers about your new post. You can browse through YouTube to know how to make your own blog, here's one video by WebDevSimplified that you can watch in order to create your own blog with Mongo.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/1NrHkjlWVhM"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;And in the meantime, you can either check out my &lt;a href="https://xjaagrav.netlify.app/stories" rel="noopener noreferrer"&gt;blog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://xjaagrav.netlify.app/stories/how-i-made-xper-a-realtime-code-deployer-and-code-editor" rel="noopener noreferrer"&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%2Fi%2Fwlmahaf90a1mrtakszs2.png" alt="Capture Images on browser using JavaScript - Book Of Jaagrav"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or the code for it.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Jaagrav" rel="noopener noreferrer"&gt;
        Jaagrav
      &lt;/a&gt; / &lt;a href="https://github.com/Jaagrav/Jaagrav" rel="noopener noreferrer"&gt;
        Jaagrav
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>showdev</category>
      <category>javascript</category>
      <category>codenewbie</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Capture Still Images on Browser using JavaScript </title>
      <dc:creator>Jaagrav</dc:creator>
      <pubDate>Fri, 13 Nov 2020 13:32:17 +0000</pubDate>
      <link>https://dev.to/jaagrav/capture-still-images-on-browser-using-javascript-2di8</link>
      <guid>https://dev.to/jaagrav/capture-still-images-on-browser-using-javascript-2di8</guid>
      <description>&lt;p&gt;Before we begin here is the &lt;a href="https://snapshotcam.netlify.app/" rel="noopener noreferrer"&gt;link&lt;/a&gt; to what you'll be able to create once you read this whole article.&lt;/p&gt;

&lt;p&gt;Yes, indeed, it is possible to capture images on the browser. Well, it is true that with the power of JavaScript, we can do almost anything but on a browser. &lt;/p&gt;

&lt;p&gt;Now in order to click still images on your browser, we are going to use JavaScript's Navigator APIs. Well for those who are unfamiliar with JavaScript's Navigator API, here is a short explanation of it that I found on &lt;a href="https://www.javascripttutorial.net/javascript-bom/javascript-navigator/#:~:text=The%20JavaScript%20Navigator%20provides%20information,via%20the%20read-only%20window.&amp;amp;text=The%20Navigator%20object%20has%20properties,a%20property%20of%20the%20window." rel="noopener noreferrer"&gt;javascripttutorial.net&lt;/a&gt;. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The JavaScript Navigator provides information about the web browser and its capabilities. You can reference the Navigator object via the read-only window.navigator property.&lt;br&gt;
The Navigator object has properties that convey the browser’s information. For example, the &lt;code&gt;userAgent&lt;/code&gt; is a property of the &lt;code&gt;window.navigator&lt;/code&gt; object. It is a long string that identifies the web browser.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//Run this in your console now&lt;/span&gt;

&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userAgent&lt;/span&gt;

&lt;span class="c1"&gt;//The output should somewhat look like this&lt;/span&gt;
&lt;span class="cm"&gt;/* Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 
(KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36 
OPR/72.0.3815.186 */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;So, yes with the Navigator API, you can get all the data about the user's device and also have access to particular peripherals like the device's camera, microphone, etc. Now the Navigator API is pretty rad considering the variety of stuff you can do with it.&lt;/p&gt;

&lt;p&gt;In fact, &lt;strong&gt;just in case if you did not know this&lt;/strong&gt;, you can even check the battery status/percentage/charging of the device, and on mobile devices, you can even use &lt;code&gt;navigator.vibrate(100)&lt;/code&gt; in order to vibrate the user's device just for some haptic feedback.&lt;/p&gt;

&lt;p&gt;So by now, you probably have got enough idea of what you can do with JavaScript's Navigator API, it is way sexier than how it sounds here. &lt;/p&gt;
&lt;h1&gt;
  
  
  The Code
&lt;/h1&gt;

&lt;p&gt;Well since we are making a camera app, we need to show the user what his/her device's camera is seeing. And in order to do that, we are going to have to stream their camera footage on an HTML Video tag. So here's how the HTML looks 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="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Document Title&lt;span class="nt"&gt;&amp;lt;/title&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://fonts.googleapis.com/icon?family=Material+Icons"&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;href=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/material-components-web@latest/dist/material-components-web.min.css"&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt;&lt;span class="nt"&gt;&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/material-components-web@latest/dist/material-components-web.min.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;/head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;center&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

            &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Camera&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

            &lt;span class="nt"&gt;&amp;lt;video&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"videoStream"&lt;/span&gt; &lt;span class="na"&gt;muted&lt;/span&gt; &lt;span class="na"&gt;playsinline&lt;/span&gt; &lt;span class="na"&gt;autoplay&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/video&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;center&amp;gt;&lt;/span&gt;
                 &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"mdc-button capture-shot"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"mdc-button__ripple"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
                  &lt;span class="nt"&gt;&amp;lt;i&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"material-icons mdc-button__icon"&lt;/span&gt; &lt;span class="na"&gt;aria-hidden=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;camera&lt;span class="nt"&gt;&amp;lt;/i&lt;/span&gt;
                  &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"mdc-button__label"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Capture Image&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/center&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;canvas&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"shot"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/canvas&amp;gt;&lt;/span&gt;

        &lt;span class="nt"&gt;&amp;lt;/center&amp;gt;&lt;/span&gt;

        &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
            &lt;span class="nx"&gt;mdc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ripple&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MDCRipple&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;attachTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.capture-shot&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Well I used Material UI in order to make the capturing buttons look a bit prettier. &lt;/p&gt;

&lt;p&gt;So as you can see in the HTML, there are &lt;strong&gt;3 main components&lt;/strong&gt; the &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt; tag to stream the footage sent from the device's camera, the &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; tag to click the picture and &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; the legendary HTML5 Canvas tag where we would be seeing the still image that we click when the &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; is pressed.&lt;/p&gt;

&lt;p&gt;Now let's take a look at the CSS, it ain't much but still I want to show you guys the whole code.&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="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Sans-Serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;orangered&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;video&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;canvas&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30pc&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;That's all CSS we need for this, now let's move on to the most essential part of this project, the JavaScript. Now pay attention on each and every line that I write after this because it is important that you understand every line of code that I wrote in order to bring life to this project. If you have any questions regarding the JavaScript part, feel free to mention it in the comments down below.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.videoStream&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;constraints&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;video&lt;/span&gt;&lt;span class="p"&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;//Here we are mentioning which navigator peripherals are required for this project.&lt;/span&gt;
&lt;span class="c1"&gt;//We are keeping audio false lest the user would hear his own audio when the&lt;/span&gt;
&lt;span class="c1"&gt;//video gets streamed on the &amp;lt;video&amp;gt; in html&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleSuccess&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// make stream available to browser console&lt;/span&gt;
  &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;srcObject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
  &lt;span class="c1"&gt;//Here we are hooking up the user's camera footage/stream to the video footage&lt;/span&gt;
  &lt;span class="c1"&gt;//in order to make it play/stream what the user's camera sees&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;NotAllowedError&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Please allow to record video dumbass&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;//In case the user does not allow to record video/audio, we will maturely handleSuccess&lt;/span&gt;
&lt;span class="c1"&gt;//the error&lt;/span&gt;

&lt;span class="nb"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mediaDevices&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUserMedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;constraints&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;handleSuccess&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;handleError&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;//With navigator.getUserMedia we are getting the user's media device outputs based&lt;/span&gt;
&lt;span class="c1"&gt;//On the constraints we have applied i.e. we want the user's video and not audio&lt;/span&gt;
&lt;span class="c1"&gt;//If we are allowed access to user's media then we run the function handleSuccess&lt;/span&gt;
&lt;span class="c1"&gt;//Which basically hooks up the device's camera footage to the &amp;lt;video&amp;gt; footage&lt;/span&gt;
&lt;span class="c1"&gt;//In case if the user does not allow access then we handle the error by calling&lt;/span&gt;
&lt;span class="c1"&gt;//the respective function&lt;/span&gt;

&lt;span class="c1"&gt;//Capture Image&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.shot&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;//In order to click still images, we are going to draw the frame on an HTML5 canvas&lt;/span&gt;

&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.capture-shot&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;//When user clicks on the capture button, we need to capture the image duh...&lt;/span&gt;
  &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;videoWidth&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;videoHeight&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;//With this we are setting the canvas' height and width to the footage's dimensions&lt;/span&gt;
  &lt;span class="c1"&gt;//The canvas, by default might be smaller than the footage's dimensions which might&lt;/span&gt;
  &lt;span class="c1"&gt;//lead to taking only a part of the frame instead of the whole frame&lt;/span&gt;

  &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;drawImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;video&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="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;//With this function we draw the frame when the user presses the canvas button&lt;/span&gt;
  &lt;span class="c1"&gt;//This line literally means draw a 2d image of the current frame in video which &lt;/span&gt;
  &lt;span class="c1"&gt;//is basically the &amp;lt;video&amp;gt; tag where the device's camera footage is being streamed.&lt;/span&gt;
  &lt;span class="c1"&gt;//We also need to pass in the parameters to start drawing the image of the frame from&lt;/span&gt;
  &lt;span class="c1"&gt;//0, 0 which are the x, y coordinates of where to start drawing the image on the canvas,&lt;/span&gt;
  &lt;span class="c1"&gt;//We also pass in the end coordinates which is basically the size of the canvas&lt;/span&gt;
  &lt;span class="c1"&gt;//in which coordinates the canvas stops drawing the frame of the footage&lt;/span&gt;

  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;imgURL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toDataURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;image/png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;img&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;Image&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;imgURL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;imgURL&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;//This is the data URL with which you can basically download &lt;/span&gt;
  &lt;span class="c1"&gt;//the still image that you took by clicking the capture button&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This is what it would look like if you run the code on your machine.&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%2Fi%2Fjzct2zheht29u50alc87.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%2Fi%2Fjzct2zheht29u50alc87.png" alt="Camera App Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I know, I was too shy to turn on my real camera so I used my virtual camera... However you can check out the code working by &lt;a href="https://xperbycoder.netlify.app/deploy/V0FWZmVh7bSAozvT5U1RbWjtsky2/-MM0EBdqOSas0sk_vlv1/" rel="noopener noreferrer"&gt;clicking here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now for some of you, &lt;strong&gt;exclusively those who did not read the code above&lt;/strong&gt;, let me summarize on what's going on here. &lt;/p&gt;
&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;So basically at first what we are doing here is, creating an object variable called &lt;code&gt;constraints&lt;/code&gt;, where we would basically mention what media devices we are going to access of the user.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.videoStream&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;//The html video tag where we would be streaming the device's video&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;constraints&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;video&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We are going to keep the audio false since we are using the &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt; in order to stream the user's video, and if audio were true, the user would be able to hear his own voice which is preposterous.&lt;/p&gt;

&lt;p&gt;After this, we are going to hook up the user's video to the &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt; tag so that the user can view his video and click an image when he/she wants to. And on order to do that, we create a function&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleSuccess&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
  &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;srcObject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;stream&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;All of the video data would be present inside the stream parameter which is like an event parameter that returns &lt;code&gt;navigator&lt;/code&gt; data. &lt;/p&gt;

&lt;p&gt;Now whenever you are accessing a peripheral like the user's camera/microphone you would be needing the user's consent to do so. &lt;br&gt;
And in case the user denies to do so, then the code would throw an error stating the reason of the error. Usually if the user denies the reason of the error is a string with a message like &lt;strong&gt;&lt;em&gt;NotAllowedError&lt;/em&gt;&lt;/strong&gt; and we need to check if that error comes up or not. In case it does, we need to handle it.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;NotAllowedError&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Please allow to record video dumbass&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;And now finally in order to start the video stream of the device's camera on the &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt; tag, we need to run this line,&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mediaDevices&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUserMedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;constraints&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;handleSuccess&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;handleError&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Over here what we're doing is getting the user's media data with the help of &lt;code&gt;navigator.mediaDevices.getUserMedia(constraints)&lt;/code&gt; based on the &lt;code&gt;constraints&lt;/code&gt; that we set before which is allow video and not audio, this returns a &lt;code&gt;promise&lt;/code&gt; which we get as a parameter variable in the function &lt;code&gt;handleSuccess(stream)&lt;/code&gt;, and in case if there is an error then we &lt;code&gt;.catch()&lt;/code&gt; it and call the &lt;code&gt;handleError(error)&lt;/code&gt; function to further handle it. And that's it we've finally started to stream the user's footage on our &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt; but we have still not written the code to click images. &lt;/p&gt;

&lt;p&gt;Now, in order to take a still image, we are going to use HTML5's Canvas to draw the image of the current frame that is being showed on the video stream. &lt;br&gt;
So we need to click an image only when the user presses on the Capture button, and therefore,&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.shot&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.capture-shot&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;videoWidth&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;videoHeight&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;drawImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;video&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="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;imgURL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toDataURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;image/png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;img&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;Image&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;imgURL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;imgURL&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In the first two lines, what we're doing is setting the size of the canvas to dimensions of the video that we are receiving from the userMedia. &lt;code&gt;canvas.width = video.videoWidth; canvas.height = video.videoHeight;&lt;/code&gt; &lt;br&gt;
After this we draw the frame which was being shown when the user clicked the capture button. In order to do that we run this line,&lt;br&gt;
&lt;code&gt;canvas.getContext("2d").drawImage(video, 0, 0, canvas.width, canvas.height);&lt;/code&gt; Over here we are basically drawing a 2d image of the &lt;code&gt;video&lt;/code&gt; frame on the &lt;code&gt;canvas&lt;/code&gt;. We use HTML5 Canvas's &lt;code&gt;.drawImage()&lt;/code&gt; function in order to do draw the frame. This generally takes in 5 parameters respectively, the video element in order to draw it's frame, the x and y coordinates of where to start drawing on the canvas i.e. &lt;code&gt;0, 0&lt;/code&gt; and the x and y coordinates of where to end drawing on the canvas  which is basically the dimensions of the &lt;code&gt;canvas&lt;/code&gt; since we want the image to take up all the space in the &lt;code&gt;canvas&lt;/code&gt;.&lt;br&gt;
And that's it. We have made our Browser Camera that can take still images!! Pretty cool right? Now in order to download the image you have taken, you can run the following code where we are basically converting the &lt;code&gt;canvas&lt;/code&gt; drawn data into a &lt;code&gt;.png&lt;/code&gt;, well it can be anything, jpeg as well.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;imgURL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toDataURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;image/png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;img&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;Image&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;imgURL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;imgURL&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Open the URL that get's logged in the console, it's basically a data link. In layman's language, it's the image you clicked just that now it's no more a visual image but just a string comprising random characters that makes sense only to computers.&lt;/p&gt;

&lt;p&gt;Meanwhile check out &lt;a href="https://snapshotcam.netlify.app/" rel="noopener noreferrer"&gt;SnapShot&lt;/a&gt; the camera app that I made where you can not only take images but also edit them just after you're done with clicking your image!! Click on the image to open the website!!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://snapshotcam.netlify.app/" rel="noopener noreferrer"&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%2Fi%2Flpv2g4bzy7r28xsc8xbh.jpg" alt="SnapShot Mockup"&gt;&lt;/a&gt;&lt;br&gt;
You can also contribute to the project here!!&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Jaagrav" rel="noopener noreferrer"&gt;
        Jaagrav
      &lt;/a&gt; / &lt;a href="https://github.com/Jaagrav/Snapshot" rel="noopener noreferrer"&gt;
        Snapshot
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      An online Camera that uses your camera to take images, which you can immediately edit with quick edit and also download on your device.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Snapshot&lt;/h1&gt;

&lt;/div&gt;

&lt;p&gt;An online Camera that uses your camera to take images, which you can immediately edit with quick edit and also download on your device.
Live at: &lt;a href="https://snapshotcam.netlify.app" rel="nofollow noopener noreferrer"&gt;https://snapshotcam.netlify.app&lt;/a&gt;
~ Part of Project Enigma&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Jaagrav/Snapshot" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>How I made Xper - A RealTime Code Deployer and Code Editor</title>
      <dc:creator>Jaagrav</dc:creator>
      <pubDate>Wed, 04 Nov 2020 13:29:30 +0000</pubDate>
      <link>https://dev.to/jaagrav/how-i-made-xper-a-realtime-code-deployer-and-code-editor-53d2</link>
      <guid>https://dev.to/jaagrav/how-i-made-xper-a-realtime-code-deployer-and-code-editor-53d2</guid>
      <description>&lt;p&gt;In the world of Web Development, I have always faced one major/irritating problem which is responsiveness of a website. Everytime when I am developing a website, I make a quick change and push it in order to quickly check how it looks on my phone. And it does not even update in RealTime!!! Now I know we can simply turn on the inspector and toggle to mobile screen mode to have a look and get an idea of how it might look on a mobile device, but is it accurate? I still always have this urge to check something that I spent hours working on in realtime, on my phone!!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Now imagine if it was possible!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Imagine, a tool/code editor where you can simply write code, and then deploy it, and see your deployed code update in realtime, &lt;strong&gt;as you code on all DEVICES&lt;/strong&gt; that has your website open. Imagine how easy it would be to see your code's output just after you make that small two line change to your code and see it update in &lt;strong&gt;REALTIME&lt;/strong&gt; on your phone without connecting your laptop to it. Imagine being able to edit your &lt;strong&gt;code&lt;/strong&gt; on any device that you visit your website from!!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Seem's kinda surreal right?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Well, that's why with the help of AceJS and FirebaseJS, I created something pretty much what I needed. Something that I told you to &lt;strong&gt;imagine&lt;/strong&gt; above. Now you might be like, "&lt;em&gt;&lt;strong&gt;What the hell are you talking about?!&lt;/strong&gt;&lt;/em&gt;", Well you need to watch the video below in order to get a hint of what I am really talking about.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/UFeu4lRtPHI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Well, if you watched the video, thanks for watching but in case you're in a hurry and you did not, let me explain Xper to you in a nutshell&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Xper - In a nutshell&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Xper is a responsive React app where you can simply create HTML/CSS/JS code and see it run in RealTime on all the devices that has your deployed website open. Again, I will request you to consider watching the YouTube video in order to properly understand what Xper is really about. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How Xper works?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Xper uses AceJS in order to highlight your code, for backend, I am using Firebase, now with Firebase's realtime database, I was able to update the database with data in realtime, so this gave me an idea, what if I make a website and save all my codes/snippets quickly on the website, well of course I could use the browser's Local Storage in order to save all of it, but is it really useful? Just write code and save it? That also on my device only! I wanted to create something like codepen, where I could easily write code and view the output in realtime and once when I was done, simply close the browser window, just like I do once I am done designing something on Figma. Now with JavaScript's &lt;code&gt;document.write()&lt;/code&gt; function and HTML5's &lt;code&gt;iframe&lt;/code&gt;, I could easily run the user written code everytime the user made changes and show him/her the output of the code the user wrote in realtime. Makes Sense. And since I am using Firebase's RealTime Database, I could easily save the code everytime the user made a change! And with Firebase's on change database listener, I could easily update the user written code everywhere the website was open. With React Routers I could easily provide the user a deploy link where the user could see the deployed version of his/her code. And that's how I developed Xper.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Xper is OpenSource!!!&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Jaagrav" rel="noopener noreferrer"&gt;
        Jaagrav
      &lt;/a&gt; / &lt;a href="https://github.com/Jaagrav/Xper" rel="noopener noreferrer"&gt;
        Xper
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Xper is a realtime code editor where you can both write and save your code in realtime! Please make all the changes and pull requests in the changes/updates branch in order to contribute.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/22021e196e30bb7ecd122e2400d4165b7b9c044347af82d9d83e10f33412f37b/68747470733a2f2f692e696d6775722e636f6d2f50644d695048412e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/22021e196e30bb7ecd122e2400d4165b7b9c044347af82d9d83e10f33412f37b/68747470733a2f2f692e696d6775722e636f6d2f50644d695048412e706e67" alt="Xper Banner"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Xper&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Xper is a realtime code editor where you can both write and save your code in realtime! The unique thing about Xper is it updates your deployed code in realtime, which means you can code on your computer and immediately be able to check how it looks like on your phone, tablet, and literally everywhere else. Xper is developed in React, which makes it a lightning fast code editor considering everything is being saved remotely. Check it out in the links given below
&lt;br&gt;
Live at: &lt;a href="https://xperbycoder.netlify.app" rel="nofollow noopener noreferrer"&gt;https://xperbycoder.netlify.app&lt;/a&gt;
Source Code: &lt;a href="https://github.com/Jaagrav/Xper" rel="noopener noreferrer"&gt;https://github.com/Jaagrav/Xper&lt;/a&gt;
&lt;br&gt;
You can create issues in case you detect a bug, and if you know how to fix it, you can work on it yourself and make a PR, I will accept all the PRs that deserve to be accepted, so now you can also become a contributor for Xper
&lt;br&gt;
This project was bootstrapped with &lt;a href="https://github.com/facebook/create-react-app" rel="noopener noreferrer"&gt;Create React App&lt;/a&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Available Scripts&lt;/h2&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Jaagrav/Xper" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
You can contribute your changes and versions easily to my repo by creating a PR or an issue that developers around the world could work on. And oh, check out &lt;a href="https://xperbycoder.netlify.app" rel="noopener noreferrer"&gt;Xper&lt;/a&gt; now!! I bet you'd love to play with it!!!

&lt;p&gt;Learn the technologies used!!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So if you want to learn all the technologies that I used, just tap on their names, to know more:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://reactjs.org" rel="noopener noreferrer"&gt;React&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://material-ui.com" rel="noopener noreferrer"&gt;Material-UI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/react-ace" rel="noopener noreferrer"&gt;React-Ace&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://firebase.google.com/docs/web/setup" rel="noopener noreferrer"&gt;Firebase&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://sweetalert.js.org/guides/" rel="noopener noreferrer"&gt;SweetAlert&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Make your own code editor
&lt;/h2&gt;

&lt;p&gt;Check out this video where I made a simple CodePen clone&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/8x5DdcSBaZk"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Clone this repo to run it on your machine&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Jaagrav" rel="noopener noreferrer"&gt;
        Jaagrav
      &lt;/a&gt; / &lt;a href="https://github.com/Jaagrav/CodePen-Clone" rel="noopener noreferrer"&gt;
        CodePen-Clone
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Here is how you can easily use AceJS to add a code editor to your website with HTML5 and Vanilla JavaScript.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Here's the HTML&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Paste this at the bottom of your HTML first&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="html-editor" style="height: 100%;"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;!--Define a div with an id where you want to write the code--&amp;gt;

&amp;lt;script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ace.js"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Here's the JavaScript&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Paste this in your main JavaScript file i.e. basically the file where you're writing your JavaScript&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let htmlEditor = ace.edit("html-editor"); 
//html-editor is the id of the div where I want to write the code

htmlEditor.session.setMode("ace/mode/html");
htmlEditor.setTheme("ace/theme/terminal");

htmlEditor.session.setValue(`&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;title&amp;gt;Document&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;`);//Default text you want to show in your code editor

htmlEditor.session.setUseWrapMode(true); 
//You can even enable text wrap which is disabled by default

htmlEditor.setOptions({
  fontSize: "20pt"
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you're done doing this, you would get to see 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%2Fuser-images.githubusercontent.com%2F52719271%2F98115576-0ec73f80-1ecd-11eb-9311-870ce12d2529.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%2Fuser-images.githubusercontent.com%2F52719271%2F98115576-0ec73f80-1ecd-11eb-9311-870ce12d2529.png" alt="image_2020-11-04_183923"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pretty cool right?&lt;br&gt;
Here, check it out &lt;a href="https://xperbycoder.netlify.app/deploy/V0FWZmVh7bSAozvT5U1RbWjtsky2/-MLIKKf5pJtMa0Mv1ZPB/" rel="noopener noreferrer"&gt;live&lt;/a&gt; on your device, and also you can view the code &lt;a href="https://xperbycoder.netlify.app/edit/V0FWZmVh7bSAozvT5U1RbWjtsky2/-MLIKKf5pJtMa0Mv1ZPB" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;br&gt;
Here is how it looks on &lt;a href="https://xperbycoder.netlify.app" rel="noopener noreferrer"&gt;Xper&lt;/a&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%2Fuser-images.githubusercontent.com%2F52719271%2F98115804-68c80500-1ecd-11eb-8aba-dc6d87dc4325.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%2Fuser-images.githubusercontent.com%2F52719271%2F98115804-68c80500-1ecd-11eb-8aba-dc6d87dc4325.png" alt="image_2020-11-04_184153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Challenges for you!!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Try creating a realtime code editor by yourself, add cool text themes, an awesome UI, and a feature you personally have always wanted on a realtime code editor. Also try to save the code in the local storage so that the user has access to his code only on his computer. And then make a Github Repo and mention it down below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;THE BEST SUBMISSION WILL BE FEATURED IN MY NEXT ARTICLE!!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Until then, thanks for your time, reading this, and yes you made it through all the crap that I talked about in this article, hope you liked it!!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Check out &lt;a href="https://xperbycoder.netlify.app" rel="noopener noreferrer"&gt;Xper&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/Jaagrav/Xper" rel="noopener noreferrer"&gt;Contribute&lt;/a&gt; to Xper&lt;br&gt;
&lt;a href="https://xperbycoder.netlify.app/deploy/V0FWZmVh7bSAozvT5U1RbWjtsky2/-MLIKKf5pJtMa0Mv1ZPB/" rel="noopener noreferrer"&gt;Code&lt;/a&gt; to add AceJS to your website&lt;br&gt;
&lt;br&gt;Stay tuned to learn how to make your own realtime code editor that can save your code locally on your device!!&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>react</category>
      <category>database</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
