CollectionJS is a JavaScript project that dynamically generates a collection of song cards on a webpage.
- Technology Stack
- Code Overview
- Live Site
This project uses the following technologies:
- HTML
- SASS
- JavaScript
The script.js file contains the main logic of the application. It listens for the DOMContentLoaded event and then executes the following steps:
- Defines an array of song objects, each with properties for the related button text, title, author, genre, and image URLs.
- Gets a reference to the bookInfoContainer element from the DOM.
- Creates a h1 element, sets its text content to "SONGS COLLECTION COVERS", and appends it to the bookInfoContainer.
- Creates a div element with the classes main-card and main to hold all song cards.
- Loops through the array of songs and for each song:
- Creates a div element with the classes book-card and main to hold the individual song card.
- Creates an img element for the song image and a button element for the related button.
- Creates p elements for the genre, title, and author.
- Creates an img element for the icon.
- Appends all these elements to the song card div.
- Appends the song card div to the main div.
- Appends the main div to the bookInfoContainer.
You can view the live site at https://okly2023.github.io/Collection_project/