Pure Javascript chess board implementation