songcassette = loadSound('thriller.mp3');
songcd = loadSound('heart.mp3');
songipod = loadSound('umberella.mp3');
songyoutube = loadSound('uptown.mp3');
songspotify = loadSound('lights.mp3');
timeline = loadImage('timeline.png');
cnv = createCanvas(600, 450);
btncassette = new imageButton("cassette.png", 150, 150);
btncassette.position(-20, height / 2 - 15);
btncassette.mousePressed(cassetteBtnPressed);
btncassette.mouseReleased(cassetteBtnReleased);
btncd = new imageButton("cd.png", 100, 100);
btncd.position(130, height / 2 + 15);
btncd.mousePressed(cdBtnPressed);
btncd.mouseReleased(cdBtnReleased);
btnipod = new imageButton("ipod.png", 100, 100);
btnipod.position(250, height / 2 + 20);
btnipod.mousePressed(ipodBtnPressed);
btnipod.mouseReleased(ipodBtnReleased);
btnyoutube = new imageButton("youtube.png", 100, 100);
btnyoutube.position(370, height / 2 );
btnyoutube.mousePressed(youtubeBtnPressed);
btnyoutube.mouseReleased(youtubeBtnReleased);
btnspotify = new imageButton("spotify.png", 90, 90);
btnspotify.position(485, height / 2 + 20);
btnspotify.mousePressed(spotifyBtnPressed);
btnspotify.mouseReleased(spotifyBtnReleased);
headerTxt = "Song Museum";
descriptionTxt = "A nostalgic journey with various listening devices, each playing a song that defined it's era!";
currentlyPlayingTxt = "...";
text(descriptionTxt, 20, 70, width - 50);
image(timeline, 8 , -20);
if (songcassette.isPlaying() == true) {
currentlyPlayingTxt = 'Thriller by Michael Jackson';
else if (songcd.isPlaying() == true) {
currentlyPlayingTxt = 'My Heart will Go On by Celine Dion';
else if (songipod.isPlaying() == true) {
currentlyPlayingTxt = 'Umberella by Rihanna';
else if (songyoutube.isPlaying() == true) {
currentlyPlayingTxt = 'Uptown Funk by Bruno Mars';
else if (songspotify.isPlaying() == true) {
currentlyPlayingTxt = 'Blinding Lights by The Weeknd';
currentlyPlayingTxt = '...';
text(currentlyPlayingTxt, 20, height - 50, width - 50);
function cassetteBtnPressed() {
function cassetteBtnReleased() {
function cdBtnPressed() {
function cdBtnReleased() {
function ipodBtnPressed() {
function ipodBtnReleased() {
function youtubeBtnPressed() {
function youtubeBtnReleased() {
function spotifyBtnPressed() {
function spotifyBtnReleased() {