displays the user's top songs via spotify api, authentication via oauth 2.

This commit is contained in:
Joshua Ashton
2025-02-01 21:53:45 -07:00
parent 331bfa0a01
commit eab066346e
9 changed files with 191 additions and 45 deletions
+21 -6
View File
@@ -1,10 +1,25 @@
async function modeSwitch() {
async function modeSwitch(mode) {
const content = document.getElementById("content");
var response = await fetch('explore.php');
console.log(mode);
if (mode == 'explore') {
var response = await fetch('explore.php');
if (response.status === 200) {
let data = async () => { return await response.text() };
let text = await data();
content.innerHTML = text;
if (response.status === 200) {
let data = async () => { return await response.text() };
let text = await data();
content.innerHTML = text;
}
switcher.setAttribute("onclick", "modeSwitch('core')")
switcher.innerText = 'Core';
} else {
var response = await fetch('core.php');
if (response.status === 200) {
let data = async () => { return await response.text() };
let text = await data();
content.innerHTML = text;
}
switcher.setAttribute("onclick", "modeSwitch('explore')")
switcher.innerText = 'Explore';
}
}