Giter VIP home page Giter VIP logo

minesweeper-wc's Introduction

minesweeper-wc

Have you always wanted to sweep mines, but with Web Components?

Live Demo

https://minesweeper-wc.onrender.com/

Build

npm install
npm run build

Note: tsc -w should also work after initial setup.

Note: build command copies tests/test.html to dist/index.html

I liked being able to edit it in the tests folder before. Now you need to run a build step every time. #TODO

To do:

  • Sometimes no mines spawn (since the spawning is purely random)
  • Sometimes one click wins the game, even if many mines spawn, because flood-fill algorithm uncovers the whole board in one click. (How to detect and prevent this?)
  • Look into how to generate a No Guess board.
  • MineSweeper.render() is atrocious. I think making a Cell component would clear things up a lot.
  • MineSweeper's <template> is currently in test.html, which doesn't make sense. I could move it into MineSweeper, but having it in JS seems to defeat the purpose of having a template?
  • Component styles are intest.html, which again doesn't seem right. These could be moved to a css file, but the whole point of WebComponents is that things are self-contained. I need to look into styling WebComponents. Examples put a <style> node directly in the custom element (with Shadow DOM), is that really the right solution?
  • UX: Red mines being red on win is confusing
  • UX: Apply .glow to HighScore when it increases
  • Aesthetics? Not happy with the current layout
  • Shadow DOM? (May be necessary for sane styling)
  • Nicer dev workflow. (See complaint about editing html files in build section)

minesweeper-wc's People

Contributors

avelican avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.