We speak with Niels Leenheer about playful browser experiments, strange hardware, and why the web is still a great runtime for doing things it was never really designed for. After a short recap of …
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
Ich denke nicht, es ist ein Dutch Ding, aber ja, Fazilis kind of infects mich mit dem Klox. Ja, und ich habe einen Flamethrower als auch. Ja, das du hast auf stage, für obvious reasons. So, irgendwie, da gibt es Probleme mit insurance, ich denke. Ja, die Germans sind so funnend. Ja, ja.
Wir haben heute eine besondere Episode, weil wir nämlich einen nicht-deutschsprachigen Gast haben und darum werden wir jetzt direkt ins Englische wechseln. Hello and welcome to the Working Draft Podcast. We are three folks today from the team. There's Hans. Hello, Hans. Hello. Then there's me, Shep. And that means that we have a guest. And that's Nils Lienher. Hello, Nils. Hi there. Hi, Nils. Thanks for joining. Thanks for being here.
So you've been a guest on our podcast twice already, but that's like really long time ago. Der erste Mal war 10 Jahre, wo wir über Open Device Labs und mit Browsers gesprochen haben. Der zweite Mal war 8 Jahre, wo wir über Web Bluetooth und Web USB gesprochen haben. Ich denke, dass die meisten unserer listeners nicht wissen oder nicht kennen Sie. So, ja, vielleicht können Sie sich einfach als wenn Sie hier für den ersten Mal waren.
All right. So, hi, ich bin Niels Linger und ich bin ein Web Developer von den Niederlanden. As a day job, I build software for hair salons, like appointment booking software and point-of-sale systems. And it's all based on the web because I just love the web. I've been playing with the web since 1993, playing with web standards and new technologies online.
Ja, so people might know you from the html5test.com website, which you built. So, as you said, you were interested in all kinds of APIs and things that the browser offers. And at a certain point in time, you just decided to write a big test suit that tests for all kinds of features. And browsers would score like I think,
on a scale of 100 or something or no, it was just an open scale Yeah, it was kind of like a growing scale, it started with 100 and ended up well, 555 because, HTML5 Yeah, it was kind of like a fun product for a while nowadays it's kind of obsolete and I don't maintain it anymore because html5 is well html5 was a success everybody uses
it and and when i started it it was kind of still in an area an era where html5 was the future and and i was trying to get browsers to implement the new features and adding a little bit of gamification just just helped, because browsers wanted to score high on the test so they implemented features that they. Didn't plan on implementing.
In some cases, even browser vendors started directing more resources to the team to implement HTML5 features. But that's not the case anymore. It's just looking back seeing all those standards looking back, On the test and some of them didn't make it. Some of them haven't changed so much since then. So it's not that useful anymore.
No, but it really did its job back then. So it really motivated the browser makers. And it was also a good tool to like check if something is supported on a browser. Because I think back in the days we didn't have like all these platforms like Can I Use and MDN, the compatibility data stuff. So yeah, that was really cool. Es hat ihre Mission erfüllt. Ja, und als ich bereits erwähnt, die anderen zwei Visiten, die du mit uns waren, waren auch über die Differences in Browsers und auch neue
APIs wie Web Bluetooth und Web USB, which are still kind of unusual nowadays. Mostly, I guess, because people don't have that many use cases and also not all browsers implement them. So that's kind of an evergreen episode that we will link to in our show notes for our listeners to listen to as well. And last time we met was two weeks ago in Dusseldorf at the Beyond Telerand
conference, which we all three used to attend every year, I'd say. So we're always returning because it's such a fantastic conference. So maybe we can do a little recap of our impressions from the conference. And then we'll also talk about tinkering in the browser because you, Niels, you gave a talk. You were in the lineup of Beyond Tellerant and you gave a really,
really nice talk on the first day about all kinds of tinkering. So that's the plan. All right. I think this game that you show, like CSS-based Doom playing, that's definitely something I look forward and learning more about because that was awesome. But we will come to that in a second. So for me, I had a little break a couple of years ago, not attending Beyond for, let's say, two years or so.
But I have been there now for a couple of events. And for me, it's always this, Meeting people, we always talked about this before the conference as well. You meet a lot of people that you know. It's like the class trip, the yearly one to Düsseldorf where everybody meets. But I got the sentiment this time that lots of people that I talked to in mind, industry is currently a little bit flat, not too much investment happening.
And some people were a little bit like, yeah, kind of how do you say it, like depressed, kind of a bit depressed depressed, yeah did you have that feeling as well? I yeah. Not just at Beyond Talent but basically every conference I go to lately, it's been about AI and about how AI,
can be a good thing for an industry but also a very I'm not going to say a danger to the industry but it's going to complicate our lives, with a lot of slop somehow, it kind of makes us feel like we're not really um so i don't know how to put it it it feels like like we have less worth as developers because we can
just let the client ask ai to to build something and and where does that leave us as as developers or designers and and that kind of is like always in the back of my mind when i go to these conferences and i think, with a lot of other people as well. Yeah, definitely. I mean, let's not dig into that whole, like, what AI does to our jobs, right? Yeah, it definitely changes a lot, and you can see it in the industry, obviously.
I found it interesting to hear so many, like, the negative sentiments about AI in general, right? But I think it's because we come from this point where software engineers were the ones that were, you know, the holy cow somehow, right? And everybody wanted to have the best developers and hiring was hard and so on and so forth. And now the market has turned, the view has shifted from the companies. But what I found interesting, Oliver Reichenstein, he put it in the first,
I think it was the first talk on the first day, where he talked about his IA writer, a minimalistic tool and how AI development has helped him to grow his tool not by using AI to work on it but rather people trying to do the exact same product and then clients don't buy these let's say copy products, copycats but they rather come back to the original tool and buy that one and
I heard this story not once aber auch eine andere Person hat mich über das, dass sie die gleichen Erfahrungen haben. Und ich fand das sehr interessant, weil das zeigt, was die andere Seite ist. Wenn es zu AI-engineering ist. Ja, ich denke, die andere Grund, warum es ein Thema ist, dass bei Beyond Tellerrandt viele Leute haben, und die Kreative professions sind auch unter Menace von AI.
But my point of view is that sure you can use AI but like if you want to like the really cool stuff, you still like the things that were shown on stage are things that are kind of that you don't get when you ask AI you get like nice mainstream stuff but that's also the nice thing about Beyond Telerand that it's totally not mainstream so it's the least mainstream tech conference that I know where there's always folks and
presentations on stage that blow your mind with things that are being done and shown that you would not see at any other conference in the world, I'd say. And it's a nice mix between creativity and technology. So there's creative conferences where you have a lot of creative folks, but Und dann gibt es tech-konferenz, aber das Mix ist wirklich unique, ich würde sagen, oder almost unique. So, ich denke, da sind ein paar andere, vielleicht FITC in Canada,
und dann Half-Stack-Conferenz kind of, vielleicht. Ja, maybe. Ja, ich kann auch sprechen, Niels. Ja. So, es war so gut zu sehen, diese Talks zu werden, zu werden, zu sehen, was Leute kommen mit. On der ersten day, Niels, du blew all, Ja. Auf der zweiten Tag war André Michel, der mit einem Digital Signal Prozessor oder Digital Signal Processing SDK,
das erbaut, in der Browser, das jeder kann, um Produkte zu bauen. Und er hat sich alle möglichen Worte, um es zu prächtigen, und sie waren alle fantastisch. And at the end, there was even Bastian Allgeier, the creator of the Kirby CMS, that volunteered to come on stage with an electric guitar that was connected to André's computer. And then he did live effects, and that was just a great opening of the day.
And then later, there was James White, someone that I've seen once at FITC in Amsterdam, and that I love the art. Er macht 80s Synthwave-style illustrations und er ließ die alten 80s comics und He-Man und was wir noch hatten. Er macht eine fantastische Präsentation, performance-wise. Und so,
ja, er macht mir mein Herz auch. Ja, aber als ich gesagt habe, du hast eine Präsentation und nicht nur eine Präsentation. Es war wirklich, wirklich, wirklich cool, weil du bist auf deinem recenten Tinkeringen hast, dass du bei Hause auf all kinds of weirden Dinge und auch Dinge, dass du nicht, wahrscheinlich nicht connect mit Browser und computers,
oder vielleicht computers, aber nicht mit Browsers. So, ja. Wir thought wir können über Ihre Projekte und auch Ihre Weise zu. Und ich denke, du hast die Gespräche mit einem Klok. So, du bist ein Klok-Nerd, das vielleicht von Vasilis von Gehmann ist auch ein Klok-Nerd.
Vielleicht die Dutch Leute sind alle Klok-Nerd, ich weiß. Ich denke, es ist ein Deutsch-Nerd. But yeah, Fazilis kind of infected me with building clocks. A while ago, he built this gradient clock on a Raspberry Pi with a touchscreen and I loved that so much that I wanted to build a clock myself as well. But one of the things his clock had was a square screen and I think clocks should be round. I went looking for a round touchscreen and,
Well, you can buy one. That's not an issue. So I bought one at Raspberry Pi and I got Chrome working on it without the browser UI. So it's running full screen. And then I started building a clock and then I thought, well, this is boring. Well, maybe I can already ask a question. So you said it's easy to get a round touchscreen. So for me, it would be like, I don't know, Where would I look for around Touchscreen?
Would I find it on Amazon? Yeah, probably. Amazon or just like any of the major electronics companies. I think I bought one on AliExpress, which is... Yeah. Then it takes a couple of weeks to get there and it just works. So the screen I had you can you can basically bolt a Raspberry Pi on the back of it, and it's it's done it's like a full computer and you can run Chrome on it and
you can basically do anything with it, so the browser is basically the enabler for like the runtime where you can do anything like you don't know you could build native applications as well but but yeah I built everything in the web so So the first thing I did was just run Chrome on it. Or you could go in Firefox on it, whatever. And then you can build whatever you want. For me, that was a clock. And...
Well, the thing I started out with was that I wanted just to build a clock, but that's not that much of a challenge. And I started thinking, what can I do with this clock? And all kinds of just ideas popped up. And in the end, it turned into a clock that doesn't tell the time. It kind of refuses to tell the correct time. So it's a stubborn clock. Yeah, a stubborn clock, a bad clock.
One of the things it does, for example, if you have summertime or wintertime, it just doesn't understand that. And it will change the time for you, but maybe in the wrong direction. And sometimes it will just forget to reset the clock at midnight. So we'll start, continue counting, like 24, 25, 26, 27, and so on. And there's all kinds of just little quirks that makes it really difficult to tell the time.
Und wie Sie kommen mit diesen? Ist es unter der shower? Oder wenn es summertime und es Zeit für die clocks, Sie sind like, oh, wait, das ist ein schönes Ding. Basically, ich habe es über die letzten zwei Jahre oder so, vielleicht eine Jahr und ein halb. Und every time ich komme mit etwas, das ich denke, ist weird und counterintuitive, I put it in the clock and one
of the last projects I did was. Add gravity to the clock so whatever you see on screen, like the hands of the clock, you usually just draw that but what I did is basically put the hands into a full box 2D gravity simulation with motors that run the clock and And it's way too complicated for just a clock. But then you can do fun stuff like use a touchscreen to flick the hands and
they move around the pivot point of the clock. And if you shake the clock, there's an accelerometer that picks up the position of the clock in space. And if you shake it, it detects that. And then the hands drop down. And if you flick the hands too hard, they just launch into the edges of the screen and bounce off and fall on the
floor and all kinds of stuff like that, which is totally not useful. But it's so much fun to play with and so much fun to create. And that is kind of the thing with my projects is that I just want to have fun with these projects, with the web, with web technology. Und just making something that is totally ridiculous, is so much fun yeah and i think it's these small things that really draw
the attention to a project like this right if you would have just shown on stage yeah this is a clock i did it with some stuff whatever right people wouldn't care too much but it's because of like effects like you can just like push away one of the hands that's that's, really cool I wonder, you mentioned a couple of things when it comes to technology, but how do you set up a project like this? You've got the Chrome running, okay. But then really, are you using libraries for that?
Well, I did use a library for the Gravity. It's like a JavaScript clone of Box2D, which basically you can set up motors and, gravity and it'll just push out all the coordinates that you need to draw on screen and, but other than that it's just custom code that, basically the hands are just in this case SVG.
And they are positions using CSS and it's not, Es ist einfach nur ein HTML-File mit ein JavaScript und das ist es. So, wenn ich auf die Clockwerke arbeite, ich kind of mache es alt-Style. Ich SSH in die Clockwerke und dann writee meine Code auf die Clockwerke. Und es hat einen kleinen Web-Server, das dann die HTML zu den Browser.
And I can just refresh the page and the new updated clock runs. So it's really a hobby project. And it's designed to... The development really feels like you're... In a laboratory. Yeah, laboratory. Yeah. It's not anything you would use in a professional environment. No. So you have no CI, CD pipeline that runs on every push and these kind of things.
No, it's just me and HTML and JavaScript. I totally understand this for the clock, right? Okay, you can manage it that way. Probably just have it wired together in some form or another and then it needs to load kind of fast and react. But you also have other projects where, from what I've seen, like the lasers, for example, or the auxilator, I think it's called,
these seem a little bit more complex. Is that correct? Yeah. Well, one of the projects I showed at Beyond Telerant was using CSS and SVG to draw images on a 1980s oscilloscope. Und das begann mit meinem obsessionen mit clocks, weil ich wollte ein clocken mit Glasern machen.
Aber ich habe einen Laser Projector. Und sie sind sehr expensive. So ich habe gedacht, als ein Geek das into Elektronik 20 Jahre alt, So I've always wanted to have an oscilloscope. And I figured, well, that kind of works in the same way. It doesn't. But on a very basic level, it kind of works in the same way. You have like in an oscilloscope, you have this electron beam that you can steer around.
And I figured I could probably connect that to the web on some level. And then I can draw shapes. and if I can draw shapes, I can draw a clock and, the aesthetic of having a clock on an oscilloscope is like 1980s lab equipment, that is I love that, it makes you feel like you're in the lab of a math professor and. It's not very energy efficient to use as a clock and there are other reasons
why you don't want to have it running continuously but yeah, I just started playing with it in also a very basic way to just generate a signal that the oscilloscope can pick up. So what is an oscilloscope? So an oscilloscope is basically an equipment, it's like lab equipment that you can use to visualize signals.
Either analog signals like audio oder digital signals. It's like an instrument with a lot of knobs and things and then there's a kind of cathode ray tube. You have a CRT tube in there that shoots an electron beam and. So you have so for example the most if people are familiar with this kind of technology.
Probably you've seen something like a heart rate monitor where you see the ECG wave on the screen. It looks like that. And you can use it for that as well. But it's really just for visualizing any electrical signal. So you use it a lot in electronics to measure things and see the output of components and stuff like that.
So what I am using it for is totally ridiculous because nobody wants to see a clock on an oscilloscope. That's not what they're for. But I figured that from a web page you can basically generate a signal that the oscilloscope can understand. Und du kannst Web Audio für das. Mit Web Audio, du hast ein left-channel und ein right-channel.
Wenn du ein Signal für den left-channel und ein Signal für den right-channel, du kannst das direkt in die oscilloskop und stehre den beam auf den x- und y-axis. So du hast eine Channel zu eine Axis Ja, das war der Anfang der Idee. Und dann Math got involved und ich hatte eine whole refresher course auf mein High School Math.
Und ich habe basically gebaut etwas, dass man kann eine Arbitrary-Signal- und Output es zu den Oszilloskopen. Und ich habe das mit SVG und CSS. So you can basically draw shapes using SVG, like the clock face and hands. You can animate them using CSS. And then every, say, 25 or 30 times a second, you sample the geometry of the
shapes. There's APIs for that. And you turn that into an audio wave. And that audio wave is directed to the oscilloscope. And then you get a picture on the screen. Yeah, nice. And technology-wise, it's actually really, really simple because the core wave generation is maybe like 10 or 15 lines of JavaScript code.
I guess the most complicated part was really doing the math of decomposing the current SVG and CSS und das in die. Well, not even that. That's also not really that difficult because there's APIs for... Well, if you inject SVG in a DOM, you can basically use an API to get all the elements.
And for every element, you get the length of the path. There's an API for that. And then you determine, oh, I have this length. Then I should sample the path this many times to get a reasonable approximation of the shape. And then you call an API, get point at length, and they get the X and the Y coordinates of the shape at that length of the path.
So it's not that difficult. The only difficult part is that in the DOM, you can have CSS Transforms. Und das sind nicht in der GetPoint-Length-Output. Ja, so die Element ist immer auf der Startung Position. Ja. Du musst die Transformation Matrixen und dann machen die Mathen, um die actualen Punkte zu bekommen. Aber das war nicht wirklich die Hard Part.
In its core, das Projekt ist nicht so schwierig. Mm-hmm it's it's uh that's maybe also something where like ai can can like kind of help like uh if if you're if you need to like hey how can i like get the matrices and how can i like do i need to like multiply my coordinates to get like the real ones i guess so i i would probably, give it a try yeah you can probably do that it's,
all web APIs that are not really new, it's been there for years so AI probably knows a lot about how to do that. The only problem I had I did use AI for a couple of things, not this one but for example if you build the clock, that weird clock that I talked about Wenn man die AI zu ermöglichen, wie ein neues Quark oder so,
That works, but it also sees all the errors you made, the deliberate errors you made because you want the clock to be weird and not show the time. But it'll just fix that for you. And then you have a working clock again and you don't want that. Yeah, yeah. Yeah, yeah, sure. AI always tries to do things the right way, in quotes. And yeah, the projects I do are not how you should do things.
It's not the right way. It's just me having fun and using technology in a different way than you expect. And using AI for that is a challenge. And for some of the things, I don't mind using AI. But for a lot of the joy I get out of these projects is just coding myself. Yep. Das ist also where you learn most, I'd say.
And of course if I don't understand something about, I want to achieve a certain goal I know where I want to go that's the important part but I don't know quite how to get there. Then you can ask AI, sure. And it'll maybe offer a solution for you and then you can just build it yourself again. Ja, das ist immer so. Es ist wie mit diesen Puzzles, wo man manchmal auch Hinten bekommt. Das ist auch wie ich sie benutze.
Wie ich mir ein Hinten kann, wie ich das approache. Und dann sagt es, ja, das ist wie ich es. Und dann habe ich über und recherchieren und versuchen Dinge. Ja. Probably, that's how smart people do it. You know, ask for, do the job. But speaking of lights and lasers, so you also, I think you also had like these
DMX lights on stage that you controlled with the browser, if I remember correctly, right? That's correct, yeah. Yeah, one of the things I wanted to do, maybe like for the last 10 years already. So back in 2018, when I was on, I talked about controlling lights using Bluetooth. And it kind of evolved from that. I wanted to control lights, like not small light bulbs or anything,
but really big, big stage lights. And the protocol you use for that is dmx which is like a 1980s protocol and and uh it's it's relatively simple it's it's basically you have like this array of 512 values and and like light uses maybe three out of that that big array uh like for red green and blue and that that big The big array is shared among all the lights,
and it gets sent out every 40 times a second. And every light picks up its part of that array and then changes the light based on the values it sees. There is basically a USB to DMX dongle that you can use. And, well, if it's a USB device, you can use WebUSB for that. So what I did is build a driver that translates a JavaScript array of 512 bytes,
into packets that are being sent to the DMX controller. Then when you change the value in the Java cryptor, light changes. And. In its core, it's also very simple. It's not more than like 20 lines of code to do that. But I think the hard part is maybe the driver then in that case. So that sounds like a not web-based thing?
It's not a web-based thing, but the driver is also just JavaScript code. You have to take the input that array and then write packets, USB packets to the controller and use web USB for that. Okay, so basically it's like a converter more than a drive. It's not a device driver. oder like not a classic device driver? It's like a JavaScript-based device driver.
Yeah, okay. And... But the device is pretty sensible. You can just write data to it. It's really not that difficult. Yeah, I would say that pretty much every web developer can do that. If they just know how the device wants to receive the data, like the web USB spec.
The API isn't that difficult. You just have to learn a bit about how USB works. Yeah, it's like a pretty low-level... Yeah, it's really low-level, yeah. But it's not difficult. I would say in my day job, actually building web applications, I deal with far more complicated stuff. Yeah, but also with WebUSB, right? Because you connect printers to point-of-sale systems in hair salons.
Ja, that's where I learned how to do WebUSB stuff. So maybe the step to DMX Lite isn't that big because of that. But really, anybody that wants to do stuff like what I do could do that. I'm also just a web developer. Ja, du musst ein bisschen Zeit anhand und natürlich auch, du musst du shopper, die equipment auf Alibaba oder AliExpress. Ja.
So, wie viele DMX-Lights hast du in deinem Haus? Ja. So I have like five DbX lights, I think. Then I have a smoke machine as well. Oh yeah, right. You also had the smoke machine on stage. Yeah, right. And I do have a flamethrower as well. Yes, which you didn't have on stage for obvious reasons. So somehow there are issues with insurance I think.
Ja, Germans are so like so funless Yeah, I kind of get the idea why Mark didn't want to bring it on stage because it was the second talk of the first day and well, to burn the building down, But it would have been nice if the flamethrower would have been like in the courtyard outside I could do that, yeah Yeah. Cool Yeah, right So, these are also all DMX protocol controlled.
Yeah. Like, the flamethrower is basically using two channels, like two values out of that 512 value array. And, well, just set two bytes and you have, like, a big fireball coming out of the device. Yeah. But how do you get these ideas? So, okay, DMX Light, okay. Maybe also the Smoke Machine, but then Flamethrowers, how?
Well, the Flamethrower, I wasn't supposed to get one. But I was on a train on the way to Beyond Telerand in Berlin last November. I was just browsing my phone, AliExpress, and all kinds of devices came up. Your next Prey? Yeah, and I was just thinking, hey, that's a flamethrower.
It's like a stage flamethrower that uses DMX. So it's really cheap, and I can just buy it, just one tap of a button. Und dann you slipped and clicked it. Und ich weiß nicht, wie es happened, aber ich habe es, wie ich es. Ich hatte so viel Spaß mit der Idee von einem Flamethrower, dass ich einfach etwas tun habe.
Ich habe einfach zu erklären mit meinem Wirt. Ja, aber sie ist so viel zu deinen Explanations nowadays, ich glaube. Ja, ich kann einfach sagen, ich habe es für Arbeit. Maybe it's not a good idea to start with the flamethrower, but once you've already tinkered with all kinds of things, then later on you can bring the flamethrower. Yeah, yeah. Well, I kind of expected that I had a couple of weeks to prepare my wife that I bought a flamethrower.
But when I got back from the conference in Berlin, it was just sitting there on my coffee table. Und deine Wife war so, Niels, was das wieder? So mein 11-jähriger-old son, he really... He has probably a lot of fun with your stuff. Ja, ja. Is he also kind of helping you with these things nowadays?
Well, programming, not really. I don't think that's really his thing. But lately he's gotten into soldering electronics. You built something for that too, right? If I remember correctly, didn't you? Wasn't there something where you could Oder maybe I'm mixing it up then. If you're not coming to it, then probably I mix it up. Okay. Not yet. No, not yet. No.
I could probably do something. Yeah, so looking forward to everything you do in the future, of course. But one thing One thing that you also showed, and I think you also showed it on the oscilloscope, was like, so there's this kind of running joke nowadays that like you are required to try to get to run Doom on any device that kind of you get in your hands.
And I think you also demonstrated Doom. I think you showed Asteroids, the game. In the end, at the beginning, you said you wanted a laser, but they were too expensive and all these kinds of things. And then you went the detour over the oscilloscope and then the MX lights and then the smoke machine flamethrowers. And then you also had a laser. Yeah.
So you came around to buying the laser? I did buy the laser because, yeah. Well, once you go with a flamethrower, where do you go from there? Well, lasers. Of course. Yeah. Like I said, I wanted to build a clock with lasers originally. Those things are expensive and I didn't even know if I could connect it to a webpage. I did see a talk by Sepp Lee Delisle 10 years ago where he recreated the game
Asteroids on Laser Projector. And the way he did it was not from the browser, but I think using C or Python. I'm not sure anymore. And, That's fun, but I kind of want to do everything in the browser because that is what I know. And also because I love the web. And it took me a while to find the method to actually be able to draw figures
on a laser projector using web technology. So how do you connect things to it? Yeah, the laser projector basically talks in a protocol called ILDA. And the missing part was how do I generate ILDA from the browser. And luckily there was also a company that sold like a USB dongle that translates or that allows you to send coordinates to the dongle.
And it then translates that into the proper ILDA protocol that the laser projector understands. And from then on, it was just sending out the right coordinates. And I started out with basically my oscilloscope project, which generates XY coordinates for steering the electron beam. And I basically tapped into that and then redirected those coordinates to the ILDA dongle.
And within like 30 minutes, I had a laser projector that worked like an oscilloscope. Nice. And everything I built on the oscilloscope, I could also run on the laser projector. Cool. And one of the things I did build was like a JavaScript version of Asteroids. Well, the same game that Sebeli Delisle recreated on the laser projector and
got that running on the scope first. And then when I connected the laser projector to it, I could just play Asteroids on the laser projector as well. And one of the other things that I started playing with was Doom on the oscilloscope. Yeah, so that's basically the running joke. So trying to get to run Doom on anything. Yeah, that kind of started out as just a joke because realistically you can't
play Doom on an oscilloscope because. At least not on an oscilloscope alone without help by some external device, right? An oscilloscope just visualizes things. So you need to have an input signal. So the project I did was basically generate that signal that the oscilloscope can visualize. And it can be any signal. So, if I generate Doom, I'm playing Doom on the oscilloscope.
And if I'm generating asteroids, I'm playing asteroids. And if I'm generating Chrome offline dinosaur game, I'm playing the Chrome offline dinosaur game. But Doom was quite a challenge. Yeah, especially since you can run Doom in the browser, so that exists. But that's just like an engine that uses HTML5 Canvas. But what you need for your kinds of display devices is like real shapes,
like not just one, like not a pixel, not just pixels in the canvas, but you need different elements with shapes, with outlines. Yeah. Ja, für DOOM, ich habe eine Parser, die die Gamefile von DOOM hat, die all die Maps hat. Und dann die Renderer ist, wie eine 3D-Scene, und einfach nur mit Lines,
weil die Oschilloscope nur die Lines kann. Um that that got me into the 3d rendering and and i it was a rabbit hole yeah it's it's a rabbit hole and and it it kind of was fun but i'm also kind of glad that i finished it and i don't have to worry about that anymore because it it was uh the end result is fun but but getting there that was a lot of work a lot of hard work but um in the
end i i just had something that i could run around uh i i had a map in in 3d on the oscilloscope and i could just run around and and not actual gameplay because i figured that is too difficult i i don't want to bother but just running around this is fun enough and then i got into a another rabbit hole that that was I have all this, I have these maps, I know how to extract data from that game file, from the Watt file I,
could do something else with that I could basically render Doom map in CSS. Using divs for everything on a div you have a background image that's a texture and you position them in 3D space using CSS 3D transforms. And. That kind of happened after a conference in Brighton,
and I had an extra day there, and I just started playing with that, and I had the data, so I figured, well, I could do something with that. In the end, I basically recreated the whole game, Doom, including gameplay, and it's rendered completely in CSS because you can that is basically
the only reason so you can just go to a browser and go to cssdome.w2f and just play it and it works And the challenge for me was basically, how can I create this with as much CSS as possible? Because ultimately you have to use JavaScript as well. Because the gameplay...
Yeah, controlling where to move to and what the monsters do. Yeah, that is basically all JavaScript and you can't really get around that. But the challenge for myself was how to do as much as possible in CSS. So I basically took the game Doom and split it into two. Like half a CSS renderer and JavaScript game Doom.
And the CSS renderer is basically just divs. Und wenn du eine Tür hast, das ist ein CSS-Animation. Es ist ein CSS-Transition. Und wenn du eine Fireball hast, das ist von einem Anni, das ist ein HTML-Element, das ist Spawned.
Es hat die Start-in-Coordinaten und die End-Coordinaten. And it has a CSS animation that basically moves the fireball from one set of coordinates to the other one. Yeah, that also makes total sense because these fireballs never change the trajectory. So that's perfect for CSS animations. Yeah. And so there is basically so much is happening in CSS that while some browsers
have some issues with that, it's kind of pushing the boundaries of what browsers can do and that it's, also fun because that's an opportunity to optimize the browser. I think you or somebody like skeeted or tutored today that the Ladybird browser team just did a CSS anchor positioning fix in that case to fix a bug that the Ladybird browser had with your game.
So you're basically playing them again just in a more subtle way than with HTML5 tests. Yeah, that was really fun to read. I would guess that CSS anchor positioning is useful enough without Doom. And you want to implement it in any case. But, yeah, that they want to implement it because they want to run CSS Doom, that is – I didn't expect that.
That's nice. But, yeah, inkling position is used for several things in the game because for the position of the hand or the weapon, for example, that is –, If you run the original game, that's always in a fixed position. But the game in the browser, of course, it changes size based on the size of the browser window. It's responsive.
So you need to position the hand as well relative to the heads-up display that is on the bottom of the screen. And if that wraps over two columns or two rows or three rows if you have a very narrow screen, then the hand needs to move up. Otherwise it gets behind the head-up display. And that's one of the issues that the original developers never had to think about.
But once you implement it in CSS, that's things you run into and anchoring position was perfect for the job. You could do it in JavaScript as well, of course, but the goal was... Yeah, that would have ruined the whole purpose of this experiment. Yeah. Yeah, and the same thing with... Basically, you could do this 12, 15 years ago. Because the basics of CSS Doom is just CSS 3D transforms and that have been
around since like 2012 I think something like that so it's not really, that innovative but yeah. When I implemented it, I want to do as much as possible in CSS. And yes, for example, if you have the walls that are using CSS 3D transforms, you could calculate the values of the transforms in JavaScript.
But I purposely don't. I just take the values from that game file, from the Watt file, and just set them as custom properties on every ball. And then I use CSS trigonometry functions to actually calculate the transforms, so it's really well like a stress test for modern CSS functions in that way there's also a few other tricks you applied for example you're reusing textures,
there's a set of textures that you use everywhere but there's areas where they are more lit than in other areas where they are more in the shadow. And I think if I remember right, from your Smashing Conference gem session talk, you were using CSS filters to increase and decrease brightness and these kind of things. Yeah, so I said the brightness of every sector, of every room,
you basically set a custom property with the brightness. Und das ist all pre-calculated und auch von der Gamefile. So, das ist... Aber du hast auch animations für flickeringen lights. Ja. Und das Custom Property ist die Kälter-Filter, And a filter is basically brightness. So you can change how dark the texture appears. And of course, because everything can be animated nowadays with add property in CSS,
you can basically animate that custom property, the brightness property, to get flicker effects or pulsating lights and stuff like that. In the original game, that was all just calculated by the game engine. And for CSS Doom, that is basically just setting a custom property, and let CSS handle all of that stuff.
I think that's also a lot more performant because what you also explained is that And I think that's also the case with WebGL things, that when you have the impression that you move through a level, in fact, the camera is still at its place, like it stays at its place. And what happens is that the engine takes everything around you and moves that in the opposite way. So if you go forward, then it will take everything and move it backwards and
the other way around. So for you looking at the screen, it looks like you are moving through it. But in reality, everything is moved around you. Yeah, that's the thing with CSS 3D transforms is you don't have like a moving camera. So, everything you see is how the scene is laid out. So, if you want to simulate moving through the scene, you have to transform everything around you.
So, if you go upstairs, for example, you move the whole world down. Yep. And if you go forwards, you move the whole world backwards. And that way it appears that you are moving, but it's actually the world moving around you. With CSS, that is really simple because what I do is I have this container. It's like a div. And that container is the scene.
And I place all of the walls and all of the floors and everything inside of the container and they have CSS transforms relative to the container. And then when I apply a CSS transform on the container, everything moves. So I don't have to do any calculations at all to move around. Just set like three or four custom properties that is the player position on the scene, on the container.
Ja, ich glaube, das ist ein großer Vorteil von dieser Struktur, dass wir in Webseiten haben, dass wir nicht alle die Elemente haben. Aber wir können sie dann mit dem Gruppen und dann mit dem Gruppen. Ja, und die Browser Renderer einfach nur das alles zusammen und einfach so wie wir wollen. Und wir brauchen nicht zu worry über die Komplikationen. Basically, the rendering. It's just a fixed scene that we create.
And then we transform the scene, the world around us. And that works really, really well. Except that, well, the first level works really well. But the other levels are more complicated. Then you'll get into performance issues like you'll have to render 10,000 divs in a 3D space and that really,
stresses some browsers out and for example in Chrome there's actually an issue with that many divs well not the divs itself, that's fine but like every div gets, a texture on the CPU for itself. And most of the textures are identical. Walls all have the same texture. But on the GPU, they don't share that texture. And in other browsers, they probably do that. They do share it.
And on Chrome, every div gets their own GPU texture. And that basically breaks everything. So one of the things to make things more performant is to actually hide things that are not in view. The world that is behind you, you can just add the hidden attribute on it. Does your implementation do that? Yeah.
And that is in JavaScript. Unfortunately, I wanted really to have that in CSS. Did you try content visibility? Yeah, you can do it in CSS, but. You kind of need the if function for that. Okay. And that's not really well supported yet. Yeah. I did implement it and it works.
But some, yeah, with JavaScript, you can optimize better. Yeah. So for now, I've done that in JavaScript. So everything that is behind you is hidden. So it doesn't add any stress to the GPU. Also, if you have a wall right in front of you, everything behind the wall is hidden. So instead of having to render 10,000 divs, you only have to render 1,000.
Okay. And that makes things more manageable. And that is one of the optimizations I do in JavaScript. But yeah. Like I said, I really want to do as much as possible in CSS. But yeah, not everything I want to do is possible right now. Yeah, but maybe with these things appearing, as we've seen with the Ladybug browser.
Browser makers have a reason. And if it's just that they want to see their browser be able to render these nice things, even if it's maybe not on the priority for most people to be able to do that, sometimes it's like a personal thing. Yeah, but even these performance optimizations, most websites won't run into
these performance issues. But under the hood, if you optimize for CSS Doom, then every website will benefit from that, even by a tiny bit, because the rendering just gets more efficient. I'm happy that that browser are trying to improve their rendering of CSS Doom even though it's in itself. It probably isn't really a big priority for them to get CSS Doom running.
It just lays bare the shortcomings of engines by pushing them. One of the things I... Wanted to use, but that I couldn't yet is like CSS random function. It's just in Safari right now, right? Yeah. So one of the things I encountered was that I used this like stepped, sprite animation. So for example, if you have an enemy that is walking,
you basically have like one big background image, and you change the background positioning. Und all movement phases sind auf der Strip. Und dann muss man die Strip auf der Right Phase. Ja, für example, wenn die Sprite ist 60 pixels wide, man muss die Background-Image minus 60, minus 120, minus 180, und dann back zu zero.
Und du kannst du CSS-Animations für das. Standard, dann muss man einfach nur gradually. But you have a stepped function for that so it basically steps from 0 to 60 in one step it just doesn't transition between the two positions anymore and that's great, I use it all over the game, but when you have like 5 or 6 of soldiers running towards you,
they are walking in step They are all marching towards you all at the same time. Their feet move exactly the same. That's really disturbing. So what I do now is I basically set an animation delay, a negative animation delay. Sorry, the animation has started in the past. So they move not in step anymore.
And if I had the CSS random function, that would be just so much easier. Yeah, right. Yeah, I don't know why it's like, I think in Safari, it's there already for quite a while, at least a year, I'd say. But the other browsers don't seem to make progress on that. Yeah, nice. And then you said you built everything out of divs.
Some of them you had to like, because divs are always like rectangular, you had to like cut them with a clip path and shape, I think. Yeah. So with Doom you have basically walls are in Doom are always squares. So walls translate really well to divs. You can basically create all the walls with just a div and then translate them into 3D space.
But once you got to floors and ceilings, you have a problem because the floors and ceilings are not squares. And to solve that, you basically have to calculate a clip path. You have to take all the walls and their coordinates and basically recreate that shape that is where a lot of math, comes in and clip path isn't that
new so it's not that once you get the coordinates it's not that difficult, getting the coordinates that's the difficult part of math. You can basically clip a div into a different shape and position that flat on the floor and then you have your floor, the only issue I had with that traditionally clip path were, you had to do it with pixels so,
Or at least CSS, like pixels or points or millimeters or whatever. I want everything to be independent. So what you want is something where, is it like when you resize the browser, you want things to adapt? Yeah. So I want to use percentages because the rendering details, I don't want to do that in JavaScript. I want the rendering details to be in CSS.
So if you have a clipart that is percentages, it will just adapt to however you use it. And that's possible, I think. And that's now possible with clipart's shape. That is relatively new, and I'm very happy that that now just works. And that basically means that you don't have to do calculations in the CSS coordinate space in JavaScript.
You can basically just generate the shape that you want and be that independent of the coordinate space that you use in CSS. Cool. And then you said you used divs everywhere. Yeah. But there's one place you did not. There's one thing that kind of started out as a joke. Yeah. We're waiving Manuel Matusowicz also. Yeah. Yeah. Yeah. A div is not a button. A div is not a button. Yeah, exactly.
So whenever you get to the end of the level, you have this button. Oder wie ein Switch, dass du einen Punkt hast, um die Level zu Ende und zu den nächsten. Und das ist der einzige Element, dass nicht ein Diff ist, weil das ein Button ist. Of course. Es ist ein Button. Ja, es muss sich umsynchisch sein. Ja. Ich finde, dass ich das ein Button, instead of ein Diff, dann kann ich ihre
Website mit Buttons machen. Ja, absolut. So, if Doom can do it, everybody can do it. So, why are people doing it? Ja, wirklich toll. So, fantastic projects, fantastic ideas, great execution, really hacky. I think, so, although we've seen your talks, I think through this episode, we learned quite a few more details, which you spared from at least the Beyond Teleron talk.
Because, yeah, so I think it's not that important for the crowd there to know all the nitty-gritty details. But yeah, it was nice to be able to dig a little bit deeper this time. Fantastic. So the next time people can see you talk will be also not like soon at CSS Day in Amsterdam, right? Yeah, I'll give a talk called CSS Doom Lasers in Amsterdam at CSS Day in June.
June 11th and 12th, I think. I'm just going to go there and just have fun, I think. Talk about my oscilloscope projects and CSS Doom, of course. I'll bring the laser projector as well to show some experiments. So bring sunglasses everyone. Yeah, it's going to be... PPK, the organizer, basically told me I wasn't allowed to bring the flamethrower, so it will probably be safe. Yeah, although you have to say it happens in a church.
Maybe like flamethrowers in a church are also not appropriate. No, no. Earlier this year one of the churches, a historic church in Amsterdam burned down unfortunately. Have you given a talk there? No, no, no. Okay. That wasn't my doing, no. Okay. But, uh, Ja, das ist wahrscheinlich nicht ein guter Idee, zu bringen die Flamethrower. No, wenn wir eine Open-Air-Conference machen können, dann können wir es vielleicht in Verona in der Arena oder so machen.
Ja, so wenn jemand jemanden will, zu sehen Sie, oder zu sehen Sie, zu sehen Sie, die Talk-Kartung, dann CSSDay wird, für heute für heute, die letzte Chance. Ich denke, ticket prices will also increase the day after this episode comes out. So people that are listening and are quick they will save a few bucks. Yeah and, Speaking of conferences, Niels, you and I, we are both members of the Frontiers organization,
which is like a group of front-end developers from the Netherlands that used to organize also the Frontiers conference. That's what everybody knows under the term Frontiers, but that's Frontiers conference, then there's Frontiers organization. Und so Covid also made us all pause these conferences and we started doing these again but in another kind of way so unfortunately we can't do them as big as we used to do
them back in the days maybe someday again maybe someday but, the conference that we're putting on this year it's going to be a lot of fun, it's going to be in Dordrecht in a theater on October 2nd if I remember correctly and it's going to be an evening conference we start in the afternoon and go throughout the whole evening with five amazing speakers and we'll have dinner together like
proper dinner with a two course dinner in a restaurant Und das ist in der Ticket price. Ticket price ist €99. Für Frontiers members ist es sogar weniger. So, do wir wollen, wie ein paar Sprecher schon mal? Well, we could talk about a couple of the speakers, yeah. Because we haven't, like officially, we haven't published anything about the speakers yet. So I can tell you that Sid Stumble is going to be there, which does amazing
work with CSS and animations. And I just love her stuff and we're so lucky to have her. Und Hayden Pickering ist da, was auch wenn du hast, wenn du hast, wenn du den Briefs hast, du solltest das. Das ist so funny und so zu dem Punkt. Ich liebe das auch. Ja, und dann wir also haben Harry Roberts. Ja.
Er might do a rant about our state of web development. Maybe. Yep. There's still a few months to go. Maybe he changes minds. And then, well, so we have, like, our MC will be Jake Archibald. Yep. And, yeah, we have two more speakers. Like, so it's very probably Anjana Vakil will do some stuff with web audio. So we basically already have, like, her
um or her okay she also she said yeah i'm gonna be part and then there's like a last speaker that we still have to uh so we have somebody in mind and um but we haven't got a yes yet it's it's gonna be a good conference either way it's uh i'm so looking forward to it. We'll link to it from our show notes as well as to the CSS Day conference. And yeah, looking forward to seeing as many of you listeners as possible at
both of the conferences. Also a good place to ask you, Nils, any questions related to your projects that you talked about today. Yeah, I'm happy to talk to anybody at CSS Day. Just come up to me and I'll happily explain how I build stuff. And yeah, it's going to be some code. Yeah. Awesome. Cool. So thank you for taking the time and visiting us,
being here, chatting with us about all the things you do. It was fantastic. We'll try so your talk from beyond tolerant isn't yet published so if that's gonna be the case then we'll also put it in the in our show notes so everyone that listen thank you as well if you like the episode give us a thumb up and yeah looking forward to seeing as many of you as possible and also you Niels,
at the bespoke conferences. Thank you for having me and looking forward to seeing you again at CSSA. Thank you very much. Thanks for your time. Thanks to the listeners for listening. Bye bye Bye bye everyone. Bye bye.
Mit dieser Revision setzen wir unsere Reise durch die State of HTML 2026 fort. Nachdem wir in der vorherigen Folge bereits Performance, Web Components und Formulare behandelt haben, nehmen wir uns die…
Gemeinsam mit Stefan Judis nehmen wir uns die State-of-HTML-Umfrage 2026 vor. Statt auf die noch ausstehenden Ergebnisse zu warten, gehen wir die abgefragten Webtechnologien durch und diskutieren, wel…
In dieser Revision begrüßen wir Moritz Glantz (LinkedIn / Mastodon), UX Engineer und Accessibility-Spezialist aus Karlsruhe, den einige von euch vielleicht noch aus dem Podcast Wo wir sind ist vorne k…
Wir haben uns auf der code.talks in Hamburg mit Nico Martin zusammengesetzt, den ihr auch auf LinkedIn und YouTube findet. Nico war bereits 2022 bei uns zu Gast, damals ging es um WebBluetooth, WebUSB…
Für diese Ausgabe unseres Glücksrads haben wir uns Stefan Judis eingeladen. Stefan war schon einige Male zu Gast, zuletzt in Revision 542, ist Frontend-Entwickler, DevRel bei Checkly, schreibt den wöc…