From 61c93d20500e03db73d734b76e1ca88f3c08a461 Mon Sep 17 00:00:00 2001 From: shiffman Date: Thu, 23 May 2019 16:00:37 -0400 Subject: [PATCH] drawings for 2-7 #35 --- module2/exercise_07_save_files/shiffman.db | 3 +- module2/exercise_08_p5_drawings/drawings.db | 3 + module2/exercise_08_p5_drawings/index.js | 28 ++ .../exercise_08_p5_drawings/package-lock.json | 422 ++++++++++++++++++ module2/exercise_08_p5_drawings/package.json | 20 + .../exercise_08_p5_drawings/public/index.html | 24 + .../public/logs/index.html | 15 + .../public/logs/logs.js | 25 ++ .../exercise_08_p5_drawings/public/sketch.js | 50 +++ .../exercise_08_p5_drawings/public/style.css | 4 + 10 files changed, 592 insertions(+), 2 deletions(-) create mode 100644 module2/exercise_08_p5_drawings/drawings.db create mode 100644 module2/exercise_08_p5_drawings/index.js create mode 100644 module2/exercise_08_p5_drawings/package-lock.json create mode 100644 module2/exercise_08_p5_drawings/package.json create mode 100644 module2/exercise_08_p5_drawings/public/index.html create mode 100644 module2/exercise_08_p5_drawings/public/logs/index.html create mode 100644 module2/exercise_08_p5_drawings/public/logs/logs.js create mode 100644 module2/exercise_08_p5_drawings/public/sketch.js create mode 100644 module2/exercise_08_p5_drawings/public/style.css diff --git a/module2/exercise_07_save_files/shiffman.db b/module2/exercise_07_save_files/shiffman.db index fc2604e..4e709b4 100644 --- a/module2/exercise_07_save_files/shiffman.db +++ b/module2/exercise_07_save_files/shiffman.db @@ -1,5 +1,4 @@ {"lat":40.7296086,"lon":-73.9938007,"mood":"rainbow","image_file":"image_1558376232234.png","timestamp":1558376232234,"_id":"7QLBKrUrXTPAoEyA"} {"lat":40.7296086,"lon":-73.9938007,"mood":"unicorn","image_file":"image_1558376240358.png","timestamp":1558376240358,"_id":"rLp45mGTbW4wa5pw"} {"lat":40.7296086,"lon":-73.9938007,"mood":"🚂🌈","image_file":"image_1558376266448.png","timestamp":1558376266448,"_id":"YLHImEEXOlLOPbFJ"} -{"lat":40.7296086,"lon":-73.9938007,"mood":"❤️❤️❤️❤️❤️❤️❤️","image_file":"image_1558376281197.png","timestamp":1558376281197,"_id":"j2knqdvxHKqC2EB8"} -` \ No newline at end of file +{"lat":40.7296086,"lon":-73.9938007,"mood":"❤️❤️❤️❤️❤️❤️❤️","image_file":"image_1558376281197.png","timestamp":1558376281197,"_id":"j2knqdvxHKqC2EB8"} \ No newline at end of file diff --git a/module2/exercise_08_p5_drawings/drawings.db b/module2/exercise_08_p5_drawings/drawings.db new file mode 100644 index 0000000..0eb6464 --- /dev/null +++ b/module2/exercise_08_p5_drawings/drawings.db @@ -0,0 +1,3 @@ +{"lat":19.075984,"lon":72.877656,"mood":"rainbow","image64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAARJ0lEQVR4Xu1dB8wVxRY+SBGjCIqKIipFIhJs0QRslGAhGgQJSpOAgJIgiBisESwExYDwBwXECoRqCSjFBBQLKIgFKRFRAVsEsTcULLx8+97yLpe7e85O2dm9/5zkz/Nxp5w58+2U06YKEe0lT14CjiRQxQPQkeR9t4EEPAA9EJxKwAPQqfh95x6AHgNOJeAB6FT8vnMPQI8BpxLwAHQqft+5B6DHgFMJeAA6Fb/v3APQY8CpBDwAnYrfd+4B6DHgVAJlA8DLLruMTj75ZNqyZQv99ttv+wn12GOPDf7/jh07DhB21G+m6hS2c9hhh1GTJk3o008/pSVLljid+Kx0nnkAhsD65ptvAgABZAcddBDVr1+fzjzzTGrVqhWFk5wVoUr5+Oyzz2jBggX01Vdf0U8//RSM7/zzz6d169bRvHnzpM3kulxmABgC7ffff6cTTzyRrr76amrWrFmuhavL/Ny5c6lHjx66zWS6vjMA1qlTh2699Vbq3r07NWrUKNNCcsnc1q1b6eyzzw5WyHIkJwCcOHEiDR48mKpUQfeeOAn8+++/9Mgjj9DQoUO5orn7PXUAvvHGG3ThhRfmTlBZYPijjz4KtuQPPvggC+wY4SE1AJ500knBza958+ZGGK/Mjbz44ot044030ueff557MaQCQGy5Q4YMyb2wsjSAvXv30oMPPkh33HFHlthKzIt1AI4cOZLuvffexIwlrfDPP/8E+r/vvvsu+Pvzzz+pZs2a1KBBA4L+DYTfofKI+w3lTNT59ttv6eijj97X9x9//EG7d+8mXL5q166ddHiR5Z988kkaMGCAsfbSbsgqALHtQtelS1DN/PDDD3TooYdS1apVg+a2bdtGCxcupOXLlwdnorzdEqHDvOiii6hXr16BFgAXsho1agQfTVK69tpradq0aUmrZaK8NQCqbLu47f3111/BSgH1w5QpU+iZZ57JHbh0ZhZqqRkzZlD16tUTNXPDDTfQ5MmTE9XJQmErAEy67f799990xRVX0EsvvZQFmTjnATsHLCEtW7ZMxMvDDz8cXE7yRFYAiAOylLB9du7cuSxudNIxS8thm66oqKA2bdpIq9Bzzz1HV111lbi864LGAXj//feLb2bQacHc5CleAoMGDSKsbrCBS+i1116jK6+8MhdHF+MAxA20bt26rJy+/vprOv7449lyvsB/JYBt+e2336Z69eqJRLJz507q2rUrrVixQlTeVSGjADz99NMDTw6OoAa55JJLMi8cbhxp/w4VzltvvUWnnnqquOusq2mMAnD27Nms98amTZsCB4T169eLhegL/l8CACF0mVBJSenuu++m++67T1o81XJGAQhFb5xgNm/enAsXq0IfxHA2QmfWQgdT/De2xLQdTLEdwy4s1RlCy5BUrZMWCo0BEF/mjz/+GMv3NddcQ7NmzUprbOJ+unXrFjiCXnzxxVofCEDx8ssv08qVK607lAKEUMI3btxYNE6Y7W6//XZR2TQLGQMgVCnz58+P5T1L7lfDhg2j6667jk455RTx7TLJxECpjpVx+vTpBM2ALbrnnnsIWyxHuBzCNJg1MgbApUuXBitIFLncfnHmxEpxyCGH0KWXXho4eEpVGiYmDHbqV155hbDS2jAZ4uOHxYjbZrO4ChoDIIztcWeSO++8kx544AET8ylu49VXX6W2bduKy9suCAU9FMs333yz8a5wbl28eHFsu7t27QpUXzY+AtUBGQGg5Px31llnWXekDN38L7/8cjrttNMy63GNc2LcbqE6mWi3ffv2sdWXLVsWqMCyQkYAmIXz36OPPkr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5gKAkjNIqYFw9ZIMHlYSEM6heSNsxwsXLtTOIGt63Kre6yp8aKlhOCCBoWIwmXJaKBWLjH9Dura8EYA4ffr0wEPHhZtYsbxwHg8vOrZlaRWAcGwsfiAQGU05x0vu7TXYhaNeeBw2bFhgJ84j4VIGnd3AgQONsI8FQur7uGfPHlq7dm2gt8UFJy2yCsBffvmFevTosU8JmkR3Fff2Gm7NUedECDIum1ZagtXpByvi1KlTA89pzn8wqh88rh1anxD8PnLkyCCGGRcfXA6x0uK8DbUQXngqVlTr8J+krjIApZr4kJlQCTp69GgRfxASnn8oJRhu609yhhQx47AQPlo4cgwZMiSIY+EuaJANzKJ4oiwPpAzAJKuZriBC8G7ZsiVoKnQ9imq3nABYPMbC1QwqKwAOoMT/IlMDssmmuYXqzq0yANFx3Faoy5hO/XIGoI5cslhXC4Bxru8uB5uGJ6/L8ZVT31oAhCAkt9q0BeYq5DLtcZZDf9oAxIGXO5OlKagsPEGa5njz3pc2ACEARJnBnbxp06bO5VGofnDOjGeAlYARAIa9wMgOjT7y4oVOBZIgG9zgTFwcEBZQHGTNSsAXcCoBowAsNZJQbdC8efNAqQoFKP4AOHi/bN68OVBWg1TAW9hnmiYkp7NWRp1bB6COrIrBi5USlg6AFxp9rK4AMR6zgfnKu/7rSNtN3UwD0I1IfK9pSsADME1p+74OkIAHoAeFUwl4ADoVv+/cA9BjwKkEPACdit937gHoMeBUAv8BQgH9eZx3KbAAAAAASUVORK5CYII=","timestamp":1558641552218,"_id":"jvS1aOXQLILmnH0T"} +{"lat":19.075984,"lon":72.877656,"mood":"heart","image64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAOAklEQVR4Xu1dZ4gUTRMuz5wVDwOHOSsmPBXFiJizqCiInhlzQAxwiAGMYA4YjjMgYs6KiOE8FRXFjIo559MfYj59eeZj/dbzdqZ6dnqmZ7cb9tdWd1c//Ux3VXXKQkS/SSeNgEcIZNEE9Ah5Xa2BgCagJo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WbNmjR//nzHHBc9BWsC8hAIIYUpGmGdhg0bUtu2balu3bpsjxqersihq7AU9XlmPQIKdCBIiYuAsOkV12LkzJnzn1eKcGQSMjrxENAE5OGkpSQhoAkoCVhdLA8BTUAeTlpKEgKagJKA1cXyENAE5OGkpSQhoAkoCVhdLA8BTUAeTlpKEgKagJKA1cXyENAE5OGkpSQhoAkoCVhdLA8BTUAeTlpKEgKagJKA1cXyENAE5OGkpSQhoAkoCVhdLA+B/wAkqeVMVWz0GAAAAABJRU5ErkJggg==","timestamp":1558641564311,"_id":"iERo6urx2G2qdKXq"} +{"lat":19.075984,"lon":72.877656,"mood":"kitty","image64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAARRUlEQVR4Xu2dB6wdtRKGHQgt9CZAooPoHUQThBBEJ5SI3ksChI5EB1GCgEAoofcWICL03msgECAQegmi9yZ6L3n6/N4+LSdn12Ovvd5z4pGu7tU9tsce/2dsj2fGPZRSE1SiJIFIEuiRABhJ8omtlkACYAJCVAkkAEYVf2KeAJgwEFUCCYBRxZ+YJwAmDESVQAJgVPEn5rUDcI011lB9+/ZVU001lZpiiinU888/r0aOHJlmYhKVQG0AfOyxx9Raa61VKObXX39dDR48OIFxEgNiLQC89dZb1eabby4W7RNPPKF69+4tLp8Kdq4EagHgn3/+qXr27GklpX/++UeNGTNGnXPOOUkrWkmuswoHB+B5552n9t1338pSSVqxsggb2UBwAP71119q8skn9zL4CRMmqFtuuUVtueWWXtpLjcSXQFAALrfccmrcuHHeR5mA6F2k0RoMCsCZZppJffvtt8EGxz7xnnvuUTvttJP67rvvgvFJDYeTQFAAjhgxQm233Xbhep9r+dxzz1UHHHBALbwSE38SCArAr7/+Ws0666ylvR07dqxiqbY9Jbdr9LjjjtO2xESdI4FgAJQsvx999JGad955tbTmm28+dfPNN6sVV1zRWXrsDSebbDLn+qli/RIIBkCGAiDKaOONN9Z7uDwts8wy6vLLL3fWiqNHj1Zc9yXqDAlEBWCPHrAvJletOHDgQHXZZZfphjfaaCO18MILqy+++GIiRp9//rmac8459f/L/ubzDz74QL3//vudMasd1MtGAzCTowsQx48frxZZZBHvU3H88cerE044wWu7Q4cOVXPPPbc6//zz1ZNPPum17aY31hEAzAPxpptuUiuttFJUuR588MFq2LBhlftQZKR/9NFHtcfQpEBRAYiA33vvPbXgggtayZo6888/v1Udn4Uff/xx1adPn0pN/vrrr2rqqacubOO2225TW2yxRSUenVA5GABtbkFsT68PP/xwdA1h2r+aJt90QPv+++8VloRup2AAlJhh8sKVgPCUU05Rhx12WHRTS1VwDBgwQF166aVGbFUFuZFBAwoEAyBj+/3339WUU04pHiZXa+0cFwDzM888E+RQIe5cruDtt99u5d/YyoNxSsAlKePS/ybVCQrA3XbbTV1xxRVW420VelO0XjYItB/7vxdffNFqXFnhCy64QA0aNEhUd+aZZ+76O+6gAETKts6oGQAxvbDXW2ihhUSTVVbol19+0f3gloRYFOiPP/7Qv7O92HTTTVeolSgzatQoDTpOv1XsgTby4BDCYaSbKTgA2bOdeuqpYhkCQLTe4YcfLlqmihrGcHz00Ueru+++W6RFTIcCH8vhySefrI488kixLAB9WRyNuKEGFwwOQMaOA+k111xTanbIZMQ13B577OEkMuxqaM299tpL31xI6Y477lD9+vUrLe4DgBLnjHwnfvrpJzX99NNLh9GR5WoBYCYZvJnLbFtcl80xxxzWguT+F82C274tmTRf1t7yyy/vvO+jDe64X3rpJdvuVVoFrJlFqFArADNtOHz4cDXNNNP8a7jvvvuutUGaJWrnnXe20nZ5pn///bfYpHPiiSeq1157zTlA6sYbb3QKJfCheSPgSsyydgC269mQIUP0nk9KbOT79++v7rrrLmmVtuWk2q+1sm2AFI4RrtuKBMBKU2yuvM8+++hLeClhD9xmm22ctV7GZ80119QnW1fClke8M2B8++23J3Iry9o96KCD1FlnneXKJi3BzpITVCTmd//99xeU/K85x4fWy5jZ3tRIOsk2gkMUp10IHt988414mW/HI2lAieQdyqAV0A4S+vLLL9XKK69cWeu18nJdgk19zo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Sq0gyaTj83Nd3yJ7dib8BpVRwGwdWl2fW/DNFGhNvKYibCruWRXIGEndjoyR+Dt7WslqJLRyyRHyecdCcD8wLDi77rrrnoZCxEpx+mZEAH2jpwuW6ksAymGcggnAcAnvbZr5cH+DU+Z7PUl9oyAECdfU8ywCAQ9gEEc6ngA5sXGYYXDxaqrrirODRhH7HKupge8uVI87bTT9P2uNB/iRAeBBED5hEhLohX5wSOkU4k9KZpO+oB3thr0799fzTPPPOJh+7C5ipm1FOwqDdhOCEzK4MGDVb9+/VxlVHs9snDhso8vpCuxGhB2StJMEyUAmiTk4XNsihdffLF2VA0Z41ClqwCPmGcOG1KtZ+I3YMAAbXYpAlmI16hMfcp/3vUasJ0wsL+xZ2J5I2Kv7N1fG2G6lsU5Abcq0s6FIPaJtJ1/zZSDDa9gxX6dfpIEYOskb7LJJtowy3LtupF3Ac6oUaN0pof828Iu7XRynQTAltkLbdaBHa70OJNW2eN1Mugm+SVYOnkkNcJTmJdBMR5jE8RvEdMI4aVFGUjzWUkJEeVEisMtyx4nW8A3KWu9BEApAlO54BJIS3BwEScGZRJIAEz4iCqBBMCo4k/MEwATBqJKIAEwqvgT8wTAhIGoEkgAjCr+xDwBMGEgqgQSAKOKPzFPAEwYiCqBBMCo4k/MEwATBqJKIAEwqvgT8wTAhIGoEkgAjCr+xDwBMGEgqgQSAKOKPzFPAEwYiCqBBMCo4k/MEwATBqJKIAEwqvgT8/8AX1Gnapv6yygAAAAASUVORK5CYII=","timestamp":1558641582246,"_id":"qTR9aig8HFTrSVFM"} diff --git a/module2/exercise_08_p5_drawings/index.js b/module2/exercise_08_p5_drawings/index.js new file mode 100644 index 0000000..a499bab --- /dev/null +++ b/module2/exercise_08_p5_drawings/index.js @@ -0,0 +1,28 @@ +const express = require('express'); +const Datastore = require('nedb'); + +const app = express(); +app.listen(3000, () => console.log('listening at 3000')); +app.use(express.static('public')); +app.use(express.json({ limit: '1mb' })); + +const database = new Datastore('database.db'); +database.loadDatabase(); + +app.get('/api', (request, response) => { + database.find({}, (err, data) => { + if (err) { + response.end(); + return; + } + response.json(data); + }); +}); + +app.post('/api', (request, response) => { + const data = request.body; + const timestamp = Date.now(); + data.timestamp = timestamp; + database.insert(data); + response.json(data); +}); diff --git a/module2/exercise_08_p5_drawings/package-lock.json b/module2/exercise_08_p5_drawings/package-lock.json new file mode 100644 index 0000000..1adf6e7 --- /dev/null +++ b/module2/exercise_08_p5_drawings/package-lock.json @@ -0,0 +1,422 @@ +{ + "name": "module2", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "accepts": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", + "requires": { + "mime-types": "~2.1.18", + "negotiator": "0.6.1" + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=" + }, + "binary-search-tree": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/binary-search-tree/-/binary-search-tree-0.2.5.tgz", + "integrity": "sha1-fbs7IQ/coIJFDa0jNMMErzm9x4Q=", + "requires": { + "underscore": "~1.4.4" + } + }, + "body-parser": { + "version": "1.18.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", + "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", + "requires": { + "bytes": "3.0.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "~1.6.3", + "iconv-lite": "0.4.23", + "on-finished": "~2.3.0", + "qs": "6.5.2", + "raw-body": "2.3.3", + "type-is": "~1.6.16" + } + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" + }, + "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.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + }, + "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=" + }, + "express": { + "version": "4.16.4", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", + "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", + "requires": { + "accepts": "~1.3.5", + "array-flatten": "1.1.1", + "body-parser": "1.18.3", + "content-disposition": "0.5.2", + "content-type": "~1.0.4", + "cookie": "0.3.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.1", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.4", + "qs": "6.5.2", + "range-parser": "~1.2.0", + "safe-buffer": "5.1.2", + "send": "0.16.2", + "serve-static": "1.13.2", + "setprototypeof": "1.1.0", + "statuses": "~1.4.0", + "type-is": "~1.6.16", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + } + }, + "finalhandler": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.4.0", + "unpipe": "~1.0.0" + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + } + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ipaddr.js": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", + "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=" + }, + "lie": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", + "integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=", + "requires": { + "immediate": "~3.0.5" + } + }, + "localforage": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/localforage/-/localforage-1.7.3.tgz", + "integrity": "sha512-1TulyYfc4udS7ECSBT2vwJksWbkwwTX8BzeUIiq8Y07Riy7bDAAnxDaPU/tWyOVmQAcWJIEIFP9lPfBGqVoPgQ==", + "requires": { + "lie": "3.1.1" + } + }, + "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.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" + }, + "mime-db": { + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", + "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" + }, + "mime-types": { + "version": "2.1.22", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", + "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", + "requires": { + "mime-db": "~1.38.0" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "nedb": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/nedb/-/nedb-1.8.0.tgz", + "integrity": "sha1-DjUCzYLABNU1WkPJ5VV3vXvZHYg=", + "requires": { + "async": "0.2.10", + "binary-search-tree": "0.2.5", + "localforage": "^1.3.0", + "mkdirp": "~0.5.1", + "underscore": "~1.4.4" + } + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" + }, + "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.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" + }, + "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.4", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", + "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.8.0" + } + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + }, + "raw-body": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", + "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.3", + "iconv-lite": "0.4.23", + "unpipe": "1.0.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "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.16.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "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.6.2", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" + } + }, + "serve-static": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", + "send": "0.16.2" + } + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + }, + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + }, + "type-is": { + "version": "1.6.16", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", + "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.18" + } + }, + "underscore": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz", + "integrity": "sha1-YaajIBBiKvoHljvzJSA88SI51gQ=" + }, + "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=" + } + } +} diff --git a/module2/exercise_08_p5_drawings/package.json b/module2/exercise_08_p5_drawings/package.json new file mode 100644 index 0000000..06a6119 --- /dev/null +++ b/module2/exercise_08_p5_drawings/package.json @@ -0,0 +1,20 @@ +{ + "name": "module2", + "version": "1.0.0", + "description": "This is the data selfie app by Joey Lee.", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [ + "example", + "data", + "selfie" + ], + "author": "Daniel Shiffman", + "license": "MIT", + "dependencies": { + "express": "^4.16.4", + "nedb": "^1.8.0" + } +} diff --git a/module2/exercise_08_p5_drawings/public/index.html b/module2/exercise_08_p5_drawings/public/index.html new file mode 100644 index 0000000..09410df --- /dev/null +++ b/module2/exercise_08_p5_drawings/public/index.html @@ -0,0 +1,24 @@ + + + + + + + + + + Document + + +

Data Selfie App

+
enter | list
+

+ latitude: °
+ longitude: ° +

+ + + + + + diff --git a/module2/exercise_08_p5_drawings/public/logs/index.html b/module2/exercise_08_p5_drawings/public/logs/index.html new file mode 100644 index 0000000..5e55a91 --- /dev/null +++ b/module2/exercise_08_p5_drawings/public/logs/index.html @@ -0,0 +1,15 @@ + + + + + + + + Document + + +

Data Selfie App

+
enter | list
+ + + diff --git a/module2/exercise_08_p5_drawings/public/logs/logs.js b/module2/exercise_08_p5_drawings/public/logs/logs.js new file mode 100644 index 0000000..abb4820 --- /dev/null +++ b/module2/exercise_08_p5_drawings/public/logs/logs.js @@ -0,0 +1,25 @@ +getData(); + +async function getData() { + const response = await fetch('/api'); + const data = await response.json(); + + for (item of data) { + const root = document.createElement('p'); + const mood = document.createElement('div'); + const geo = document.createElement('div'); + const date = document.createElement('div'); + const image = document.createElement('img'); + + mood.textContent = `mood: ${item.mood}`; + geo.textContent = `${item.lat}°, ${item.lon}°`; + const dateString = new Date(item.timestamp).toLocaleString(); + date.textContent = dateString; + image.src = item.image64; + image.alt = 'Dan Shiffman making silly faces.'; + + root.append(mood, geo, date, image); + document.body.append(root); + } + console.log(data); +} diff --git a/module2/exercise_08_p5_drawings/public/sketch.js b/module2/exercise_08_p5_drawings/public/sketch.js new file mode 100644 index 0000000..760cf30 --- /dev/null +++ b/module2/exercise_08_p5_drawings/public/sketch.js @@ -0,0 +1,50 @@ +function setup() { + const canvas = createCanvas(160, 120); + pixelDensity(1); + background(0); + let lat, lon; + const button = document.getElementById('submit'); + button.addEventListener('click', async event => { + const mood = document.getElementById('mood').value; + canvas.loadPixels(); + const image64 = canvas.elt.toDataURL(); + const data = { lat, lon, mood, image64 }; + const options = { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(data) + }; + const response = await fetch('/api', options); + const json = await response.json(); + console.log(json); + }); + + if ('geolocation' in navigator) { + console.log('geolocation available'); + navigator.geolocation.getCurrentPosition(position => { + lat = position.coords.latitude; + lon = position.coords.longitude; + console.log(lat, lon); + document.getElementById('latitude').textContent = lat; + document.getElementById('longitude').textContent = lon; + }); + } else { + console.log('geolocation not available'); + } +} + +function keyPressed() { + if (key == 'c') { + background(0); + } +} + +function draw() { + stroke(255); + strokeWeight(8); + if (mouseIsPressed) { + line(pmouseX, pmouseY, mouseX, mouseY); + } +} diff --git a/module2/exercise_08_p5_drawings/public/style.css b/module2/exercise_08_p5_drawings/public/style.css new file mode 100644 index 0000000..bfde56c --- /dev/null +++ b/module2/exercise_08_p5_drawings/public/style.css @@ -0,0 +1,4 @@ +p { + padding: 10px; + background-color: #ffaaff; +}