<?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: Ramon Gebben</title>
    <description>The latest articles on DEV Community by Ramon Gebben (@ramongebben).</description>
    <link>https://dev.to/ramongebben</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F207318%2F22b92440-6970-4365-abdd-4192007475e0.jpg</url>
      <title>DEV Community: Ramon Gebben</title>
      <link>https://dev.to/ramongebben</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ramongebben"/>
    <language>en</language>
    <item>
      <title>I needed a cone, so I built a cosplay pattern generator</title>
      <dc:creator>Ramon Gebben</dc:creator>
      <pubDate>Mon, 16 Nov 2026 15:23:40 +0000</pubDate>
      <link>https://dev.to/ramongebben/i-needed-a-cone-so-i-built-a-cosplay-pattern-generator-2kp8</link>
      <guid>https://dev.to/ramongebben/i-needed-a-cone-so-i-built-a-cosplay-pattern-generator-2kp8</guid>
      <description>&lt;p&gt;I started a new cosplay: a human-sized gnome, a Nisse, like the little one that sits at the edge of my table.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F26hsqd6ifeyfaxm3ywid.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F26hsqd6ifeyfaxm3ywid.jpg" alt="gnome or Nisse" width="800" height="1422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The hat is one big cone. Patterns for basic shapes online cost 3 or 4 euro, and I would still have to scale them to my size and hope the proportions held. So I drew it out and did the math myself.&lt;/p&gt;

&lt;p&gt;Halfway through, I thought this should be simpler. There should be a website where you type in your measurements and the computer does the geometry, so you can trust the pattern you print. So I put the gnome down and started on that instead. A few hours later, the proof of concept was working.&lt;/p&gt;

&lt;p&gt;That is &lt;a href="https://cosplayshapes.ra-ge.net" rel="noopener noreferrer"&gt;CosplayShapes&lt;/a&gt;. Pick a shape and enter what you measured, and you get a true-scale PDF to print or an SVG for a cutting machine. It started with eight basic shapes and now has fifteen. What surprised me is that I barely had to start from scratch for the new ones. Every shape I got right made the next one a small step.&lt;/p&gt;

&lt;h2&gt;
  
  
  It starts with a fan
&lt;/h2&gt;

&lt;p&gt;A cone unrolls into a fan: a slice of a circle. The radius of that circle is the slant of the cone, from the tip down to the base. The curved edge has to be exactly as long as the base circumference, so the angle of the fan is the circumference divided by the slant.&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;slant&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hypot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;midRadius&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;midHeight&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;sweep&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;TAU&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;midRadius&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;slant&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="n"&gt;outerArc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;outline&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;slant&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="n"&gt;sweep&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;&lt;code&gt;TAU&lt;/code&gt; is 2π, one full turn in radians, so &lt;code&gt;TAU * midRadius&lt;/code&gt; is the circumference.&lt;/p&gt;

&lt;p&gt;That was the hat. But I wasn't making it from paper. I was making it from 6 mm EVA foam, and foam bent into a cone is longer on the outside than on the inside. If you cut the pattern to the size you measured, the finished hat comes out too small.&lt;/p&gt;

&lt;p&gt;So the app draws every pattern at the middle of the material, half the thickness further out than the form it goes around. That is the &lt;code&gt;mid&lt;/code&gt; in &lt;code&gt;midRadius&lt;/code&gt; and &lt;code&gt;midHeight&lt;/code&gt;. For a hat 22 cm around and 15 cm tall, a paper cone has a 15.4 cm seam. In 6 mm foam the app makes it 16.8 cm, with an arc angle of 81.8°.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0wnp9vwn6a2epav1uqmv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0wnp9vwn6a2epav1uqmv.png" alt="The cone page on a phone: a yellow cone model above its fan-shaped flat pattern" width="800" height="1735"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That one rule, measure at the middle, came along into every shape after it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cut a hole in the fan
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;0&lt;/code&gt; in &lt;code&gt;sector(slant, 0, sweep)&lt;/code&gt; is the inner radius. A cone with its tip cut off, a truncated cone, is the same fan with a smaller arc cut out of the middle. Carry the slanted wall on until it meets at a point, and you know the radius of the full fan. The inner radius is that minus the slant.&lt;/p&gt;

&lt;p&gt;So the pattern for a bracer or a hat brim was one extra argument.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyduxb4g7uv2wccj5vayo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyduxb4g7uv2wccj5vayo.png" alt="The truncated cone page on a phone: a tapered tube above its curved band of a pattern" width="800" height="1735"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Slant a tube, then stack it
&lt;/h2&gt;

&lt;p&gt;A cylinder unrolls into a rectangle. Cut its top on a slant, and going round the tube, the top rises from the short side to the tall side and comes back down. Unrolled, that edge is a cosine wave:&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;heightAt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="n"&gt;middle&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;midRadius&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;slope&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;TAU&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;width&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 gave me the angled cylinder. It also gave me something better. Put two of those slanted ends together, and the tube turns a corner. Each side is cut at half the angle of the turn, and the two waves meet exactly. That is one joint of an elbow, the kind you see on a lobster-back pipe. Stack a few sections, each slanted at both ends, and you have a bend as smooth as you want.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffjvud3vs9wg4uzbe6l4w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffjvud3vs9wg4uzbe6l4w.png" alt="The elbow page on a phone: a bent yellow tube above its section patterns with wavy ends" width="800" height="1735"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Put the cone and the elbow together
&lt;/h2&gt;

&lt;p&gt;Now I had a shape that tapers and a shape that bends. A horn does both. So the curved horn is an elbow built from cone sections instead of cylinder sections, all with the same taper.&lt;/p&gt;

&lt;p&gt;This is the one step that didn't come for free. A cylinder has the same radius everywhere, so two of them cut on the plane halfway between their directions meet in the same ellipse. A cone gets narrower towards its tip. Cut two neighbouring cone sections on that same halfway plane, and their edges come out a slightly different size. The glued seam would gap.&lt;/p&gt;

&lt;p&gt;What makes it work is a sphere. Place the sections so that, where their axes cross, they have the same radius. Then a single sphere sits snugly inside both cones at that point, touching each of them all the way round. Two cones that touch the same sphere meet in a flat curve, so there is a plane that cuts both edges to the same shape. That plane faces the same way as the halfway plane, shifted a little towards the tip by an amount that follows from the taper and the turn.&lt;/p&gt;

&lt;p&gt;I wasn't going to trust that to a drawing. The tests take points along each cut and check that they lie on both neighbouring cones, and that the two edges you glue together are the same length.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn8t6z1q8dx72actt8j8p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn8t6z1q8dx72actt8j8p.png" alt="The curved horn page on a phone: a curling, tapering yellow horn above six section patterns" width="800" height="1735"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop thinking in spheres
&lt;/h2&gt;

&lt;p&gt;Domes and spheres are cut as gores, the long pointed pieces of a beach ball. My first version could only cut gores from a sphere. A dome was the top of a sphere, and the width of a gore came straight from the sphere's formula.&lt;/p&gt;

&lt;p&gt;The oval dome broke that, because an ellipse isn't a sphere. Instead of adding a second formula, I changed the question. Any round shape can be described by its outline from the top down: its profile. Walk down that profile, and at every point you know how far you have come, and how wide the shape is there. The gore is exactly that far along, and as wide as that circle divided between the gores:&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;halfWidth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&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="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PI&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;radius&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;gores&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once that worked, a new round shape was only a new outline. The oval dome is a quarter ellipse, and a capsule is two half circles with a straight piece between them. The sphere and the dome moved over to the same code, and a pointed dome came out of the same afternoon.&lt;/p&gt;

&lt;p&gt;There is one catch. "How far you have come" becomes the length of the seam, so it has to be exact. Measuring a curve with straight chords always comes out a little short. The error shrinks with the square of the chord's angle, so measuring with 8 chords and with 16, and combining the two, cancels most of it:&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="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;chordSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;segment&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nf"&gt;chordSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;segment&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a circle, that is exact to well under a micron.&lt;/p&gt;

&lt;h2&gt;
  
  
  Printing it
&lt;/h2&gt;

&lt;p&gt;All of this only matters if the pattern prints at the right size. The PDF starts with a guide page holding a calibration square, so you can check that the printer didn't scale the page. Large pieces are tiled across pages with crosshairs to line them up, and the guide page has a QR code back to the exact pattern, so you can find it again when you start the second horn.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe86tdtudgrumijsozpkc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe86tdtudgrumijsozpkc.png" alt="The CosplayShapes picker with the basic shapes: cylinder, cone, truncated cone, dome and sphere" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's free, with nothing to sign up for, and the code is MIT licensed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Try it: &lt;a href="https://cosplayshapes.ra-ge.net" rel="noopener noreferrer"&gt;https://cosplayshapes.ra-ge.net&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Source: &lt;a href="https://github.com/RamonGebben/CosplayShapes" rel="noopener noreferrer"&gt;https://github.com/RamonGebben/CosplayShapes&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The gnome is next. The hat pattern is ready.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>sideprojects</category>
      <category>geometry</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Responsive type and spacing by changing only the root font size</title>
      <dc:creator>Ramon Gebben</dc:creator>
      <pubDate>Thu, 12 Nov 2026 13:06:37 +0000</pubDate>
      <link>https://dev.to/ramongebben/responsive-type-and-spacing-by-changing-only-the-root-font-size-1hd9</link>
      <guid>https://dev.to/ramongebben/responsive-type-and-spacing-by-changing-only-the-root-font-size-1hd9</guid>
      <description>&lt;p&gt;In print, space was never a number of its own. It was measured in ems, the size of the type being set. The spaces between words were fractions of it. Change the type size, and the space changed with it.&lt;/p&gt;

&lt;p&gt;On screen we lost that. Designs arrived as pixel comps, so we wrote pixels: 16px body, 24px gap, 32px heading. Then screens multiplied, and every value got a table per breakpoint:&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="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;sizes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;mobile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'16px'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'22px'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;desktop&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'18px'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'32px'&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="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;Nothing in that table says the heading is a step above the body, or that a gap belongs to the text it separates. On mobile &lt;code&gt;l&lt;/code&gt; is 1.375 times &lt;code&gt;base&lt;/code&gt;; on desktop it's 1.78 times. Nobody decided that. It's just what the numbers happen to be.&lt;/p&gt;

&lt;p&gt;Version 4.0 of my design system package, &lt;a href="https://www.npmjs.com/package/@pindakaasman/design-system" rel="noopener noreferrer"&gt;&lt;code&gt;@pindakaasman/design-system&lt;/code&gt;&lt;/a&gt;, replaces those tables with one relation.&lt;/p&gt;

&lt;h2&gt;
  
  
  One scale
&lt;/h2&gt;

&lt;p&gt;Every font size and every spacing step is a step on one modular scale. &lt;code&gt;base&lt;/code&gt; is &lt;code&gt;1rem&lt;/code&gt;, each step up multiplies by one ratio, and each step down divides by it. The ratio is the token author's choice; the template uses 1.333, a perfect fourth.&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="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;ratio&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.333&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;base&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;mobile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'100%'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;tablet&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'100%'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;tabletLandscape&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'106.25%'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;desktop&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'112.5%'&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Spacing uses the same scale as the type, as print did. There is no spacing table to tune. Type has five steps (&lt;code&gt;s&lt;/code&gt; to &lt;code&gt;xl&lt;/code&gt;); spacing has the same five plus &lt;code&gt;xxs&lt;/code&gt; and &lt;code&gt;xs&lt;/code&gt; below them.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;Font size&lt;/th&gt;
&lt;th&gt;Spacing&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;xxs&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;0.4222rem&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;xs&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;0.5628rem&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;s&lt;/td&gt;
&lt;td&gt;0.7502rem&lt;/td&gt;
&lt;td&gt;0.7502rem&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;base&lt;/td&gt;
&lt;td&gt;1rem&lt;/td&gt;
&lt;td&gt;1rem&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;m&lt;/td&gt;
&lt;td&gt;1.333rem&lt;/td&gt;
&lt;td&gt;1.333rem&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;l&lt;/td&gt;
&lt;td&gt;1.7769rem&lt;/td&gt;
&lt;td&gt;1.7769rem&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;xl&lt;/td&gt;
&lt;td&gt;2.3686rem&lt;/td&gt;
&lt;td&gt;2.3686rem&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Type stops at &lt;code&gt;s&lt;/code&gt; because of &lt;code&gt;type.floor&lt;/code&gt;: no font size resolves below 0.75rem. Anything smaller would be raised to the floor and merge with &lt;code&gt;s&lt;/code&gt;. Spacing has no floor, so it can go further down.&lt;/p&gt;

&lt;h2&gt;
  
  
  One root
&lt;/h2&gt;

&lt;p&gt;Per breakpoint, one value changes: the root font size. Everything else is a constant rem value, so it grows or shrinks with the root and keeps its proportions.&lt;/p&gt;

&lt;p&gt;This is the CSS the package generates from the tokens above (&lt;code&gt;rootCss()&lt;/code&gt;):&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="p"&gt;:&lt;/span&gt;&lt;span class="nt"&gt;root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="kt"&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;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;min-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;768px&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="n"&gt;root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="kt"&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="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;min-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1024px&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="n"&gt;root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;106.25&lt;/span&gt;&lt;span class="kt"&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="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;min-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1440px&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="n"&gt;root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;112.5&lt;/span&gt;&lt;span class="kt"&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="p"&gt;:&lt;/span&gt;&lt;span class="nt"&gt;root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nv"&gt;--ds-font-size-s&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.7502rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nv"&gt;--ds-font-size-base&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nv"&gt;--ds-font-size-m&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.333rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nv"&gt;--ds-font-size-l&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.7769rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nv"&gt;--ds-font-size-xl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;2.3686rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nv"&gt;--ds-spacing-xxs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.4222rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nv"&gt;--ds-spacing-xs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.5628rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="cm"&gt;/* … the remaining spacing steps */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is the same page at 390px and at 1440px. The sizes are measured in the browser, not typed in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F610w9iw1u6auvnglhh37.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F610w9iw1u6auvnglhh37.png" alt="The specimen page at 1440px wide: root 18px, xl 42.6px" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnccxh3u3pqy4qc5rarb2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnccxh3u3pqy4qc5rarb2.png" alt="The specimen page at 390px wide: root 16px, xl 37.9px" width="800" height="1735"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;390px (root 16px)&lt;/th&gt;
&lt;th&gt;1440px (root 18px)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;s&lt;/td&gt;
&lt;td&gt;12px&lt;/td&gt;
&lt;td&gt;13.5px&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;base&lt;/td&gt;
&lt;td&gt;16px&lt;/td&gt;
&lt;td&gt;18px&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;m&lt;/td&gt;
&lt;td&gt;21.3px&lt;/td&gt;
&lt;td&gt;24px&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;l&lt;/td&gt;
&lt;td&gt;28.4px&lt;/td&gt;
&lt;td&gt;32px&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;xl&lt;/td&gt;
&lt;td&gt;37.9px&lt;/td&gt;
&lt;td&gt;42.6px&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Different scale, same relation: at both widths, each step is 1.333 times the one below it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using it
&lt;/h2&gt;

&lt;p&gt;Components never see a number. The accessors return CSS variables, so a component describes which step it is on, not how big that is:&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="kd"&gt;const&lt;/span&gt; &lt;span class="nc"&gt;Card&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="sb"&gt;`
  background: ${({ theme }) =&amp;gt; theme.color('background')};
  padding: ${({ theme }) =&amp;gt; theme.spacing('base')};
  font-size: ${({ theme }) =&amp;gt; theme.fontSize('base')};
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because the values are CSS variables and the root changes through real &lt;code&gt;@media&lt;/code&gt; rules, the browser resolves the breakpoint itself. Nothing is measured in JavaScript, so the server's HTML and the client's first render can't disagree about which breakpoint they are on.&lt;/p&gt;

&lt;p&gt;The global CSS goes in once, next to the theme provider:&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="kd"&gt;const&lt;/span&gt; &lt;span class="nc"&gt;RootStyle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;createGlobalStyle&lt;/span&gt;&lt;span class="sb"&gt;`
  ${({ theme }) =&amp;gt; theme.rootCss()}
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Rules that keep it honest
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The root is a percentage, never px.&lt;/strong&gt; &lt;code&gt;font-size: 18px&lt;/code&gt; on the root overrides the text size the user set in their browser (WCAG 1.4.4). &lt;code&gt;112.5%&lt;/code&gt; scales with it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The smallest screen is the reference.&lt;/strong&gt; It stays at 100%, and wider screens grow from there. A phone is held closer than a laptop, so body text shouldn't shrink on it. There is also a practical reason: iOS Safari zooms in when you focus an input with text under 16px.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Touch targets are the exception, and they stay in px.&lt;/strong&gt; &lt;code&gt;minTarget()&lt;/code&gt; is 24px for a mouse or trackpad and 44px when there's a touch input. A finger doesn't shrink with the type. It's meant as a floor: &lt;code&gt;min-block-size: max(${theme.minTarget()}, …)&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trade-off
&lt;/h2&gt;

&lt;p&gt;Everything scales by the same factor. A heading can't shrink more than body text does on a small screen. When one component genuinely needs a different size at some breakpoint, it picks a different step with a media query. It doesn't get a second scale:&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="kd"&gt;const&lt;/span&gt; &lt;span class="nc"&gt;Title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;h1&lt;/span&gt;&lt;span class="sb"&gt;`
  font-size: ${({ theme }) =&amp;gt; theme.fontSize('l')};

  ${({ theme }) =&amp;gt; theme.mq.greaterThan('desktop')`&lt;/span&gt;
    &lt;span class="n"&gt;font&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;${theme.fontSize('xl')}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="sb"&gt;`}
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The relation is still defined once. The exception is visible in the one component that needs it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install @pindakaasman/design-system styled-components@^6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The package is on &lt;a href="https://www.npmjs.com/package/@pindakaasman/design-system" rel="noopener noreferrer"&gt;npm&lt;/a&gt;, and the source is in &lt;a href="https://github.com/RamonGebben/mise/tree/main/packages/design-system" rel="noopener noreferrer"&gt;RamonGebben/mise&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>designsystem</category>
      <category>css</category>
      <category>typography</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Building a Custom Stream Deck for My D&amp;D Table: Solving Gamepad Integration with a Custom SDK</title>
      <dc:creator>Ramon Gebben</dc:creator>
      <pubDate>Tue, 01 Oct 2024 11:16:20 +0000</pubDate>
      <link>https://dev.to/ramongebben/building-a-custom-stream-deck-for-my-dd-table-solving-gamepad-integration-with-a-custom-sdk-5c2h</link>
      <guid>https://dev.to/ramongebben/building-a-custom-stream-deck-for-my-dd-table-solving-gamepad-integration-with-a-custom-sdk-5c2h</guid>
      <description>&lt;p&gt;As a passionate Dungeons &amp;amp; Dragons player and tech enthusiast, I decided to elevate my game setup by creating a custom coffee table that features an embedded screen. This table displays maps, tokens, plays sound effects, and even shows artwork for players. All of this runs through a powerful platform called &lt;a href="https://foundryvtt.com/" rel="noopener noreferrer"&gt;Foundry VTT&lt;/a&gt;, which is similar to Roll20 but with a better pricing model and an extensive open module system. It's perfect for customizing your tabletop experience.&lt;/p&gt;

&lt;p&gt;While exploring ways to enhance my setup, I noticed modules that allowed stream decks to be integrated with Foundry. These tools provide quick access to macros and commands, making gameplay even smoother. However, after seeing the price of a stream deck (200+ euros!), I wasn't ready to make that investment.&lt;/p&gt;

&lt;p&gt;Then I remembered something – a few years ago, I built an arcade machine. Though the machine has long since been dismantled, I still had the buttons and controller boards from the project. With a bit of creativity and a 3D printer, I made my own custom "stream deck" by printing a small box with slots for the buttons.&lt;/p&gt;

&lt;p&gt;Now I had the hardware ready, but integrating it with Foundry VTT presented a challenge. I wanted to use the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API" rel="noopener noreferrer"&gt;Gamepad API&lt;/a&gt; in the browser to register my button presses, but I was shocked by the lack of flexibility in how the API handled inputs. The default approach was to use a &lt;code&gt;while(true)&lt;/code&gt; loop to constantly poll for the pressed state of each button. While this works fine in a game loop using &lt;code&gt;requestAnimationFrame&lt;/code&gt;, for my purposes, it felt inefficient and frankly, stupid. I wanted to simply respond to button presses with event listeners, not constantly check the gamepad state in an endless loop.&lt;/p&gt;

&lt;p&gt;This led me to create the &lt;a href="https://github.com/RamonGebben/Gamepad-SDK" rel="noopener noreferrer"&gt;Gamepad SDK&lt;/a&gt; I'm sharing today.&lt;/p&gt;

&lt;p&gt;With this SDK, I simplified the process by allowing developers to add event listeners for button presses, releases, and axis changes directly – no polling required. It also includes support for connecting and disconnecting gamepads, which makes it easy to integrate with platforms like Foundry VTT or any browser-based project.&lt;/p&gt;

&lt;p&gt;By using this SDK, anyone can hook up their custom controller to a browser-based app without the hassle of manually checking gamepad states. For my D&amp;amp;D table, it now means I can seamlessly use my makeshift stream deck to control in-game macros, actions, and more – all thanks to a few buttons and a little code.&lt;/p&gt;

&lt;p&gt;If you're interested, check out the SDK, and feel free to reach out if you're looking to solve similar problems!&lt;/p&gt;

&lt;p&gt;The Github: &lt;a href="https://github.com/RamonGebben/Gamepad-SDK" rel="noopener noreferrer"&gt;https://github.com/RamonGebben/Gamepad-SDK&lt;/a&gt;&lt;br&gt;
NPM: &lt;a href="https://www.npmjs.com/package/@pindakaasman/gamepad-sdk" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/@pindakaasman/gamepad-sdk&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>gamedev</category>
      <category>dnd</category>
    </item>
    <item>
      <title>lock-your-pc.com: A page made for people that do not lock their PC's</title>
      <dc:creator>Ramon Gebben</dc:creator>
      <pubDate>Fri, 31 Jan 2020 12:48:10 +0000</pubDate>
      <link>https://dev.to/ramongebben/lock-your-pc-com-a-page-made-for-people-that-do-not-lock-their-pc-s-5epk</link>
      <guid>https://dev.to/ramongebben/lock-your-pc-com-a-page-made-for-people-that-do-not-lock-their-pc-s-5epk</guid>
      <description>&lt;p&gt;The last couple of weeks in the office I noticed more and more tardiness when it come to locking PC's.&lt;br&gt;
Since the "shock images" like tubgirl are fun and all you cannot have that being open when customers walk into the office.&lt;/p&gt;

&lt;p&gt;With this in mind I created &lt;a href="https://lock-your-pc.com" rel="noopener noreferrer"&gt;lock-your-pc.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Pop open this page on fullscreen to give tardy people a care.&lt;/p&gt;

</description>
      <category>privacy</category>
      <category>satire</category>
      <category>fun</category>
    </item>
  </channel>
</rss>
