<?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: The coding Freak</title>
    <description>The latest articles on DEV Community by The coding Freak (@thecodingfreak).</description>
    <link>https://dev.to/thecodingfreak</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%2F639970%2F00699882-0567-4e8a-b724-a557c063bca8.jpeg</url>
      <title>DEV Community: The coding Freak</title>
      <link>https://dev.to/thecodingfreak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thecodingfreak"/>
    <language>en</language>
    <item>
      <title>Awwward : Mouse Wheel Event + CSS Perspective, REACT.JS</title>
      <dc:creator>The coding Freak</dc:creator>
      <pubDate>Thu, 17 Jun 2021 14:45:14 +0000</pubDate>
      <link>https://dev.to/thecodingfreak/awwward-mouse-wheel-event-css-perspective-react-js-38a9</link>
      <guid>https://dev.to/thecodingfreak/awwward-mouse-wheel-event-css-perspective-react-js-38a9</guid>
      <description>&lt;h2&gt;
  
  
  Awwward : Mouse Wheel Event + CSS Perspective, REACT.JS
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2560%2F1%2AEK8nXViqIdf7vyZEj297zA.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F2560%2F1%2AEK8nXViqIdf7vyZEj297zA.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I love to spend time studying cool websites on &lt;a href="https://www.awwwards.com/" rel="noopener noreferrer"&gt;awwward.com&lt;/a&gt;, there are always impressive and inspiring effects.&lt;/p&gt;

&lt;p&gt;In this tutorial, we are building an interactive vinyl box using React.&lt;/p&gt;

&lt;p&gt;Original website &lt;a href="https://music.zajno.com/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The plan
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Install React, SASS, …&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create your folder structure&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create the Home page and your components&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create data and setup vinyls with CSS&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create your wheel event&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Handle click on current vinyl&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  1. Install React, SASS, …
&lt;/h3&gt;

&lt;p&gt;To use React, you first have to install it using NPM:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app nameOfYourProject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Install SASS&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install node-sass@4.14.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Launch your app&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd nameOfYourProject
npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  2. Create your folder structure
&lt;/h3&gt;

&lt;p&gt;Add the following folders in &lt;strong&gt;/src :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;/&lt;strong&gt;components&lt;/strong&gt; (It will contain our Cursor component)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;/&lt;strong&gt;pages&lt;/strong&gt; (It will contain our Home page)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;/&lt;strong&gt;services&lt;/strong&gt; (It will contain utils functions)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;/&lt;strong&gt;styles&lt;/strong&gt; (It will contain styles of our app)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;/*&lt;em&gt;assets *&lt;/em&gt;(It will contain your images)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ARUnbBz-v-x6tPASMZddudw.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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ARUnbBz-v-x6tPASMZddudw.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  3. &lt;strong&gt;Create the Home page and your components&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Now we need to create a Home page so add &lt;strong&gt;Home.jsx **in the pages folder. Don’t forget to also create a home folder in /&lt;/strong&gt;styles** and add to it &lt;strong&gt;Home.scss&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
In &lt;strong&gt;index.css **add few lines to your body tag.&lt;br&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
Then add **Home **in your **app.js&lt;br&gt;&lt;/p&gt;

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
Easy, isn’t it! Create a new folder /&lt;strong&gt;vinyleBox *&lt;em&gt;in *&lt;/em&gt;/components **and add to it **VinyleBox.jsx&lt;/strong&gt;. &lt;strong&gt;VinyleBox.jsx **contain one parameter which is data. Add your **VinyleBox **component in **Home.jsx. **Do the same thing for the CSS that we did previously.&lt;br&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
Create a new folder /vinyles &lt;strong&gt;in **/components **and add to it **Vinyles.jsx **and save images bellow like **cover.jpg&lt;/strong&gt; to your folder &lt;strong&gt;/assets. Vinyles.jsx **contains two parameters id and styles! Then add your **Vinyles **component in **VinylesBox.jsx.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AAqacQCXkyOt1I_ZF0TVxsg.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AAqacQCXkyOt1I_ZF0TVxsg.jpeg"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
You should have this result :

&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%2Fcdn-images-1.medium.com%2Fmax%2F3796%2F1%2Af3oEIDjrMn6rB-MxB10MtA.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%2Fcdn-images-1.medium.com%2Fmax%2F3796%2F1%2Af3oEIDjrMn6rB-MxB10MtA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. &lt;strong&gt;Create data and setup vinyls with CSS&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;First, we need two functions to generate random ID and background color. So add &lt;strong&gt;VinylesServices.js&lt;/strong&gt; to &lt;strong&gt;/services&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
You’ll initialize a new state data and create a new function initData. Each vinyl contains an id, parameters position, and style.

&lt;p&gt;To place vinyls like on the image with CSS you need to use the property transform and three transform-function. The first one is perspective which will be similar for each vinyls, it’s to sets the distance between the user and the z=0 plane. In other words, have a logic scaling if your item is far or near to you. The second is translateZ to move an element along the z-axis and the last one is translateY to move an element vertically.&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Ap2GUOLx4xIMGkSRNfjVSGw.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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Ap2GUOLx4xIMGkSRNfjVSGw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So let’s do this in &lt;strong&gt;Home.jsx&lt;/strong&gt; by including the two previous new services functions. And pass data to your &lt;strong&gt;VinylesBox **component.&lt;br&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
Add a map function in **VinylesBox.js.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
Now you should have this result :

&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%2Fcdn-images-1.medium.com%2Fmax%2F2182%2F1%2AGJONgJ0N6gXKCu6WUzen-w.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%2Fcdn-images-1.medium.com%2Fmax%2F2182%2F1%2AGJONgJ0N6gXKCu6WUzen-w.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://thecodingfreak.medium.com/awwward-mouse-wheel-event-css-perspective-react-js-a04e874f37ea" rel="noopener noreferrer"&gt;Read the rest of the article on medium&lt;/a&gt;
&lt;/h1&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Awwward : Images following cursor, REACT.JS + UNSPLASH API</title>
      <dc:creator>The coding Freak</dc:creator>
      <pubDate>Sat, 29 May 2021 17:04:54 +0000</pubDate>
      <link>https://dev.to/thecodingfreak/awwward-images-following-cursor-react-js-unsplash-api-3l60</link>
      <guid>https://dev.to/thecodingfreak/awwward-images-following-cursor-react-js-unsplash-api-3l60</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tZ9ivZBs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/krx4s8e9nykbij6t423g.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tZ9ivZBs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/krx4s8e9nykbij6t423g.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I love spend time to study cool website on awwward.com, there are always impressive and inspiring effects.&lt;/p&gt;

&lt;p&gt;In this tutorial we are building an interactive cursor using React and the Unspash API.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://thecodingfreak-contact.medium.com/awwward-images-following-cursor-react-js-unsplash-api-5091d012432c"&gt;https://thecodingfreak-contact.medium.com/awwward-images-following-cursor-react-js-unsplash-api-5091d012432c&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/TheCodingFreak1"&gt;https://twitter.com/TheCodingFreak1&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/TheCodingFreak-Github"&gt;https://github.com/TheCodingFreak-Github&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>api</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
