Skip to content

Simple calendar application that allows a user to save events for each hour of the day. This app will run in the browser and feature dynamically updated HTML and CSS powered by jQuery.

License

Notifications You must be signed in to change notification settings

FAC-73/blue-monday-planner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blue-monday-planner

Simple calendar application that allows a user to save events for each hour of the day. This app runs in the browser and features dynamically updated HTML and CSS powered by jQuery.

Jquery and Javascript Workday Planner

Table of Contents

  1. View project
  2. About The Project
  3. Getting Started
  4. Usage
  5. Contributing
  6. License
  7. Contact

About The Project

Jquery and Javascript Workday Planner

Built using Javascript, Jquery, HTML and CSS. This daily planner application provides a list of rows with text inputs. These 9 rows map to each hour of a working day (9am-5pm). A user can add an event to each row using the text input and clicking save. If the input content is changed and focus is moved, the save button will alert the user to click it to save changes to localStorage.

Once saved the events will be saved to the application even after the page is refreshed. The row color will change based on the time of the day. Current hour displays as pink, upcoming hours as green. Hours passed are displayed in gray

Built With

Getting Started

To get a local copy up and running follow these simple steps. You can also download the source files provided. You will need a text editor such as Visual Studio Code, Xcode or similar to edit the source code.

Installation

  1. Clone the repo

    git clone https://github.com/FAC-73/blue-monday-planner.git
  2. Pull the latest

    git pull

Usage

Jquery and Javascript Workday Planner

What's included

  1. HTML, CSS and Javascript (incl. Jquery) files include the source code for running the Day Planner application
  2. This project demonstrates ways in which javavscript and jquery can be used to manipulate the DOM elements, store and pass data to and from variables, and dynamically update HTML and trigger interactions through the use of Jquery eventListeners and the the moment.js API.

Project deliverables

Included functionality

  1. The planner list includes 9 rows, each row representative of an hour of the work day from 9am to 5pm.

Day planner list

  1. Each row is color coded. Pink denotes the current hour of the day, Teal represents hours left/upcoming. Gray represents time elapsed/passed.

Color blocks representing current, upcoming and past time rows

  1. The current date is displayed in the header of the page.

Current date

  1. Onload a pre-defined event is included so that the planner doesn't appear empty.

Pre-defined event

  1. To add an event to an hour clicking or focus on a row and type the name of the event into the input.

Add/update event

  1. Clicking save stores the event to localStorage. If focus is lost from the input prior to clicking save, the save button pulses orange until the user actions the button. The event will not be saved to localStorage if this is not actioned, and changes are lost.

    A prevent default method is used to stop the default behavior of the input to clear the content on submit.

Save changes

  1. If the user leaves the page, refreshes or closes the browser. On subsequent reload the events are stored and shown when the page has loaded.

  1. To delete an event. Remove the text from the input and click save. Again, if focus is lost after removing text the save button will pulse to alert the user to commit the change. Otherwise it will not be saved in localStorage.

HTML, CSS and Javascript & Jquery

  1. Index.html - Contains basic layout structure. Main planner content is contained in a div using the container class from bootstrap to leverage the responsive grid, with the ID 'dayEventContainer'. Here javascript and Jquery dynamically appends the divs for displaying the hour, input for events, and the save button. Most div's leverage Bootstrap CSS classes for responsive purposes. Semantic html is used for elements such as header, text elements.
  • For improved accessibility additional descriptions for icons has been included.
  1. styles.css - Contains layout, styling and media-queries and animations, as well as leveraging bootstrap CSS grid via the CDN.

  2. script.js - Contains variables, variable arrays and objects for declaring current time and hour.

  • Makes use of the moment.js API for pulling time and date information. Date is displayed in the header of the document. Time is stored in an array and has variables set for determining the 9am - 5pm typical work day
  • Functions for creating a row to display the time by hour. As well as add text into the input to create an even and to save it to local storage using JSON stringify method.
  • A for loop for iterating through the hours 9am - 5pm (17:00) for creating the event array.
  • Two eventListeners one onClick event to store the event into localStorage through clicking the save button. The second an onChange event to determine if the input content has been modified and needs to trigger a changeClass method if changes are not saved.
  • A function to change the color of the rows determined on whether the hour is current, upcoming or passed. Using if and else if statements based on the time stored in the variable 'hour
  • If, Else statements for validating whether there are saved events in localStorage on load of the document which are appended into the DOM elements. and to pass this data into an array

Responsive view example - On mobile

Responsive layout

Responsive layout

Pushing to GitHub

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/FeatureName)
  3. Commit your Changes (git commit -m 'Add some FeatureName)
  4. Push to the Branch (git push origin feature/FeatureName)
  5. Open a Pull Request

License

Distributed under the MIT License.

See LICENSE for more information.

Contact

Kay Davis

Project repo link: https://fac-73.github.io/blue-monday-planner
Project website: https://github.com/FAC-73/blue-monday-planner

About

Simple calendar application that allows a user to save events for each hour of the day. This app will run in the browser and feature dynamically updated HTML and CSS powered by jQuery.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published