Skip to content

A JavaScript library for easily creating 15x15 webpage crossword puzzles.

License

Notifications You must be signed in to change notification settings

tlong314/cruciverb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CruciverbJS

A JavaScript library for easily creating webpage crossword puzzles.

Usage

Include an external script reference to cruciverb.js (or cruciverb.min.js) in your webpage before initializing the puzzle. Also remember to include an external stylesheet reference to cruciverb.css to ensure that the puzzle is rendered properly.

Basic initialization of a Cruciverb element (which will automatically create, draw, and initialize the puzzle) is done by invoking the Cruciverb constructor:

var crux = new Cruciverb(options);

where options is a simple JavaScript object with the keys described below.

Options

answers {string} - Required. A string of length 225 (i.e., 15 x 15) representing the squares of the puzzle from top left to bottom right, one row at a time. Each character should be a letter representing the answer letter in that square or an underscore _ representing a black square.

clues {Object} - Required. A primitive JavaScript object with two keys, "Across" and "Down", each pointint to an object where the keys represent the clue number, and the properties represent the corresponding clues.

hostElement {Object} - Optional. A page element that the puzzle will be rendered inside of (otherwise will be set to the element).

theme {string} - Optional. The puzzle theme (traditionally a motif/running theme that the longer clues follow).

referenceLinkName {string} - Optional. A description of your site, or a description of some link you would like the user to visit after completing the puzzle.

referenceLinkHref {string} - Optional. The actual link URL that users will be redirected to if they click the link provided after completing the puzzle.

onComplete {Object} - Optional. A callback function containing any actions you want to occur after the puzzle is completed and after the results screen is created. If you don't want the results screen to show, you can add the line document.getElementById("results_div").style.display = "none"; inside your onComplete function.

License

CruciverbJS is available for use under the MIT License.

About

A JavaScript library for easily creating 15x15 webpage crossword puzzles.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published