07.23 · Ambient & Background
Game of Life
Cells live and die by their neighbors, and patterns grow. Best for tech sites.
Watch it
It moves by itself. Click, drag or touch it to draw new cells, or press Reset to start again.
Inside, each mark shows a cell's next step: an empty cell with exactly three live neighbors is born, a live one with two or three lives on, and every other cell dies.
In By chance, each cell lives or dies at random, so the grid only twinkles. In By the rules, each cell counts its neighbors, so shapes grow, move and settle.
Try it
Change a setting and see the difference as it moves.
Speed
How quickly one generation follows the next.
Cell size
Smaller cells make a bigger world; on phones the small ones are a little larger.
Start pattern
The glider gun fires gliders forever; the acorn grows from seven cells.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add a Game of Life background to [the section you want it behind]. Split a canvas into a grid of square cells, each alive or dead, and at a steady pace work out the next generation from each cell's eight neighbors: a dead cell with exactly three live neighbors is born, a live cell with two or three stays alive, and every other cell dies. Time the generations by elapsed time, not by frames, and when the settings include trails, let dying cells fade out. Let the visitor click, drag or touch to draw cells, and start again when the world settles. Keep the cells from getting too small on phones. If the visitor has reduced motion turned on, show one still frame. Match the settings listed below.
Your settings
Replace the words in brackets with your own element. Your settings are added at the end.
Free and open source. If this helped, a star on GitHub helps other people find it.
Star on GitHubWhat it is
The full explanation is in README.md.