An enhanced version of the classic 2048 game, featuring an undo mechanic and a fast mode!
- Made a wrong move? No worries!
- Just hit the "Undo" button to go back one step.
- You can undo as many times as you like, all the way back to the start.
- Never let a slip of the finger ruin your game again!
- Enter the magic sequence: ⬅️⬅️ ➡️➡️ ➡️➡️ ⬅️⬅️ (left, left, right, right; right, right, left, left).
- All tiles will magically turn into 128!
- An Easter egg to skip the early grind — just for fun.
This project has been refactored into a Pure Frontend Single-Page Application (SPA), making deployment and playing extremely lightweight.
git clone https://github.com/sz30/2048--.gitor download the zip.- Unzip it and simply double-click
index.htmlto start playing in your browser!
Zero-cost, one-click deployment with global CDN using hosting platforms. Click the buttons below to deploy instantly:
Or configure manually:
- GitHub Pages: Fork repo -> Settings -> Pages -> Enable Deploy from a branch (select main) -> Save.
- Cloudflare Pages: Dashboard -> Pages -> Connect to Git (select repo) -> Framework preset:
None-> Deploy.
For advanced users with their own servers (e.g., Serv00):
- Install Nginx on your server.
- Upload
index.htmlto your Nginx web directory (usually/var/www/html). - (Optional) Configure an Nginx virtual host for your domain and restart the service.
(For a detailed step-by-step guide, please refer to the built-in DEPLOYMENT.md)
2048--/
├── assets/ # Historical files and media resources
├── index.html # Main file containing all HTML/CSS/JS
└── DEPLOYMENT.md # Deployment guide
File Descriptions:
assets/: Stores historical project files and media resources (such as demonstration screenshotsdemo_v2.png).index.html: The core file. This game has been extremely stripped down; all structure (HTML), styling (CSS), matrix calculation, and game mechanics (JS) are encapsulated in this single file. This follows the KISS principle, making distribution and hosting extremely easy.DEPLOYMENT.md: Step-by-step guide for deploying the application (Static hosting & VPS).
Thanks to the ultra-minimalist single-file architecture, modding this game couldn't be easier! No build tools or dev environments required. Just open index.html in any text editor:
- Tweak the UI: Locate the
<style>block at the top to completely overhaul the theme colors, tile border-radius, or typography. - Hack the Mechanics: Scroll down to the
<script>block where all matrix logic and scoring live. Want a 5x5 board? A new cheat code? Go for it!
The code is standalone and begging to be hacked. Have fun!
- license: GPL-2.0
- Still updating! Issues and PRs are super welcome—let’s make this game even more awesome together!
Thanks to the following sponsors for supporting this project:
- / providing the server
Last updated: May. 2026
