No description
Find a file
2022-11-28 09:52:03 +01:00
src chore: update readme; add link to source code 2022-11-28 09:24:17 +01:00
.gitignore initial commit 2019-12-08 16:36:29 +08:00
index.html chore: update readme; add link to source code 2022-11-28 09:24:17 +01:00
instructions initial commit 2019-12-08 16:36:29 +08:00
package-lock.json Bump nth-check and optimize-css-assets-webpack-plugin 2022-11-28 07:17:16 +00:00
package.json Bump nth-check and optimize-css-assets-webpack-plugin 2022-11-28 07:17:16 +00:00
README.md chore: update readme 2022-11-28 09:52:03 +01:00
webpack.config.js access mode in webpack config 2019-12-16 18:21:49 +08:00

Play Minesweeper Online

Netlify Status

This is the classic game Minesweeper built with vanilla JS (i.e., no framework dependency).

Stack:

  • HTML, JS, and CSS
  • Webpack for bundling
  • Firebase for leader board store
  • Netlify for hosting

Project motivation

One day, while working in my home office, I heard loud and fast mouse clicks coming from our bedroom. It's my wife, playing her favorite game (Minesweeper) on a crappy website full of advertisements.

I can't allow this, it's a security issue. 🤣

But it is also an opportunity.

I wanted to give her the same game, with a similar leader board she can dominate. But I also saw it as a chance to dig deeper into vanilla JS.

Can I make page with complex interactions (more on this later) without any dependency?

What I have learned:

We don't always necessarily need JS frameworks (or TS)

Even subtle UI changes can improve user experience

There's more ways to break you're app than you are initially aware of

Competition motivates users to use your app more

Hash in bundled filenames help issues in browser caching (when shipping versions fast)

Development

To start development, you need node v16 (the dev server doesn't work on v18 yet). Once you know you have this, you can do the following:

  1. Install dependencies: npm i
  2. Start the dev server: npm run dev

Sorry there's no hot reloading. You have to reload the app after making a change. OR contribute to enable HMR? ;)

Running Locally

After running the commands to start development, open in a browser: http://localhost:4200

Live Demo

👉 The live site is here: Minesweeper