Giter VIP home page Giter VIP logo

crosswords-js's People

Contributors

allcontributors[bot] avatar dwmkerr avatar github-actions[bot] avatar guardrails[bot] avatar mmkal avatar pvspain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

crosswords-js's Issues

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

demo doesn't seem to be working!

Hi! This looks very nice - but I tried to play around with it and the github pages site doesn't seem to render anything (other than the word "AcrossDown" - a clue??)

image

How to validate answers?

I didn't get how to validate answers.

  1. crosswordDefinition doesn't contains right answers.
  2. I didn't find a way to catch typed answers, to validate them after. #1
  3. I didn't find a way to highlight the answers.

Implement core features of "The Guardian" style crossword

Here's a sample:

image

https://www.theguardian.com/crosswords/quick/16472#5-across

Features that this has, that we might implement (note that we should split the samples to have a 'vanilla' sample, then a 'guardian' sample, that changes the styles (showing you can style your crosswords how you like):

  • url includes current clue, meaning we can share links to clues
  • clue list on RHS
  • blinking cursor, better cell highlight
  • backspace to delete cells, rather than move back
  • reveal
  • check
  • reveal all
  • check all
  • TODO check what else is missing!

[Feature Request] copying a revealed word

Hello ! nice project you got here guys, just I taught I share a feature that came to my mind while testing the app, copying a revealed word, sometimes when we reveal a word we don't know it and try to web search it, would be easier to quickly copy paste in search bar.

Error: Cannot find module './compile-crossword'

When I run the basic example illustrated in the README, the following error appears:

internal/modules/cjs/loader.js:883
throw err;
^

Error: Cannot find module './compile-crossword'
Require stack:

  • /home/diego/cursos/node/testlibs/crosswordsjs/node_modules/crosswords-js/src/index.js
  • /home/diego/cursos/node/testlibs/crosswordsjs/index.js

Stop using <input> fields

Hi again! A problem that crosswords-js (and some other HTML-based crossword software I've come across) has is that on iPhone, using an input field opts in to some unwanted functionality (it may also happen on Android). For example, when you tap on the current cell to switch from across to down, a popup appears offering for you to "Select" the text in the input:

image

Also, for users with dark mode enabled, Safari iOS automatically changes the input background to be dark, making the difference between light and dark cells almost invisible:

image

Both of these could be controlled for by using a div or span with a keypress listener. This is, I think, roughly what squares.io does:

squares.io:

image

The Guardian uses an input, but is somehow hiding it so it's not clickable. They use some kind of customised HTML tags to actually show the entered letter:

image

I think the squares.io approach would be easier! I'd be happy to submit a pull request making this change after #42 is in, if you'd be open to it @dwmkerr and @pvspain ?

(Side-note: the modified styling in the first couple of screenshots is taking advantages of the overridable CSS variables in #41!)

Be server-side-rendering friendly

Hi @dwmkerr and/or @pvspain - curious if this has come up so far. I'm using crosswords-js on a react application, and have noticed there can be a lag between page load and the crossword being rendered. I think that part of this is the cost of iterating through the clues, validating them, and calling document.createElement(...) for the grid, for each cell, and for each clue.

It's very useful to have the signature of the CrosswordController class just be a model and two elements for the grid and the clues, for getting started quickly. But it'd be useful to be able to pass fully-hydrated HTML element references in, and just have the controller attach the various event handlers/callbacks. That way, the crossword itself could be server-side rendered, cached, and loaded instantly, with the support for interactions coming after the user loads the page.

It might be possible to implement as simply as moving all the document.createElement(...) calls to a method, and call it conditionally, based on whether the dom element looks to be ready already or not:

class CrosswordController {
  constructor(crosswordModel, domGridParentElement, domCluesParentElement) {
    const domElementsReady = this.checkIfDomElementsAreReady(domGridParentElement, domCluesParentElement)
    if (!domElementsReady) {
      this.createView()
    }
  }

  createView() {
    this.#crosswordGridView = this.#document.createElement('div');
    // create cells, clues elements, add classes etc. etc.
  }
}

Then it'd allow people using this library to do things like generate the HTML once when a puzzle is uploaded to a dashboard, and serve that HTML much faster to users when they use it - the structure will look the same for all users.

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.