I'm Nikita, an entrepreneur from Ukraine. In about a month I built BIGBOARD.GAMES, a site with free games that friends play together in the browser. I launched it on October 5. A few weeks later my post on r/SideProject took off, and people loved my games. So far, more than 2,500 people from 90 countries have played more than 10,000 games. I wrote about that first month on my blog.
The idea is simple. You put two to four phones or tablets next to each other on a table, and their screens become one board. In air hockey the puck leaves one screen and comes in on the next one, on the same line and at the same speed. A friend in another city can join from their own phone, and a laptop or a TV can join just to show the board to everyone.
The top comment under my Reddit post asked how the game handles screens of different sizes, like an iPhone next to a much bigger Android tablet. For that, each phone needs the real size of its screen in millimeters. A web page can't simply ask for it.
Why a web page can't know its screen size
A browser gives you CSS pixels. A CSS inch is always 96 CSS pixels on any screen, so it has little to do with a real inch. devicePixelRatio tells you how many device pixels make one CSS pixel. It doesn't tell you how many of them fit in a millimeter.
There is no API for the DPI or the physical size of the screen. Browsers leave it out on purpose: every extra detail about the hardware makes it easier to fingerprint a user. So two phones can report the same width in CSS pixels and still have screens of different sizes.
If you join such screens pixel by pixel, the puck changes size at the gap, or it comes out off its line.
How the game finds the size anyway
It recognizes the device. iPhones and iPads are told apart by their screen resolution: Safari reports the screen in points together with the device's scale, and the pair matches one model family. Android phones and tablets are recognized by model number. Chrome hides the model from the user agent string, but it gives it through User-Agent Client Hints when you ask:
const { model } = await navigator.userAgentData.getHighEntropyValues(["model"]); // a Samsung model number, a Pixel's name, and so on The game looks the model up in its own catalog, built from the makers' spec sheets, with the panel size in pixels and the size of the body for each model. At the end of October it knew 96 phones and tablets this way.
It still gets some phones wrong. The iPhone 12 mini and 13 mini report the same screen as the iPhone X, so the game first takes them for an X. In Settings you can pick the mini instead. For a device that isn't in the catalog at all, the game makes a guess from the pixel density.
When the guess is wrong, use a bank card
Every bank card has the same size, set by an ISO standard for ID cards. So the game uses a card as a ruler. You hold it to the screen and drag a handle until the outline on the screen matches the card. After that the game knows how many pixels make a millimeter on that phone, and the browser remembers it.
How the puck crosses the gap
The game also needs to know where each phone lies. When you pick a game, it shows your table as a small map with the devices laid out for that game. If a phone on the map lies differently from the real one, you drag it to match.
Then the whole board is measured in millimeters of your real table, and the gaps are part of it. The frames between screens count too. The game takes the frame width from the device's catalog entry. For a device it doesn't know, it uses 7.5 mm. If you say the phone is in a case, it adds 3 mm per side. The puck keeps moving under the frames, where nobody sees it, and comes out on the next screen where it would on a real table.
The table plays at one scale, so the puck keeps its size when it moves from a small phone to a big tablet. In Air Hockey and Hot Potato the court is even for everyone. Its size comes from the smallest screen, unless you set a bigger screen to use all of it.
A slow connection is the hard case. The news about a shot can arrive late, and a plain replay would make the puck pop up in the middle of the next screen. So the game draws it late instead. The puck comes out of the frame at full speed, a little behind, and then moves up to 20% faster until it catches up. The frame hides the delay, because nobody expects to see the puck there anyway.
How phones in one room find each other
Browsers have no API to look for other devices on the local network. So "same Wi-Fi" is a guess that the server makes from the public address. Phones behind one home router usually share one. On a home network the phones join one table by themselves. You open the site, and the table is already there.
The guess fails on guest Wi-Fi, with a VPN on one phone, with iCloud Private Relay or behind a carrier's shared address. Then you scan the table's QR code or type its four-letter code. A link in a chat works too, and that link is also how a friend in another city joins. Their screen shows the whole board, turned to them.
One bug came from link previews. A table link in a Threads post once took a seat at the table. Meta's previewer opens pages in a real browser, so it sat down like a guest. Now a device that comes in by a link waits until it sees a person, for example a real tap.
Why the phones talk to each other directly
Mostly for speed. In air hockey the puck's position should go from my phone to yours across the table, not to a server and back. So when a match starts, every pair of devices opens a WebRTC connection. In real-time games like this, the server only helps them meet: it passes the offers and answers between them, and it keeps the seats and the results.
Each connection has two data channels. Puck positions go on an unordered one with no retransmits, because an old position is useless once a newer one exists. The phone that holds the puck sends its position about 60 times a second. Goals, moves and the moment the puck passes to the next screen go on the ordered, reliable channel.
In a healthy match the devices even close their connection to the server, and the table's Durable Object goes to sleep. A device wakes it up only when it has something to report, like a result.
On mobile data the carrier often blocks a direct path. Then a TURN relay passes the packets between the phones, and a match uses a little of your data. For the game it's still one device talking to another.
Install it like an app
You can play right in Safari or Chrome. You can also install it from the browser: it gets an icon on your home screen and opens full screen, with no browser bars. The Full screen button in the game shows how to do it on your phone. On Android it's easy, and on iPhone it takes a few more taps.
For this game full screen matters more than for most. While the browser toolbar shows, a seam along the toolbar's edge comes out short by the toolbar's height, and a web page can't fix that. The installed app has no toolbar. It's a progressive web app, so it also opens offline and plays the games that need just one device. It's free, and you don't need an account.
Built on Cloudflare
I love Cloudflare. I wrote a whole post on why I build on Cloudflare, so it was an easy choice for BIGBOARD.GAMES. The pages are static files served by Workers, close to wherever you are. One Worker answers the API, every table is its own Durable Object, and match results go to D1. The relay is Cloudflare's TURN service. All of it runs on the Workers Paid plan, $5 a month.
Try it on two phones
Open BIGBOARD.GAMES on two phones and tap Start a table on one. Put them next to each other and watch the puck at the gap. Since the Reddit post I added 5 new games: Paddle Tennis, Tower Defense, Billiards with snooker, Secret Words and Go with Gomoku. Two of them came from the comments: the same top comment asked for a co-op tower defense, and another one for pool and snooker. There are 15 free games now. I write about building it on my blog, and the launch post has the story from the first days.
If you know a better way to get the real size of a screen in a browser, please tell me in the comments. I'd really like to hear it.
I first wrote a shorter version of this post for players on the BIGBOARD.GAMES blog.



