Updated README.md
This commit is contained in:
1 parent
b8e28ca5ea
commit
21fce3ff1e
3 files changed
+1
-82
No files matched your search
@@ -1,45 +0,0 @@
|
||||
<style>
|
||||
#back {
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
top: 10px;
|
||||
}
|
||||
#div-container {
|
||||
position: absolute;
|
||||
left: 300px;
|
||||
top: 50px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
// Catch url Parameter
|
||||
window.onload = function () {
|
||||
const queryString = window.location.search;
|
||||
if (queryString != null) {
|
||||
const urlParams = new URLSearchParams(queryString);
|
||||
const id = urlParams.get('id');
|
||||
document.getElementById('div-container').innerHTML = "<h2>Uh oh, there was an issue getting the quest id! :(</h2>";
|
||||
<% if(quests.length == 0) { %>
|
||||
document.getElementById('div-container').innerHTML = "<h2>Uh oh, theres no quests :(</h2>";
|
||||
<% } else if(quests.length > 0) { %>
|
||||
<% quests.forEach(function (quest) { %>
|
||||
if('<%= quest._id %>' == id) {
|
||||
document.getElementById('div-container').innerHTML += '<div id="quest">';
|
||||
document.getElementById('quest').innerHTML += '<h1 class="title"><%= quest.title %></h1>';
|
||||
document.getElementById('quest').innerHTML += '<h2 class="title">Campaign: <%= quest.campaign %></h2>'
|
||||
document.getElementById('quest').innerHTML += '<p class="info">XP: <%= quest.xp %></p>';
|
||||
document.getElementById('quest').innerHTML += '<p class="info">Expires: <%= quest.expiry %></p>';
|
||||
document.getElementById('quest').innerHTML += `<h3 class="info">Instructions: <%= quest.instruction %></h3>`;
|
||||
}
|
||||
<% }) %>
|
||||
<% } %>
|
||||
} else {
|
||||
document.getElementById('div-container').innerHTML = "<h2>Uh oh, there was an issue getting the quest id :(</h2>";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<a id='back' href="/dashboard" class="btn btn-secondary">Back to Dashboard</a>
|
||||
|
||||
<!-- Quest container -->
|
||||
<div id='div-container'></div>
|
||||
Reference in new issue
Block a user