let pauseButton, stopButton;
let song1Button, song2Button, song3Button;
let swashFont, serifFont;
song1 = loadSound("PAWSA & Adventures of Stevie V - Dirty Cash (Money Talks).mp3");
song2 = loadSound("PICK UP THE PHONE (Extended).mp3");
song3 = loadSound("PAWSA - TOO COOL TO BE CARELESS.mp3");
swashFont = loadFont("JunigardenSwash_PERSONAL_USE_ONLY.otf");
serifFont = loadFont("JunigardenSerif_PERSONAL_USE_ONLY.otf");
playIcon = loadImage("music.icon.png");
cdImage = loadImage("cd.png");
let playImgButton = createImg("music.icon.png", "Play");
playImgButton.position(50, 300);
playImgButton.mousePressed(playSong);
playImgButton.style('width', '50px');
playImgButton.style('cursor', 'pointer');
pauseButton = createButton('Pause');
pauseButton.position(150, 300);
styleButton(pauseButton);
pauseButton.mousePressed(pauseSong);
stopButton = createButton('Stop');
stopButton.position(250, 300);
stopButton.mousePressed(stopSong);
song1Button = createButton('Song 1: Dirty Cash');
song1Button.position(50, 350);
styleButton(song1Button);
song1Button.mousePressed(() => switchSong(song1));
song2Button = createButton('Song 2: Pick Up the Phone');
song2Button.position(200, 350);
styleButton(song2Button);
song2Button.mousePressed(() => switchSong(song2));
song3Button = createButton('Song 3: Too Cool');
song3Button.position(400, 350);
styleButton(song3Button);
song3Button.mousePressed(() => switchSong(song3));
volumeSlider = createSlider(0, 1, 0.5, 0.01);
volumeSlider.position(350, 300);
translate(width / 2, height / 2);
rotate(radians(cdAngle));
image(cdImage, 0, 0, 200, 200);
text("Music Player", width / 2, height / 2 - 130);
if (!currentSong.isPlaying()) {
if (currentSong.isPlaying()) {
function switchSong(song) {
if (currentSong.isPlaying()) {
function styleButton(button) {
button.style('background-color', '#4CAF50');
button.style('color', 'white');
button.style('border', 'none');
button.style('padding', '10px');
button.style('font-size', '14px');
button.style('font-family', 'JunigardenSerif_PERSONAL_USE_ONLY.otf');
button.style('cursor', 'pointer');