Skip to content

feat: add interactive Game of Life cellular automata page#6

Open
arc-butler wants to merge 1 commit into
ARC345:mainfrom
arc-butler:feat/game-of-life
Open

feat: add interactive Game of Life cellular automata page#6
arc-butler wants to merge 1 commit into
ARC345:mainfrom
arc-butler:feat/game-of-life

Conversation

@arc-butler

Copy link
Copy Markdown
Contributor

What

Adds an interactive Game of Life (Conway's cellular automata) simulation as a new page on the site, accessible from the navbar dropdown.

Why

Arnav's about page lists cellular automata as a core interest. This puts a living, interactive demonstration of that interest directly on the site — it's a conversation starter that's also genuinely fun to play with.

What makes it weird

  • The initial seed pattern is derived from Arnav's actual travel coordinates — lat/lng from the travel map are mapped to grid cells, so every trip he's taken becomes a live cell at startup
  • Blog post count, project count, and travel count are embedded in the seed data (though not all visually displayed — they affect the organic random fill density)
  • Cell brightness decays with age: newborn cells glow, veterans fade — giving the simulation a living-organism feel
  • Toroidal (wrap-around) grid so patterns can migrate across edges
  • Dark/light mode aware — reads CSS custom properties from the theme system and re-draws on theme toggle
  • Keyboard shortcuts: Space (toggle), C (clear), R (randomize) — plus click to toggle individual cells

What's sensible

  • Pure frontend: Canvas API, zero dependencies, one JS file
  • Conway's Game of Life is a computer science classic — no gimmick value, just a well-executed interactive demo
  • Follows existing al-folio conventions: Jekyll page with embedded Liquid data (same pattern as the Leaflet travel map in _layouts/leaflet_map.liquid)
  • Reuses the site's CSS custom properties for theming
  • Adds to the existing navbar dropdown (bookshelf > life > divider > blog)

Files changed

  • _pages/life.md (new) — Jekyll page with embedded Liquid data and canvas container
  • assets/js/game-of-life.js (new) — Full Game of Life engine: grid, rendering, controls, seeding
  • _pages/dropdown.md (modified) — Added "life" link to the dropdown menu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant