diff --git a/assets/classroom/script.js b/assets/classroom/script.js index 2970124..f09d3ed 100644 --- a/assets/classroom/script.js +++ b/assets/classroom/script.js @@ -260,8 +260,9 @@ function removePlaylistDiv(index) { let items = document.getElementsByClassName('playlistItem') items[index].remove() + playlist[index].remove() - items = document.getElementsByClassName('playlistItem') + // items = document.getElementsByClassName('playlistItem') for (let i = 0; i < items.length; i ++) { items[i].children[0].innerHTML = i + 1 @@ -532,8 +533,15 @@ document.addEventListener('DOMContentLoaded', function() { let codeVerifier2 = localStorage.getItem('code_verifier'); const urlParams = new URLSearchParams(window.location.search); let code = urlParams.get('code'); -// const redirectUri = 'http://127.0.0.1:4100/classroom'; -const redirectUri = 'https://classroomjukebox.com/classroom'; +var redirectUri = ""; +var siteUrl = "{{ site.url }}" +if (siteUrl.includes("localhost")){ + redirectUri = 'http://127.0.0.1:4100/classroom'; +} +else { + redirectUri = 'https://classroomjukebox.com/classroom'; +} + const clientId = 'a76d4532c6e14dd7bd7393e3fccc1185'; let body = new URLSearchParams({ diff --git a/assets/search/search.css b/assets/search/search.css index 7530259..fd90793 100644 --- a/assets/search/search.css +++ b/assets/search/search.css @@ -2,15 +2,22 @@ height: 5em; width: auto; } +@import url("https://fonts.googleapis.com/css?family=Rubik%20Mono%20One:900&display=swap"); body{ background-color: #191414; + background-image: url('../../images/purple-bg.jpeg'); + } table { table-layout: fixed; - width: 100%; + width: 95%; border-collapse: collapse; - border: 3px solid purple; + /*border: 3px solid purple;*/ } +.center { + margin-left: auto; + margin-right: auto; +} thead th:nth-child(1) { width: 20%; } @@ -18,10 +25,10 @@ thead th:nth-child(2) { width: 20%; } thead th:nth-child(3) { - width: 15%; + width: 12.5%; } thead th:nth-child(4) { - width: 25%; + width: 27.5%; } thead th:nth-child(5) { width: 15%; @@ -33,12 +40,13 @@ html { font-family: "helvetica neue", helvetica, arial, sans-serif; } thead th, tfoot th { - font-family: "Rock Salt", cursive; + font-family: 'Rubik Mono One', sans-serif; /* Apply the imported font */ } th { - letter-spacing: 2px; + letter-spacing: 1.5px; text-align: center; max-height: 5%; + font-size: 20px; } td { letter-spacing: 1px; @@ -60,7 +68,7 @@ thead th, tfoot th, tfoot td { rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5) ); - border: 3px solid rgb(101, 178, 216); + border: 2px solid white; } tr { font-weight: bold; @@ -72,7 +80,11 @@ tbody tr:nth-child(even) { background-color: #e597e2; } table { - background-color: #a023d5; + background-color: #924bee; +} +.center { + margin-left: auto; + margin-right: auto; } /* .metadata { height: 0px; @@ -80,6 +92,9 @@ table { /* Code for the Search Input */ .input-group{ + display: flex; + justify-content: space-between; + flex: 2; margin: auto; margin-top: auto; width: 80%; @@ -94,7 +109,7 @@ table { } .button-elements { - + margin-left: 10px; } .button-elements button { @@ -111,4 +126,17 @@ table { } .button-elements button:hover { background-color: #df7bda; -} \ No newline at end of file +} + +.table button{ + margin: auto; + display: block; + background-color: #924bee; + color: #fff; + border: none; + border-radius: 25px; + padding: 10px 20px; + cursor: pointer; + font-size: 18px; + margin-bottom: 20px; +} \ No newline at end of file diff --git a/assets/search/search.js b/assets/search/search.js index 433203d..e41d0b8 100644 --- a/assets/search/search.js +++ b/assets/search/search.js @@ -95,6 +95,9 @@ function fetchData() { const preview = document.createElement("td"); const playSong = document.createElement("td"); + image.style.display = "flex"; + image.style.justifyContent = "center"; + const playButton = document.createElement("button") playButton.innerHTML = "Request Your Song!" playButton.onclick = function() {sendMessage(row.uri.slice(14))} @@ -128,63 +131,10 @@ function fetchData() { .catch(error => { console.error('Error:', error); }); - +} -// fetch(url, headers) -// .then(response => { -// if (response.status !== 200) { -// const errorMsg = 'Database response error: ' + response.status; -// console.log(errorMsg); -// const tr = document.createElement("tr"); -// const td = document.createElement("td"); -// td.innerHTML = errorMsg; -// tr.appendChild(td); -// resultContainer.appendChild(tr); -// return; -// } - -// response.json().then(data => { -// console.log(data); - -// for (const row of data.results) { -// console.log(row); - -// const tr = document.createElement("tr"); - -// const artist = document.createElement("td"); -// const track = document.createElement("td"); -// const image = document.createElement("td"); -// const preview = document.createElement("td"); - -// artist.innerHTML = row.artistName; -// track.innerHTML = row.trackName; -// const img = document.createElement("img"); -// img.src = row.artworkUrl100; -// image.appendChild(img); - -// const audio = document.createElement("audio"); -// audio.controls = true; -// const source = document.createElement("source"); -// source.src = row.previewUrl; -// source.type = "audio/mp4"; -// audio.appendChild(source); -// preview.appendChild(audio); - -// tr.appendChild(artist); -// tr.appendChild(track); -// tr.appendChild(image); -// tr.appendChild(preview); - -// resultContainer.appendChild(tr); -// } -// }) -// }) -// .catch(err => { -// console.error(err); -// const tr = document.createElement("tr"); -// const td = document.createElement("td"); -// td.innerHTML = err; -// tr.appendChild(td); -// resultContainer.appendChild(tr); -// }); -} \ No newline at end of file +document.addEventListener("keydown", function (key) { + if (key.code === "Enter") { + fetchData(); + } +}); diff --git a/assets/sign-in/script.js b/assets/sign-in/script.js index cd41250..b5bc149 100644 --- a/assets/sign-in/script.js +++ b/assets/sign-in/script.js @@ -1,31 +1,30 @@ -function signIn(event) { - event.preventDefault(); +document.getElementById('signInForm').addEventListener('submit', function(event) { + event.preventDefault(); - // Get email and password from the form - const email = document.getElementById('email').value; - const password = document.getElementById('password').value; + var email = document.getElementById('email').value; + var password = document.getElementById('password').value; - // authentication logic (validate email and password) - /* - if (email == (get email data) && password == (get password data)) { - const isAuthenticated = true; - } - else { - const isAuthenticated = false; - } - */ + // Make a POST request to your authentication endpoint + fetch('https://cj-backend.stu.nighthawkcodingsociety.com/human/authenticate', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + email: email, + password: password + }) + }) + .then(response => response.json()) + .then(data => { + // Assuming the response contains a 'token' field + var token = data.token; + // Store the token in localStorage or a cookie for future use + // For simplicity, we're using localStorage here + console.log(token); + localStorage.setItem('token', token); - // For demo purposes, let's assume successful authentication - const isAuthenticated = true; - - if (isAuthenticated) { - // Set a cookie with the user's email - document.cookie = `userEmail=${email}; expires=Sun, 1 Jan 2023 00:00:00 UTC; path=/`; - - // Redirect to the home page - window.location.href = '/'; - } else { - // Display an error message (you can customize this based on your authentication logic) - alert('Authentication failed. Please check your email and password.'); - } -} + alert('Sign in successful!'); + }) + .catch(error => console.error('Error:', error)); +}); \ No newline at end of file diff --git a/search.html b/search.html index a28808c..e80ef73 100644 --- a/search.html +++ b/search.html @@ -8,24 +8,18 @@
-