UNPKG

chessgroundx

Version:
87 lines 2.84 kB
import * as fen from './fen.js'; import { timer } from './util.js'; import { premove } from './premove.js'; import { predrop } from './predrop.js'; import * as cg from './types.js'; export function defaults() { return { boardState: fen.read(fen.initial, { width: 8, height: 8 }), orientation: 'white', turnColor: 'white', coordinates: true, ranksPosition: 'right', autoCastle: true, viewOnly: false, disableContextMenu: false, addPieceZIndex: false, blockTouchScroll: false, pieceKey: false, highlight: { lastMove: true, check: true, }, animation: { enabled: true, duration: 200, }, movable: { free: true, color: 'both', showDests: true, events: {}, rookCastle: true, }, premovable: { enabled: true, premoveFunc: premove('chess', false, { width: 8, height: 8 }), predropFunc: predrop('chess', { width: 8, height: 8 }), castle: true, events: {}, }, draggable: { enabled: true, distance: 3, autoDistance: true, showGhost: true, deleteOnDropOff: false, }, selectable: { enabled: true, }, stats: { // on touchscreen, default to "tap-tap" moves // instead of drag dragged: !('ontouchstart' in window), }, events: {}, drawable: { enabled: true, visible: true, defaultSnapToValidMove: true, eraseOnClick: true, shapes: [], autoShapes: [], brushes: { green: { key: 'g', color: '#15781B', opacity: 1, lineWidth: 10 }, red: { key: 'r', color: '#882020', opacity: 1, lineWidth: 10 }, blue: { key: 'b', color: '#003088', opacity: 1, lineWidth: 10 }, yellow: { key: 'y', color: '#e68f00', opacity: 1, lineWidth: 10 }, paleBlue: { key: 'pb', color: '#003088', opacity: 0.4, lineWidth: 15 }, paleGreen: { key: 'pg', color: '#15781B', opacity: 0.4, lineWidth: 15 }, paleRed: { key: 'pr', color: '#882020', opacity: 0.4, lineWidth: 15 }, paleGrey: { key: 'pgr', color: '#4a4a4a', opacity: 0.35, lineWidth: 15, }, }, prevSvgHash: '', }, hold: timer(), dimensions: { width: 8, height: 8 }, notation: cg.Notation.ALGEBRAIC, kingRoles: ['k-piece'], }; } //# sourceMappingURL=state.js.map