commit
9a2082920a
10 changed files with 1377 additions and 1 deletions
6
.glitch-assets
Normal file
6
.glitch-assets
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{"name":"drag-in-files.svg","date":"2016-10-22T16:17:49.954Z","url":"https://cdn.hyperdev.com/drag-in-files.svg","type":"image/svg","size":7646,"imageWidth":276,"imageHeight":276,"thumbnail":"https://cdn.hyperdev.com/drag-in-files.svg","thumbnailWidth":276,"thumbnailHeight":276,"dominantColor":"rgb(102, 153, 205)","uuid":"adSBq97hhhpFNUna"}
|
||||||
|
{"name":"click-me.svg","date":"2016-10-23T16:17:49.954Z","url":"https://cdn.hyperdev.com/click-me.svg","type":"image/svg","size":7116,"imageWidth":276,"imageHeight":276,"thumbnail":"https://cdn.hyperdev.com/click-me.svg","thumbnailWidth":276,"thumbnailHeight":276,"dominantColor":"rgb(243, 185, 186)","uuid":"adSBq97hhhpFNUnb"}
|
||||||
|
{"name":"paste-me.svg","date":"2016-10-24T16:17:49.954Z","url":"https://cdn.hyperdev.com/paste-me.svg","type":"image/svg","size":7242,"imageWidth":276,"imageHeight":276,"thumbnail":"https://cdn.hyperdev.com/paste-me.svg","thumbnailWidth":276,"thumbnailHeight":276,"dominantColor":"rgb(42, 179, 185)","uuid":"adSBq97hhhpFNUnc"}
|
||||||
|
{"uuid":"adSBq97hhhpFNUna","deleted":true}
|
||||||
|
{"uuid":"adSBq97hhhpFNUnc","deleted":true}
|
||||||
|
{"uuid":"adSBq97hhhpFNUnb","deleted":true}
|
15
README.md
15
README.md
|
@ -1 +1,14 @@
|
||||||
amogus
|
# universal-whiteboard
|
||||||
|
|
||||||
|
Drawing with a twist
|
||||||
|
|
||||||
|
This is a simple drawing app using express and socket.io to let everyone share the same canvas.
|
||||||
|
|
||||||
|
- Click `shift` to draw straight lines
|
||||||
|
- Click `ctrl` to draw straight circles
|
||||||
|
- Click `alt` to draw straight rectangles
|
||||||
|
- Right click while holding a modifier to fill shape
|
||||||
|
|
||||||
|
## Made with [Glitch](https://glitch.com/)
|
||||||
|
|
||||||
|
\ ゜ o ゜)ノ
|
||||||
|
|
535
package-lock.json
generated
Normal file
535
package-lock.json
generated
Normal file
|
@ -0,0 +1,535 @@
|
||||||
|
{
|
||||||
|
"name": "universal-whiteboard",
|
||||||
|
"version": "1.1.1",
|
||||||
|
"lockfileVersion": 1,
|
||||||
|
"requires": true,
|
||||||
|
"dependencies": {
|
||||||
|
"express": {
|
||||||
|
"version": "4.17.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/express/-/express-4.17.2.tgz",
|
||||||
|
"integrity": "sha512-oxlxJxcQlYwqPWKVJJtvQiwHgosH/LrLSPA+H4UxpyvSS6jC5aH+5MoHFM+KABgTOt0APue4w66Ha8jCUo9QGg==",
|
||||||
|
"requires": {
|
||||||
|
"accepts": "~1.3.7",
|
||||||
|
"array-flatten": "1.1.1",
|
||||||
|
"body-parser": "1.19.1",
|
||||||
|
"content-disposition": "0.5.4",
|
||||||
|
"content-type": "~1.0.4",
|
||||||
|
"cookie": "0.4.1",
|
||||||
|
"cookie-signature": "1.0.6",
|
||||||
|
"debug": "2.6.9",
|
||||||
|
"depd": "~1.1.2",
|
||||||
|
"encodeurl": "~1.0.2",
|
||||||
|
"escape-html": "~1.0.3",
|
||||||
|
"etag": "~1.8.1",
|
||||||
|
"finalhandler": "~1.1.2",
|
||||||
|
"fresh": "0.5.2",
|
||||||
|
"merge-descriptors": "1.0.1",
|
||||||
|
"methods": "~1.1.2",
|
||||||
|
"on-finished": "~2.3.0",
|
||||||
|
"parseurl": "~1.3.3",
|
||||||
|
"path-to-regexp": "0.1.7",
|
||||||
|
"proxy-addr": "~2.0.7",
|
||||||
|
"qs": "6.9.6",
|
||||||
|
"range-parser": "~1.2.1",
|
||||||
|
"safe-buffer": "5.2.1",
|
||||||
|
"send": "0.17.2",
|
||||||
|
"serve-static": "1.14.2",
|
||||||
|
"setprototypeof": "1.2.0",
|
||||||
|
"statuses": "~1.5.0",
|
||||||
|
"type-is": "~1.6.18",
|
||||||
|
"utils-merge": "1.0.1",
|
||||||
|
"vary": "~1.1.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"accepts": {
|
||||||
|
"version": "1.3.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
|
||||||
|
"integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
|
||||||
|
"requires": {
|
||||||
|
"mime-types": "~2.1.24",
|
||||||
|
"negotiator": "0.6.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"array-flatten": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
|
||||||
|
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
|
||||||
|
},
|
||||||
|
"body-parser": {
|
||||||
|
"version": "1.19.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.1.tgz",
|
||||||
|
"integrity": "sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA==",
|
||||||
|
"requires": {
|
||||||
|
"bytes": "3.1.1",
|
||||||
|
"content-type": "~1.0.4",
|
||||||
|
"debug": "2.6.9",
|
||||||
|
"depd": "~1.1.2",
|
||||||
|
"http-errors": "1.8.1",
|
||||||
|
"iconv-lite": "0.4.24",
|
||||||
|
"on-finished": "~2.3.0",
|
||||||
|
"qs": "6.9.6",
|
||||||
|
"raw-body": "2.4.2",
|
||||||
|
"type-is": "~1.6.18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bytes": {
|
||||||
|
"version": "3.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.1.tgz",
|
||||||
|
"integrity": "sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg=="
|
||||||
|
},
|
||||||
|
"content-disposition": {
|
||||||
|
"version": "0.5.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
|
||||||
|
"integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
|
||||||
|
"requires": {
|
||||||
|
"safe-buffer": "5.2.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"content-type": {
|
||||||
|
"version": "1.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
|
||||||
|
"integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
|
||||||
|
},
|
||||||
|
"cookie": {
|
||||||
|
"version": "0.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz",
|
||||||
|
"integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA=="
|
||||||
|
},
|
||||||
|
"cookie-signature": {
|
||||||
|
"version": "1.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
|
||||||
|
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
|
||||||
|
},
|
||||||
|
"debug": {
|
||||||
|
"version": "2.6.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||||
|
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||||
|
"requires": {
|
||||||
|
"ms": "2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"depd": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
|
||||||
|
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
|
||||||
|
},
|
||||||
|
"destroy": {
|
||||||
|
"version": "1.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
|
||||||
|
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
|
||||||
|
},
|
||||||
|
"ee-first": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
||||||
|
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
|
||||||
|
},
|
||||||
|
"encodeurl": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
|
||||||
|
},
|
||||||
|
"escape-html": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
||||||
|
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
|
||||||
|
},
|
||||||
|
"etag": {
|
||||||
|
"version": "1.8.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
||||||
|
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
|
||||||
|
},
|
||||||
|
"finalhandler": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
|
||||||
|
"requires": {
|
||||||
|
"debug": "2.6.9",
|
||||||
|
"encodeurl": "~1.0.2",
|
||||||
|
"escape-html": "~1.0.3",
|
||||||
|
"on-finished": "~2.3.0",
|
||||||
|
"parseurl": "~1.3.3",
|
||||||
|
"statuses": "~1.5.0",
|
||||||
|
"unpipe": "~1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"forwarded": {
|
||||||
|
"version": "0.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
||||||
|
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="
|
||||||
|
},
|
||||||
|
"fresh": {
|
||||||
|
"version": "0.5.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
|
||||||
|
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
|
||||||
|
},
|
||||||
|
"http-errors": {
|
||||||
|
"version": "1.8.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz",
|
||||||
|
"integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
|
||||||
|
"requires": {
|
||||||
|
"depd": "~1.1.2",
|
||||||
|
"inherits": "2.0.4",
|
||||||
|
"setprototypeof": "1.2.0",
|
||||||
|
"statuses": ">= 1.5.0 < 2",
|
||||||
|
"toidentifier": "1.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"iconv-lite": {
|
||||||
|
"version": "0.4.24",
|
||||||
|
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||||
|
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||||
|
"requires": {
|
||||||
|
"safer-buffer": ">= 2.1.2 < 3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"inherits": {
|
||||||
|
"version": "2.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||||
|
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||||
|
},
|
||||||
|
"ipaddr.js": {
|
||||||
|
"version": "1.9.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
||||||
|
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
|
||||||
|
},
|
||||||
|
"media-typer": {
|
||||||
|
"version": "0.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
||||||
|
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
|
||||||
|
},
|
||||||
|
"merge-descriptors": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
|
||||||
|
},
|
||||||
|
"methods": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
|
||||||
|
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
|
||||||
|
},
|
||||||
|
"mime": {
|
||||||
|
"version": "1.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
|
||||||
|
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
|
||||||
|
},
|
||||||
|
"mime-db": {
|
||||||
|
"version": "1.51.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz",
|
||||||
|
"integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g=="
|
||||||
|
},
|
||||||
|
"mime-types": {
|
||||||
|
"version": "2.1.34",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz",
|
||||||
|
"integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==",
|
||||||
|
"requires": {
|
||||||
|
"mime-db": "1.51.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ms": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
||||||
|
},
|
||||||
|
"negotiator": {
|
||||||
|
"version": "0.6.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
|
||||||
|
"integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
|
||||||
|
},
|
||||||
|
"on-finished": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
|
||||||
|
"integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
|
||||||
|
"requires": {
|
||||||
|
"ee-first": "1.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"parseurl": {
|
||||||
|
"version": "1.3.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
||||||
|
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
|
||||||
|
},
|
||||||
|
"path-to-regexp": {
|
||||||
|
"version": "0.1.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
|
||||||
|
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
|
||||||
|
},
|
||||||
|
"proxy-addr": {
|
||||||
|
"version": "2.0.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||||
|
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
|
||||||
|
"requires": {
|
||||||
|
"forwarded": "0.2.0",
|
||||||
|
"ipaddr.js": "1.9.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"qs": {
|
||||||
|
"version": "6.9.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz",
|
||||||
|
"integrity": "sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ=="
|
||||||
|
},
|
||||||
|
"range-parser": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
|
||||||
|
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
|
||||||
|
},
|
||||||
|
"raw-body": {
|
||||||
|
"version": "2.4.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.2.tgz",
|
||||||
|
"integrity": "sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ==",
|
||||||
|
"requires": {
|
||||||
|
"bytes": "3.1.1",
|
||||||
|
"http-errors": "1.8.1",
|
||||||
|
"iconv-lite": "0.4.24",
|
||||||
|
"unpipe": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"safe-buffer": {
|
||||||
|
"version": "5.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||||
|
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
|
||||||
|
},
|
||||||
|
"safer-buffer": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||||
|
},
|
||||||
|
"send": {
|
||||||
|
"version": "0.17.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz",
|
||||||
|
"integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==",
|
||||||
|
"requires": {
|
||||||
|
"debug": "2.6.9",
|
||||||
|
"depd": "~1.1.2",
|
||||||
|
"destroy": "~1.0.4",
|
||||||
|
"encodeurl": "~1.0.2",
|
||||||
|
"escape-html": "~1.0.3",
|
||||||
|
"etag": "~1.8.1",
|
||||||
|
"fresh": "0.5.2",
|
||||||
|
"http-errors": "1.8.1",
|
||||||
|
"mime": "1.6.0",
|
||||||
|
"ms": "2.1.3",
|
||||||
|
"on-finished": "~2.3.0",
|
||||||
|
"range-parser": "~1.2.1",
|
||||||
|
"statuses": "~1.5.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"ms": {
|
||||||
|
"version": "2.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||||
|
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"serve-static": {
|
||||||
|
"version": "1.14.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.2.tgz",
|
||||||
|
"integrity": "sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==",
|
||||||
|
"requires": {
|
||||||
|
"encodeurl": "~1.0.2",
|
||||||
|
"escape-html": "~1.0.3",
|
||||||
|
"parseurl": "~1.3.3",
|
||||||
|
"send": "0.17.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"setprototypeof": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
|
||||||
|
},
|
||||||
|
"statuses": {
|
||||||
|
"version": "1.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
|
||||||
|
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
|
||||||
|
},
|
||||||
|
"toidentifier": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="
|
||||||
|
},
|
||||||
|
"type-is": {
|
||||||
|
"version": "1.6.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
|
||||||
|
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
|
||||||
|
"requires": {
|
||||||
|
"media-typer": "0.3.0",
|
||||||
|
"mime-types": "~2.1.24"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"unpipe": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
|
||||||
|
},
|
||||||
|
"utils-merge": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
|
||||||
|
},
|
||||||
|
"vary": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||||
|
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"socket.io": {
|
||||||
|
"version": "4.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.4.0.tgz",
|
||||||
|
"integrity": "sha512-bnpJxswR9ov0Bw6ilhCvO38/1WPtE3eA2dtxi2Iq4/sFebiDJQzgKNYA7AuVVdGW09nrESXd90NbZqtDd9dzRQ==",
|
||||||
|
"requires": {
|
||||||
|
"accepts": "~1.3.4",
|
||||||
|
"base64id": "~2.0.0",
|
||||||
|
"debug": "~4.3.2",
|
||||||
|
"engine.io": "~6.1.0",
|
||||||
|
"socket.io-adapter": "~2.3.3",
|
||||||
|
"socket.io-parser": "~4.0.4"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/component-emitter": {
|
||||||
|
"version": "1.2.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.11.tgz",
|
||||||
|
"integrity": "sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ=="
|
||||||
|
},
|
||||||
|
"@types/cookie": {
|
||||||
|
"version": "0.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz",
|
||||||
|
"integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q=="
|
||||||
|
},
|
||||||
|
"@types/cors": {
|
||||||
|
"version": "2.8.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz",
|
||||||
|
"integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw=="
|
||||||
|
},
|
||||||
|
"@types/node": {
|
||||||
|
"version": "17.0.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.8.tgz",
|
||||||
|
"integrity": "sha512-YofkM6fGv4gDJq78g4j0mMuGMkZVxZDgtU0JRdx6FgiJDG+0fY0GKVolOV8WqVmEhLCXkQRjwDdKyPxJp/uucg=="
|
||||||
|
},
|
||||||
|
"accepts": {
|
||||||
|
"version": "1.3.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
|
||||||
|
"integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
|
||||||
|
"requires": {
|
||||||
|
"mime-types": "~2.1.24",
|
||||||
|
"negotiator": "0.6.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"base64-arraybuffer": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-vFIUq7FdLtjZMhATwDul5RZWv2jpXQ09Pd6jcVEOvIsqCWTRFD/ONHNfyOS8dA/Ippi5dsIgpyKWKZaAKZltbA=="
|
||||||
|
},
|
||||||
|
"base64id": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog=="
|
||||||
|
},
|
||||||
|
"component-emitter": {
|
||||||
|
"version": "1.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
|
||||||
|
"integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg=="
|
||||||
|
},
|
||||||
|
"cookie": {
|
||||||
|
"version": "0.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz",
|
||||||
|
"integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA=="
|
||||||
|
},
|
||||||
|
"cors": {
|
||||||
|
"version": "2.8.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
|
||||||
|
"integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
|
||||||
|
"requires": {
|
||||||
|
"object-assign": "^4",
|
||||||
|
"vary": "^1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"debug": {
|
||||||
|
"version": "4.3.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
|
||||||
|
"integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
|
||||||
|
"requires": {
|
||||||
|
"ms": "2.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"engine.io": {
|
||||||
|
"version": "6.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.1.0.tgz",
|
||||||
|
"integrity": "sha512-ErhZOVu2xweCjEfYcTdkCnEYUiZgkAcBBAhW4jbIvNG8SLU3orAqoJCiytZjYF7eTpVmmCrLDjLIEaPlUAs1uw==",
|
||||||
|
"requires": {
|
||||||
|
"@types/cookie": "^0.4.1",
|
||||||
|
"@types/cors": "^2.8.12",
|
||||||
|
"@types/node": ">=10.0.0",
|
||||||
|
"accepts": "~1.3.4",
|
||||||
|
"base64id": "2.0.0",
|
||||||
|
"cookie": "~0.4.1",
|
||||||
|
"cors": "~2.8.5",
|
||||||
|
"debug": "~4.3.1",
|
||||||
|
"engine.io-parser": "~5.0.0",
|
||||||
|
"ws": "~8.2.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"engine.io-parser": {
|
||||||
|
"version": "5.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.2.tgz",
|
||||||
|
"integrity": "sha512-wuiO7qO/OEkPJSFueuATIXtrxF7/6GTbAO9QLv7nnbjwZ5tYhLm9zxvLwxstRs0dcT0KUlWTjtIOs1T86jt12g==",
|
||||||
|
"requires": {
|
||||||
|
"base64-arraybuffer": "~1.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mime-db": {
|
||||||
|
"version": "1.51.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz",
|
||||||
|
"integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g=="
|
||||||
|
},
|
||||||
|
"mime-types": {
|
||||||
|
"version": "2.1.34",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz",
|
||||||
|
"integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==",
|
||||||
|
"requires": {
|
||||||
|
"mime-db": "1.51.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ms": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||||
|
},
|
||||||
|
"negotiator": {
|
||||||
|
"version": "0.6.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
|
||||||
|
"integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
|
||||||
|
},
|
||||||
|
"object-assign": {
|
||||||
|
"version": "4.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||||
|
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
|
||||||
|
},
|
||||||
|
"socket.io-adapter": {
|
||||||
|
"version": "2.3.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.3.3.tgz",
|
||||||
|
"integrity": "sha512-Qd/iwn3VskrpNO60BeRyCyr8ZWw9CPZyitW4AQwmRZ8zCiyDiL+znRnWX6tDHXnWn1sJrM1+b6Mn6wEDJJ4aYQ=="
|
||||||
|
},
|
||||||
|
"socket.io-parser": {
|
||||||
|
"version": "4.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.4.tgz",
|
||||||
|
"integrity": "sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g==",
|
||||||
|
"requires": {
|
||||||
|
"@types/component-emitter": "^1.2.10",
|
||||||
|
"component-emitter": "~1.3.0",
|
||||||
|
"debug": "~4.3.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"vary": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||||
|
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
|
||||||
|
},
|
||||||
|
"ws": {
|
||||||
|
"version": "8.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz",
|
||||||
|
"integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
26
package.json
Normal file
26
package.json
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
"name": "universal-whiteboard",
|
||||||
|
"version": "1.1.1",
|
||||||
|
"description": "A drawing program where everyone shares the same whiteboard",
|
||||||
|
"main": "server.js",
|
||||||
|
"scripts": {
|
||||||
|
"start": "node server.js"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"express": "^4.17.2",
|
||||||
|
"socket.io": "^4.4.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "14.x"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"url": "https://glitch.com/edit/#!/universal-whiteboard"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"keywords": [
|
||||||
|
"node",
|
||||||
|
"glitch",
|
||||||
|
"express",
|
||||||
|
"drawing"
|
||||||
|
]
|
||||||
|
}
|
111
public/client.js
Normal file
111
public/client.js
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
const $ = e => document.getElementById(e);
|
||||||
|
const socket = io();
|
||||||
|
const canvas = $("canvas");
|
||||||
|
const ctx = canvas.getContext("2d");
|
||||||
|
const peers = new Map();
|
||||||
|
let penColor = "black";
|
||||||
|
|
||||||
|
const colors = document.querySelectorAll(".picker button");
|
||||||
|
let colorel = colors[Math.floor(Math.random() * colors.length)];
|
||||||
|
select(colorel);
|
||||||
|
|
||||||
|
for (let el of colors) {
|
||||||
|
el.addEventListener("click", () => select(el));
|
||||||
|
el.style.background = el.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
function select(el) {
|
||||||
|
penColor = el.id;
|
||||||
|
if (colorel) colorel.classList.remove("selected");
|
||||||
|
el.classList.add("selected");
|
||||||
|
colorel = el;
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.lineCap = "round";
|
||||||
|
ctx.lineJoin = "round";
|
||||||
|
|
||||||
|
canvas.addEventListener("mousedown", mousedown);
|
||||||
|
canvas.addEventListener("mouseup", mouseup);
|
||||||
|
canvas.addEventListener("mousemove", mousemove);
|
||||||
|
canvas.addEventListener("touchstart", mousedown);
|
||||||
|
canvas.addEventListener("touchmove", mousemove);
|
||||||
|
canvas.addEventListener("touchend", mouseup);
|
||||||
|
canvas.addEventListener("touchcancel", mouseup);
|
||||||
|
window.addEventListener("resize", resize);
|
||||||
|
document.addEventListener("contextmenu", e => e.preventDefault());
|
||||||
|
|
||||||
|
resize();
|
||||||
|
|
||||||
|
function resize() {
|
||||||
|
canvas.height = window.innerHeight;
|
||||||
|
canvas.width = window.innerWidth;
|
||||||
|
ctx.height = window.innerHeight;
|
||||||
|
ctx.width = window.innerWidth;
|
||||||
|
ctx.clearRect(0, 0, 99999, 99999);
|
||||||
|
socket.emit("sync");
|
||||||
|
}
|
||||||
|
|
||||||
|
function mousedown(e) {
|
||||||
|
e = e.clientX ? e : e.touches[0];
|
||||||
|
socket.emit("drawstart", {
|
||||||
|
x: e.clientX,
|
||||||
|
y: e.clientY,
|
||||||
|
color: penColor,
|
||||||
|
stroke: penColor === "white" ? 30 : 5,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function mousemove(e) {
|
||||||
|
e = e.clientX ? e : e.touches[0];
|
||||||
|
socket.emit("drawmove", {
|
||||||
|
x: e.clientX,
|
||||||
|
y: e.clientY,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function mouseup(e) {
|
||||||
|
e = e.clientX ? e : e.touches[0];
|
||||||
|
socket.emit("drawend", {
|
||||||
|
x: e.clientX,
|
||||||
|
y: e.clientY,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
socket.on("drawstart", (msg) => {
|
||||||
|
const path = new Path2D();
|
||||||
|
path.moveTo(msg.x, msg.y);
|
||||||
|
peers.set(msg.id, {
|
||||||
|
color: msg.color,
|
||||||
|
stroke: msg.stroke,
|
||||||
|
path,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
socket.on("drawmove", (msg) => {
|
||||||
|
if(!peers.has(msg.id)) return;
|
||||||
|
const peer = peers.get(msg.id);
|
||||||
|
peer.path.lineTo(msg.x, msg.y);
|
||||||
|
ctx.strokeStyle = peer.color;
|
||||||
|
ctx.lineWidth = peer.stroke;
|
||||||
|
ctx.stroke(peer.path);
|
||||||
|
});
|
||||||
|
|
||||||
|
socket.on("drawend", (msg) => {
|
||||||
|
if(!peers.has(msg.id)) return;
|
||||||
|
const peer = peers.get(msg.id);
|
||||||
|
peer.path.lineTo(msg.x, msg.y);
|
||||||
|
ctx.strokeStyle = peer.color;
|
||||||
|
ctx.lineWidth = peer.stroke;
|
||||||
|
ctx.stroke(peer.path);
|
||||||
|
peers.delete(msg.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
socket.on("gc", (id) => {
|
||||||
|
peers.delete(id);
|
||||||
|
});
|
||||||
|
|
||||||
|
socket.on("sync", (id) => {
|
||||||
|
if($("loading")) $("loading").remove();
|
||||||
|
});
|
||||||
|
|
||||||
|
socket.emit("join", location.pathname);
|
65
public/style.css
Normal file
65
public/style.css
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
font-family: "Trebuchet MS", Arial, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
padding: 4px;
|
||||||
|
border: solid #cccccc 2px;
|
||||||
|
border-bottom: none;
|
||||||
|
border-radius: 5px 5px 0 0;
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker button {
|
||||||
|
height: 2em;
|
||||||
|
width: 2em;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: solid black 2px;
|
||||||
|
margin: 0 2px;
|
||||||
|
outline: none;
|
||||||
|
transform: scale(1);
|
||||||
|
transition: all 0.1s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker button.selected {
|
||||||
|
transform: scale(0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
#stroke {
|
||||||
|
width: 100%;
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
#stroke-display {
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loading {
|
||||||
|
z-index: 9999;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: #ffffff;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 2em;
|
||||||
|
}
|
49
server.js
Normal file
49
server.js
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
// server.js
|
||||||
|
// where your node app starts
|
||||||
|
|
||||||
|
// init project
|
||||||
|
const express = require("express");
|
||||||
|
const app = express();
|
||||||
|
const rooms = new Map();
|
||||||
|
|
||||||
|
app.use(express.static(__dirname + "/public"));
|
||||||
|
|
||||||
|
app.get("/", (req, res) => {
|
||||||
|
res.sendFile(__dirname + "/views/index.html");
|
||||||
|
});
|
||||||
|
|
||||||
|
app.get("/*", (req, res) => {
|
||||||
|
res.sendFile(__dirname + "/views/board.html");
|
||||||
|
});
|
||||||
|
|
||||||
|
const server = app.listen(3000);
|
||||||
|
const io = require("socket.io")(server);
|
||||||
|
|
||||||
|
io.on("connection", (socket) => {
|
||||||
|
const room = () => [...socket.rooms][1];
|
||||||
|
const { id } = socket;
|
||||||
|
socket.on("join", (msg) => {
|
||||||
|
socket.join(msg);
|
||||||
|
if(rooms.has(msg)) {
|
||||||
|
for(let ev of rooms.get(msg)) socket.emit(...ev);
|
||||||
|
} else {
|
||||||
|
rooms.set(msg, []);
|
||||||
|
}
|
||||||
|
socket.emit("sync");
|
||||||
|
});
|
||||||
|
socket.on("sync", () => {
|
||||||
|
if(rooms.has(room())) {
|
||||||
|
for(let ev of rooms.get(room())) socket.emit(...ev);
|
||||||
|
}
|
||||||
|
socket.emit("sync");
|
||||||
|
});
|
||||||
|
socket.on("disconnect", (msg) => emit("gc", id));
|
||||||
|
socket.on("drawmove", (msg) => emit("drawmove", { ...msg, id }));
|
||||||
|
socket.on("drawstart", (msg) => emit("drawstart", { ...msg, id }));
|
||||||
|
socket.on("drawend", (msg) => emit("drawend", { ...msg, id }));
|
||||||
|
|
||||||
|
function emit(...args) {
|
||||||
|
io.to(room()).emit(...args);
|
||||||
|
if(rooms.has(room())) rooms.get(room()).push(args);
|
||||||
|
}
|
||||||
|
});
|
502
shrinkwrap.yaml
Normal file
502
shrinkwrap.yaml
Normal file
|
@ -0,0 +1,502 @@
|
||||||
|
dependencies:
|
||||||
|
express: 4.17.2
|
||||||
|
socket.io: 4.4.0
|
||||||
|
packages:
|
||||||
|
/@types/component-emitter/1.2.11:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ==
|
||||||
|
/@types/cookie/0.4.1:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==
|
||||||
|
/@types/cors/2.8.12:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==
|
||||||
|
/@types/node/17.0.8:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-YofkM6fGv4gDJq78g4j0mMuGMkZVxZDgtU0JRdx6FgiJDG+0fY0GKVolOV8WqVmEhLCXkQRjwDdKyPxJp/uucg==
|
||||||
|
/accepts/1.3.7:
|
||||||
|
dependencies:
|
||||||
|
mime-types: 2.1.34
|
||||||
|
negotiator: 0.6.2
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==
|
||||||
|
/array-flatten/1.1.1:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=
|
||||||
|
/base64-arraybuffer/1.0.1:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6.0'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-vFIUq7FdLtjZMhATwDul5RZWv2jpXQ09Pd6jcVEOvIsqCWTRFD/ONHNfyOS8dA/Ippi5dsIgpyKWKZaAKZltbA==
|
||||||
|
/base64id/2.0.0:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: ^4.5.0 || >= 5.9
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==
|
||||||
|
/body-parser/1.19.1:
|
||||||
|
dependencies:
|
||||||
|
bytes: 3.1.1
|
||||||
|
content-type: 1.0.4
|
||||||
|
debug: 2.6.9
|
||||||
|
depd: 1.1.2
|
||||||
|
http-errors: 1.8.1
|
||||||
|
iconv-lite: 0.4.24
|
||||||
|
on-finished: 2.3.0
|
||||||
|
qs: 6.9.6
|
||||||
|
raw-body: 2.4.2
|
||||||
|
type-is: 1.6.18
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.8'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA==
|
||||||
|
/bytes/3.1.1:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.8'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg==
|
||||||
|
/component-emitter/1.3.0:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==
|
||||||
|
/content-disposition/0.5.4:
|
||||||
|
dependencies:
|
||||||
|
safe-buffer: 5.2.1
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==
|
||||||
|
/content-type/1.0.4:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==
|
||||||
|
/cookie-signature/1.0.6:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-4wOogrNCzD7oylE6eZmXNNqzriw=
|
||||||
|
/cookie/0.4.1:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==
|
||||||
|
/cors/2.8.5:
|
||||||
|
dependencies:
|
||||||
|
object-assign: 4.1.1
|
||||||
|
vary: 1.1.2
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.10'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==
|
||||||
|
/debug/2.6.9:
|
||||||
|
dependencies:
|
||||||
|
ms: 2.0.0
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
|
||||||
|
/debug/4.3.3:
|
||||||
|
dependencies:
|
||||||
|
ms: 2.1.2
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>=6.0'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==
|
||||||
|
/depd/1.1.2:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=
|
||||||
|
/destroy/1.0.4:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=
|
||||||
|
/ee-first/1.1.1:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
|
||||||
|
/encodeurl/1.0.2:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.8'
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=
|
||||||
|
/engine.io-parser/5.0.2:
|
||||||
|
dependencies:
|
||||||
|
base64-arraybuffer: 1.0.1
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>=10.0.0'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-wuiO7qO/OEkPJSFueuATIXtrxF7/6GTbAO9QLv7nnbjwZ5tYhLm9zxvLwxstRs0dcT0KUlWTjtIOs1T86jt12g==
|
||||||
|
/engine.io/6.1.0:
|
||||||
|
dependencies:
|
||||||
|
'@types/cookie': 0.4.1
|
||||||
|
'@types/cors': 2.8.12
|
||||||
|
'@types/node': 17.0.8
|
||||||
|
accepts: 1.3.7
|
||||||
|
base64id: 2.0.0
|
||||||
|
cookie: 0.4.1
|
||||||
|
cors: 2.8.5
|
||||||
|
debug: 4.3.3
|
||||||
|
engine.io-parser: 5.0.2
|
||||||
|
ws: 8.2.3
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>=10.0.0'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-ErhZOVu2xweCjEfYcTdkCnEYUiZgkAcBBAhW4jbIvNG8SLU3orAqoJCiytZjYF7eTpVmmCrLDjLIEaPlUAs1uw==
|
||||||
|
/escape-html/1.0.3:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=
|
||||||
|
/etag/1.8.1:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=
|
||||||
|
/express/4.17.2:
|
||||||
|
dependencies:
|
||||||
|
accepts: 1.3.7
|
||||||
|
array-flatten: 1.1.1
|
||||||
|
body-parser: 1.19.1
|
||||||
|
content-disposition: 0.5.4
|
||||||
|
content-type: 1.0.4
|
||||||
|
cookie: 0.4.1
|
||||||
|
cookie-signature: 1.0.6
|
||||||
|
debug: 2.6.9
|
||||||
|
depd: 1.1.2
|
||||||
|
encodeurl: 1.0.2
|
||||||
|
escape-html: 1.0.3
|
||||||
|
etag: 1.8.1
|
||||||
|
finalhandler: 1.1.2
|
||||||
|
fresh: 0.5.2
|
||||||
|
merge-descriptors: 1.0.1
|
||||||
|
methods: 1.1.2
|
||||||
|
on-finished: 2.3.0
|
||||||
|
parseurl: 1.3.3
|
||||||
|
path-to-regexp: 0.1.7
|
||||||
|
proxy-addr: 2.0.7
|
||||||
|
qs: 6.9.6
|
||||||
|
range-parser: 1.2.1
|
||||||
|
safe-buffer: 5.2.1
|
||||||
|
send: 0.17.2
|
||||||
|
serve-static: 1.14.2
|
||||||
|
setprototypeof: 1.2.0
|
||||||
|
statuses: 1.5.0
|
||||||
|
type-is: 1.6.18
|
||||||
|
utils-merge: 1.0.1
|
||||||
|
vary: 1.1.2
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.10.0'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-oxlxJxcQlYwqPWKVJJtvQiwHgosH/LrLSPA+H4UxpyvSS6jC5aH+5MoHFM+KABgTOt0APue4w66Ha8jCUo9QGg==
|
||||||
|
/finalhandler/1.1.2:
|
||||||
|
dependencies:
|
||||||
|
debug: 2.6.9
|
||||||
|
encodeurl: 1.0.2
|
||||||
|
escape-html: 1.0.3
|
||||||
|
on-finished: 2.3.0
|
||||||
|
parseurl: 1.3.3
|
||||||
|
statuses: 1.5.0
|
||||||
|
unpipe: 1.0.0
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.8'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==
|
||||||
|
/forwarded/0.2.0:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==
|
||||||
|
/fresh/0.5.2:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=
|
||||||
|
/http-errors/1.8.1:
|
||||||
|
dependencies:
|
||||||
|
depd: 1.1.2
|
||||||
|
inherits: 2.0.4
|
||||||
|
setprototypeof: 1.2.0
|
||||||
|
statuses: 1.5.0
|
||||||
|
toidentifier: 1.0.1
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==
|
||||||
|
/iconv-lite/0.4.24:
|
||||||
|
dependencies:
|
||||||
|
safer-buffer: 2.1.2
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>=0.10.0'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
|
||||||
|
/inherits/2.0.4:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||||
|
/ipaddr.js/1.9.1:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.10'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==
|
||||||
|
/media-typer/0.3.0:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=
|
||||||
|
/merge-descriptors/1.0.1:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=
|
||||||
|
/methods/1.1.2:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=
|
||||||
|
/mime-db/1.51.0:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==
|
||||||
|
/mime-types/2.1.34:
|
||||||
|
dependencies:
|
||||||
|
mime-db: 1.51.0
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==
|
||||||
|
/mime/1.6.0:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>=4'
|
||||||
|
hasBin: true
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
|
||||||
|
/ms/2.0.0:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
|
||||||
|
/ms/2.1.2:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
|
||||||
|
/ms/2.1.3:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
|
||||||
|
/negotiator/0.6.2:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==
|
||||||
|
/object-assign/4.1.1:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>=0.10.0'
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
|
||||||
|
/on-finished/2.3.0:
|
||||||
|
dependencies:
|
||||||
|
ee-first: 1.1.1
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.8'
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=
|
||||||
|
/parseurl/1.3.3:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.8'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==
|
||||||
|
/path-to-regexp/0.1.7:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=
|
||||||
|
/proxy-addr/2.0.7:
|
||||||
|
dependencies:
|
||||||
|
forwarded: 0.2.0
|
||||||
|
ipaddr.js: 1.9.1
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.10'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==
|
||||||
|
/qs/6.9.6:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>=0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ==
|
||||||
|
/range-parser/1.2.1:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==
|
||||||
|
/raw-body/2.4.2:
|
||||||
|
dependencies:
|
||||||
|
bytes: 3.1.1
|
||||||
|
http-errors: 1.8.1
|
||||||
|
iconv-lite: 0.4.24
|
||||||
|
unpipe: 1.0.0
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.8'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ==
|
||||||
|
/safe-buffer/5.2.1:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
|
||||||
|
/safer-buffer/2.1.2:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
|
||||||
|
/send/0.17.2:
|
||||||
|
dependencies:
|
||||||
|
debug: 2.6.9
|
||||||
|
depd: 1.1.2
|
||||||
|
destroy: 1.0.4
|
||||||
|
encodeurl: 1.0.2
|
||||||
|
escape-html: 1.0.3
|
||||||
|
etag: 1.8.1
|
||||||
|
fresh: 0.5.2
|
||||||
|
http-errors: 1.8.1
|
||||||
|
mime: 1.6.0
|
||||||
|
ms: 2.1.3
|
||||||
|
on-finished: 2.3.0
|
||||||
|
range-parser: 1.2.1
|
||||||
|
statuses: 1.5.0
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.8.0'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==
|
||||||
|
/serve-static/1.14.2:
|
||||||
|
dependencies:
|
||||||
|
encodeurl: 1.0.2
|
||||||
|
escape-html: 1.0.3
|
||||||
|
parseurl: 1.3.3
|
||||||
|
send: 0.17.2
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.8.0'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==
|
||||||
|
/setprototypeof/1.2.0:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==
|
||||||
|
/socket.io-adapter/2.3.3:
|
||||||
|
dev: false
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-Qd/iwn3VskrpNO60BeRyCyr8ZWw9CPZyitW4AQwmRZ8zCiyDiL+znRnWX6tDHXnWn1sJrM1+b6Mn6wEDJJ4aYQ==
|
||||||
|
/socket.io-parser/4.0.4:
|
||||||
|
dependencies:
|
||||||
|
'@types/component-emitter': 1.2.11
|
||||||
|
component-emitter: 1.3.0
|
||||||
|
debug: 4.3.3
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>=10.0.0'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g==
|
||||||
|
/socket.io/4.4.0:
|
||||||
|
dependencies:
|
||||||
|
accepts: 1.3.7
|
||||||
|
base64id: 2.0.0
|
||||||
|
debug: 4.3.3
|
||||||
|
engine.io: 6.1.0
|
||||||
|
socket.io-adapter: 2.3.3
|
||||||
|
socket.io-parser: 4.0.4
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>=10.0.0'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-bnpJxswR9ov0Bw6ilhCvO38/1WPtE3eA2dtxi2Iq4/sFebiDJQzgKNYA7AuVVdGW09nrESXd90NbZqtDd9dzRQ==
|
||||||
|
/statuses/1.5.0:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=
|
||||||
|
/toidentifier/1.0.1:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>=0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==
|
||||||
|
/type-is/1.6.18:
|
||||||
|
dependencies:
|
||||||
|
media-typer: 0.3.0
|
||||||
|
mime-types: 2.1.34
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.6'
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==
|
||||||
|
/unpipe/1.0.0:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.8'
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=
|
||||||
|
/utils-merge/1.0.1:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.4.0'
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=
|
||||||
|
/vary/1.1.2:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>= 0.8'
|
||||||
|
resolution:
|
||||||
|
integrity: sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=
|
||||||
|
/ws/8.2.3:
|
||||||
|
dev: false
|
||||||
|
engines:
|
||||||
|
node: '>=10.0.0'
|
||||||
|
peerDependencies:
|
||||||
|
bufferutil: ^4.0.1
|
||||||
|
utf-8-validate: ^5.0.2
|
||||||
|
resolution:
|
||||||
|
integrity: sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==
|
||||||
|
registry: 'https://registry.npmjs.org/'
|
||||||
|
shrinkwrapMinorVersion: 9
|
||||||
|
shrinkwrapVersion: 3
|
||||||
|
specifiers:
|
||||||
|
express: ^4.17.2
|
||||||
|
socket.io: ^4.4.0
|
29
views/board.html
Normal file
29
views/board.html
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>whaet boared</title>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/style.css" />
|
||||||
|
<script src="/socket.io/socket.io.min.js"></script>
|
||||||
|
<script src="/client.js" defer></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="loading">loading...</div>
|
||||||
|
<canvas id="canvas"></canvas>
|
||||||
|
<div class="bottom">
|
||||||
|
<div class="picker">
|
||||||
|
<button type="button" id="#F45B69"></button>
|
||||||
|
<button type="button" id="#FE7F2D"></button>
|
||||||
|
<button type="button" id="#FCCA46"></button>
|
||||||
|
<button type="button" id="#87FF65"></button>
|
||||||
|
<button type="button" id="#00A5CF"></button>
|
||||||
|
<button type="button" id="#7D5BA6"></button>
|
||||||
|
<button type="button" id="#312F2F"></button>
|
||||||
|
<button type="button" id="white"></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
40
views/index.html
Normal file
40
views/index.html
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>bored</title>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/style.css" />
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
padding: 2em;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>public whiteboard service</p>
|
||||||
|
<ol>
|
||||||
|
<li>go to any path on this domain</li>
|
||||||
|
<li>share the same link with a friend</li>
|
||||||
|
<li>draw stuff</li>
|
||||||
|
<li>have a nice day</li>
|
||||||
|
</ol>
|
||||||
|
<script>
|
||||||
|
location.pathname = generate();
|
||||||
|
|
||||||
|
function generate() {
|
||||||
|
const consonants = "bcdfghjklmnpqrstvwxyz";
|
||||||
|
const vowels = "aeiou";
|
||||||
|
const rnd = (arr) => arr[Math.floor(Math.random() * arr.length)];
|
||||||
|
let word = "";
|
||||||
|
for (let i = 0; i < Math.random() * 2 + 2; i++) {
|
||||||
|
word += rnd(consonants);
|
||||||
|
word += rnd(vowels);
|
||||||
|
}
|
||||||
|
return word;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in a new issue