In this talk, Niels Leenheer, CTO of Salonhub, walks us through how he built DOOM with nothing but HTML and CSS, and reminds us why building for fun can be the best way to learn. This talk was recorded live at HalfStack Vienna on November 15th 2026.
----------------------------------------
Welcome to WeAreDevelopers, the #1 developer community in Europe!
This is your one-stop destination for the latest tech insights, tutorials, and career advice to elevate your developer career.
Stay updated Dev Digest, with our weekly newsletter featuring the most recent tech trends, career guidance, and original content crafted by developers, for developers. Subscribe now
Interested in advancing your career? Browse through our job board featuring over 190,000 jobs. Unlock job opportunities with a free developer profile
Don't miss out on the annual highlight of every developer's calendar - the WeAreDevelopers World Congress. Network with 15,000 peers and learn from over 500 speakers. Secure your spot and save 10% with "wearedevs_yt"
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.
SPEAKER_00So hi everybody. My name is Niels and it's so lovely to be back here in Vienna. This morning in his introduction, Dylan mentioned a talk I did years ago where all of my live demos failed. So just in case if anything fails today, I'm well prepared.
SPEAKER_00So this talk is about how I created Doom in CSS. And I wanted to go over some of the CSS details and features that I used. And we're still gonna do that. But I also want to share a bit about my process and the story behind CSS Doom, how it was created, because it started out something completely different, and I think just as interesting as the nitty-gritty CSS code. So, first of all, um today we heard a lot about AI.
SPEAKER_00And yes, uh for sure, all of our jobs has changed a lot over the last uh year or two years. Uh for my day job, I hardly write code anymore. And to be honest, I don't want to go back. But but I I love coding. Um, I love writing JavaScript, but also HTML and very much CSS. And what AI allows me to do is automate the things that I don't want to do.
SPEAKER_00And focus on the things I do want to do and spend more time being creative and challenging myself. Now this story starts with an obsession of mine. Making a laser clock. Ever since I've seen SAP Hugh Delisle talk about lasers ten years ago, I've been fascinated by laser projectors. But I know nothing about them, how they work, and and could I connect them to the web?
SPEAKER_00Now SEP explained some of the issues he ran into recreating a classic 1979 game called Asteroids. Now, that original game used a special display system called the Quadra scan, which uses a CRT. But but instead of pixels, it it directly steered the electron beam to draw these vector shapes. It's really simple, but it worked amazing.
SPEAKER_00Now, before you get excited about me showing a laser clock, um laser projectors are expensive. They well, it's not not my my name is not Seb Lee Delisle. I don't have a couple of spare ones stacked up behind the couch or something. So I started thinking that that game of asteroids kept lingering in the back of my head, and I figured that an oscilloscope could function in pretty much the same way as that original quadra scan display.
SPEAKER_00And they are really cool too. And it's uh oscilloscope is like a lab equipment and it visualizes electrical signals, any signal. Um I just love the aesthetic. It really feels like you've wandered into the lab of a mad scientist with all of these buttons. Um I think well, if you think of it, it literally is just a small particle accelerator that that fires electrons at about a quarter of the speed of light right at your face.
SPEAKER_00And only be stopped by a very thin layer of phosphor. Now, of course I wanted to use web technology to make my clock. So this part of the tight of the talk is titled How I Use CSS Animations to Draw a Clock on an Oscilloscope. Well, not really accurate. Uh it's more how I used web audio to blow up a 1980s oscilloscope and almost cost a fire.
SPEAKER_00Hence the fire extinguisher. So start let's start with it what a clock really is. Uh to me, a clock is a simple analog dial. It's a circle and three lines. And on the web we can use SVG for that. Uh simple shapes, vectors, and um just like that asteroids game. Now we only need to animate them over time, and we can use CSS for that. Now we need to draw these shapes on the scope.
SPEAKER_00So the phase melting electron beam is tiered, or better deflected, uh by two electrically charged plates called the X plate and the Y plate. Um and by deflecting that beam vertically and horizontally, we can basically trace the image that we want. And do that multiple times per second, and you get an image. So we need two signals, X and Y. And we need to trace the image that we want to draw.
SPEAKER_00So let's start with the clock phase, the circle. This is that circle.
unknownUh
SPEAKER_00to create this, you need some high school math. Turns out my math professor was right all along, all those years ago. I did need math later in life. Um if you look at this circle, it actually kind of starts to make sense. We just make a waveform directly from the x and the y coordinates of the circumference of the circle. And we can make any shape with that method: squares, triangles, even clocks.
SPEAKER_00Um, and any line drawing that you can trace. We can take the x-coordinates and the y-coordinates and create a waveform. But how do we get those coordinates? Well, we start with our SVG and insert it into the DOM. And uh with all of the CSS transformed and animations applied, we can get the total length of the paths and point at length to get the raw coordinates. And we end up with, well, two arrays. Two arrays of numbers.
SPEAKER_00Um if we plot those in a graph, we get our waves. One for X, one for Y. And we do this 30 times per second, and because SVG exists in the DOM, we just get the CSS animations for free. Because every time we sample uh the vectors, uh we get the current state. Now we only need to generate a signal for the oscilloscope.
SPEAKER_00And turns out that is actually pretty simple. The only thing we need to do is uh give web audio or coordinates, and it will create the audio waveform for us. So we simply plug in a cable to the headphone port of the computer, hook it up to the oscilloscope, and well, two audio channels left and right, two signals, X and Y. It it just matches up, it works perfect.
SPEAKER_00So I build a web app that does exactly this. Uh it has a small editor where I can use uh to to edit your SVGs and your uh CSS, and it will just inject it into DOM, sample it, and output the waveforms using web audio. We've connected the computer's audio output to the X and the Y channel uh of the scope, and and well, let's see how it looks. Set it to XY mode, and there it is.
SPEAKER_00Yeah. Then this happened. The oscilloscope decided to explode. Um so this is the aftermath. Um I was too busy finding the power plug and and and scrambling to find my phone to film it, of course, but uh smoke was rising up and sparks went flying everywhere, and yeah. I I was fine, I did not get electrocuted, uh, but the scope was dead.
SPEAKER_00So now what? Redundancy. I I may have overreacted here. Um but I have a new one. One that fits in a suitcase. And I brought it with me uh through airport security. Three times. First to Brighton last week, and yesterday from Brighton via Frankfurt to Vienna. Yeah. Um so in Amsterdam, my scope, my back, and even I was swept for explosives.
SPEAKER_00Uh take another suitcase, uh, another time to the x-ray. Fine, fair enough, fair enough. Then yesterday at Gedwick, I was swapped again. And then at Frankfurt, uh, well, I was the only one at the security lane. Um, I I I could see the guy looking at the x-ray. To the suitcase, back to the x-ray. Then he was looking at me, going, huh? I said, just oscilloscope. Uh he nodded approvingly, uh, yeah, makes sense.
SPEAKER_00Uh and then just let me leave with the suitcase without even opening it. Apparently in Germany they travel with oscilloscopes? I don't know. Anyway, um it's time for the demo. Okay. Now this is scary because I haven't tried it yet.
unknownUm
SPEAKER_00so let's just turn on the generator, set it to the clock. Let's go. There is the button. Now, if everything survived the trip, we should see a clock. Well, it's a little bit.
SPEAKER_00Something like that. It works. No explosions yet, so okay. Um, so I built this clock, which isn't really useful because it's kind of dangerous to let it run. Uh I don't want to leave the house with this just on. And it's environmentally very unfriendly because it takes a lot of power. But I figured what can I else what what else can you do with this?
SPEAKER_00So uh I basically already said we can use this to visualize any SVG. Um we can do, for example, uh where is it? Love tech. Um but it doesn't have to be a static image. It can be any animation. It could be that game of asteroids, for example.
SPEAKER_00All right. Let's try it again, asteroids. Sound effects, yes. Well, I'm really bad at this. But of course, I have a I have a eleven-year-old son.
SPEAKER_00And he has a Chromebook at school, and one of the things he loves to play is the Dino game. So I made it for him. The Dino Game. He's very good at this. I I I well.
unknownUm
SPEAKER_00then I thought, what else can I do with this? Is there some game that everybody tries to port to a platform, to any platform like fridges or thermometers or or whatever? And it's of course it's Doom. So I spent some time quite a bit of time
unknownon
SPEAKER_00making this work. So this is level one of the game of Doom. I can just walk around here and it just works. It's it isn't using CSS, it's directory drawing uh lines. Uh and actually the scope
unknownuh
SPEAKER_00it works, but isn't really optimal. I have to remove a lot of lines and it doesn't have any gameplay, but still, I thought it was so cool to make this. Now let's go back to the talk. Turn it off for safety.
unknownUm
SPEAKER_00back to the talk. So we have Doom on our oscilloscope and it looks great. If you keep in mind that we're just generating lines and encoding this with audio and showing it on an old dumb device that's 50-year-old technology, um, but it isn't the real Doom game. We can move around, and that's pretty much it. Um this is where the second part of the story uh starts.
SPEAKER_00Earlier this year I was at a conference in Brighton, and if you know anything about Brighton, it's a it's the coast, it's it's a coastal city, and anytime outside of uh summer, it's freezing cold. So I had an extra day and I had nothing planned, and I was walking around and I was pretty quickly done with that. Um so I went back to the hotel and I suddenly had this idea. We have all this data from Doom.
SPEAKER_00I I uh discovered how I could uh decode uh all of the maps and everything, and and I learned about how to render frames in 3D. And well, so we could use that data and project those walls with CSS 3D transforms. We could add textures, and within a day I had something where I could walk around.
SPEAKER_00Uh I posted a little video of that on social media and and went somewhere to get a drink. And then my phone blew up because thousands of likes came in and reposted, and and and so I started adding more and and more, such as doors and pickups and enemies and fireballs. Um uh, well, this isn't fully CSS, of course. There's a considerable bit of JavaScript ported from the original original game, and yes, I did use AI for that, because I was interested in the CSS, and the renderer is almost 100% CSS.
SPEAKER_00But why? Well, first of all, JavaScript should only do what only JavaScript can do, because the browser is much better at optimizing than you are. So there is this this small layer of JavaScript that does basically nothing more than create DOM elements and set classes and custom properties. And every wall, floor, or ceiling is a div.
SPEAKER_00Simple divs that are 3D animated, uh transformed. And we're not using JavaScript to position every div, but instead the JavaScript extracts the raw coordinates from the Doom game file, the bot file, and those raw coordinates and then pass to the CSS as custom properties. So these are all the discs we created for level one. And this is one of the smaller levels. And we insert this in the DOM and we let CSS handle the rest.
SPEAKER_00And and all the complicated math is done by CSS itself. It's actually not that bad. Um it basically boils down to the theorem of Pythagoras. And the reason why is that DOOM isn't fully 3D, it's actually like two and a half D. It's a flat map with heights, and it's not a full 3D scene. And that's why it fits so perfectly with CSS. So this is our top view. We have our start coordinate and our end coordinates, and and what we want to do is position our wall on these coordinates.
SPEAKER_00We have to set a width and an angle. Um it's basically along the side of the triangle, uh, which is the square root of x uh squared plus y squared, and the angle is the inverse tangent of y divided by x. Everybody with me? Yeah? Just not, just fine, just not. Uh pretend it makes sense. Um so in our CSS it looks like this.
SPEAKER_00And thanks to the CSS trigonometry functions, we can now just calculate the width and the height uh that we need, or the the width and the angle that we need. No need for JavaScript or to pre-calculate everything. We're just setting properties for straight from the DOM what file. And CSS does the calculations. And this is them where we simply set the width and we position the div in 3D space and using translate 3D and with the start coordinates, and finally rotate it on the angle that we had just calculated.
SPEAKER_00We do that for every wall in our scene, which can be a couple of thousands. And of course, ceilings and floors too. They are just square divs that use the same positioning uh logic, uh, except we need to rotate them 90 degrees flat on the floor. Now, this works if you have a square sector. A sector is basically a group of walls and floors and ceilings that belong to each other. But rooms are not squares.
SPEAKER_00So how do we do this? Almost none of the rooms are squares. And and diffs are very much squares. So how are we dealing with this floors? Um here we can see two sectors. Uh, one is a simple octagon and the other is a polygon with a hole cut out of it. Well, these are diffs too. These are diffs with a clipping path. Um involves a bunch of extra math that we have to do in JavaScript. It isn't feasible to do this in CSS, and that little bit of JavaScript is just what we're gonna add to the renderer.
SPEAKER_00Um, but we pre-calculate this uh and and CSS does the rendering. Now, simple shit like Octagon have been possible for a while now, but thanks to the shape function, that's relatively new, you can even uh write a path, a clipping path, in a uh human readable uh format instead of SVG paths, which are horrible. Um, and thanks to even odd, we can even have two paths, uh, one that cuts off the triangles at the outer edge, and one that creates the hole in the middle.
SPEAKER_00Now, if we turn around and look at the lighting of the scene, we can see two things. First of all, we're standing on a light platform, a dark room, with in the distance another light room. And those are all static lights. Those are defined in the Doom game file, and they are not calculated by the game. They're just preset. And we set a light per sector. That means this room contains many different sectors. Like all the stairs.
SPEAKER_00Each stair is a different sector with a different height, with a different floor. And because they are staggering, it just appears as stairs. And you can see that the light for the whole sector is the same. So even the ceiling above the stairs have the same light as the floor. Now, how do we set the light level? It's a custom property again on the sector itself, and then that property is inherited by all the floors and ceilings and whatever.
SPEAKER_00Now we just apply a filter to it, to our whole scene. Every light is a filter. And but if you look closely here, you can see those pillars, that those are pillars. Those are pulsating. That's a lighting effect. Those are also defined by the Watt file. And Doom supports different types of lightings. And those are a little more just animated brightness changes. So the pillar has a simple class on it, and it runs with an infinite animation that changes the light custom property.
SPEAKER_00Now some of you will say that this isn't possible. And you're right. This doesn't work. Because CSS does not know what the light custom property is. It can't translate or or or morph between values. So we need to use add property to tell that light is actually a number, then it can make those smooth animations. Now we can change that animation to anything that we want.
SPEAKER_00We only have to change one class and then it has a completely different lighting effect. Now, one more very important part of Doom is the textures. So the textures of the original game are uh well just images. I extracted them from the Doom what file, converted them to PNG, they're really tiny. Every wall ceiling of forgives has a data texture attribute that we use to load the image.
SPEAKER_00Oh uh yeah, that wasn't supposed to happen. Let's try again. Uh right, here we go. Um okay. Well, you need a version where every service has pictures of a cat. Okay, we can do that. Um this is just CSS, we can load any image that we want. Um so this time uh cat Swan Dylan.
SPEAKER_00Um okay, um so we've been walking around in this world, but but how do we actually do that? Uh of course there's JavaScript involved here. We read keystrokes and and and mouse events and touch events and gamepad buttons and and then a lot of more JavaScript because we're not you don't want to walk through the walls, we want to be stopped by the walls, so there's collision detection, it's all JavaScript. And well the Doom source code is open source, and I really don't like writing C code and translating to JavaScript, so AI helped me with that.
SPEAKER_00So I could focus on the fun parts, the CSS. Um but there's no camera in CSS. And and and we we can move around, we can't move around the world. Um instead, we move the world around us. We don't move through the world, the world revolves around us, which is how it should be. I think. No, um so we just set a couple of custom properties on on the viewport on on our scene, and and that makes the world uh change, uh move around us.
SPEAKER_00And and whenever the player uh moves, those properties are updated, and uh the world then moves using translate 3D and and rotate y. We don't need to recalculate every wall, everything stays the same, it's static. So if we zoom out a bit, we can actually see this. The world moves around us. So if we move up the stairs, the world moves down. But the player stays always centered in the middle, it's static. And if we move back down, the world moves back up.
SPEAKER_00And CSS gives us this for free. Uh what we're seeing right here, that that's spectator mode, and it's just a couple of overrides in the CSS. Nothing more. Like you may have noticed sprites such as barrels and pickups, they are always directed at the player. It's called billboarding. Um from above, it's very clearly visible. And again, that's something that CSS will do for free for us. We already have the player angle, and we can just apply that to every sprite.
SPEAKER_00Um that's it. No. This angle also gives us a good look at the door. Let's open it. Yeah. That's it. Uh I wish it I could show some more interesting code here.
SPEAKER_00Uh but but no. Doors are actually really boring. Uh it's just a transition between heights. Uh the offset is defined by the game data, and and and just set that as a custom property when we generate the door. Um difficult part is the game loop. Uh it needs to check collision detection again and make sure that enemies don't see through doors, and that's not interesting. The rendering doesn't need to know about any of that, it just responds to uh an attribute, the door state.
SPEAKER_00Next thing we should talk about is sprites. Uh, we have all kinds of objects that we can pick up, like barrels that we can shoot and monsters, and those are 2D animated images. For example, um for in them for for enemies we have images for walking, from the front, from the side, from the other side, from the back. Um and those are all combined into one image, uh, a sprite sheet. And if we go into this room, we can actually see those sprite sheets.
SPEAKER_00And the yellow box, that is the active image, the active sprite. You can see the selection when that sprite sheet is constantly changing. And by clever orientation uh of the images, we couldn't change in the background position, we can have the sprites, just the the images fully animated. One important detail is that we're using stepped animations.
SPEAKER_00In case of the helmet, we are stepping over four different images. It's not a smooth transition, it's just uh the size of the image is the step. And that gives us the appearance of the helmet pulsating. Um and and while in reality that image is moving around, and it looks really good, uh, free uh automatic again, and and powered by CSS. Now, fireballs are also sprites.
SPEAKER_00They are animated and billboarded just like the other sprites. But they are quite special because they are flying through space using a simple CSS animation. Whenever an imp uh launches a fireball, a new div is added to the DOM with a couple of custom properties, um, such as the start point and and the calculated endpoint and the time it needs to reach the endpoint. And then we let's let CSS run the animation.
SPEAKER_00It's incredibly effective. Uh we don't need to update the position of the fireball from the game loop. It CSS does it all for free. And if you look closely here, um we use the standalone translate properties, not transform, uh, and that that's for a very good reason because um it's billboarding. Well, we'd use the transform property, we could not independently run the animation and have the billboarding effect. By using the standalone properties, we can set them without overriding each other.
SPEAKER_00So here, animation controls the positioning and the player angle controls the rotation. Now we do need to tell the renderer that when there's an impact to remove it, perhaps even mid-flight, and and and then show the explosion sprite, which are normal sprites. They are just added to the DOM at the moment, and then run its course and then remove themselves again from the DOM using the uh animation and event. They're literally fire and forget. So let's talk a lot about another animation uh technique that's used throughout this project.
SPEAKER_00Um the player is moving around, you can see the weapon bob around. And it's a nice little CSS animation. Um, and originally we just apply the animation when the player was moving using a class set on the viewport. But that kind of breaks the illusion when you stop moving. It just the weapon would just jerk back to the default position. Now, the solution is to always have the animation.
SPEAKER_00Uh, but the default play state is set to pause. Yeah, it just paused somewhere in the animation, and we don't care where, and whenever the player is moving, we set the state to running. And so we continue where it was last stopped, and and the transition between walking and stopping is now seamless. Now, one of the last things I want to show you, because this is the web. CSS Doom is responsive.
SPEAKER_00Um that creates some challenges because the gun here needs to be aligned with the top of the status bar, and whenever the status bar wraps over two or three rows, we need to move the gun upwards. So anchor positioning, that's new, that's amazing. Uh the status bar is the anchor, and we just make sure that the bottom of the gun is is anchored to the top of the status bar. It's probably not something that the spec authors intended, but I'll take it.
SPEAKER_00So, yeah, that was just some of the details of how CSO and CSS Doom works. Uh it's actually amazing that it works at all. We're pretty close to the limit of what the browser can do here. And like I said, everything you've seen here, uh everything is a div. Thousands of divs.
SPEAKER_00Still, probably less than a React app, but still thousands of divs and some CSS. But there's one exception, and that's this one. This is a button. As it should be. And if I can do that in Doom, what excuse do you have in your apps? Div is not a button. Um, yeah.
SPEAKER_00So is this useful? No! Well, e even if Dylan says yes, don't do this. Uh CSS were never intended for this.
unknownUm,
SPEAKER_00but it has been an amazing experience just making this.
unknownUm
SPEAKER_00I loved working on the CSS and finding new ways to implement uh or or let's say finding new ways to abuse CSS to get this working. Um of course I did try AI for this a little bit, but then you give it a prompt and tell it to make something, and we'll just remove half of your CSS and replace it with Canvas. So that wasn't really feasible. But it's been an amazing experience.
SPEAKER_00When I launched it, I I I got almost 10,000, uh hundred thousand plays in like a week and a half, and people started posting videos on YouTube about run throughs. It was just crazy. Uh so I just wanted to say um I love to code. Even nowadays with AI, I love to code. And CSS is awesome. So thank you.
In this talk, Eduardo Aparicio Cardenes, Senior Software Engineer at the Super Group, tells a story of a little iFrame with big dreams, and how some simple rules when using iFrames can help solve some seemingly complex...
This talk - delivered by Paul Campbell, Founder of ticketing software Tito - was recorded live at HalfStack Vienna on November 15th 2026. Paul tells us developers and users deserve better software, and that now is the...
In this talk, Ramona Schwering talks - and draws - her way into explaining some key and increasingly important security concepts that all builders should know. This talk was recorded live at HalfStack Vienna on November...
On this edition of Coffee with Developers we're joined by CEO and Lead Software Architect @ daenet, Dr. Damir Dobric, to look at the Masterclass he'll be leading at 2026's WeAreDevelopers World Congress Europe....
Faris Aziz, Software Engineer at Netlify, asks what seniority means in the age of AI, when writing code is no longer the bottleneck. This talk was recorded live at HalfStack Vienna on November 15th 2026....