Javascript chess games viewer.
e2-e4 and ... white wins!
Chess Engine 'pgn4web' is for website developers that need a nice chess viewer.
Javascript chess games viewer for websites, blogs and live broadcasts. Chess Engine 'pgn4web' comes as software package you can to your website or blogsite, but also provides a very simple board generator web tool helping you adding chess games to your website or blog without any html and javascript coding from your side. It has been designed to make it easier adding chess games to your web pages and blogs, without the need of much knowledge of HTML or any other technicality. It also has been integrated with many popular web software platforms and services.
Javascript chess games viewer for websites
Developer: Paolo Casaschi.
Project homepage:
(including downloads and wiki)
Contact email:
pgn4web(at)casaschi.net
Package pgn4web release 2.53 set here, for new version please follow to links above.
Please note. Game variations support started from release 2.46.
~~~~~~~~~~~~
Useful links to study how pgn4web works.
home.html :: Home page of Package pgn4web release 2.53 on USA2017.INUMO.RU website.
~~~~~~~~~~~~
Features:
- display chess games form a PGN file on a dynamic chessboard on your webpage or blog
- full support for browsing game variations and reviewing comments
- shortcut keys for navigating through the game, for selecting the game from the file and much more; also uses chessboard squares as input buttons (hit escape for help)
- fully customizable display. Each item (board, button bar, game selection menu, PGN header info, game text, game comment and more) can be displayed (or hidden) at pleasure in your html file
- support different chess bitmaps (even custom bitmaps) and different chessboard sizes
- provides a very simple board generator web tool helping you adding chess games to your website or blog without any html/javascript coding
(see:
,
/cheng/board-generator/
- integrated with popular blog platforms (such as blogger and wordpress), portal platforms (such as joomla, drupal and wikimedia), forum platforms
(such as phpBB, simplemachines and vbulletin) and hosting services (such as google sites)
- integrated with HTML5 video and YouTube video
- allows for live broadcast of games
~~~~~~~~~~~~
Sample 1: Mikhail Tal :: President of USA2017
~~~~~~~~~~~~
To show sample above on your site or blog you need:
1. Get PGN code of the game:
2. Go to the page:
/cheng/board-generator/
where use following parameters:
~~~~~
game replay options
~~~~~
game :: autoplay games autoplay first game once, or loop continiously, or autoplay none
5 sec :: autoplay delay
first :: initial game
:: initial variation a number; applies only at the first game load; when blank, defaults to the main variation
start :: initial halfmove start, end, random and comment settings apply at every game load, custom number only at the first load
0 :: initial halfmove number actual halfmove number when the setting above is custom number
~~~~~
chessboard options
~~~~~
60 :: square size a number; must be larger than the piece size plus the highlight border if any
50 :: piece size default selects piece size based on square size
0font :: piece font default selects piece font based on piece size
D0D0D0 :: light squares color
303030 :: dark squares color
000000 :: board border color
border :: board shadow color a color; transparent disables the shadow, border copies the board border color
border :: square highlight mode
FFFFE0 :: highlight squares color
standard :: how to show control buttons browser's standard buttons, or custom colors below, or hidden buttons
custom control buttons background color (no use for standard mode)
custom control buttons text color (no use for standard mode)
~~~~~
header and moves options
~~~~~
10 :: text margin a number; header/moves margin, nice to have when text overflows with scrollbars
centered :: how to show game header
16 :: header font size a number
000000 :: header font color
figurine :: how to show game moves select a game moves display option or use the one click optimized puzzle setup
16 :: moves font size a number
000000 :: moves font color
FFFF90 :: highlight move color a color; background copies the background color
inline :: how to show move comments and variations inline inbetween game moves, or on a newline , or hidden
moves :: comments and variations font size a number; moves copies the moves font size
808080 :: comments and variations font color
~~~~~
header and moves options
~~~~~
horizontal :: chessboard and header/moves layout
560 :: iFrame height a number or board; min 541; when blank, assigned to board
790 :: iFrame width a number or page; min 486; when blank, assigned to page; board width is 486
05 :: iFrame padding a number; border padding around the iframe, included within the iFrame width value
transparent :: background color a color; transparent uses the parent's background color
Click 'generate the HTML code and preview your chessboard', you have to get a code like this:
Insert this code on your site or blog and all done.
~~~~~~~~~~~~
Sample 2: Carlsen, Magnus :: Svidler, Peter (Wch Blitz, Moscow, 2010.11.18)
PGN code of the game:
~~~~~~~~~~~~
Sample 3: Task 'mate in 2' (USA2017 ©)
PGN code of the task:
~~~~~~~~~~~~
Sample 4: piece font alpha, dark squares color blue.
~~~~~~~~~~~~
Sample 5: piece font merida, size of the board is little.
~~~~~~~~~~~~
Sample 6: piece font uscf.
~~~~~~~~~~~~
Sample 7: Big board, text below, piece font merida.
~~~~~~~~~~~~
Portable Game Notation (PGN) is a computer-processible format for recording chess games (both the moves and related data); many chess programs recognize this extremely popular format due to its being stored in plain text.
- Filename extension :: .pgn
- Internet media type :: application/x-chess-pgn (unregistered)
- Developed by :: Steven J. Edwards
- Initial release :: 1993
- Type of format :: Chess game record
PGN code begins with a set of "tag pairs" (a tag name and its value), followed by the "movetext" (chess moves with optional commentary).
Tag pairs.
Tag pairs begin with an initial left bracket "[", followed by the name of the tag in plain text (ASCII). The tag value is enclosed in double-quotes, and the tag is then terminated with a closing right bracket "]". There are no special control codes involving escape characters, or carriage returns and linefeeds to separate the fields, and superfluous embedded spaces (or SPC characters) are usually skipped when parsing.
PGN data for archival storage is required to provide seven bracketed fields, referred to as "tags" and together known as the STR (Seven Tag Roster). In export format, the STR tag pairs must appear before any other tag pairs that may appear, and in this order:
- Event: the name of the tournament or match event.
- Site: the location of the event. This is in "City, Region COUNTRY" format, where COUNTRY is the three-letter International Olympic Committee code for the country. An example is "New York City, NY USA".
- Date: the starting date of the game, in YYYY.MM.DD form. "??" are used for unknown values.
- Round: the playing round ordinal of the game within the event.
- White: the player of the white pieces, in "last name, first name" format.
- Black: the player of the black pieces, same format as White.
- Result: the result of the game. This can only have four possible values: "1-0" (White won), "0-1" (Black won), "1/2-1/2" (Draw), or "*" (other, e.g., the game is ongoing).
The standard allows for supplementation in the form of other, optional, tag pairs. The more common tag pairs include:
- Annotator: The person providing notes to the game.
- PlyCount: String value denoting total number of half-moves played.
- TimeControl: "40/7200:3600" (moves per seconds: sudden death seconds)
- Time: Time the game started, in "HH:MM:SS" format, in local clock time.
- Termination: Gives more details about the termination of the game. It may be "abandoned", "adjudication" (result determined by third-party adjudication), "death", "emergency", "normal", "rules infraction", "time forfeit", or "unterminated".
- Mode: "OTB" (over-the-board) "ICS" (Internet Chess Server)
- FEN: The initial position of the chess board, in Forsyth-Edwards Notation. This is used to record partial games (starting at some initial position). It is also necessary for chess variants such as Fischer random chess, where the initial position is not always the same as traditional chess. If a FEN tag is used, a separate tag pair "SetUp" must also appear and have its value set to "1".
Forsyth–Edwards Notation (FEN) is a standard notation for describing a particular board position of a chess game. The purpose of FEN is to provide all the necessary information to restart a game from a particular position.
FEN is based on a system developed by the Scottish newspaper journalist, David Forsyth. Forsyth's system became popular in the 19th century; Steven J. Edwards extended it to support use by computers. FEN is an integral part of the Portable Game Notation for chess games, since FEN is used to define initial positions other than the standard one. FEN does not represent sufficient information to decide on a draw by threefold repetition; for that, a different format such as Extended Position Description is needed.
A FEN "record" defines a particular game position, all in one text line and using only the ASCII character set. A text file with only FEN data records should have the file extension ".fen".
The board is broken into eight ranks. (A rank is a chess term for a row of eight squares running from left to right.) Each rank is converted into a string, then all eight of these strings are compacted together separated only by slashes (/).
A FEN record contains six fields. The separator between fields is a space. The fields are:
- Piece placement (from white's perspective). Each rank is described, starting with rank 8 and ending with rank 1; within each rank, the contents of each square are described from file "a" through file "h". Following the Standard Algebraic Notation (SAN), each piece is identified by a single letter taken from the standard English names (pawn = "P", knight = "N", bishop = "B", rook = "R", queen = "Q" and king = "K").[1] White pieces are designated using upper-case letters ("PNBRQK") while black pieces use lowercase ("pnbrqk"). Blank squares are noted using digits 1 through 8 (the number of blank squares), and "/" separate ranks.
- Active color. "w" means white moves next, "b" means black.
- Castling availability. If neither side can castle, this is "-". Otherwise, this has one or more letters: "K" (White can castle kingside), "Q" (White can castle queenside), "k" (Black can castle kingside), and/or "q" (Black can castle queenside).
- En passant target square in algebraic notation. If there's no en passant target square, this is "-". If a pawn has just made a two-square move, this is the position "behind" the pawn. This is recorded regardless of whether there is a pawn in position to make an en passant capture.
- Halfmove clock: This is the number of halfmoves since the last pawn advance or capture. This is used to determine if a draw can be claimed under the fifty-move rule.
- Fullmove number: The number of the full move. It starts at 1, and is incremented after Black's move.
Examples:
Here is the FEN for the starting position:
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
Here is the FEN after the move 1. e4:
rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1
~~~~~~~~~~~~
More Info about Javascript chess games viewer for websites 'pgn4web' →
::
Chess Engine 'pgn4web' comes as software package you can to your website or blogsite, but also provides a very simple board generator web tool helping you adding chess games to your website or blog without any html and javascript coding from your side.
~~~~~~~~~~~~
Happy chess games to you!
If you plan to come back later...
Please remember this page -
URL: https://usa2017.inumo.ru/cheng/