69°F

Aaron Parecki

  • Articles
  • Notes
  • Photos
  • Pixel Art!

    January 21, 2018

    I just finished my IndieWebCamp hack day project, and I'm pretty excited about it!

    A long time ago, my website used to have this 7x7 grid of pixels on the home page, which visitors could toggle between blue and green. It saved the state after you'd click them, so you could leave little pictures for the rest of my website visitors. 

    I eventually abandoned that version of my site, and that feature disappeared as well. I decided that it would be fun to add it back to my current website today!

    So now, my home page has a similar section at the top with a little grid of pixels again!

    There were a few differences in my approach this time around. I decided to make the grid 20 pixels wide by 3 pixels tall, in order to reduce the chances of people being able to spell things or draw anything inappropriate. 

    I wanted the grid to be responsive as well, so that the cells shrink appropriately when the width of the column shrinks. I found this nice answer on StackOverflow, "Grid of Responsive Squares", which pointed me at a technique I hadn't know about, which is to use a percentage for the padding-bottom property. Each cell in my grid is calc(5% - 1px) wide, with padding-bottom: calc(5% - 1px) as well. This makes the height match the width, which is based on the relative size of the container.

    I also made the grid realtime! If you open the home page in two browsers, you'll see one browser update when you click a pixel in the other! I was able to do this without any complicated server-side support thanks to the nginx push-stream module that I already have installed. It lets a browser subscribe to an endpoint using the EventSource API, and then from my server I can send a POST request to the nginx module to broadcast data to anyone listening.

    Maybe my next project will be to get some Neopixels and make a little thing for my desk that always shows the current pattern!

    Baltimore, Maryland • 55°F
    Sun, Jan 21, 2018 2:11pm -05:00 #indiewebcamp #pixel #art #p3k
    2 likes 4 mentions
    • Johan Bové
    • Marty McGuire

    Other Mentions

    • Wouter Groeneveld brainbaking.com
      Cool Things People Do With Their Blogs
      Tue, Apr 26, 2022 7:00pm -05:00
    • Aaron Parecki aaronparecki.com
      First Quarter 2018 in Review
      Sun, Apr 1, 2018 4:42pm -07:00
    • Percolator percolator.today
      Episode 18: IndieWebCamp Baltimore
      Mon, Feb 5, 2018 7:00pm -05:00
    • Aaron Parecki aaronparecki.com
      Episode 18: IndieWebCamp Baltimore
      Tue, Feb 6, 2018 12:00am +00:00
Posted in /articles using quill.p3k.io

Hi, I'm Aaron Parecki, Director of Identity Standards at Okta, and co-founder of IndieWebCamp. I maintain oauth.net, write and consult about OAuth, and participate in the OAuth Working Group at the IETF. I also help people learn about video production and livestreaming. (detailed bio)

I've been tracking my location since 2008 and I wrote 100 songs in 100 days. I've spoken at conferences around the world about owning your data, OAuth, quantified self, and explained why R is a vowel. Read more.

  • Director of Identity Standards at Okta
  • IndieWebCamp Founder
  • OAuth WG Editor
  • OpenID Board Member

  • 🎥 YouTube Tutorials and Reviews
  • 🏠 We're building a triplex!
  • ⭐️ Life Stack
  • ⚙️ Home Automation
  • All
  • Articles
  • Bookmarks
  • Notes
  • Photos
  • Replies
  • Reviews
  • Trips
  • Videos
  • Contact
© 1999-2025 by Aaron Parecki. Powered by p3k. This site supports Webmention.
Except where otherwise noted, text content on this site is licensed under a Creative Commons Attribution 3.0 License.
IndieWebCamp Microformats Webmention W3C HTML5 Creative Commons
WeChat ID
aaronpk_tv