Code Monkey home page Code Monkey logo

hz-crossword's Introduction

hz-crossword

hz-crossword is an haztivity resource wrapper for jq-crossword

hz-crossword uses jq-crossword under the hood.

Install

NPM

npm i --save @haztivity/hz-crossword

Dependencies

  • JQuery
  • jq-crossword
  • @haztivity/core

Usage

  1. Import @haztivity/hz-crossword
  2. Add HzCrossword to the page
  3. Set data-hz-resource="HzCrossword"

Ts

import {PageFactory, Page, PageController, PageRegister} from "@haztivity/core";
import template from "./page.pug";
import {HzCrosswordResource} from "@haztivity/hz-crossword";
export let page: PageRegister = PageFactory.createPage(
    {
        name: "myPage",
        resources: [
            HzCrosswordResource
        ],
        template: template
    }
);

Pug

div
    -
       var definition = {
           "height":8,//height of the board, 8 cells
           "width":5,//width of the board, 5 cells
           "acrossClues":[
               {
                   "number":1, //number to identify the world, must be unique
                   "x":1,//The x position where the word starts, starting from 1
                   "y":2,//The y position where the word starts, starting from 1
                   "answer":"Hello",//the word itself
                   "clue":"A common greeting",//the clue
                   "hints":[2],//the letter 'e' is a hint. Starting from 1
               },
               {
                   "number":2,
                   "x":3,
                   "y":5,
                   "answer":"Old",
                   "clue":"Having lived for a long time; no longer young."
               }
           ],
           "downClues":[
               {
                   "number":1,//this clue starts in the same cell that "Hello", so it must have the same number
                   "x":1,
                   "y":2,
                   "answer":"History",
                   "clue":"The study of past events, particularly in human affairs.",
                   "hints":[2,7]
               },
               {
                   "number":3,
                   "x":5,
                   "y":1,
                   "answer":"World",
                   "clue":"The earth is our _____"
               }
           ]
       }
    div(data-hz-resource="HzCrossword", data-opt-jq-crossword-definition=definition)

Options

jq-crossword options

All the options of jq-crossword except functions could be specified by attributes using:

    data-opt-jq-crossword-[option]=[value]

If the option have multiple words, use dashes, for example acrossListTitle have to be provided as across-list-title

For more info please visit jq-crossword

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.