CSS Hole docs
How to play the games and use the tables, all of which run on HTML and CSS alone.About
CSS Hole is a collection of projects that test the limits of what is possible without any JavaScript. Enjoy the games, try to figure out how they are possible, or get inspired to create your own alternatives.
Chess
You can play chess against yourself or a friend on the same computer. If you are using a phone or older laptop, the game may be unplayably slow. Even if you have a fast computer the full game may not provide the fast-paced experience that most chess players crave.
The chess puzzles are quite a bit faster and not timed if the full game is too slow. Firefox seems to be faster.
How to Play
For the most part illegal moves are not playable. Most commonly, it is possible to make plays that keep your king in check. There is also no tracking of whether en passant or castling are currently legal. Every legal move should be playable, and almost all of them will display a neon green-blue helper covering legal destinations.
In general, a turn consists of clicking the piece you want to move then clicking the destination square and then clicking your clock.
White should take its first turn before pressing the clock to start the clock for black. Once you have pressed your clock the board will flip and it will be your opponent’s turn.
To capture a piece you must click the destination square twice. The first click will remove the opponent’s piece and the second will move your piece to that square.
En passant is possible. First click the piece you wish to move, then click the piece you want to remove, then click the square you wish to move to. The computer allows en passant at all times, so make sure your opponent does not try to do something illegal.
Castling requires moving the king to the desired square (one square at a time) and then moving the rook to the desired square. The computer always allows castling so watch your opponent.
To promote your pawn to a queen, first move your pawn to its destination where it will appear as a queen. If you are capturing use the normal procedure. Your old pawn will still be on the board. A new square at the top right of the board should have appeared. Click this square at the end to remove your pawn.
It is currently only possible to promote to queen, and you are only able to have a max of 3 queens on the board at the same time.
If you click something that causes something weird to happen then there is unlikely any recourse other than restarting the game. If you select the wrong piece to move, click it again to unselect it. Turns only end when the clock is pressed so you can make multiple (or 0) moves either intentionally or accidentally.
Chess Puzzles
The chess puzzles are untimed, significantly faster on most devices, and work the same way as the regular game. You will always play as the white pieces and must mate to win. If you try to take a turn and nothing happens that means that you have not selected the best move. Try another move. Once you have found the best move, a new button might appear below the board. If so, click this button to see your opponent’s response. If not, that means you have successfully checkmated your opponent!
Sudoku
Play sudoku by selecting a number from the top row and then placing it in the desired square. Only legal plays should be playable. As you hover over a square, other available squares in the same row, column, or 3x3 block will be different colors. These colors may or may not be helpful to you, but they were really hard to implement so they are not optional.
Sudoku Farm
CSS only Sudoku Farm is played in a similar manner to normal Sudoku Farm, but the gameplay can range from noticeably slow to unplayably slow depending on your computer/browser. Firefox seems to work significantly faster right now, but that may depend on the version/OS and could change at any time. If you run out of a resource then it will show a negative number in the total row. Admitting defeat at this point relies on the honor system.
Sudoku Variants
Three variants from SudokuFarm.com, with a few puzzles of each level here.
In Football Sudoku every row is a drive that has to gain its yards before the punt; in
Baseball Sudoku every row is an inning that has to score its runs before the third out;
and Gerrymandered Sudoku swaps the boxes for zones drawn so the even digits win
most of them. Pick a pen above the grid and click cells to fill them in. "Show mistakes" marks wrong cells, and the grid
turns green when the puzzle is solved: each cell is checked against the answer, with CSS's :has()
selector. Each game's page explains its rules, and SudokuFarm.com has hundreds more puzzles, with hints and printable
pages.
Sortable Table
A large, paginated table that can easily be sorted and is somewhat filterable. The stats come from the Lahman Baseball Database, the war data comes from https://www.baseball-reference.com/, and the wOBA constants come from https://www.fangraphs.com/guts.aspx. The data is updated once a year, after the season ends, so the newest season shows up the following winter or spring.
You can sort the table by clicking the column header. Click the ascending or descending button below the table to change the sort order.
In the options box there is an option to filter for minimum PA or IP. The left column sets the hundreds digit, the middle column sets the tens digit, and the right column sets the ones digit.
Move to a different page of results by clicking the page number in the bottom right.
~FIP
The ~FIP stat is computed the same way as regular FIP1 with expected IP replacing IP. Expected IP is the sum of expected outs from balls in play plus strikeouts. The league average for outs per ball in play is multiplied by each pitcher’s balls in play and then added to their strikeouts. It only has a significant impact on pitchers who have faced a few batters, but is probably better in these cases. For one thing there are fewer 0s in denominators.
1 FIP = Fielding Independent PitchingMath Quiz
Enter the answer to each trigonometry question. Answer 16 in a row correctly to win. You should be able to enter sqrt(3) or root(3) for . Use the unit circle to see where the various angles are. Hover over the square and move the mouse to different locations to get the angle in radians.
15 Puzzle
In the 15 puzzle, click a tile next to the gap to slide it. Put the numbers in order, 1 to 15, with the gap in the bottom-right corner. There are 60 puzzles: 1–20 are easy, 21–40 medium and 41–60 hard.
“Show hints” lights up the tile that a solver written in CSS would move next. Keep clicking the lit tile and the puzzle solves itself, row by row, then the last two rows a column at a time. “Start over” puts the tiles back where they began.
Fox and Geese
In Fox and Geese you play the geese against a fox whose moves are chosen by CSS. The two sides take turns moving along the paths between cities, and the geese move first.
A goose can move one step to any empty city that is joined to it by a path. The fox can do the same, or jump over one goose to remove it; a jump has to stay on one path, so it ends on an empty city along the same coloured path. The fox wins by reaching Rome (the city with the red border) or by removing enough geese. You win by trapping the fox so it has no move left.
To move, click a goose and then the city it should go to. Then make the fox’s move by clicking the box in the upper left: once for a normal move, three times for a jump (Jump, Kill, Done).
City Builders
The city builders are made for a computer with a mouse. The pages are very large, so they are unlikely to work on a phone or tablet.
CSSopolis
CSSopolis is an isometric city builder. The View / Edit switch at the top changes between the two modes. In Edit mode, drag the grey squares to move the roads and reshape the blocks, then pick a kind of lot in the top menu and click lots in the city to place it. Switch to View to see the finished city, with people walking in the parks and swimmers in the hotel pools. Center brings the middle of the city back on screen. It works best in Chrome.
The small map in the bottom left shows where the homes (red) and jobs (blue) are, and updates as you build. It needs CSS anchor positioning, so in older browsers it stays empty.
3D City
In the 3D city, click a block type in the menu and then a place on the map to build there. The − and + buttons zoom, the curved arrows rotate the city and the straight arrows move it. The menu counts the people and jobs in your city. The full city is 10×10 blocks; smaller ones load faster: 2×2, 4×4, 6×6 and 8×8.
Designers
The CSSopolis Designer and the 3D City Designer let you change the kinds of lots and blocks, or make your own, and try them in a live city. They are the only pages on CSS Hole that use JavaScript. When you are done you can download your city as one HTML file that needs no JavaScript. Your designs are saved in your browser, and you can share one as a link or a file.
Tables & Maps
City populations shows how many people live within 5 to 200 km of 200 big cities. Click a column name to sort by it (again to reverse), filter by continent, country or a minimum population, and page through the results.
Wikipedia by country shows which language editions of Wikipedia each country reads in a given month, in thousands of pageviews. Use the Next buttons to page across languages and down countries, and the form in the side panel to pick another month.
Near-earth objects lists this week’s asteroid close approaches from NASA, nearest first. Distances are in lunar distances (LD), the distance from the Earth to the Moon.
On the electoral map, click a state to cycle through its colours and watch the totals change. Open Help to choose how many colours the map has (2 to 7). The merge map lets you merge states: click a state, then one of the 13 original colonies (they are labelled) to merge it into that one.