A simple library application written in HTML, CSS, and Javascript.
This is an application designed to take an input from a user and store that input as a Book object and display it on screen.
Display: A main area where stored books are displayed.
Books are displayed in a grid fashion, with each Book having its own 'card.' Each card has the following information:
- The title of the book
- The author of the book
- The number of pages
- An indication of whether or not the book has been read
- A button to delete the book
An Add Form for adding new books to the array. This is acheived via a modal window and a button on the display to add a new Book. The form has the following:
- An input for the title, author, and number of pages
- A checkbox for whether or not the book has been read
- A button to submit the book
A Book Collection for storing the Books that are added by the user.
- A user clicks on the
addBook
button and fills out the required information. - An event listener attached to the
addBook
button fires thecreateNewBook
function once clicked, which fetches the information from the form elements and stores that information in temporary variables. createNewBook
then calls a Book object constructor, passing in the information that was fetched previously.- A new Book object is created with the information provided
- The newly created Book is then added to the
bookCollection
array createNewBook
then calls theupdateDisplay
function, which reads thebookCollection
array and adds the proper HTML and CSS to a new DOM element.
- A user clicks on the
removeButton
present on every Book DOM item. - An event listener attached to the
removeButton
calls theremoveBook
function, which removes the element from the display removeBook
then callsupdateDisplay
, which updates the DOM with the correct elements.