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 + '' + + '