From 99bbf5adf15084c15aa158c5073fe060f3c1882f Mon Sep 17 00:00:00 2001 From: awex Date: Fri, 4 Jun 2021 06:35:38 -0400 Subject: [PATCH] Some changes - Added embeds to homepage to show off my kewlness - Fixed an issue where my Medal clips would throw a hissy fit about not being in an async function, therefore not loading --- assets/js/medalclips.js | 15 +++++++-------- index.html | 15 ++++++++++----- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/assets/js/medalclips.js b/assets/js/medalclips.js index 45086ff..5213704 100644 --- a/assets/js/medalclips.js +++ b/assets/js/medalclips.js @@ -5,13 +5,12 @@ const medalapi = 'https://developers.medal.tv/v1/latest?userId=215577&limit=1' - async function medalClips() { - window.addEventListener('load', function () { - const { contentObjects } = await fetch(medalapi, { - method: 'GET', - headers: { 'Authorization': 'pub_x9mjeQnqk07tEK1ge7w2xHYxTpTEbKwN', 'Content-Type': 'application/json' } - }).then(response => response.json()) + async function loadClip() { + const { contentObjects } = await fetch(medalapi, { + method: 'GET', + headers: { 'Authorization': 'pub_x9mjeQnqk07tEK1ge7w2xHYxTpTEbKwN', 'Content-Type': 'application/json' } + }).then(response => response.json()) - document.querySelector("#clip").innerHTML = contentObjects[0].embedIframeCode - }) + document.querySelector("#clip").innerHTML = contentObjects[0].embedIframeCode + document.querySelector("#title").innerHTML = "" + contentObjects[0].contentTitle + "" } \ No newline at end of file diff --git a/index.html b/index.html index fa04826..05c4be3 100644 --- a/index.html +++ b/index.html @@ -7,18 +7,19 @@ - + + + - - +

Awexx