optional desktop app update
This commit is contained in:
parent
5fe7f37b57
commit
02aeb3316f
|
@ -0,0 +1 @@
|
|||
node_modules/
|
39
index.html
39
index.html
|
@ -1,6 +1,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>chessn't</title>
|
||||
<link rel="icon" href="icon.png">
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
|
@ -100,7 +101,7 @@ body::-webkit-scrollbar {
|
|||
//board
|
||||
var boardMain =
|
||||
[
|
||||
[{},{},{},{},{'piece':'bridger','icon':'br+','loc':{'z':0}},{},{},{'piece':'bridger','icon':'br+','loc':{'z':0}},{}],
|
||||
[{},{},{},{},{'piece':'bridger','icon':'br+','color':'white','loc':{'z':0}},{},{},{'piece':'rook','icon':'r','color':'white','loc':{'z':0}},{}],
|
||||
[{},{},{},{},{},{},{},{},{}],
|
||||
[{},{},{},{},{},{},{},{},{}],
|
||||
[{},{},{},{},{},{},{},{},{}],
|
||||
|
@ -209,6 +210,7 @@ body::-webkit-scrollbar {
|
|||
let piece = board[row][col]
|
||||
switch(piece.piece){
|
||||
case'rook':
|
||||
/*
|
||||
for(let c in board[row]){ //sides
|
||||
let elem = document.getElementById(row+c)//maybe change to string
|
||||
if(board[row][c]!='temp'&&board[row][c]!=''&&row+''+c!=row+''+col){
|
||||
|
@ -223,7 +225,40 @@ body::-webkit-scrollbar {
|
|||
elem.addEventListener('click', function(){ move(row,col,r,col,z,z) } )
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
for(let r = row;r!=board.length;r++){
|
||||
let elem = document.getElementById(r+''+col)
|
||||
if(board[r][col]!=null&&board[r][col].color==board[row][col].color&&r+''+col!=row+''+col){break}
|
||||
if(elem!=null&&[r][col]!='temp'&&board[r][col]!=''&&r+''+col!=row+''+col){
|
||||
elem.style.backgroundColor=highlight1
|
||||
elem.addEventListener('click', function(){ move(row,col,r,col,z,z) } )
|
||||
}
|
||||
}
|
||||
for(let r = row;r!=-1;r--){
|
||||
let elem = document.getElementById(r+''+col)
|
||||
if(elem!=null&&board[r][col].color==board[row][col].color&&r+''+col!=row+''+col){break}
|
||||
if(elem!=null&&[r][col]!='temp'&&board[r][col]!=''&&r+''+col!=row+''+col){
|
||||
elem.style.backgroundColor=highlight1
|
||||
elem.addEventListener('click', function(){ move(row,col,r,col,z,z) } )
|
||||
}
|
||||
}
|
||||
for(let c = col;c!=board[row].length;c++){
|
||||
let elem = document.getElementById(row+''+c)
|
||||
if(board[row][c].color==board[row][col].color&&row+''+c!=row+''+col){break}
|
||||
if(elem!=null&&[row][c]!='temp'&&board[row][c]!=''&&row+''+c!=row+''+col){
|
||||
elem.style.backgroundColor=highlight1
|
||||
elem.addEventListener('click', function(){ move(row,col,row,c,z,z) } )
|
||||
}
|
||||
}
|
||||
for(let c = col;c!=-1;c--){
|
||||
let elem = document.getElementById(row+''+c)
|
||||
if(board[row][c].color==board[row][col].color&&row+''+c!=row+''+col){break}
|
||||
if(elem!=null&&[row][c]!='temp'&&board[row][c]!=''&&row+''+c!=row+''+col){
|
||||
elem.style.backgroundColor=highlight1
|
||||
elem.addEventListener('click', function(){ move(row,col,row,c,z,z) } )
|
||||
}
|
||||
}
|
||||
//console.log(row + ''+board.length)
|
||||
break;
|
||||
case'bridger':
|
||||
elem = document.getElementById(row+1+''+col)//maybe change to string
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
const path = require('path')
|
||||
const createWindow = () => {
|
||||
const win = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
autoHideMenuBar: true,
|
||||
icon: __dirname + '/icon.png',
|
||||
frame: false
|
||||
})
|
||||
|
||||
win.loadFile('index.html')
|
||||
|
||||
}
|
||||
app.whenReady().then(() => {
|
||||
createWindow()
|
||||
})
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"name": "chessnt",
|
||||
"version": "1.0.0",
|
||||
"description": "[view it here](https://squiresgrant.github.io/chessnt/)",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "electron ."
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/squiresgrant/chessnt.git"
|
||||
},
|
||||
"author": "grant squires",
|
||||
"license": "ISC",
|
||||
"bugs": {
|
||||
"url": "https://github.com/squiresgrant/chessnt/issues"
|
||||
},
|
||||
"homepage": "https://github.com/squiresgrant/chessnt#readme",
|
||||
"dependencies": {
|
||||
"electron": "^18.2.0"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue