{"id":50519765,"url":"https://github.com/josedasilva11/2048-game","last_synced_at":"2026-06-03T03:06:30.206Z","repository":{"id":350736327,"uuid":"1208074323","full_name":"josedasilva11/2048-game","owner":"josedasilva11","description":"The classic 2048 sliding puzzle game with smooth animations, undo, and mobile support. Built with vanilla JavaScript.","archived":false,"fork":false,"pushed_at":"2026-04-11T19:36:04.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-11T21:20:42.178Z","etag":null,"topics":["2048","css-animations","game","github-pages","html5","javascript","puzzle","responsive","touch-support","vanilla-js"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/josedasilva11.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-11T19:31:38.000Z","updated_at":"2026-04-11T19:36:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/josedasilva11/2048-game","commit_stats":null,"previous_names":["josedasilva11/2048-game"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/josedasilva11/2048-game","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josedasilva11%2F2048-game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josedasilva11%2F2048-game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josedasilva11%2F2048-game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josedasilva11%2F2048-game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/josedasilva11","download_url":"https://codeload.github.com/josedasilva11/2048-game/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josedasilva11%2F2048-game/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33845814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2048","css-animations","game","github-pages","html5","javascript","puzzle","responsive","touch-support","vanilla-js"],"created_at":"2026-06-03T03:06:29.677Z","updated_at":"2026-06-03T03:06:30.201Z","avatar_url":"https://github.com/josedasilva11.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧩 2048\n\nThe classic 2048 sliding puzzle game with smooth CSS animations, undo support, and full mobile compatibility — built entirely with **vanilla JavaScript**. No frameworks, no dependencies.\n\n| Start | Gameplay |\n|:-----:|:--------:|\n| ![Start](screenshot.png) | ![Gameplay](screenshot-gameplay.png) |\n\n## 🎮 Play Now\n\n**[▶ Play 2048](https://josedasilva11.github.io/2048-game/)**\n\n## ✨ Features\n\n- **Smooth Tile Animations** — CSS transitions for sliding + pop effect on merge\n- **Undo Support** — Go back up to 20 moves with the undo button\n- **Responsive Design** — Works perfectly on desktop and mobile\n- **Touch / Swipe Controls** — Swipe to move tiles on mobile devices\n- **Keyboard Controls** — Arrow Keys or WASD\n- **Score Tracking** — Current score and best score (persisted in localStorage)\n- **Win \u0026 Game Over Detection** — Visual overlay messages with play-again option\n- **Keep Playing Mode** — Continue after reaching 2048 to chase higher tiles\n- **Zero Dependencies** — Pure HTML, CSS, and JavaScript\n\n## 🕹️ How to Play\n\n1. Use **arrow keys** or **swipe** to slide all tiles in one direction\n2. When two tiles with the **same number** collide, they **merge** into one\n3. Each merge adds to your score\n4. Try to create a **2048** tile!\n\n## 🏗️ Tech Stack\n\n- **HTML5** — Semantic game layout\n- **CSS3** — Grid layout, transitions, animations, CSS custom properties\n- **Vanilla JavaScript** — Game logic with grid rotation algorithm\n- **localStorage** — Best score persistence\n\n## 📁 Project Structure\n\n```\n2048-game/\n├── index.html    # Game page with grid layout\n├── style.css     # Tile colors, animations, responsive design\n├── game.js       # Complete game engine (~350 lines)\n└── README.md\n```\n\n## 🧠 How the Engine Works\n\nThe game uses a **rotation-based algorithm**: instead of implementing slide logic for all 4 directions, the grid is rotated so that every move becomes a \"slide left\" operation. This keeps the code clean and DRY.\n\n```\nMove Right = Rotate 2x → Slide Left → Rotate 2x back\nMove Down  = Rotate 3x → Slide Left → Rotate 1x back\n```\n\n## 🚀 Run Locally\n\n```bash\ngit clone https://github.com/josedasilva11/2048-game.git\ncd 2048-game\nopen index.html\n# or: npx serve .\n```\n\n## 📄 License\n\nMIT License — feel free to fork and modify.\n\n---\n\nBuilt by [José Pedro Silva](https://github.com/josedasilva11)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosedasilva11%2F2048-game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosedasilva11%2F2048-game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosedasilva11%2F2048-game/lists"}