Comments (5)
@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.
Didn't account for a case where someone changes their mind...
from chess-elm.
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.
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...
from chess-elm.
@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)
- Create a function that returns a list of available pawn moves HOT 2
- Create a way to move pieces HOT 3
- Refactor moves file
- Do you need elm-live? HOT 2
- Grade moves by colour
- Epic: Backend? HOT 1
- Update readme HOT 8
- Manage who's turn it is
- Spike captures HOT 3
- Create logic that will allow "en passant" captures HOT 4
- When a king is in check do not allow illegal moves HOT 1
- Store current game state in local storage
- Track previous move HOT 4
- club soda testing HOT 7
- Time management HOT 21
- Focus on UI (What People See) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chess-elm.