The good old Minesweeper, but coded in ReactJS and with a declarative UI!
Check the Demo
Table of Contents
React Minesweeper is a small hobby project that I've created to put in practice a new way to create interfaces for WEB applications.
The game component was entirely created with a declarative UI. That means, we have not a single CSS file in use.
Also, no image file was used to create the UI. What you might think is an image, is basically an emoticon.
I made use of Chakra UI to create the interface. And the rest of the code is simply Typescript.
Feel free to fork the project and use it as you will. Just mention me somewhere :D
The only dependency in this project is the Chakra UI, that is used to create the UI.
Running your own "React Minesweeper" project is very simple!
- Clone the repo
git clone https://github.com/marcelo-bottoni/react-minesweeper
- Install packages
yarn install
- Run the application
yarn dev
The "React Minesweeper" project provides one component called "Minesweeper" that you can add anywhere and have the game up and running! Check the code below. It adds the game to a ReactJS page.
import { Minesweeper } from './components/Minesweeper';
export function SamplePage ()
{
return (
<div>
<Minesweeper size={{rows: 9, columns: 9}} bombs={10}/>
</div>
);
}
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Marcelo F Bottoni - @marcelo-bottoni - marcelo.bottoni.85@gmail.com
Project Link: https://github.com/marcelo-bottoni/react-minesweeper