From 3aea7c273c8bd3bbb818274bdb0c43a65419c484 Mon Sep 17 00:00:00 2001 From: "Glitch (a2-mlshax)" Date: Thu, 17 Sep 2020 00:57:41 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=9A=9C=F0=9F=8D=AF=20Updated=20with?= =?UTF-8?q?=20Glitch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .glitch-assets | 0 package.json | 10 +-- public/css/style.css | 35 ++++++++++- public/index.html | 43 ++++--------- public/js/scripts.js | 145 ++++++++++++++++++++++++++++++++++++++++++- server.improved.js | 70 +++++++++++++++++---- shrinkwrap.yaml | 15 +++++ 7 files changed, 268 insertions(+), 50 deletions(-) create mode 100644 .glitch-assets create mode 100644 shrinkwrap.yaml diff --git a/.glitch-assets b/.glitch-assets new file mode 100644 index 00000000..e69de29b diff --git a/package.json b/package.json index 988f135f..106fd90b 100755 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { - "name": "", - "version": "", - "description": "", - "author": "", + "name": "TODO", + "version": "1.0", + "description": "A Simple TODO List Application", + "author": "Malek ElShakhs", "scripts": { "start": "node server.improved.js" }, "dependencies": { - "mime": "^2.4.4" + "mime": "^2.4.6" } } diff --git a/public/css/style.css b/public/css/style.css index d5f842ab..0afa1bb4 100755 --- a/public/css/style.css +++ b/public/css/style.css @@ -1 +1,34 @@ -/*Style your own assignment! This is fun! */ \ No newline at end of file +body{ + font-family: 'Lato', sans-serif; +} +form{ + display: flex; + justify-content: center; +} +input{ + margin-right: 10px; + font-family: 'Lato', sans-serif; +} +li{ + margin: 5px; + display: flex; +} +task, date, due{ + width: 25% +} +priority{ + width: 20% +} +p{ + margin-right: 36px; +} +.deleteButton{ + background-color: #E97451; +} +#submitButton{ + background-color: #AEB7FD; +} +#titles{ + display: flex; + justify-content: left; +} \ No newline at end of file diff --git a/public/index.html b/public/index.html index c56d620e..429b3842 100755 --- a/public/index.html +++ b/public/index.html @@ -1,41 +1,24 @@ + + CS4241 Assignment 2 +
- - + + +
+ + - diff --git a/public/js/scripts.js b/public/js/scripts.js index de052eae..d41a1edc 100755 --- a/public/js/scripts.js +++ b/public/js/scripts.js @@ -1,3 +1,146 @@ // Add some Javascript code here, to run on the front end. -console.log("Welcome to assignment 2!") \ No newline at end of file +console.log("Welcome to assignment 2!") + +var todos = [] + +const updateData = function(e){ + console.log('Getting') + + fetch( '/appData', { + method: 'GET' + }) + .then( function( response ) { + + return (response.json()) + + }).then(function(data) { + + todos = data; + console.log(todos); + document.querySelector('#taskList').innerHTML = ''; + todos.forEach( + element => document.querySelector('#taskList').innerHTML += + '
  • ' + element.task + '' + element.priority + + '' + element.date + '' + element.due + '' + + '