How to use the chessground function in chessground

To help you get started, we’ve selected a few chessground examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gustaYo / vue-chess / src / components / puzzles / puzzle.vue View on Github external
setTimeout(function () {
      this.ground = Chessground(document.getElementById('puzzleBoard'), options)
      var Width = document.getElementById('puzzleBoard').clientWidth
      document.getElementById('puzzleBoard').style.height = Width + 'px'
      document.getElementById('puzzleBoard').style.width = Width + 'px'
      // getFromLocalStorage
      console.log('cargando board')
      this.loadPuzzle()
    }.bind(this), 10)
  },
github gustaYo / vue-chess / src / components / home / boardVisor.vue View on Github external
setTimeout(function () {
      this.ground = Chessground(document.getElementById('frontBoardVisor'), options)
      var Width = document.getElementById('frontBoardVisor').clientWidth
      document.getElementById('frontBoardVisor').style.height = Width + 'px'
      document.getElementById('frontBoardVisor').style.width = Width + 'px'
      // getFromLocalStorage
      this.loadDataGame(this.board)
    }.bind(this), 10)
  }
github gustaYo / vue-chess / src / components / game / index.vue View on Github external
setTimeout(function () {
      this.orientation = this.user.username === this.board.u2 ? 'black' : 'white'
      this.ground = Chessground(document.getElementById('tablerochess'), {
        viewOnly: false,
        turnColor: 'white',
        animation: {
          duration: 300
        },
        movable: {
          free: false,
          premove: true,
          dests: this.chessToDests(this.chess),
          events: {
            after: this.onMove
          }
        },
        drawable: {
          enabled: true
        },
github gustaYo / vue-chess / src / components / puzzles / index.vue View on Github external
setTimeout(function () {
        groundInit = Chessground(document.getElementById('puzzleGenerateFenInit'), options)
        if (this.puzzleType.position) {
          var optionsF = {
            fen: this.fenFinish,
            orientation: 'white',
            movable: {
              events: {
                after: this.updateFenFinish
              }
            }
          }
          groundFinish = Chessground(document.getElementById('puzzleGenerateFenFinish'), optionsF)
        }
      }.bind(this), 100)
    },
github gustaYo / vue-chess / src / components / puzzles / index.vue View on Github external
setTimeout(function () {
        groundInit = Chessground(document.getElementById('puzzleGenerateFenInit'), options)
        if (this.puzzleType.position) {
          var optionsF = {
            fen: this.fenFinish,
            orientation: 'white',
            movable: {
              events: {
                after: this.updateFenFinish
              }
            }
          }
          groundFinish = Chessground(document.getElementById('puzzleGenerateFenFinish'), optionsF)
        }
      }.bind(this), 100)
    },

chessground

lichess.org chess ui

GPL-3.0
Latest version published 3 days ago

Package Health Score

81 / 100
Full package analysis