<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
  <channel>
    <title>#javascript posts — Ben Crowder</title>
    <link>https://bencrowder.net/blog/tag/javascript/</link>
    <atom:link href="https://bencrowder.net/blog/tag/javascript/feed/" rel="self" />
    <description>Feed for blog posts tagged with #javascript.</description>
    <lastBuildDate>Sat, 04 Apr 2026 05:22:16 GMT</lastBuildDate>
    <language>en-US</language>
    <generator>https://bencrowder.net/</generator>

    <item>
      <title>Some dinky pixel art experiments, exploring what it looks like when you add texture and make them lo...</title>
      <link>https://bencrowder.net/blog/2023/1504/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2023/1504/</guid>
      <pubDate>Fri, 21 Apr 2023 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<p>Some dinky pixel art experiments, exploring what it looks like when you add texture and make them look kind of like mosaic tiles. (I’m sure someone else has already done this, but I haven’t, so here we are.) Also, this isn’t great pixel art, just to be clear.</p>
<p><figure>
        <img src="https://cdn.bencrowder.net/blog/2023/04/pixeltest-a.jpg" alt="pixeltest-a.jpg" title="pixeltest-a.jpg" />
        
      </figure></p>
<p>For this first experiment, I made the squares in Figma and set the colors there, which was pretty laborious. Exported to SVG and added turbulence/displacement filters to get some variation. When exporting to PNG via Inkscape, I ran into the perennial issue where the filters sometimes only work on the top and left sides of the shape. (Someday I’ll figure out what’s going on there, since the filters look fine in Finder via Quick Look. In this case, from a distance, it still kind of looks okay.) Finally, I added some textures in Affinity Photo with opacity set to around 20% and blend mode set to soft light or overlay.</p>
<p><figure>
        <img src="https://cdn.bencrowder.net/blog/2023/04/pixeltest-b.jpg" alt="pixeltest-b.jpg" title="pixeltest-b.jpg" />
        
      </figure></p>
<p>Second experiment: making things easier. I made a 48x48 image in Procreate Pocket on my phone and painted the scene using the oil paint brush. (Which is why the eyes are crazy and there isn’t a ton of definition on the characters. Like I said, not great pixel art.) I then wrote a quick command-line script (JS/Node) to take a PNG and export an SVG where each pixel of the PNG is a <code>&amp;lt;rect&amp;gt;</code> in SVG. Way faster than making the squares in Figma. The script shrinks each square a little and adds some jitter to the points as well. And I changed the background color to be more ground-like. Exported to PNG and textured as in the first experiment.</p>
<p>Some ideas for future exploration:</p>
<ul>
<li>More subdivision on the tiles, for a little more geometric variety</li>
<li>Programmatically export masks from the SVG so that each tile can look more different from its neighbors, texturally (a masked tile would be next to an unmasked one, basically, with some randomness thrown in)</li>
<li>Rounding the edges of the tiles a little</li>
<li>Rendering the tiles in Blender (either with heightfields or by generating actual geometry with Python), ideally with some procedural texturing</li>
</ul>
<p>Anyway, a fun afternoon diversion.</p><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20Some dinky pixel art experiments, exploring what it looks like when you add texture and make them lo...">Reply via email</a></p>]]></description>
    </item>
    <item>
      <title>Dot grid paper</title>
      <link>https://bencrowder.net/blog/2023/dot-grid-paper/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2023/dot-grid-paper/</guid>
      <pubDate>Mon, 27 Feb 2023 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<p>I’ve added <a href="https://bencrowder.net/note-paper/#dot-grid">dot grid paper</a> to the note paper page, in a handful of sizes:</p>
<p><figure class="border">
        <a href="https://bencrowder.net/note-paper/#dot-grid"><img src="https://cdn.bencrowder.net/images/projects/note-paper/dot-grid-paper-0.1in.png" alt="A grid made up of dots" title="A grid made up of dots" /></a>
        
      </figure></p>
<p>Colophon: I made these with JavaScript/Node, generating SVGs that I then converted into PDFs with Inkscape.</p><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20Dot grid paper">Reply via email</a></p>]]></description>
    </item>
    <item>
      <title>Links #46</title>
      <link>https://bencrowder.net/blog/2021/links-46/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2021/links-46/</guid>
      <pubDate>Sat, 07 Aug 2021 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<p><a href="https://www.google.com/welltemperedtraveler/">Google’s Well-Tempered Traveler</a>. Love this. Baghdad in July, though — whew.</p>
<p><a href="https://medium.com/young-coder/the-future-web-will-canvas-rendering-replace-the-dom-847be872884c">Matthew MacDonald on whether Canvas rendering might replace the DOM</a>. I like Canvas a lot, but I hope this potential future is far from the timeline we’re living in.</p>
<p><a href="https://astro.build/blog/introducing-astro">Astro is an intriguing newish static site builder</a>.</p>
<p><a href="https://macwright.com/2020/10/28/if-not-spas.html">Tom MacWright on alternatives to SPAs</a>, also in a similar vein. I need to look more into the projects he links to.</p>
<p><a href="https://timdaub.github.io/2021/01/16/web-principles/">Tim Daub on how he builds JavaScript apps in 2021</a>, which I suppose is also in a similar vein. Sensing a theme here. (And much of this resonated with me. The more minimal the build process, for example, the happier I am.)</p><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20Links #46">Reply via email</a></p>]]></description>
    </item>
    <item>
      <title>I seem to have forgotten how to blog. (Actual blogging, as opposed to merely linking to new art.) In...</title>
      <link>https://bencrowder.net/blog/2021/1238/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2021/1238/</guid>
      <pubDate>Fri, 30 Jul 2021 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<p>I seem to have forgotten how to blog. (Actual blogging, as opposed to merely linking to new art.) In an attempt to get back on the saddle again:</p>
<p>Outside of art, my project time lately has primarily been swallowed up by some internal tooling changes. I <a href="https://bencrowder.net/blog/2021/1223/">alluded to this</a> back in June, though the plan changed along the way. Rather than merging all those apps into one behemoth conglomerate, I decided it would be better (along at least a few axes) to follow the Unix philosophy and stick with smaller tools that do one thing well. Which conveniently lines up with the set of tools I’ve already built. Fancy that.</p>
<p>Arc is (was) my notes app, written using FastAPI. I wanted an app that felt more a wiki, and I wanted to move it to Django (easier to maintain, considering most of my other tools are also in Django). And I didn’t really like the name anymore. Thus Codex was born. Heretically, I built it using hardly any JavaScript — just a bit for keyboard shortcuts and another bit for the autosuggest when linking to another page. Everything else uses plain old HTML forms.</p>
<p>In fact, it was so liberating and fun that I plowed onward and decided to ditch Vinci (my internal blog/notebook app) and build a new app, Leaf, using the same technique; the only JS it uses is for keyboard shortcuts. It’s simpler, easier to maintain (I think? it’s still early on), and in a way it feels more in line with the grain of the web.</p>
<p>One other thing I did differently with both apps was to wait to write any CSS until after the functionality was all in place. It was disconcerting and delightful, building something with bare browser styles, and it certainly helped me focus on functionality first rather than getting distracted by layout.</p>
<p>Conclusion: while I doubt I would ever build apps at work this way, this old-school mode was invigorating and absolutely worth it for these personal projects.</p><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20I seem to have forgotten how to blog. (Actual blogging, as opposed to merely linking to new art.) In...">Reply via email</a></p>]]></description>
    </item>
    <item>
      <title>Introducing Cirque</title>
      <link>https://bencrowder.net/blog/2020/introducing-cirque/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2020/introducing-cirque/</guid>
      <pubDate>Thu, 05 Nov 2020 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<p>As schoolwork starts to wind down, I’m finally starting to make progress on the creativity tools and HCI explorations I talked about <a href="https://bencrowder.net/blog/2020/1001/">back in September</a>. This week I’ve also realized that graphical tools for art and design are what I want to focus most on. (I do still intend to explore textual interfaces, but they’re on the backburner for now.)</p>
<p>In the spirit of working in public, then, <a href="https://bencrowder.net/cirque/">Cirque</a> is a small WIP web app I’m building for making patterns via circle packing:</p>
<p><figure>
        <img src="https://cdn.bencrowder.net/blog/2020/11/cirque-01.png" alt="cirque-01.png" title="cirque-01.png" />
        
      </figure></p>
<p><figure>
        <img src="https://cdn.bencrowder.net/blog/2020/11/cirque-02.png" alt="cirque-02.png" title="cirque-02.png" />
        
      </figure></p>
<p><figure>
        <img src="https://cdn.bencrowder.net/blog/2020/11/cirque-03.png" alt="cirque-03.png" title="cirque-03.png" />
        
      </figure></p>
<p><figure>
        <img src="https://cdn.bencrowder.net/blog/2020/11/cirque-04.png" alt="cirque-04.png" title="cirque-04.png" />
        
      </figure></p>
<p>This is very much a rough initial MVP. You can tweak some settings, generate new patterns using a simple circle-packing algorithm, and export SVG (with the turbulence/displacement filters enabled by default), but that’s it. Some of the features I’m planning to build next:</p>
<ul>
<li>Replace the settings text box with, you know, good UI (I’m also excited to explore color picker design here)</li>
<li>Add the ability to manually place both circles and anticircles (so artists are able to create intentional negative space)</li>
<li>Add a way to programmatically set the circle colors (probably via something like shaders, so you could say all circles smaller than a certain size get one color and the rest get another, or circle color is dependent on position or something else)</li>
</ul>
<p>I’ve also thought about moving the circle packing code from JavaScript to Rust, to be able to play around with WebAssembly, but it seems overkill, at least at this point. (Instead I think I’ll plan to Rust and WebAssembly on the graphical type design tool I want to build.)</p><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20Introducing Cirque">Reply via email</a></p>]]></description>
    </item>
    <item>
      <title>Links #17</title>
      <link>https://bencrowder.net/blog/2020/links-17/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2020/links-17/</guid>
      <pubDate>Fri, 18 Sep 2020 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<ul>
<li><a href="https://www.bryanbraun.com/2019/11/02/music-box-fun/">Bryan Braun on his Music Box Fun project</a> — quite enjoyed this (and it makes me want to make something similar, which is always a good sign)</li>
<li><a href="https://dougbelshaw.com/blog/2020/09/15/working-out-loud/">Doug Belshaw on working in public</a> — great thoughts</li>
<li><a href="https://mango.pdf.zone/finding-former-australian-prime-minister-tony-abbotts-passport-number-on-instagram">Alex Hope on finding Tony Abbott’s passport number on Instagram</a> — a long read but oh is it hilarious and delightful</li>
<li><a href="https://justinehsmith.substack.com/p/the-internet-is-not-what-you-think">Justin E. H. Smith on the philosophy of the Internet</a> — fascinating throughout</li>
<li><a href="https://www.bryanbraun.com/2020/08/31/how-searching-for-a-bundle-free-react-led-me-to-web-components/">Bryan Braun (again) on web components</a> — the past few years I’ve avoided frontend dev (I’m allergic to unnecessary stack complexity), but this post gives me hope</li>
</ul><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20Links #17">Reply via email</a></p>]]></description>
    </item>
    <item>
      <title>Links #6</title>
      <link>https://bencrowder.net/blog/2020/links-6/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2020/links-6/</guid>
      <pubDate>Thu, 20 Aug 2020 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<ul>
<li><a href="https://kottke.org/20/08/researchers-can-duplicate-keys-from-the-sounds-they-make-in-locks">Kottke on duplicating keys from the sound they make in locks</a> — freaky but also a fascinating area of research</li>
<li><a href="https://gomakethings.com/series/service-workers/">Chris Ferdinandi’s tutorial on service workers in vanilla JavaScript</a> — I’ve been thinking lately of going more vanilla, less jQuery (yes, I know, I am old and outdated, but I am still a minimalist)</li>
<li><a href="https://nabeelqu.co/education">Nabeel Qureshi on how video games are the future of education</a> — and how to make learning stick; I’m thinking about exploring this space more</li>
<li><a href="https://12factor.net/">The Twelve-Factor App</a> — I recently reread this, good set of software engineering principles</li>
<li><a href="https://birthmoviesdeath.com/2013/12/11/hulks-screenwriting-101-excerpt-the-myth-of-3-act-structure">Film Crit Hulk on the myth of three-act structure</a> — found this useful (with some strong language, which wasn’t as useful)</li>
</ul><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20Links #6">Reply via email</a></p>]]></description>
    </item>
    <item>
      <title>Alphabet app</title>
      <link>https://bencrowder.net/blog/2013/alphabet-app/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2013/alphabet-app/</guid>
      <pubDate>Thu, 28 Feb 2013 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<p>Our toddler loves looking at letters and saying their names. A while ago we printed the alphabet out onto cardstock and have been using that with her, which is great, but I’ve also wanted to write a small web app that does the same thing — mostly for when we’re in another room, but also to make the randomization a little better. And because I can’t seem to stop writing little apps.</p>
<p>So this morning I threw together <a href="https://bencrowder.net/coding/alphabet/">Alphabet</a>:</p>
<figure><a href="https://bencrowder.net/coding/alphabet/"><img src="https://cdn.bencrowder.net/images/2013/02/Alphabet-800.png" alt="" /></a></figure>
<p>Super simple. Click, tap, or hit a key to move to the next letter. It works on phones and tablets as well.</p><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20Alphabet app">Reply via email</a></p>]]></description>
    </item>
    <item>
      <title>Botswana 2.0</title>
      <link>https://bencrowder.net/blog/2013/botswana-2/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2013/botswana-2/</guid>
      <pubDate>Mon, 14 Jan 2013 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<p>Two years ago my friend Chad and I released <a href="https://bencrowder.net/coding/2011/botswana/">Botswana</a>, a browser-based arena game with programmable bots written in JavaScript.</p>
<p>But the original was kind of boring. So we tweaked the game mechanics a bit and made a number of other modifications (multiple bots per team, extensible rulesets, etc.). And now we present <a href="https://bencrowder.net/coding/botswana/">Botswana 2.0</a>, a culmination of rampant nerdiness.</p>
<figure><a href="https://cdn.bencrowder.net/images/2013/01/botswana-01.png" rel="shadowbox"><img src="https://cdn.bencrowder.net/images/2013/01/botswana-01-630.png" alt="" /></a></figure>
<p>The thing that interests me most about the game now is the customizable rulesets. For example, it took all of ten minutes to change the game so it’s played on a series of conveyor belts that move the bots up and down:</p>
<figure><a href="https://cdn.bencrowder.net/images/2013/01/botswana-02.png" rel="shadowbox"><img src="https://cdn.bencrowder.net/images/2013/01/botswana-02-630.png" alt="" /></a></figure>
<p>It likewise took less than half an hour to make the bots orbit the Death Star instead:</p>
<figure><a href="https://cdn.bencrowder.net/images/2013/01/botswana-03.png" rel="shadowbox"><img src="https://cdn.bencrowder.net/images/2013/01/botswana-03-630.png" alt="" /></a></figure>
<p>Since the drawing code is part of the ruleset, it’s fairly easy to get a radically different look:</p>
<figure><a href="https://cdn.bencrowder.net/images/2013/01/botswana-04.png" rel="shadowbox"><img src="https://cdn.bencrowder.net/images/2013/01/botswana-04-630.png" alt="" /></a></figure>
<p>Switching between the rulesets is just a matter of changing the URL in the ruleset box and starting a new tournament.</p>
<p>Anyway, as before, the release is on <a href="http://github.com/bencrowder/botswana">GitHub</a>, with a README that explains how to write bots and customize rulesets and stuff.</p><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20Botswana 2.0">Reply via email</a></p>]]></description>
    </item>
    <item>
      <title>Javascript name box</title>
      <link>https://bencrowder.net/blog/2011/javascript-name-box/</link>
      <guid isPermaLink="true">https://bencrowder.net/blog/2011/javascript-name-box/</guid>
      <pubDate>Fri, 30 Sep 2011 12:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Ben Crowder]]></dc:creator>
      <description><![CDATA[<p>In genealogy web apps, I kind of like consolidating name fields into a single textbox. Simpler is better. But then you run into the problem of distinguishing the surname from the rest of the name — because of surnames like “Gutierrez Sanchez,” you can’t just assume the surname is the last word in the string.</p>
<p>I’ve been thinking for a while about a clean way to deal with this (as well as giving a nice visual indication of the surname instead of just slashes), and here’s what I’ve got so far, which I’m dubbing (rather unimaginatively) the <a href="https://bencrowder.net/sandbox/namebox/">Javascript name box</a>:</p>
<figure><a href="https://bencrowder.net/sandbox/namebox/"><img src="https://cdn.bencrowder.net/images/2011/09/JavascriptNameBox1-580.jpg" alt="" /></a></figure>
<p>When you click on the name, it becomes editable:</p>
<figure><a href="https://cdn.bencrowder.net/images/2011/09/JavascriptNameBox2.jpg" rel="shadowbox"><img src="https://cdn.bencrowder.net/images/2011/09/JavascriptNameBox2-580.jpg" alt="" /></a></figure>
<h3>How it works</h3>
<p>Basically, you give it an <code>input.namebox</code> element and it creates a corresponding <code>div</code> tag for displaying the highlighted surname. It then flips back and forth between the <code>input</code> and the <code>div</code>, parsing the name field and changing the highlight appropriately.</p>
<h3>Live demo</h3>
<p><a href="https://bencrowder.net/sandbox/namebox/">Javascript name box</a></p><hr class="feed-extra" style="margin-top: 48pt;" /><p class="feed-extra feed-mail"><a href="mailto:ben.crowder@gmail.com?subject=Re%3A%20Javascript name box">Reply via email</a></p>]]></description>
    </item>
    
  </channel>
</rss>
