From de42c831ca2284786496c62df69972d0d7e34232 Mon Sep 17 00:00:00 2001 From: Ngoodman <112005039+poz123@users.noreply.github.com> Date: Fri, 9 Sep 2022 13:02:04 -0400 Subject: [PATCH 1/6] Update style.css --- public/css/style.css | 52 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/public/css/style.css b/public/css/style.css index d5f842a..16987d0 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -1 +1,51 @@ -/*Style your own assignment! This is fun! */ \ No newline at end of file +/*Style your own assignment! This is fun! */ +body{ + background-color: #D3D3D3; + font-family: "Antonio",sans-serif; +} +.res{ + margin: auto; + width: 50%; + + padding: 10px; +} +p{ + color:#2F4F4F +} +table, th, td { + background-color:lightgray; + + table-layout: auto; + width: 180px; +} + + +.flex { + margin-right:auto; + margin-left:auto; + + +} +.pm { + text-align: center; + +} +button:hover{ + background-color:green +} +#submitButton { + background-color: #2F4F4F; + border-radius: 5px; + color: white; + padding: 10px 16px; + text-align: center; + display: inline-block; + font-size: 11px; + margin-left:50%; + + + +} +#submitButton:hover{ + background-color:black +} From 037e18f01871632578d424e42c44e54c2e3e2af9 Mon Sep 17 00:00:00 2001 From: Ngoodman <112005039+poz123@users.noreply.github.com> Date: Fri, 9 Sep 2022 13:02:45 -0400 Subject: [PATCH 2/6] Update scripts.js --- public/js/scripts.js | 71 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/public/js/scripts.js b/public/js/scripts.js index de052ea..9ce195f 100644 --- a/public/js/scripts.js +++ b/public/js/scripts.js @@ -1,3 +1,72 @@ // Add some Javascript code here, to run on the front end. +const submit = function (e) { +let d1 = document.getElementById("data1").value; +let d2 = document.getElementById("data2").value; +let d3 = document.getElementById("data3").value; + let json = { + data: d1, + data2: d2, + data3: d3, + init:"", + + } + let body = JSON.stringify(json) + fetch( '/submit', { + method:'POST', + body + }) + .then( async function ( response ) { + let tData = await response.json() + makeTable(tData) + console.log( tData ) + }) + return false +} + function makeTable(tData){ + const table = document.getElementById("table") + table.innerHTML = "
" + return false + } + function deleteRow( ind) { + + console.log(ind) + let json = { + index: ind + } + let body = JSON.stringify(json) + fetch( '/delete', { + method:'POST', + body + }) + .then( async function ( response ) { + let dData = await response.json() + makeTable(dData) + console.log( dData ) + }) + + +} + + + window.onload = function () { + const button = document.getElementById("submitButton"); + button.onclick = submit + }; +console.log("Welcome to assignment 2!") + + -console.log("Welcome to assignment 2!") \ No newline at end of file From 6e0e11831e1406dc9a628d839b1484bac3f6da20 Mon Sep 17 00:00:00 2001 From: Ngoodman <112005039+poz123@users.noreply.github.com> Date: Fri, 9 Sep 2022 13:03:19 -0400 Subject: [PATCH 3/6] Update index.html --- public/index.html | 63 +++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/public/index.html b/public/index.html index c56d620..531ec95 100644 --- a/public/index.html +++ b/public/index.html @@ -1,41 +1,46 @@ - +