Skip to content

Latest commit

 

History

History
71 lines (48 loc) · 1.93 KB

README.md

File metadata and controls

71 lines (48 loc) · 1.93 KB

trueChess - Free and Open Source JS framework for your next chess project.

"trueChess is under beta development"

Features supported

  • Support board theming
  • Add custom rules
  • Add custom icons for piceses
  • Support lock mode for view only
  • Support true chess rules (How human play chess on physical board !)
  • Min board size 150px, can create multiple chess board.

Getting started

  1. Add/link following files
  <link rel="stylesheet" href="style.css"> <!-- color and style information -->
  <script type="text/javascript" src="truechess.js"> </script> <!--  main js file -->
  1. Add board div inside body tag of your html page
  <div id="chessBoard" style="width: 500px; margin: auto;"> </div>
  1. Call createChessBoard function, after the page load
var config = {
		showBoardNotations:true,	//show board notations 1-8, a-f
		position:{d6: 'bking', d4: 'wpawn',e4: 'wking',a1:'wrook',a8:'brook'}, // either "start" or position object
		isDraggable:false,		//drag element			
		boardTheme:'theme_wood',	//board color
		imgSrc:'img/',			//directory path of icons
		showBoardWithPieces:true,	//show board only
		animation:true, 		//show animation 
		showBorder:false,		//show black border around the board
		lockMoves:false			//lock the moment of piceses
	}
	//refer index.html for all config options
		
	truechess.createChessBoard('chessBoard',config);
  1. That's it !

Position property

position property in config support following inputs

var config = {position:"start"};
var config= {position: {board_notation:'picesType+picesName'} };
//example var config={ position: {d4:wpawn, e4:wknight} }

d4 - board notation, wpawn - white pawn

Click here for demo

Wooden Theme

Design, Build, Tested by
Twitter/Github /sonuauti