diff --git a/Develop/index.html b/Develop/index.html deleted file mode 100644 index e2549e4..0000000 --- a/Develop/index.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - Work Day Scheduler - - - -
-

Work Day Scheduler

-

A simple calendar app for scheduling your work day

-

-
-
- -
- - - - - diff --git a/README.md b/README.md index 6747f6e..8b13789 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# Work Day Scheduler Starter Code + diff --git a/assets/script.js b/assets/script.js new file mode 100644 index 0000000..dd2c5e5 --- /dev/null +++ b/assets/script.js @@ -0,0 +1,51 @@ +$(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 = () => { + // 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 + 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(() => { + // 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) + }); + // tracks time and shifts row color + timeTracker = () => { + // loops through the .row DOM element activating the function + $("textarea").each(function() { + // current hour from moment js + 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") + $(this).addClass("present") + } else { + $(this).removeClass("future") + $(this).removeClass("present") + $(this).addClass("past") + } + }) + } + timeTracker(); +}); \ No newline at end of file diff --git a/Develop/style.css b/assets/style.css similarity index 83% rename from Develop/style.css rename to assets/style.css index 7c4bdff..0306f3b 100644 --- a/Develop/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; } @@ -18,16 +18,18 @@ 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{ text-align: center; border-radius: 15px; + color: black; } .row { @@ -39,9 +41,11 @@ textarea{ .hour { background-color: #ffffff; color: #000000; - border-top: 1px dashed #000000; + border-top: 2px solid #000000; } +/* dynamic css options */ + .past { background-color: #d3d3d3; color: white; @@ -53,7 +57,7 @@ textarea{ } .future { - background-color: #77dd77; + background-color: #77c5dd; color: white; } diff --git a/index.html b/index.html new file mode 100644 index 0000000..18666ee --- /dev/null +++ b/index.html @@ -0,0 +1,94 @@ + + + + + + + + + + + Work Day Scheduler + + + +
+

Work Day Scheduler

+

A simple calendar app for scheduling your work day

+

+
+ + +
+
9:00
+ + +
+ +
+
10:00
+ + +
+ +
+
11:00
+ + +
+ +
+
12:00
+ + +
+ +
+
13:00
+ + +
+ +
+
14:00
+ + +
+ +
+
15:00
+ + +
+ +
+
16:00
+ + +
+ +
+
17:00
+ + +
+ + + + + + + r + + 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" +}