GithubHelp home page GithubHelp logo

webxdc-scores's Introduction

webxdc-scores

Library to facilitate the process of creating score-based webxdc games.

Install

npm install git+https://github.com/webxdc/webxdc-scores.git

Usage

Import webxdc-scores lib (webxdc.js also needs to be included) in your index.html:

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <script src="webxdc.js"></script>

    <script type="module">
      import "webxdc-scores";
      // you can use window.highscores here
    </script>
  </head>
  <body>
    ...
  </body>
</html>

Usage without modules

Include webxdc-scores lib (together with webxdc.js) in your index.html:

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />

    <script src="webxdc.js"></script>
    <script src="./node_modules/webxdc-scores/dist/webxdc-scores.umd.js"></script>
  </head>
  <body>
    ...
  </body>
</html>

Then you will have an scores API via window.highscores object, check dist/webxdc-scores.d.ts file for documentation of the available API.

โš ๏ธ NOTE: If you use window.highscores.getScoreboard() you need to include dist/webxdc-scores.css in your index.html, edit it to adapt the scoreboard style to your app.

For a full example check the index.html file included in this repository.

webxdc-scores's People

Contributors

adbenitez avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.