Skip to content

Commit

Permalink
audio functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
tposejank committed Jun 14, 2024
1 parent fdfb7bd commit 79ebba8
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 11 deletions.
46 changes: 35 additions & 11 deletions festival/js/featured.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,42 @@ function getFeaturedJamTracks() {

//console.log(jamTrack)

const jamTrackElement = document.createElement('jam-track');

const jamShit = document.createElement('a');

jamShit.classList.add("jam-track-item-card", "fortnite-button-border");
jamShit.href = 'view/?' + id;

jamTrackElement.append(jamShit)

// Add image element
const image = document.createElement("img");
image.src = album;
image.alt = songName;
jamShit.appendChild(image);

// Add description container
const description = document.createElement("div");
description.classList.add("jam-track-description");

// Add song name heading
const songNameHeading = document.createElement("h2");
songNameHeading.classList.add("header-text-bold");
songNameHeading.textContent = songName;
description.appendChild(songNameHeading);

// Add artist heading
const artistHeading = document.createElement("h3");
artistHeading.classList.add("header-text-bold");
artistHeading.textContent = artist; // Assuming you have the artist variable defined
description.appendChild(artistHeading);

// Add description container to link
jamShit.appendChild(description);

if (listFeatured.includes(id)) {
document.getElementById('featured-entries').innerHTML += `
<jam-track>
<a class="jam-track-item-card fortnite-button-border" href="view/?${id}">
<img src="${album}" alt="Give Me Everything">
<div class="jam-track-description">
<h2 class="header-text-bold">${songName}</h2>
<h3 class="header-text-bold">${artist}</h3>
</div>
</a>
</jam-track>`
document.getElementById('featured-entries').append(jamTrackElement)
}

document.getElementById('all-entries').innerHTML += `
Expand Down
7 changes: 7 additions & 0 deletions festival/view/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@

<hr>

<div class="flex">
<audio id="preview-audio" controls></audio>
<audio id="full-audio" controls></audio>
</div>

<hr>

<h1 class="header-text-bold">Leaderboards</h1>

<div class="instrument-buttons" id="instrument-buttons">
Expand Down
3 changes: 3 additions & 0 deletions festival/view/js/song.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ function loadViewer() {
//console.log(firstKey);
let _placeholder_songID = firstKey

document.getElementById('preview-audio').src = 'https://raw.githubusercontent.com/FNLookup/festival/main/music/' + _placeholder_songID + '_preview.ogg'
document.getElementById('full-audio').src = 'https://raw.githubusercontent.com/FNLookup/festival/main/music/' + _placeholder_songID + '.ogg'

// check params

fetch(_jam_tracks_URL).then(r=>r.json()).then(r=> {
Expand Down

0 comments on commit 79ebba8

Please sign in to comment.