<?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: Medusa</title>
    <description>The latest articles on DEV Community by Medusa (@mijim).</description>
    <link>https://dev.to/mijim</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%2F59549%2F6f3b9847-bb11-496d-914c-7507c9feedf8.jpg</url>
      <title>DEV Community: Medusa</title>
      <link>https://dev.to/mijim</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mijim"/>
    <language>en</language>
    <item>
      <title>Code Art &amp; iDraw H review</title>
      <dc:creator>Medusa</dc:creator>
      <pubDate>Mon, 15 May 2023 18:36:52 +0000</pubDate>
      <link>https://dev.to/mijim/code-art-idraw-h-review-43o4</link>
      <guid>https://dev.to/mijim/code-art-idraw-h-review-43o4</guid>
      <description>&lt;p&gt;Art with code, generative art, coding art, creative coding... It has many names and they all say the same thing.&lt;/p&gt;

&lt;h1&gt;
  
  
  ¿What is coding art?
&lt;/h1&gt;

&lt;p&gt;Generative art is a type of art that is created through the use of algorithms and computer programs. Instead of being created by human hands, &lt;strong&gt;generative art is generated using code and software&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This means that each piece of generative art is unique and &lt;strong&gt;cannot be replicated exactly&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The process of creating generative art often involves &lt;strong&gt;randomness and unpredictability&lt;/strong&gt;, which can lead to unexpected and surprising results.&lt;/p&gt;

&lt;h1&gt;
  
  
  Me and code art
&lt;/h1&gt;

&lt;p&gt;I discovered generative art a little over a year ago, and since then, I haven't stopped experimenting with different styles, techniques, and algorithms to explore this immense world. Here's a compilation of &lt;strong&gt;100 sketches from the past year&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkr91nfjoj7dxds523rwf.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%2Fkr91nfjoj7dxds523rwf.png" alt="100 Generative Sketches"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Twitter -&amp;gt; &lt;a href="https://twitter.com/BenajesMiguel" rel="noopener noreferrer"&gt;https://twitter.com/BenajesMiguel&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The latest thing I'm exploring is printing the artwork with the help of a drawing robot, also called  pen plotter.&lt;/p&gt;

&lt;h2&gt;
  
  
  IDraw H review
&lt;/h2&gt;

&lt;p&gt;Generative art has gained significant popularity in recent years, attracting artists from various disciplines. To support this creative endeavor, &lt;strong&gt;iDraw H emerges as a remarkable plotter designed specifically for generative art&lt;/strong&gt;. In this short review, we explore the features, performance, and overall user experience of iDraw H, comparing it to other models such as Axidraw.&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%2F58o3nb1v7kbfwp5c9wdw.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%2F58o3nb1v7kbfwp5c9wdw.png" alt="IDraw H"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh1wrep8nvp44s0h4hcr7.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%2Fh1wrep8nvp44s0h4hcr7.png" alt="IDraw H test"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Link to web: &lt;a href="https://idrawpenplotter.com/" rel="noopener noreferrer"&gt;https://idrawpenplotter.com/&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Impressive Performance and Build Quality
&lt;/h4&gt;

&lt;p&gt;Upon testing, it becomes evident that iDraw H &lt;strong&gt;outshines&lt;/strong&gt; its competitors in terms of &lt;strong&gt;speed&lt;/strong&gt;, surpassing the &lt;strong&gt;performance&lt;/strong&gt; of Axidraw. Furthermore, the solid and &lt;strong&gt;high-quality metal structure&lt;/strong&gt; sets it apart from other models in the market.&lt;/p&gt;

&lt;h4&gt;
  
  
  Precise and Versatile Drawings
&lt;/h4&gt;

&lt;p&gt;One notable feature of iDraw H is its ability to produce &lt;strong&gt;precise and sharp drawings&lt;/strong&gt;. The pen holder, being 2-3mm larger than the Axidraw, accommodates a wider range of pens. This &lt;strong&gt;flexibility&lt;/strong&gt; allows artists to experiment with &lt;strong&gt;different types of pens&lt;/strong&gt;, resulting in diverse artistic outputs.&lt;/p&gt;

&lt;h4&gt;
  
  
  Integration with Inkscape
&lt;/h4&gt;

&lt;p&gt;iDraw H's &lt;strong&gt;compatibility with Inkscape&lt;/strong&gt;, a free open source popular vector graphics editor, is a significant advantage for artists. This integration seamlessly integrates the plotting process into artists' existing workflows. Notably, the &lt;strong&gt;ability to control the order of paths&lt;/strong&gt; drawn is crucial, especially for creating timelapse videos. Additionally, the inclusion of a &lt;em&gt;button on the controller board acts as a convenient **pause button&lt;/em&gt;* during the drawing process.&lt;/p&gt;

&lt;h4&gt;
  
  
  Smooth Motor Operation and Quiet Servo
&lt;/h4&gt;

&lt;p&gt;The &lt;strong&gt;motors&lt;/strong&gt; of iDraw H &lt;strong&gt;operate smoothly&lt;/strong&gt;, ensuring consistent and uninterrupted plotting. Surprisingly, the servo of this plotter is quieter compared to that of the Axidraw A3 V3, enhancing the overall user experience.&lt;/p&gt;

&lt;h4&gt;
  
  
  Easy installation
&lt;/h4&gt;

&lt;p&gt;One of the things I have liked the most, even though it may seem silly, is how easy everything is to install. &lt;strong&gt;Within a few minutes, you have the machine up and running&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flh9y1bf7imyy85kxvh8h.jpg" 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%2Flh9y1bf7imyy85kxvh8h.jpg" alt="Easy installation IDraw H"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Considerations and Potential Improvements
&lt;/h4&gt;

&lt;p&gt;Some possible improvements would be to facilitate &lt;strong&gt;connectivity&lt;/strong&gt; through &lt;strong&gt;Bluetooth or wireless&lt;/strong&gt;, which would greatly enhance the experience.&lt;/p&gt;

&lt;p&gt;Another feature that I find very useful would be to have a &lt;strong&gt;programming interface&lt;/strong&gt; in different languages to directly control the motors. This would be a treat for any generative artist.&lt;/p&gt;

&lt;p&gt;Overall, the &lt;strong&gt;documentation and video tutorials&lt;/strong&gt; could be improved.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In summary, the iDraw H plotter is an &lt;strong&gt;excellent choice for artists venturing into generative art&lt;/strong&gt;. It provides a robust and reliable machine that seamlessly integrates with Inkscape, facilitating a &lt;strong&gt;smooth workflow&lt;/strong&gt;. The versatility of the pen holder enables artists to explore various pen types, allowing for creative experimentation. &lt;strong&gt;Assembly is straightforward&lt;/strong&gt;, making it accessible for most artists, while those interested in the technical aspects will appreciate the opportunity to build and understand the plotter's inner workings. Although the A4 drawing area may feel slightly restricted for some users, iDraw H offers for those seeking a larger canvas. With its impressive features and performance, iDraw H is an ideal tool to bring generative art to life on paper.&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%2Ful4v7gm79xu7kcipbaj7.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%2Ful4v7gm79xu7kcipbaj7.png" alt="IDraw H Work"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>idrawh</category>
      <category>penplotter</category>
      <category>generativeart</category>
      <category>creativecoding</category>
    </item>
    <item>
      <title>Creating an animated jellyfish in JS! 👀💥</title>
      <dc:creator>Medusa</dc:creator>
      <pubDate>Mon, 06 Jun 2022 12:06:35 +0000</pubDate>
      <link>https://dev.to/mijim/creating-an-animated-jellyfish-in-js-39e9</link>
      <guid>https://dev.to/mijim/creating-an-animated-jellyfish-in-js-39e9</guid>
      <description>&lt;p&gt;It looks 3D right? The reality is that the animation is composed only of curves in a 2D plane, we are going to see in depth the steps that I have followed to create this effect that we can use on our websites and combine with user actions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;To start we will need to add the p5js library to our project and create a JS file where we will put all the necessary code. We will create a canvas with a black background through the setup function in this way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function setup() {
  createCanvas(window.innerHeight, window.innerHeight);
  background(0);
  frameRate(100);
  stroke(255);
  strokeWeight(10);
  noFill();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The correct way to draw a circle
&lt;/h2&gt;

&lt;p&gt;At the end of the setup function we will create a circle of points through a for loop that iterates the angles of the circle, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function setup() {
  ...
  const radius = 200;
  const centerX = width / 2;
  const centerY = height / 2;
  for (let angle = 1; angle &amp;lt;= 360; angle += 10) {
    const x = centerX + radius * cos(radians(angle));
    const y = centerY + radius * sin(radians(angle));
    point(x, y);
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will get something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foy0ezyyacpntbm95n5qu.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%2Foy0ezyyacpntbm95n5qu.png" alt="Circle of points"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding lines
&lt;/h2&gt;

&lt;p&gt;Now we will replace the points with lines that go from each point to the center. And we change the strokeWeight from 10 to 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function setup() {
  ...
    const y = centerY + radius * sin(radians(angle));
    beginShape();
    curveVertex(centerX, centerY);
    curveVertex(centerX, centerY);
    curveVertex(x, y);
    curveVertex(x, y);
    endShape();
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Farzb1hr3f1jmioptwj0e.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%2Farzb1hr3f1jmioptwj0e.png" alt="Circle of lines"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Moving the center and crushing the circle
&lt;/h2&gt;

&lt;p&gt;Now we would be seeing our future "jellyfish" from above. To create a side view effect I have decided to move the center of the circle higher on the Y axis and flatten the circle creating this effect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function setup() {
  ...
    const y = centerY + radius * sin(radians(angle));
    beginShape();
    curveVertex(centerX, centerY - 100);
    curveVertex(centerX, centerY - 100);
    curveVertex(x, y / 10 + 500);
    curveVertex(x, y / 10 + 500);
    endShape();
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2F5k6ovjhay288w0e7sicb.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%2F5k6ovjhay288w0e7sicb.png" alt="Flatten lines circle"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Curving the lines
&lt;/h2&gt;

&lt;p&gt;Now our experiment begins to take on more of a jellyfish shape by adding curvature to the lines we just created. To do this we will modify above all the first and last curveVertex that correspond to the anchor points of the curve.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function setup() {
  ...
    const y = centerY + radius * sin(radians(angle));
    beginShape();
    curveVertex(centerX, centerY + 80);
    curveVertex(centerX, centerY - 50);
    curveVertex(x, y / 10 + 500);
    curveVertex(x, y / 10 + 1200);
    endShape();
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fx752imqk3c3kp2y1ejo6.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%2Fx752imqk3c3kp2y1ejo6.png" alt="Curving lines"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding lots of lines and noise 🤘🏿
&lt;/h2&gt;

&lt;p&gt;Adding many lines, lowering the opacity of each line and adding perlin noise on the Y axis we get a more organic and natural effect that already reminds us of a jellyfish.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function setup() {
  createCanvas(window.innerHeight, window.innerHeight);
  background(0);
  frameRate(100);
  stroke(255, 20);
  strokeWeight(1);
  noFill();

  const radius = 200;
  const centerX = width / 2;
  const centerY = height / 2;
  for (let angle = 1; angle &amp;lt;= 360; angle += 0.2) {
    const x = centerX + radius * cos(radians(angle));
    const y = centerY + radius * sin(radians(angle));
    const noiseY = 50 - noise(angle / 200) * 100;
    beginShape();
    curveVertex(centerX, centerY + 80);
    curveVertex(centerX, centerY - 50);
    curveVertex(x, y / 10 + 500 + noiseY);
    curveVertex(x, y / 10 + 1200);
    endShape();
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2F8imzki6xc1if9wt14017.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%2F8imzki6xc1if9wt14017.png" alt="Many lines"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  More noise, color and movement 🤯
&lt;/h2&gt;

&lt;p&gt;Playing with the values of our curves and with the stroke color of each line adding variation over time we created the complete effect we were looking for. I leave you the complete code of the animation and I encourage you to create your own jellyfish with new shapes and colors and adding user or sound interaction. Happy Coding! 🖖🏻🙌🏾&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%2Fjlnwvey9i7jqawv0qb7v.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjlnwvey9i7jqawv0qb7v.gif" alt="Jellyfish"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function setup() {
  createCanvas(window.innerHeight, window.innerHeight);
  background(0);
  frameRate(100);

  stroke(255, 20);
  strokeWeight(1);
  noFill();
}

let i = 0;
function draw() {
  i++;
  background(0);
  const centerX = width / 2;
  const centerY = height / 2;
  const radius = 200 * noise(i / 300) + 100;
  const radius2 = 20 * noise(i / 300) + 20;
  strokeWeight(1);
  translate(0, -150);
  for (let angle = 1; angle &amp;lt;= 360; angle += 0.2) {
    const x = centerX + radius * cos(radians(angle));
    const y = centerY + radius * sin(radians(angle)) + (200 - noise(radians(angle), i / 100) * 400);
    const noiseStrokeR = noise(radians(angle));
    const noiseStrokeG = noise(i / 100);
    const noiseStrokeB = noise(radians(angle), i / 100);
    stroke(
      Math.round(255 * noiseStrokeR + 10),
      Math.round(120 * noiseStrokeB + 40),
      Math.round(255 * noiseStrokeG),
      60
    );
    beginShape();
    const noiseY = noise(radius / 100) * 100;
    const noiseY2 = 50 - noise(radius / 100, i / 120) * 100;
    const noiseX = 500 - noise(radians(angle), i / 120) * 1000;
    curveVertex(centerX, centerY + 200);
    curveVertex(centerX, centerY - 120 + noiseY);
    curveVertex(x, y / 10 + 500 + noiseY2);
    curveVertex(x + noiseX, y / 10 + 1000);
    endShape();
  }

  for (let angle = 1; angle &amp;lt;= 360; angle += 20) {
    const x = centerX + radius2 * 3 * cos(radians(angle));
    const x2 = centerX + (radius2 / 2) * cos(radians(angle));
    const y = centerY + radius2 * sin(radians(angle));
    const noiseStrokeR = noise(angle / 200);
    const noiseStrokeG = noise(i / 100);
    const noiseStrokeB = noise(angle / 200, i / 100);
    stroke(
      Math.round(255 * noiseStrokeR + 10),
      Math.round(120 * noiseStrokeB + 40),
      Math.round(255 * noiseStrokeG),
      120
    );
    strokeWeight(2);
    beginShape();
    const noiseY = noise(radius / 100) * 100;
    const noiseY2 = 50 - noise(i / 200, angle) * 100;
    const noiseX = 1000 - noise(radians(angle), i / 200) * 2000;
    const noiseX2 = 100 - noise(radians(360 - angle), i / 200) * 200;
    curveVertex(x2, centerY + 200);
    curveVertex(x2, centerY - 120 + noiseY);
    curveVertex(x + noiseX2, y / 1.1 + 500 + noiseY2);
    curveVertex(x + noiseX, y / 10 + 1000);
    endShape();
  }
}

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

&lt;/div&gt;



</description>
      <category>p5js</category>
      <category>frontend</category>
      <category>generativeart</category>
      <category>creativecoding</category>
    </item>
    <item>
      <title>Easily animate React components when mount/unmount 😅</title>
      <dc:creator>Medusa</dc:creator>
      <pubDate>Sat, 06 Mar 2021 16:54:17 +0000</pubDate>
      <link>https://dev.to/mijim/easily-animate-react-components-when-mount-unmount-223e</link>
      <guid>https://dev.to/mijim/easily-animate-react-components-when-mount-unmount-223e</guid>
      <description>&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%2Fraw.githubusercontent.com%2Fmijim%2Freact-mount-animation%2Fmaster%2Fimages%2Fexample1.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%2Fraw.githubusercontent.com%2Fmijim%2Freact-mount-animation%2Fmaster%2Fimages%2Fexample1.gif" alt="Example 1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the things that I have neglected the most as a React programmer when it comes to animations is the transitions when mounting and unmounting a component. Normally I always &lt;strong&gt;left without animations&lt;/strong&gt; because I didn't see an easy and comfortable way to put them either. The result is quite forced and the experience for the user is that things appear and disappear by magic, nothing fluid.&lt;/p&gt;

&lt;p&gt;Until a couple of days ago I decided to investigate the best and simplest way to run animations when mounting and unmounting components. I came to the conclusion that the best thing was to &lt;strong&gt;create a generic component that allows mounting and unmounting components&lt;/strong&gt; through the simplest possible syntax.&lt;/p&gt;

&lt;p&gt;I started creating a component that would manage the animation of the component and take care of mounting and unmounting it when indicated. The animation had to be done using the &lt;strong&gt;CSS keyframes&lt;/strong&gt;, so I came up with a solution like this simple example:&lt;/p&gt;

&lt;p&gt;Instead of this (mount/unmount without animation):&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt; &lt;span class="o"&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;isMounted&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setIsMounted&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&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="p"&gt;...&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;isMounted&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="p"&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="p"&gt;&amp;gt;&lt;/span&gt;
          Hi World!
        &lt;span class="p"&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;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
   &lt;span class="p"&gt;&amp;lt;/&amp;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;We do this (same with animation):&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="nx"&gt;Animated&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-mount-animation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt; &lt;span class="o"&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;isMounted&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setIsMounted&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&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="p"&gt;...&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Animated&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="c1"&gt;//You can use any HTML element here&lt;/span&gt;
        &lt;span class="na"&gt;show&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;isMounted&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="na"&gt;mountAnim&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;` 
            0% {opacity: 0}
            100% {opacity: 1}
        `&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        Hi World!
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Animated&lt;/span&gt;&lt;span class="p"&gt;.&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;)&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Anyone who wants to collaborate on it can contact me and any technical or non-technical opinion I will receive with pleasure. Maybe this package does not make sense, maybe it does, in any case I would love for you to leave a comment.&lt;/p&gt;

&lt;p&gt;If you want to &lt;strong&gt;inspect the code&lt;/strong&gt; or simply &lt;strong&gt;test it&lt;/strong&gt;, you can do it by consulting the repository: &lt;a href="https://github.com/mijim/react-mount-animation" rel="noopener noreferrer"&gt;https://github.com/mijim/react-mount-animation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/react-mount-animation" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/react-mount-animation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks &amp;amp; Happy Coding! ⚡️&lt;/p&gt;

</description>
      <category>react</category>
      <category>mount</category>
      <category>keyframes</category>
      <category>css</category>
    </item>
    <item>
      <title>⚡️ RULERULER ⚡️ - Chrome extension for designers &amp; developers (BETA)</title>
      <dc:creator>Medusa</dc:creator>
      <pubDate>Fri, 24 Jul 2020 16:48:21 +0000</pubDate>
      <link>https://dev.to/mijim/ruleruler-chrome-extension-for-designers-developers-beta-13j2</link>
      <guid>https://dev.to/mijim/ruleruler-chrome-extension-for-designers-developers-beta-13j2</guid>
      <description>&lt;p&gt;Check &amp;amp; download the extension here --&amp;gt; &lt;a href="http://ruleruler.design/"&gt;ruleruler.design&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How did the idea come?
&lt;/h2&gt;

&lt;p&gt;In my company (&lt;a href="https://aluxion.com/"&gt;Aluxion&lt;/a&gt;) we always try to take care about the front-end finish, using design systems and looking for the pixel to fit as much as possible the proposed design. A couple of months ago, working on the final stages of a commercial application, the design department was asked to perform a visual QA to verify that the measurements of the elements and font types fit the design well. As expected, this task was an ordeal, the inspector is not something friendly for design people, nor for an initiated developer. So we looked for extensions that would make our task easier, and although we found some, none of them combined everything we wanted in one.&lt;/p&gt;

&lt;p&gt;This is how I came up with creating an extension  (as a challenge more than anything) that allowed to see the font styles and the measurements between elements in a comfortable and fast way.&lt;/p&gt;

&lt;h2&gt;
  
  
  First steps
&lt;/h2&gt;

&lt;p&gt;The first approach I made was to go through all the elements on the page and create a box with their measurements in a very small font size. I thought it would be comfortable to have all the measurements of the elements together, but the result was something like an ultra-baroque painting:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZwUz6mwk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/84tccg2s6tjfzhx9x9d7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZwUz6mwk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/84tccg2s6tjfzhx9x9d7.jpg" alt="baroque painting" width="800" height="463"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Looking for the UX
&lt;/h2&gt;

&lt;p&gt;It was clear that the user couldn't have all the information, one of the basic rules of the UX is that only relevant information should be displayed for the user. So I tried various possible interactions until I realized that the interaction was already there, I just had to catch it. For the design of our applications we use Figma, what kind of interaction will our designers and developers be more used to? To which this tool offers us without a doubt. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UB_6DzfN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/jafm8p9axbifbx6rkbr5.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UB_6DzfN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/jafm8p9axbifbx6rkbr5.gif" alt="Figma interaction" width="736" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Analyzing the UX
&lt;/h2&gt;

&lt;p&gt;The interaction is quite simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The item you go through shows your measurements.&lt;/li&gt;
&lt;li&gt;When the item is clicked, it is selected.&lt;/li&gt;
&lt;li&gt;When you move the cursor, the measurement relationship between the selected element and the one you are on appears.&lt;/li&gt;
&lt;li&gt;Also, to add value to the product, the item you are on shows its font type and allows you to copy the font styles.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once the interaction was clear, undoubtedly the most complicated point was the third. How do I create the lines and what possible scenarios can be given depending on the position of the elements? Here, after playing around with figma, narrow the result to 4 possible scenarios that had to be covered from the code:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fwx-n79y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/uqwh8l2y8iwvo1qedhou.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fwx-n79y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/uqwh8l2y8iwvo1qedhou.png" alt="Interaction Scheme" width="512" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation
&lt;/h2&gt;

&lt;p&gt;I love React, I am a big fan and I use it professionally in the applications, however and considering that this was more of a challenge than anything else, I wanted to try creating the extension with flat javascript without using any external library, so I also made sure that Google did not put any impediment to upload the app to the Chrome Store.&lt;/p&gt;

&lt;p&gt;Basically I divided the implementation into X main methods (not counting other aux functions):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;openClose(show)&lt;/strong&gt;. Used to show or hide the extension. It is responsible for instantiating the elements, setting the listeners and assigning the corresponding css to the different components that make up the extension.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;handleHover(elem)&lt;/strong&gt;. Used in the mouse listener to analyze and display the dimensions of the element you are on and the distances between the selected element. It also calls drawNav to show the font styles.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;handleClick(elem)&lt;/strong&gt;. Set the lines above the element you click and save the it to be used in the handleHover.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;drawNav(elem)&lt;/strong&gt;. It is responsible for creating the nav and displaying the font values of the element you are on.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;copyCSS()&lt;/strong&gt;. Copy the styles to the clipboard of the item you are on.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;Although the extension is in Beta and it still gives some errors in some pages, the results have been very satisfactory and it is already free available in the chrome store for those who want to try it. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://ruleruler.design/"&gt;ruleruler.design&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jfZCssIo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/ynqslpk36sv34vmtilh8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jfZCssIo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/ynqslpk36sv34vmtilh8.png" alt="RULERULER Screenshot" width="800" height="539"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>chrome</category>
      <category>tool</category>
      <category>design</category>
    </item>
    <item>
      <title>Add sitemap.xml and robots.txt to Next.js app (SEO - 01)</title>
      <dc:creator>Medusa</dc:creator>
      <pubDate>Fri, 03 Jul 2020 17:28:46 +0000</pubDate>
      <link>https://dev.to/mijim/add-sitemap-xml-and-robots-txt-to-next-js-app-3ooj</link>
      <guid>https://dev.to/mijim/add-sitemap-xml-and-robots-txt-to-next-js-app-3ooj</guid>
      <description>&lt;p&gt;Since Next.js has become the best option (in my opinion) to create serverless apps with React, I will start a new group of articles talking about how to perform SEO with this great library.&lt;/p&gt;

&lt;p&gt;This first one is a very simple recipe to add sitemap.xml and robots.txt files. As almost every body knows, these files are used by the Google Search Bot in order to know the site structure and the files that should list.&lt;/p&gt;

&lt;p&gt;In order to don't extend much the post, I'll show you only the static files. Anyway, you can transform these files into dynamic ones by fetching previously and passing to getSitemap and getRobots methods the data you want to put in. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;pages/sitemap.xml.tsx&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getSitemap&lt;/span&gt; &lt;span class="o"&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="s2"&gt;`&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"&amp;gt;
  &amp;lt;url&amp;gt;
    &amp;lt;loc&amp;gt;https://example.com/&amp;lt;/loc&amp;gt;
    &amp;lt;lastmod&amp;gt;2020-07-01&amp;lt;/lastmod&amp;gt;
    &amp;lt;changefreq&amp;gt;daily&amp;lt;/changefreq&amp;gt;
    &amp;lt;priority&amp;gt;0.9&amp;lt;/priority&amp;gt;
  &amp;lt;/url&amp;gt;
&amp;lt;/urlset&amp;gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;Sitemap&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nx"&gt;getInitialProps&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setHeader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text/xml&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;getSitemap&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;end&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="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Sitemap&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;pages/robots.txt.tsx&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getRobots&lt;/span&gt; &lt;span class="o"&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="s2"&gt;`User-agent: *
Disallow: /_next/static/
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;Sitemap&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nx"&gt;getInitialProps&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setHeader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text/plain&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;getRobots&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;end&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="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Sitemap&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Hey, now I know React, so what’s next? 🧐</title>
      <dc:creator>Medusa</dc:creator>
      <pubDate>Sun, 14 Jul 2019 14:32:09 +0000</pubDate>
      <link>https://dev.to/mijim/hey-now-i-know-react-so-what-s-next-1k7</link>
      <guid>https://dev.to/mijim/hey-now-i-know-react-so-what-s-next-1k7</guid>
      <description>&lt;p&gt;As a junior software engineer I’ve been working recently on some React projects inside the professional area and I would like to share a big lesson I’ve learned. &lt;/p&gt;

&lt;p&gt;Sometimes, when we’re beginners we start learning a new modern framework by following the page tutorial, creating our first project, consulting the API, creating new project, searching great components, consulting the API, creating new project, searching great components, consulting the API, creating new project, searching great components... InternalError: too much recursion.&lt;/p&gt;

&lt;p&gt;So what’s next? The big problem is to think that what we are going to create is worse than other solutions. &lt;/p&gt;

&lt;p&gt;-🤨 Okay, we need a calendar for our app, should I create a new calendar component? &lt;br&gt;
-😎🍹 mmm no, I’ve been searching a bit and I found a really nice calendar, very complete and easy to use. This will save us a lot of time.&lt;/p&gt;

&lt;p&gt;That’s all, using others components will save you time, at least at the beginning.&lt;/p&gt;

&lt;p&gt;-🤨 hey, the client needs to pick a range of dates in this part of the app.&lt;br&gt;
-🤯 oh, our calendar doesn’t allow it, I will try to find a new one. &lt;/p&gt;

&lt;p&gt;We all know what are the time pressures and deadlines, but forcing you, your team or you company to spend a little bit more time creating generic reusable components that scale through the projects, attending to the new requirements and solving the use cases, will save you time. And that’s not all, your mind will work in a more abstract perspective of the solution. What we have to follow are these simple rules of component design:&lt;/p&gt;

&lt;p&gt;*Scale the component on every new project.&lt;br&gt;
*Always backwards compatible.&lt;br&gt;
*Always with tests.&lt;br&gt;
*Style has to be as modificable as possible.&lt;br&gt;
*Keep a good documentation.&lt;br&gt;
*Share it with the community.&lt;/p&gt;

&lt;p&gt;With the last rule comes what I think is the most beautiful part of programming, see that other developers use your approach/solution/component and they get benefit with them. &lt;/p&gt;

&lt;p&gt;-🤬 wait wait wait, we are not going to share our code for free, I pay you for this.&lt;/p&gt;

&lt;p&gt;This is a typical boss thinking that doesn't have a large business perspective. By sharing your code you are building a brand, you expand your contacts, you generate knowledge inside and outside your company, you get less errors and, for sure, you don’t lose money (trust me). So if your company is a bit archaic with this, try to change it as possible, the benefits are multiple.&lt;/p&gt;

&lt;p&gt;-🤨 hey, the client needs to pick a range of dates in this part of the app.&lt;br&gt;
-🤓😝 oh, our calendar doesn’t allow it, I will add the functionality to it. &lt;/p&gt;

</description>
      <category>react</category>
      <category>design</category>
      <category>webdev</category>
      <category>methodology</category>
    </item>
  </channel>
</rss>
