GithubHelp home page GithubHelp logo

ronfromhp / pgn-viewer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lichess-org/pgn-viewer

0.0 0.0 0.0 1015 KB

PGN viewer widget

Home Page: https://lichess.org

License: GNU General Public License v3.0

Shell 0.47% JavaScript 1.49% TypeScript 49.47% CSS 4.47% SCSS 44.10%

pgn-viewer's Introduction

Lichess PGN Viewer

PGN viewer widget, designed to be embedded in content pages.

This won't replace a fully featured analysis board.

board with move variation tree

See it in action

License

Lichess PGN Viewer is distributed under the GPL-3.0 license (or any later version, at your option). When you use it for your website, your combined work may be distributed only under the GPL. You must release your source code to the users of your website.

Please read more about GPL for JavaScript on greendrake.info.

Goals

  • load and render very fast
  • browse through a game
  • variation tree
  • PGN comments
  • players and clocks
  • mobile support
  • translatable and customisable
  • client-side only
  • easy to set up on any page

Non Goals

  • custom user moves
  • engine support
  • opening explorer

For these features, use an analysis board or Lichess studies.

Build and run

npm install
npm run sass-dev
npm run watch
npm run demo

Then run the demos in your browser.

Rebuild on code change

npm run watch

Installation

As an NPM package

npm i lichess-pgn-viewer

Usage

import LichessPgnViewer from 'lichess-pgn-viewer';

LichessPgnViewer(domElement, {
  pgn: 'e4 c5 Nf3 d6 e5 Nc6 exd6 Qxd6 Nc3 Nf6',
});

Configuration

LichessPgnViewer(domElement, {
  pgn: 'e4 c5 Nf3 d6 e5 Nc6 exd6 Qxd6 Nc3 Nf6',
  // ... more Config
});

See all configuration options in the documented source code.

View more examples in demo/index.html

pgn-viewer's People

Contributors

niklasf avatar ornicar avatar ronfromhp avatar schlawg 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.