Giter Site home page Giter Site logo

Comments (5)

nelsonic avatar nelsonic commented on June 29, 2024 4

@RobStallion as your intuition is suggesting, if you want your game/UI to be mobile first (or even just mobile "friendly"), you will need to register the tap or mouseclick event and activate the the highlight. see: https://developer.mozilla.org/en-US/docs/Web/API/Touch_events
For desktop (or anywhere a long press or mousedown can be tracked), display the valid moves on that action and hide them on mouseleave
I feel this is an (incredibly) "nice to have" feature to be considered much later. 🤔
And if you could display the range of moves by color grading (brighter highlights are better moves) it would "win the internet"!

from chess-elm.

RobStallion avatar RobStallion commented on June 29, 2024 1

Didn't account for a case where someone changes their mind...

image

from chess-elm.

RobStallion avatar RobStallion commented on June 29, 2024

I feel this is an (incredibly) "nice to have" feature to be considered much later. 🤔
And if you could display the range of moves by color grading (brighter highlights are better moves) it would "win the internet"!

@nelsonic I really like this idea (A LOT). I don't want to forget it so I am going to put it into it's own issue and label as a stretch (or something along those lines). Thanks 👍

from chess-elm.

RobStallion avatar RobStallion commented on June 29, 2024

I have managed to get this working (as an onClick event for the time being). It is a little ugly right now but it is showing that it is working as expected...

image

from chess-elm.

nelsonic avatar nelsonic commented on June 29, 2024

@RobStallion indeed. clicking a different piece should reset the available moves highlight for the previous piece. 😉
Looking good so far. 👍

from chess-elm.

Related Issues (17)

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.