Closed djunaim closed 5 years ago
As a developer, I want to set a template of how the data will look.
WHEN the function is called, THEN it will loop through the data
create for loop to run through the data
//Print to DOM const printToDom = (divId, textToPrint) => { const selectedDiv = document.getElementById(divId); selectedDiv.innerHTML = textToPrint; }; //Home Page const upcomingTourDates = [ { Date: Location: Time: }, ] //About Page *** Look at comment Below *** //Merch Page const merchandise= [ { Item: Shirt Image URL: website Price: $1.00 }, ] // Music Page const albumList = [ { title: "Wait", year: 2019, url: "https://f4.bcbits.com/img/a0535589715_16.jpg", tracks: ["Beyond the Valley of the Wolves", "Counting Backwards", "Brains", "Thankful", "It's a Phil Ochs Kind of Day", "Half Empty", "If the Black Shirt Fits", "Inconvenient Reminder", "Signing Out", "We Aren't The Champions"] }, ],
const printAlbums = (albumArray) => { //loop through albumArray and print title, year, and image to dom };
const displayTracks = (e) => { //function to reduce image div and add track list console.log('display event', e) };
const hideTracks = (e) => { //function to expand image div and hide track list console.log('hide event', e) };
const expandBtn = document.getElementById(''); const minimizeBtn = document.getElementById('');
expandBtn.addEventListener('click', displayTracks); minimizeBtn.addEventListener('click', hideTracks);
// Init - All Pages
const init = () => { if (document.URL.includes('music')){ printAlbums(albumList); } else if (document.URL.includes('merch')) { // load merch } else if (document.URL.includes('about')) { // band member cards } else { // hide tour dates } };
init();
const upcomingTourDates = [ { Date: Location: Time: }, ]
const merchandise = [ { type: Shirt item: Shirt imageUrl: website price: 10 }, ]
Artist card outline:
Story
As a developer, I want to set a template of how the data will look.
AC
WHEN the function is called, THEN it will loop through the data
Dev Notes
create for loop to run through the data
const printAlbums = (albumArray) => { //loop through albumArray and print title, year, and image to dom };
const displayTracks = (e) => { //function to reduce image div and add track list console.log('display event', e) };
const hideTracks = (e) => { //function to expand image div and hide track list console.log('hide event', e) };
const expandBtn = document.getElementById(''); const minimizeBtn = document.getElementById('');
expandBtn.addEventListener('click', displayTracks); minimizeBtn.addEventListener('click', hideTracks);
const init = () => { if (document.URL.includes('music')){ printAlbums(albumList); } else if (document.URL.includes('merch')) { // load merch
} else if (document.URL.includes('about')) { // band member cards
} else { // hide tour dates
} };
init();