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
This commit is contained in:
awex
2021-06-04 06:35:38 -04:00
parent e79f7e4435
commit 99bbf5adf1
2 changed files with 17 additions and 13 deletions
+7 -8
View File
@@ -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 = "<i>" + contentObjects[0].contentTitle + "</i>"
}
+10 -5
View File
@@ -7,18 +7,19 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
<script src="https://cdn.jsdelivr.net/gh/awexxx/awexxx.github.io/assets/js/medalclips.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/gh/awexxx/awexxx.github.io/assets/js/medalclips.js"></script> -->
<script src="http://lab.lepture.com/github-cards/widget.js"></script>
<script src="assets/js/medalclips.js"></script>
<link rel="stylesheet" href="assets/css/style.css">
<link rel="shortcut icon" type="image/png" href="assets/img/logo.png"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<meta content="awex" property="og:title">
<meta content="Name's awex / Alex. I'm the main web developer for the PlagueCraft Network, as well as one of the owners." property="og:description">
<meta content="https://awexxx.xyz/" property="og:url">
<meta content="assets/img/logo.png" property="og:image">
<meta content="#9c2d1c" data-react-helmet="true" name="theme-color">
</head>
<body onload="medalClips()">
<body onload="loadClip()">
<h3 style="padding-top:20px;">Awexx</h3>
<br>
<ul id="navbar">
@@ -52,14 +53,18 @@
<hr>
<h2>Check out my <a href="https://github.com/awexxx" target="_blank">GitHub</a> page!</h2>
<a href="https://github.com/awexxx/awexxx.github.io"><img src="https://gh-card.dev/repos/awexxx/awexxx.github.io.svg"></a>
<h2 id="twitter">Follow me on <span style="color:blue;"><a href="https://twitter.com/_awexx" target="_blank">Twitter!</a></span></h2>
<div style="text-align:center;">
<blockquote class="twitter-tweet tw-align-center"><p lang="nl" dir="ltr">cheesborbger</p>&mdash; Alex // awexx (@_awexx) <a href="https://twitter.com/_awexx/status/1400755782409412608?ref_src=twsrc%5Etfw">June 4, 2021</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
<h2 id="medal">Follow me on <span style="color:orange;"><a href="https://medal.tv/itsawexx" target="_blank">Medal!</a></span></h2>
<div id="clip"></div>
<i>My latest Medal clip ^</i><br /><br />
<span id="title"></span><br /><br />
</section>