diff --git a/main.js b/main.js new file mode 100644 index 0000000..05348ac --- /dev/null +++ b/main.js @@ -0,0 +1,35 @@ +const {app, BrowserWindow} = require('electron'); +const path = require('path'); +const url = require('url'); + +let win; + +function createWindow () { + win = new BrowserWindow({width: 975, height: 600, minHeight: 300, minWidth: 975}); + + win.loadURL(url.format({ + pathname: path.join(__dirname, 'index.html'), + protocol: 'file:', + slashes: true + })); + + win.openDevTools(); + + win.on('closed', () => { + win = null + }) +} + +app.on('ready', createWindow); + +app.on('window-all-closed', () => { + if (process.platform !== 'darwin') { + app.quit() + } +}); + +app.on('activate', () => { + if (win === null) { + createWindow() + } +}); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..f1b1ead --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "name": "Tetris.js", + "version": "0.0.1", + "main": "main.js", + "description": "Tetris.js is a decent but cool clone of the retro game classic Tetris", + "scripts": { + "start": "electron main.js", + "package": "asar pack Tetris.js-win32-x64/resources/app Tetris.js-win32-x64/resources/app.asar", + "build": "electron-packager . Tetris.js" + }, + "author": "KingOfDog", + "license": "MIT", + "devDependencies": { + "asar": "^0.14.0", + "electron": "^1.7.9", + "electron-packager": "^10.1.0" + } +} diff --git a/style.css b/style.css index b0d4e9c..c29d7b1 100644 --- a/style.css +++ b/style.css @@ -23,17 +23,18 @@ body { font-weight: 900; font-size: 40px; top: 50%; - left: 25%; + right: 75%; transform: translate(-50%, -50%); color: #fff; } #score:before { - content: 'Score:'; + content: 'Score: '; } #controls { left: 75%; + right: 0; font-size: 20px; font-weight: 300; transform: translate(0, -50%);