From 9fc56ba7654d3ffea1a872574a0cddfe3c633b6d Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Fri, 22 Apr 2022 11:44:45 -0500 Subject: [PATCH 01/17] fresh commit --- Develop/assets/script.js | 0 Develop/{ => assets}/style.css | 0 Develop/index.html | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 Develop/assets/script.js rename Develop/{ => assets}/style.css (100%) diff --git a/Develop/assets/script.js b/Develop/assets/script.js new file mode 100644 index 0000000..e69de29 diff --git a/Develop/style.css b/Develop/assets/style.css similarity index 100% rename from Develop/style.css rename to Develop/assets/style.css diff --git a/Develop/index.html b/Develop/index.html index e2549e4..a7b43cf 100644 --- a/Develop/index.html +++ b/Develop/index.html @@ -18,7 +18,7 @@ href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet" /> - + Work Day Scheduler From 0034bde5578348f19e50c3ddec5b227733f94191 Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Fri, 22 Apr 2022 12:07:03 -0500 Subject: [PATCH 02/17] boxes --- README.md | 13 +++++++++++++ {Develop/assets => assets}/script.js | 0 {Develop/assets => assets}/style.css | 0 Develop/index.html => index.html | 12 ++++++++++++ 4 files changed, 25 insertions(+) rename {Develop/assets => assets}/script.js (100%) rename {Develop/assets => assets}/style.css (100%) rename Develop/index.html => index.html (78%) diff --git a/README.md b/README.md index 6747f6e..1ac3464 100644 --- a/README.md +++ b/README.md @@ -1 +1,14 @@ # Work Day Scheduler Starter Code +GIVEN I am using a daily planner to create a schedule +WHEN I open the planner +THEN the current day is displayed at the top of the calendar +WHEN I scroll down +THEN I am presented with time blocks for standard business hours +WHEN I view the time blocks for that day +THEN each time block is color-coded to indicate whether it is in the past, present, or future +WHEN I click into a time block +THEN I can enter an event +WHEN I click the save button for that time block +THEN the text for that event is saved in local storage +WHEN I refresh the page +THEN the saved events persist diff --git a/Develop/assets/script.js b/assets/script.js similarity index 100% rename from Develop/assets/script.js rename to assets/script.js diff --git a/Develop/assets/style.css b/assets/style.css similarity index 100% rename from Develop/assets/style.css rename to assets/style.css diff --git a/Develop/index.html b/index.html similarity index 78% rename from Develop/index.html rename to index.html index a7b43cf..c0de354 100644 --- a/Develop/index.html +++ b/index.html @@ -30,6 +30,18 @@

Work Day Scheduler

+
+
+
+
+
+
+
+
+
+
+
+
From d57681b4e3d0f8a2b431055a3dcabc06d680b80b Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Fri, 22 Apr 2022 14:37:31 -0500 Subject: [PATCH 03/17] removed some ID's not using BS so idk why they were there --- index.html | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index c0de354..68bc603 100644 --- a/index.html +++ b/index.html @@ -23,14 +23,16 @@ -
-

Work Day Scheduler

-

A simple calendar app for scheduling your work day

-

+
+

Work Day Scheduler

+

A simple calendar app for scheduling your work day

+
-
+
-
+
+ +
@@ -42,8 +44,7 @@

Work Day Scheduler

-
- + From 28fe6cfa894d5ad520a35a5614f4c1e7a1e280ca Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Fri, 22 Apr 2022 14:38:12 -0500 Subject: [PATCH 04/17] actually starting over --- assets/style.css | 71 ------------------------------------------------ 1 file changed, 71 deletions(-) diff --git a/assets/style.css b/assets/style.css index 7c4bdff..e69de29 100644 --- a/assets/style.css +++ b/assets/style.css @@ -1,71 +0,0 @@ -body { - font-family: 'Open Sans', sans-serif; - font-size: 16px; - line-height: 1; -} - -textarea{ - background: transparent; - border: none; - resize: none; - color: #000000; - border-left: 1px solid black; - padding: 10px; -} - -.jumbotron { - text-align: center; - background-color: transparent; - color: black; - border-radius: 0; - border-bottom: 10px solid black; -} - -.description{ - white-space: pre-wrap; -} - -.time-block{ - text-align: center; - border-radius: 15px; -} - -.row { - white-space: pre-wrap; - height: 80px; - border-top: 1px solid white;; -} - -.hour { - background-color: #ffffff; - color: #000000; - border-top: 1px dashed #000000; -} - -.past { - background-color: #d3d3d3; - color: white; -} - -.present { - background-color: #ff6961; - color: white; -} - -.future { - background-color: #77dd77; - color: white; -} - -.saveBtn { - border-left: 1px solid black; - border-top-right-radius: 15px; - border-bottom-right-radius: 15px; - background-color: #06AED5; - color: white; -} - -.saveBtn i:hover { - font-size: 20px; - transition: all .3s ease-in-out; -} From 48628ae8170a93464ebdd34af730deeef4ec80b9 Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Fri, 22 Apr 2022 14:40:19 -0500 Subject: [PATCH 05/17] i' m an idiot --- assets/style.css | 71 ++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 8 +++--- 2 files changed, 75 insertions(+), 4 deletions(-) diff --git a/assets/style.css b/assets/style.css index e69de29..7c4bdff 100644 --- a/assets/style.css +++ b/assets/style.css @@ -0,0 +1,71 @@ +body { + font-family: 'Open Sans', sans-serif; + font-size: 16px; + line-height: 1; +} + +textarea{ + background: transparent; + border: none; + resize: none; + color: #000000; + border-left: 1px solid black; + padding: 10px; +} + +.jumbotron { + text-align: center; + background-color: transparent; + color: black; + border-radius: 0; + border-bottom: 10px solid black; +} + +.description{ + white-space: pre-wrap; +} + +.time-block{ + text-align: center; + border-radius: 15px; +} + +.row { + white-space: pre-wrap; + height: 80px; + border-top: 1px solid white;; +} + +.hour { + background-color: #ffffff; + color: #000000; + border-top: 1px dashed #000000; +} + +.past { + background-color: #d3d3d3; + color: white; +} + +.present { + background-color: #ff6961; + color: white; +} + +.future { + background-color: #77dd77; + color: white; +} + +.saveBtn { + border-left: 1px solid black; + border-top-right-radius: 15px; + border-bottom-right-radius: 15px; + background-color: #06AED5; + color: white; +} + +.saveBtn i:hover { + font-size: 20px; + transition: all .3s ease-in-out; +} diff --git a/index.html b/index.html index 68bc603..7811ce3 100644 --- a/index.html +++ b/index.html @@ -23,10 +23,10 @@ -
-

Work Day Scheduler

-

A simple calendar app for scheduling your work day

- +
+

Work Day Scheduler

+

A simple calendar app for scheduling your work day

+

From b96bb9f30dc88f2bda172b1fd694134aa31e13f8 Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Fri, 22 Apr 2022 16:09:22 -0500 Subject: [PATCH 06/17] boxes protype, need to fix outline --- assets/style.css | 4 +++- index.html | 28 ++++++++++++---------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/assets/style.css b/assets/style.css index 7c4bdff..2b41a25 100644 --- a/assets/style.css +++ b/assets/style.css @@ -39,9 +39,11 @@ textarea{ .hour { background-color: #ffffff; color: #000000; - border-top: 1px dashed #000000; + border-top: 10px solid #000000; } +/* dynamic css options */ + .past { background-color: #d3d3d3; color: white; diff --git a/index.html b/index.html index 7811ce3..f3596a6 100644 --- a/index.html +++ b/index.html @@ -28,23 +28,19 @@

Work Day Scheduler

A simple calendar app for scheduling your work day

-
+ -
- -
-
-
-
-
-
-
-
-
-
-
-
-
+
+
hour
+ + +
+
+
hour
+ + +
+ From d91b3b12dcacd10dba4a00586f4a333596d5200b Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Fri, 22 Apr 2022 16:24:20 -0500 Subject: [PATCH 07/17] realized style wasn't loading fixed, created boxes up to 5pm --- assets/style.css | 5 +++-- index.html | 50 ++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/assets/style.css b/assets/style.css index 2b41a25..3c76794 100644 --- a/assets/style.css +++ b/assets/style.css @@ -18,11 +18,12 @@ textarea{ background-color: transparent; color: black; border-radius: 0; - border-bottom: 10px solid black; + border-bottom: 2px solid black; } .description{ white-space: pre-wrap; + border: 1px solid black } .time-block{ @@ -39,7 +40,7 @@ textarea{ .hour { background-color: #ffffff; color: #000000; - border-top: 10px solid #000000; + border-top: 2px solid #000000; } /* dynamic css options */ diff --git a/index.html b/index.html index f3596a6..99f5c87 100644 --- a/index.html +++ b/index.html @@ -18,7 +18,7 @@ href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet" /> - + Work Day Scheduler @@ -31,15 +31,57 @@

Work Day Scheduler

-
hour
+
9a
-
hour
+
10a
- + +
+
+
11a
+ + +
+
+
12p
+ + +
+
+
1p
+ + +
+ +
+
2p
+ +
+ +
+
3p
+ + +
+ +
+
4p
+ + +
+ +
+
5p
+ + +
+ + + From 62a5d4be2c07cbf7e00a13069bdb600261e14f2d Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Fri, 22 Apr 2022 16:29:47 -0500 Subject: [PATCH 08/17] script sheet linked up babyy --- assets/script.js | 6 ++++++ index.html | 1 + 2 files changed, 7 insertions(+) diff --git a/assets/script.js b/assets/script.js index e69de29..eaf96ba 100644 --- a/assets/script.js +++ b/assets/script.js @@ -0,0 +1,6 @@ +let today = () => { +console.log("echo") +}; + + +today(); \ No newline at end of file diff --git a/index.html b/index.html index 99f5c87..58a4c5b 100644 --- a/index.html +++ b/index.html @@ -85,5 +85,6 @@

Work Day Scheduler

+ r From e76aa001413f94b3e41c0303b263310ac350b8fb Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Fri, 22 Apr 2022 16:33:40 -0500 Subject: [PATCH 09/17] today's date in header working --- assets/script.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/assets/script.js b/assets/script.js index eaf96ba..7a790f5 100644 --- a/assets/script.js +++ b/assets/script.js @@ -1,6 +1,2 @@ -let today = () => { -console.log("echo") -}; - - -today(); \ No newline at end of file +const today = moment().format('MMMM Do YY, h:mm:ss a') +$("#currentDay").html(today); \ No newline at end of file From 87b5b78c4b3a51c1788d7ab3b586bef286db3e7c Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Fri, 22 Apr 2022 16:41:58 -0500 Subject: [PATCH 10/17] gave rows IDs and switched everything to military time since this is for me and I use military time --- assets/script.js | 6 ++++-- index.html | 40 ++++++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/assets/script.js b/assets/script.js index 7a790f5..089106d 100644 --- a/assets/script.js +++ b/assets/script.js @@ -1,2 +1,4 @@ -const today = moment().format('MMMM Do YY, h:mm:ss a') -$("#currentDay").html(today); \ No newline at end of file +// This posts date/time in the header +const today = moment().format('MMMM Do YY, H:mm:ss a') +$("#currentDay").html(today); + diff --git a/index.html b/index.html index 58a4c5b..56654da 100644 --- a/index.html +++ b/index.html @@ -30,52 +30,56 @@

Work Day Scheduler

-
-
9a
+
+
9:00
-
-
10a
+ +
+
10:00
-
-
11a
+ +
+
11:00
-
-
12p
+ +
+
12:00
-
-
1p
+ +
+
13:00
-
-
2p
+
+
14:00
-
-
3p
+
+
15:00
-
-
4p
+
+
16:00
-
-
5p
+
+
17:00
From baf577e5cff6578611ab6920894b88758e5f474c Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Sat, 23 Apr 2022 13:30:01 -0500 Subject: [PATCH 11/17] fell asleep --- assets/script.js | 12 ++++++++++++ index.html | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/assets/script.js b/assets/script.js index 089106d..0c06cfb 100644 --- a/assets/script.js +++ b/assets/script.js @@ -1,4 +1,16 @@ +let sched = {} // This posts date/time in the header const today = moment().format('MMMM Do YY, H:mm:ss a') $("#currentDay").html(today); +// local storage +const loadSched = () => { + sched = JSON.parse(localStorage.getItem("sched")) + } + + +// save button +$(".btn").click(function(){ + console.log('CLICK') + // saveSched(); +}); diff --git a/index.html b/index.html index 56654da..e154831 100644 --- a/index.html +++ b/index.html @@ -32,7 +32,7 @@

Work Day Scheduler

9:00
- +
From 6e6614053712539f2e0bde96e3163e2900a542c3 Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Sat, 23 Apr 2022 14:22:31 -0500 Subject: [PATCH 12/17] local storage save working, document wrapped in ready method --- assets/script.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/assets/script.js b/assets/script.js index 0c06cfb..cd76f40 100644 --- a/assets/script.js +++ b/assets/script.js @@ -1,5 +1,5 @@ -let sched = {} -// This posts date/time in the header +$(document).ready(function() { +// This posts the current date and 24h clock in the header const today = moment().format('MMMM Do YY, H:mm:ss a') $("#currentDay").html(today); @@ -9,8 +9,13 @@ const loadSched = () => { } -// save button -$(".btn").click(function(){ - console.log('CLICK') - // saveSched(); +// Saves to local storage on button click +$(".btn").click(function() { + // pulls hour from id of .btn parent div + let hour = $(this).parent().attr("id") + // pulls description from text value of textarea + let description = $(this).siblings(".description").val() + // saves hour and description to localStorage + localStorage.setItem(hour,description) +}); }); From 485e43bf01735a1a38dff43e7162bdc92973d2ba Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Sat, 23 Apr 2022 14:38:50 -0500 Subject: [PATCH 13/17] local storage load working --- assets/script.js | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/assets/script.js b/assets/script.js index cd76f40..346ed6d 100644 --- a/assets/script.js +++ b/assets/script.js @@ -1,21 +1,25 @@ $(document).ready(function() { -// This posts the current date and 24h clock in the header -const today = moment().format('MMMM Do YY, H:mm:ss a') -$("#currentDay").html(today); + // This posts the current date and 24h clock in the header + const today = moment().format('MMMM Do YY, H:mm:ss a') + $("#currentDay").html(today); -// local storage -const loadSched = () => { - sched = JSON.parse(localStorage.getItem("sched")) - } + // Saves to local storage on button click + $(".btn").click(function() { + // pulls hour from id of .btn parent div + let hour = $(this).parent().attr("id") + // pulls description from text value of textarea + let description = $(this).siblings(".description").val() + // saves hour and description to localStorage + localStorage.setItem(hour,description) + }); + // // Load Storage + $('#9 .description').val(localStorage.getItem(9)) + console.log(localStorage.getItem("9")) -// Saves to local storage on button click -$(".btn").click(function() { - // pulls hour from id of .btn parent div - let hour = $(this).parent().attr("id") - // pulls description from text value of textarea - let description = $(this).siblings(".description").val() - // saves hour and description to localStorage - localStorage.setItem(hour,description) -}); }); + + // wip more effecient loadstorage + // const loadStorage = () => { + // const id = ["9","10","11","12","13","14","15","16","17"] + // } From 81336f48a90affbe5fc4e03b1b8baac9255bc104 Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Sat, 23 Apr 2022 14:51:38 -0500 Subject: [PATCH 14/17] created iterating function to pull from localStorage --- assets/script.js | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/assets/script.js b/assets/script.js index 346ed6d..db1e9e5 100644 --- a/assets/script.js +++ b/assets/script.js @@ -3,6 +3,18 @@ $(document).ready(function() { const today = moment().format('MMMM Do YY, H:mm:ss a') $("#currentDay").html(today); + // local Storage function + loadStorage = () => { + // create an array for each row parent id + const id = ["9","10","11","12","13","14","15","16","17"] + // iterate through entire id list + for (let i = 0; i < id.length; i++) { + // creates an id element with a value of each of the id iterations + const idEl = id[i]; + // sets the value of each description to locally saved data of each corresponding id + $(`#${idEl} .description`).val(localStorage.getItem(idEl)) + } + } // Saves to local storage on button click $(".btn").click(function() { @@ -13,13 +25,6 @@ $(document).ready(function() { // saves hour and description to localStorage localStorage.setItem(hour,description) }); - // // Load Storage - $('#9 .description').val(localStorage.getItem(9)) - console.log(localStorage.getItem("9")) -}); - - // wip more effecient loadstorage - // const loadStorage = () => { - // const id = ["9","10","11","12","13","14","15","16","17"] - // } + loadStorage(); +}); \ No newline at end of file From b41dd37e78332c5ab1f1bc9d16a996cf84124d96 Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Sat, 23 Apr 2022 15:40:46 -0500 Subject: [PATCH 15/17] set up the time variable through moment --- assets/script.js | 18 ++++++++++++++---- package.json | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 package.json diff --git a/assets/script.js b/assets/script.js index db1e9e5..3e35b10 100644 --- a/assets/script.js +++ b/assets/script.js @@ -1,10 +1,10 @@ + $(document).ready(function() { // This posts the current date and 24h clock in the header const today = moment().format('MMMM Do YY, H:mm:ss a') $("#currentDay").html(today); - // local Storage function - loadStorage = () => { + loadLocal = () => { // create an array for each row parent id const id = ["9","10","11","12","13","14","15","16","17"] // iterate through entire id list @@ -14,7 +14,7 @@ $(document).ready(function() { // sets the value of each description to locally saved data of each corresponding id $(`#${idEl} .description`).val(localStorage.getItem(idEl)) } - } + }; // Saves to local storage on button click $(".btn").click(function() { @@ -26,5 +26,15 @@ $(document).ready(function() { localStorage.setItem(hour,description) }); - loadStorage(); + loadLocal(); + + // Tracks time and changes colors of "row" + timeTracker = () => { + let time = moment().hours() + + console.log(time); + } + + timeTracker(); + }); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..a69ca30 --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "work-day-scheduler", + "version": "1.0.0", + "description": "persistant work day planner using localStorage and moment.js", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Father-of-Cats/Work-Day-Scheduler.git" + }, + "keywords": [], + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/Father-of-Cats/Work-Day-Scheduler/issues" + }, + "homepage": "https://github.com/Father-of-Cats/Work-Day-Scheduler#readme" +} From f4803a5cb16069deb93a6d80228b78e6764bbac1 Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Sat, 23 Apr 2022 17:00:39 -0500 Subject: [PATCH 16/17] got bg change working --- README.md | 15 +-------------- assets/script.js | 40 ++++++++++++++++++++++++++-------------- assets/style.css | 2 +- 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 1ac3464..8b13789 100644 --- a/README.md +++ b/README.md @@ -1,14 +1 @@ -# Work Day Scheduler Starter Code -GIVEN I am using a daily planner to create a schedule -WHEN I open the planner -THEN the current day is displayed at the top of the calendar -WHEN I scroll down -THEN I am presented with time blocks for standard business hours -WHEN I view the time blocks for that day -THEN each time block is color-coded to indicate whether it is in the past, present, or future -WHEN I click into a time block -THEN I can enter an event -WHEN I click the save button for that time block -THEN the text for that event is saved in local storage -WHEN I refresh the page -THEN the saved events persist + diff --git a/assets/script.js b/assets/script.js index 3e35b10..0a19346 100644 --- a/assets/script.js +++ b/assets/script.js @@ -1,23 +1,23 @@ - $(document).ready(function() { // This posts the current date and 24h clock in the header const today = moment().format('MMMM Do YY, H:mm:ss a') $("#currentDay").html(today); loadLocal = () => { - // create an array for each row parent id - const id = ["9","10","11","12","13","14","15","16","17"] + // creates an element to run through for each row.id + let id = ["9","10","11","12","13","14","15","16","17"] // iterate through entire id list for (let i = 0; i < id.length; i++) { // creates an id element with a value of each of the id iterations - const idEl = id[i]; + let idEl = id[i]; // sets the value of each description to locally saved data of each corresponding id $(`#${idEl} .description`).val(localStorage.getItem(idEl)) } }; + loadLocal(); // Saves to local storage on button click - $(".btn").click(function() { + $(".btn").click(() => { // pulls hour from id of .btn parent div let hour = $(this).parent().attr("id") // pulls description from text value of textarea @@ -25,16 +25,28 @@ $(document).ready(function() { // saves hour and description to localStorage localStorage.setItem(hour,description) }); - - loadLocal(); - - // Tracks time and changes colors of "row" + // tracks time and shifts row color timeTracker = () => { - let time = moment().hours() - - console.log(time); + // loops through the .row DOM element activating the function + $(".row").each(function() { + // current hour from moment js + let currentTime = moment().hours(); + // pulls interger from id of each .row looped through + let timeBlock = parseInt($(this).attr("id")); + if(timeBlock > currentTime) { + $(this).addClass("future") + $(this).removeClass("present") + + }else if(timeBlock == currentTime) { + $(this).removeClass("future") + $(this).removeClass("past") + $(this).addClass("present") + } else { + $(this).removeClass("future") + $(this).removeClass("present") + $(this).addClass("past") + } + }) } - timeTracker(); - }); \ No newline at end of file diff --git a/assets/style.css b/assets/style.css index 3c76794..6528ff4 100644 --- a/assets/style.css +++ b/assets/style.css @@ -56,7 +56,7 @@ textarea{ } .future { - background-color: #77dd77; + background-color: #77c5dd; color: white; } From 1dd47b49518dd00b59ded26d8fdbeff30675fb46 Mon Sep 17 00:00:00 2001 From: Hunter Nelson Date: Sat, 23 Apr 2022 17:39:22 -0500 Subject: [PATCH 17/17] cleaned up background function to only effect text block --- assets/script.js | 9 ++++----- assets/style.css | 3 ++- index.html | 18 +++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/assets/script.js b/assets/script.js index 0a19346..dd2c5e5 100644 --- a/assets/script.js +++ b/assets/script.js @@ -28,15 +28,14 @@ $(document).ready(function() { // tracks time and shifts row color timeTracker = () => { // loops through the .row DOM element activating the function - $(".row").each(function() { + $("textarea").each(function() { // current hour from moment js - let currentTime = moment().hours(); - // pulls interger from id of each .row looped through - let timeBlock = parseInt($(this).attr("id")); + let currentTime = 12 + // pulls interger from id of the parent row + let timeBlock = parseInt($(this).parent().attr("id")); if(timeBlock > currentTime) { $(this).addClass("future") $(this).removeClass("present") - }else if(timeBlock == currentTime) { $(this).removeClass("future") $(this).removeClass("past") diff --git a/assets/style.css b/assets/style.css index 6528ff4..0306f3b 100644 --- a/assets/style.css +++ b/assets/style.css @@ -8,7 +8,7 @@ textarea{ background: transparent; border: none; resize: none; - color: #000000; + color: black; border-left: 1px solid black; padding: 10px; } @@ -29,6 +29,7 @@ textarea{ .time-block{ text-align: center; border-radius: 15px; + color: black; } .row { diff --git a/index.html b/index.html index e154831..18666ee 100644 --- a/index.html +++ b/index.html @@ -32,55 +32,55 @@

Work Day Scheduler

9:00
- +
10:00
- +
11:00
- +
12:00
- +
13:00
- +
14:00
- +
15:00
- +
16:00
- +
17:00
- +