{"id":19552993,"url":"https://github.com/emilracz21/tictactoe-javascript","last_synced_at":"2026-06-04T23:31:21.030Z","repository":{"id":207911818,"uuid":"720410800","full_name":"emilRacz21/ticTacToe-javascript","owner":"emilRacz21","description":"This repository contains a simple Tic Tac Toe game implemented in JavaScript, HTML, and CSS. The game allows two players, \"X\" and \"O,\" to take turns playing on a 3x3 grid, with the objective of placing three of their marks in a horizontal, vertical, or diagonal row.","archived":false,"fork":false,"pushed_at":"2024-10-23T20:09:28.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-19T23:03:33.950Z","etag":null,"topics":["css","frontend","game","game-development","html","html-css-javascript","javascipt","javascript","js","ui-design","ux-ui","web"],"latest_commit_sha":null,"homepage":"https://tic-tac-toe-er.netlify.app/","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/emilRacz21.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}},"created_at":"2023-11-18T12:03:31.000Z","updated_at":"2024-12-10T09:19:59.000Z","dependencies_parsed_at":"2023-11-18T12:29:51.586Z","dependency_job_id":"cd4ebfeb-a44a-46aa-b5cd-f19b9259aed0","html_url":"https://github.com/emilRacz21/ticTacToe-javascript","commit_stats":null,"previous_names":["emilracz21/tictactoe-javascript"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/emilRacz21/ticTacToe-javascript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilRacz21%2FticTacToe-javascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilRacz21%2FticTacToe-javascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilRacz21%2FticTacToe-javascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilRacz21%2FticTacToe-javascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emilRacz21","download_url":"https://codeload.github.com/emilRacz21/ticTacToe-javascript/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilRacz21%2FticTacToe-javascript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33924832,"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-04T02:00:06.755Z","response_time":64,"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":["css","frontend","game","game-development","html","html-css-javascript","javascipt","javascript","js","ui-design","ux-ui","web"],"created_at":"2024-11-11T04:20:37.211Z","updated_at":"2026-06-04T23:31:20.995Z","avatar_url":"https://github.com/emilRacz21.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tic Tac Toe Game\n\nThis repository contains a simple Tic Tac Toe game implemented in JavaScript, HTML, and CSS. The game allows two players, \"X\" and \"O,\" to take turns playing on a 3x3 grid, with the objective of placing three of their marks in a horizontal, vertical, or diagonal row.\n\n* [Tic Tac Toe Game](https://tic-tac-toe-er.netlify.app/)\n\n## Features\n\n- Two-player gameplay.\n- Win detection for both \"X\" and \"O\".\n- Score tracking for both players.\n- Animated UI interactions for an enhanced user experience.\n\n## Code Overview\n\n### Initial Setup\n\n- **Current Player**: The game starts with player \"X\".\n- **Winning Combinations**: An array defines all possible winning combinations on the board.\n- **Score Tracking**: Points are stored for both players.\n\n### HTML Elements\n\n- The game board is represented by a series of `\u003ctd\u003e` elements.\n- Player scores are displayed in designated elements with the classes `.player` and `.player-points`.\n\n### Game Logic\n\n1. **Game Start**:\n   - The game begins when a player clicks on an empty cell.\n   - The clicked cell updates to reflect the current player's symbol (\"X\" or \"O\").\n\n2. **Player Switch**:\n   - The function `setColorAndSwitchPlayer` changes the text color of the current player's symbol and switches to the next player.\n\n3. **Win Checking**:\n   - The `checkWinner` function checks if the current player's symbols form any of the winning combinations. If a player wins, the score is updated, and the game board resets.\n\n4. **Board Reset**:\n   - The `restartGame` function resets the game board and allows players to continue playing.\n\n5. **Animations**:\n   - The game features animations for cell clicks and player turns to enhance user experience. The `animBoard` function handles these animations.\n\n### Game Colors\n\n- The `getBoardColor` function applies specific background colors to the board cells for a better visual appearance.\n\n## How to Run\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/emilRacz21/ticTacToe-javascript.git\n   cd ticTacToe-javascript\n2. Open index.html in a web browser.\n\n3. Enjoy the game!\n\n## Contributions\n\nContributions are welcome! Feel free to open an issue or submit a pull request.\n\n## Design\n\n![TicTacToe](https://github.com/user-attachments/assets/496c3fab-97d7-442c-998a-35917f56d4a5)\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femilracz21%2Ftictactoe-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femilracz21%2Ftictactoe-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femilracz21%2Ftictactoe-javascript/lists"}