From 582a7e2f54d4d32cf79d8afdbe078140934c52ba Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 15 Feb 2021 22:03:59 -0800 Subject: [PATCH 01/12] first screen --- public/css/bootstrap.css | 92 +++++++++++++++++++++++++++++++++++++++- public/js/bar.js | 6 +++ public/js/bootstrap.js | 2 +- routes/index.js | 13 ++++-- views/index.handlebars | 46 +++++++++++++++++++- 5 files changed, 151 insertions(+), 8 deletions(-) create mode 100644 public/js/bar.js diff --git a/public/css/bootstrap.css b/public/css/bootstrap.css index 377dff300..261c3426a 100644 --- a/public/css/bootstrap.css +++ b/public/css/bootstrap.css @@ -42,7 +42,34 @@ html { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } - +.screen { + margin: auto; + text-align: center; + width: 350px; + height: 600px; + border: 5px solid black; + padding: 10px; + justify-content: center; + align-items: flex-end; +} +.nav{ + float: right; + color: gray; +} +.data{ + text-align: right; +} +.graph{ + height: 25px; + margin: auto; +} +.welcome{ + padding: 10px; + height:35px; +} +.name{ + height: 50px; +} body { margin: 0; } @@ -96,7 +123,68 @@ samp { font-family: monospace, serif; font-size: 1em; } +.dropbtn { + background-color: white; + color: black; + padding: 10px; + font-size: 16px; + border: none; + outline: none; +} +.dropmenu{ + background-color: white; + color: black; + padding: 10px; + font-size: 30px; + border: none; + outline: none; +} +/* The container
- needed to position the dropdown content */ +.dropdown { + position: relative; + display: inline-block; + float: left; +} +.data { + position: relative; + display: inline-block; + float: left; + left: 2px; +} +/* Dropdown Content (Hidden by Default) */ +.dropdown-content { + display: none; + position: absolute; + background-color: #f1f1f1; + min-width: 160px; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + z-index: 1; + +} +.graph-content { + display: none; + position: absolute; + background-color: #f1f1f1; + min-width: 160px; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + z-index: 1; + +} +/* Links inside the dropdown */ +.dropdown-content a { + color: black; + padding: 12px 16px; + text-decoration: none; + display: block; +} + + + +/* Change the background color of the dropdown button when the dropdown content is shown */ +.dropdown:hover .dropbtn {color: blue;} +.data:hover .dropmenu {color: blue;} +s pre { white-space: pre-wrap; } @@ -7115,4 +7203,4 @@ td.visible-print { td.hidden-print { display: none !important; } -} \ No newline at end of file +} diff --git a/public/js/bar.js b/public/js/bar.js new file mode 100644 index 000000000..4e2864225 --- /dev/null +++ b/public/js/bar.js @@ -0,0 +1,6 @@ +function openMenu() { + document.getElementById("sidebar").classList.toggle("show"); +} +function graph() { + document.getElementById("options").classList.toggle("show"); +} diff --git a/public/js/bootstrap.js b/public/js/bootstrap.js index 850e6e53b..152866bc3 100644 --- a/public/js/bootstrap.js +++ b/public/js/bootstrap.js @@ -25,7 +25,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery" * limitations under the License. * ======================================================================== */ - + +function ($) { "use strict"; // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) diff --git a/routes/index.js b/routes/index.js index 51466f4d5..56f323dc8 100644 --- a/routes/index.js +++ b/routes/index.js @@ -3,6 +3,13 @@ * GET home page. */ -exports.view = function(req, res){ - res.render('index'); -}; \ No newline at end of file +function openNav() { + document.getElementById("mySidebar").style.width = "250px"; + document.getElementById("main").style.marginLeft = "250px"; +} + +/* Set the width of the sidebar to 0 and the left margin of the page content to 0 */ +function closeNav() { + document.getElementById("mySidebar").style.width = "0"; + document.getElementById("main").style.marginLeft = "0"; +} diff --git a/views/index.handlebars b/views/index.handlebars index 7fef0f9e9..8c5bdcd69 100644 --- a/views/index.handlebars +++ b/views/index.handlebars @@ -1,8 +1,50 @@ - Test Page + Wellness Tracker + + + + + + + -Begin here (or replace this with any static code already written). +
+ +

Welcome,

+

John

+

Check out your stats for the day!:

+
+ +
+ + + + + + +
+
+
+

SLEEP

+ Record some data +
+
From 84bab221e063ab13ccca882a3ae1468ecb4caece Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 15 Feb 2021 22:26:22 -0800 Subject: [PATCH 02/12] fixed glitch --- routes/index.js | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/routes/index.js b/routes/index.js index 56f323dc8..8a4a57820 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1,15 +1,3 @@ - -/* - * GET home page. - */ - -function openNav() { - document.getElementById("mySidebar").style.width = "250px"; - document.getElementById("main").style.marginLeft = "250px"; -} - -/* Set the width of the sidebar to 0 and the left margin of the page content to 0 */ -function closeNav() { - document.getElementById("mySidebar").style.width = "0"; - document.getElementById("main").style.marginLeft = "0"; -} +exports.view = function(req, res){ + res.render('index'); +}; From f44fddc21ab0566a5e1d7b6e8588d6a1769e0125 Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 16 Feb 2021 21:15:34 -0800 Subject: [PATCH 03/12] linked pages --- public/css/bootstrap.css | 5 ++++- routes/forum.js | 3 +++ routes/help.js | 3 +++ routes/profile.js | 3 +++ routes/record.js | 3 +++ views/forum.handlebars | 29 +++++++++++++++++++++++++++++ views/help.handlebars | 29 +++++++++++++++++++++++++++++ views/index.handlebars | 8 ++++---- views/profile.handlebars | 29 +++++++++++++++++++++++++++++ views/record.handlebars | 29 +++++++++++++++++++++++++++++ 10 files changed, 136 insertions(+), 5 deletions(-) create mode 100644 routes/forum.js create mode 100644 routes/help.js create mode 100644 routes/profile.js create mode 100644 routes/record.js create mode 100644 views/forum.handlebars create mode 100644 views/help.handlebars create mode 100644 views/profile.handlebars create mode 100644 views/record.handlebars diff --git a/public/css/bootstrap.css b/public/css/bootstrap.css index 261c3426a..771b66c65 100644 --- a/public/css/bootstrap.css +++ b/public/css/bootstrap.css @@ -178,7 +178,10 @@ samp { display: block; } - +.title{ + line-height: 100px; + margin-left: -950px; +} /* Change the background color of the dropdown button when the dropdown content is shown */ diff --git a/routes/forum.js b/routes/forum.js new file mode 100644 index 000000000..5d2d60a0f --- /dev/null +++ b/routes/forum.js @@ -0,0 +1,3 @@ +exports.viewForum= function(req,res){ + res.render("forum"); +}; diff --git a/routes/help.js b/routes/help.js new file mode 100644 index 000000000..acbbf22e7 --- /dev/null +++ b/routes/help.js @@ -0,0 +1,3 @@ +exports.viewHelp= function(req,res){ + res.render("help"); +}; diff --git a/routes/profile.js b/routes/profile.js new file mode 100644 index 000000000..bfc53f707 --- /dev/null +++ b/routes/profile.js @@ -0,0 +1,3 @@ +exports.viewProfile = function(req, res){ + res.render('profile'); +}; diff --git a/routes/record.js b/routes/record.js new file mode 100644 index 000000000..f00d3793b --- /dev/null +++ b/routes/record.js @@ -0,0 +1,3 @@ +exports.viewR = function(req,res){ + res.render("record"); +}; diff --git a/views/forum.handlebars b/views/forum.handlebars new file mode 100644 index 000000000..79661793a --- /dev/null +++ b/views/forum.handlebars @@ -0,0 +1,29 @@ + + + Wellness Tracker + + + + + + + + + +
+ +

Forum

+
+ + + + diff --git a/views/help.handlebars b/views/help.handlebars new file mode 100644 index 000000000..98669ea2e --- /dev/null +++ b/views/help.handlebars @@ -0,0 +1,29 @@ + + + Wellness Tracker + + + + + + + + + +
+ +

Help

+
+ + + + diff --git a/views/index.handlebars b/views/index.handlebars index 8c5bdcd69..f028178bf 100644 --- a/views/index.handlebars +++ b/views/index.handlebars @@ -15,10 +15,10 @@

Welcome,

diff --git a/views/profile.handlebars b/views/profile.handlebars new file mode 100644 index 000000000..9a80c79e3 --- /dev/null +++ b/views/profile.handlebars @@ -0,0 +1,29 @@ + + + Wellness Tracker + + + + + + + + + +
+ +

Profile

+
+ + + + diff --git a/views/record.handlebars b/views/record.handlebars new file mode 100644 index 000000000..b0cef88c4 --- /dev/null +++ b/views/record.handlebars @@ -0,0 +1,29 @@ + + + Wellness Tracker + + + + + + + + + +
+ +

Record Data

+
+ + + + From 531bab2115b2b6a228f85f3c7f67a774283ae3e6 Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 16 Feb 2021 21:28:06 -0800 Subject: [PATCH 04/12] add missing file --- app.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index edb9f73ea..3b0e958ad 100644 --- a/app.js +++ b/app.js @@ -9,6 +9,10 @@ var path = require('path'); var handlebars = require('express3-handlebars') var index = require('./routes/index'); +var record = require('./routes/record'); +var forum = require('./routes/forum'); +var help = require('./routes/help'); +var profile = require('./routes/profile'); // Example route // var user = require('./routes/user'); @@ -34,10 +38,13 @@ if ('development' == app.get('env')) { app.use(express.errorHandler()); } -app.get('/', index.view); +app.get('/index', index.view); // Example route // app.get('/users', user.list); - +app.get("/record",record.viewR); +app.get("/help",help.viewHelp); +app.get("/forum",forum.viewForum); +app.get("/profile",profile.viewProfile); http.createServer(app).listen(app.get('port'), function(){ console.log('Express server listening on port ' + app.get('port')); }); From 14fb07ecebd731917b60dad5dc71069934abbce7 Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 16 Feb 2021 21:42:21 -0800 Subject: [PATCH 05/12] fixed critical bug --- app.js | 4 ++-- views/forum.handlebars | 2 +- views/help.handlebars | 2 +- views/profile.handlebars | 2 +- views/record.handlebars | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index 3b0e958ad..264f62821 100644 --- a/app.js +++ b/app.js @@ -6,7 +6,7 @@ var express = require('express'); var http = require('http'); var path = require('path'); -var handlebars = require('express3-handlebars') +var handlebars = require('express3-handlebars'); var index = require('./routes/index'); var record = require('./routes/record'); @@ -38,7 +38,7 @@ if ('development' == app.get('env')) { app.use(express.errorHandler()); } -app.get('/index', index.view); +app.get('/', index.view); // Example route // app.get('/users', user.list); app.get("/record",record.viewR); diff --git a/views/forum.handlebars b/views/forum.handlebars index 79661793a..828446bc3 100644 --- a/views/forum.handlebars +++ b/views/forum.handlebars @@ -14,7 +14,7 @@