-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from BigTeri/v0.2.0
v0.2.0
- Loading branch information
Showing
18 changed files
with
425 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env node | ||
|
||
require("../dist"); | ||
require("../dist/cli"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,25 @@ | ||
html, body { | ||
html, body, .fullscreen { | ||
margin: 0; | ||
height: 100%; | ||
width: 100%; | ||
background-color: #cddc39; | ||
font-family: monospace; | ||
} | ||
|
||
.fullscreen { | ||
color: #ccc; | ||
background-color: #000; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
user-select: none; | ||
cursor: pointer; | ||
} | ||
|
||
.fullscreen h1 { | ||
font-size: 6vw; | ||
} | ||
|
||
.fullscreen h1.error { | ||
color: #FF0033; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { | ||
EventEmitter | ||
} from "events"; | ||
import io from "../sockets/socket.io.js"; | ||
|
||
export default class Connection extends EventEmitter { | ||
constructor() { | ||
super(); | ||
|
||
this.isConnected = false; | ||
|
||
this.socket = io(location.host, { | ||
path: location.pathname + "sockets" | ||
}); | ||
|
||
this.socket | ||
.on("connect", () => { | ||
this.isConnected = true; | ||
this.emit("connect"); | ||
}) | ||
.on("disconnect", () => { | ||
this.isConnected = false; | ||
this.emit("disconnect"); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import $ from "jquery"; | ||
|
||
class Hint { | ||
constructor() { | ||
this.$element = $(".fullscreen > h1"); | ||
} | ||
|
||
setText(message) { | ||
this.$element.removeClass("error"); | ||
this.$element.text(message); | ||
} | ||
|
||
setError(message) { | ||
this.$element.addClass("error"); | ||
this.$element.text(message); | ||
console.error(message); | ||
} | ||
} | ||
|
||
export default new Hint(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export default { | ||
8: "backspace", | ||
9: "tab", | ||
13: "enter", | ||
16: "shift", | ||
17: "control", | ||
37: "left", | ||
38: "up", | ||
39: "right", | ||
40: "down", | ||
46: "delete", | ||
91: "command" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"use strict"; | ||
|
||
var _util = require("util"); | ||
|
||
var _commander = require("commander"); | ||
|
||
var _commander2 = _interopRequireDefault(_commander); | ||
|
||
var _server = require("./server"); | ||
|
||
var _server2 = _interopRequireDefault(_server); | ||
|
||
var _package = require("../package"); | ||
|
||
var _package2 = _interopRequireDefault(_package); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
_commander2.default.version(_package2.default.version).option("-p, --port [port]", "sets server port", parseInt).parse(process.argv); | ||
|
||
const server = new _server2.default({ | ||
port: _commander2.default.port | ||
}); | ||
|
||
server.on("clientConnect", socket => { | ||
(0, _util.log)("new client connected: " + socket.request.connection.remoteAddress); | ||
socket.once("disconnect", () => (0, _util.log)("client disconnected: " + socket.request.connection.remoteAddress)); | ||
}); | ||
|
||
server.listen(() => { | ||
(0, _util.log)(`jsremote server is running on port ${ server.port }`); | ||
}); |
Oops, something went wrong.