Green names are now clickable!

(also tweaked credits)
This commit is contained in:
GDColon 2019-11-05 18:43:04 -05:00
parent 1c6b7d87bc
commit 1acc5d9f5b
6 changed files with 29 additions and 28 deletions

View file

@ -427,6 +427,10 @@ input::-webkit-inner-spin-button {
border-bottom: 2px solid lime border-bottom: 2px solid lime
} }
.unregistered:hover {
color: rgb(0, 230, 0);
}
.popup { .popup {
position: fixed; position: fixed;
display: none; display: none;
@ -638,14 +642,14 @@ input::-webkit-inner-spin-button {
height: 5.5%; height: 5.5%;
} }
.githubChad { .specialThanks {
display: inline-block; display: inline-block;
width: 30%; width: 27%;
height: 20%; height: 21%;
margin: 1% 0%; margin: 2% 0%;
} }
.githubChad h2 { .specialThanks h2 {
margin-bottom: 3%; margin-bottom: 3%;
font-size: 4vh; font-size: 4vh;
} }
@ -768,7 +772,7 @@ input::-webkit-inner-spin-button {
.portalSetting { .portalSetting {
text-align: left; text-align: left;
display: inline-block; display: inline-block;
width: 19%; width: 23%;
} }
.triggerDiv { .triggerDiv {

View file

@ -107,11 +107,13 @@ fetch(target).then(res => res.json()).then(lvl => {
} }
else { else {
if (lvl.accountID == "0" || !lvl.accountID) $('#levelAuthor').addClass("green").removeClass("gdButton") if (lvl.accountID == undefined) $('#levelAuthor').remove()
else if (lvl.authorID) $('#levelAuthor').addClass("green").addClass("unregistered")
$('#levelName').text(lvl.name || ("Nonexistent level " + lvlID)) $('#levelName').text(lvl.name || ("Nonexistent level " + lvlID))
$('#levelAuthor').text("By " + (lvl.author || "-")) $('#levelAuthor').text("By " + (lvl.author || "-"))
$('#levelID').text("ID: " + lvlID) $('#levelID').text("ID: " + lvlID)
if (lvl.accountID && lvl.author != "-") $('#authorLink').attr('href', '../profile/' + lvl.author) if (lvl.accountID && lvl.author != "-") $('#authorLink').attr('href', '../profile/' + lvl.author)
else if (lvl.authorID) $('#authorLink').attr('href', '../search/' + lvl.authorID + "?user")
if (lvl.id) $('#levelLink').attr('href', '../' + lvl.id) if (lvl.id) $('#levelLink').attr('href', '../' + lvl.id)
else $('#levelID').removeClass("gdButton") else $('#levelID').removeClass("gdButton")
$('#levelVersion').text("Version: " + (lvl.version || 0)) $('#levelVersion').text("Version: " + (lvl.version || 0))
@ -153,7 +155,8 @@ fetch(`../api${!history ? window.location.pathname : "/comments/" + lvl.playerID
<div class="commentBG"> <div class="commentBG">
<div class="comment"> <div class="comment">
<img class="inline" src="../icon/${!history ? x.username : lvl.username}?form=${x.form}" height=21% style="margin-right: 0.8%"> <img class="inline" src="../icon/${!history ? x.username : lvl.username}?form=${x.form}" height=21% style="margin-right: 0.8%">
<a ${x.username == "Unknown" || x.accountID == "0" ? "" : "href"}="../profile/${!history ? x.username : lvl.username}"><h2 class="inline ${x.username == "Unknown" || x.accountID == "0" ? "green" : "gdButton"}">${!history ? x.username : lvl.username}</h2></a> <a href=../${x.accountID == "0" ? `search/${x.playerID}?user` : `../profile/${!history ? x.username : lvl.username}`}>
<h2 class="inline gdButton ${x.accountID == "0" ? "green unregistered" : ""}">${!history ? x.username : lvl.username}</h2></a>
${x.modColor || lvl.moderator == "2" ? `<img class="inline" src="../assets/mod-elder.png" height=18% style="margin-left: 0.6%;">` : ""} ${x.modColor || lvl.moderator == "2" ? `<img class="inline" src="../assets/mod-elder.png" height=18% style="margin-left: 0.6%;">` : ""}
<p class="commentPercent inline">${x.percent ? x.percent + "%" : ""}</p> <p class="commentPercent inline">${x.percent ? x.percent + "%" : ""}</p>
@ -176,7 +179,8 @@ fetch(`../api${!history ? window.location.pathname : "/comments/" + lvl.playerID
<div class="commentBG compactBG"> <div class="commentBG compactBG">
<div class="comment compact"> <div class="comment compact">
<img class="inline" src="../icon/${!history ? x.username : lvl.username}?form=${x.form}" height=21% style="margin-right: 0.8%"> <img class="inline" src="../icon/${!history ? x.username : lvl.username}?form=${x.form}" height=21% style="margin-right: 0.8%">
<a ${x.username == "Unknown" || x.accountID == "0" ? "" : "href"}="../profile/${!history ? x.username : lvl.username}"><h2 class="inline ${x.username == "Unknown" || x.accountID == "0" ? "green" : "gdButton"}">${!history ? x.username : lvl.username}</h2></a> <a href=../${x.accountID == "0" ? `search/${x.playerID}?user` : `../profile/${!history ? x.username : lvl.username}`}>
<h2 class="inline gdButton ${x.accountID == "0" ? "green unregistered" : ""}">${!history ? x.username : lvl.username}</h2></a>
${x.modColor || lvl.moderator == "2" ? `<img class="inline" src="../assets/mod-elder.png" height=18% style="margin-left: 0.6%;">` : ""} ${x.modColor || lvl.moderator == "2" ? `<img class="inline" src="../assets/mod-elder.png" height=18% style="margin-left: 0.6%;">` : ""}
<p class="commentPercent inline">${x.percent ? x.percent + "%" : ""}</p> <p class="commentPercent inline">${x.percent ? x.percent + "%" : ""}</p>

View file

@ -100,15 +100,14 @@ fetch(`./api/credits`).then(res => res.json()).then(res => {
}) })
$('#credits').append(`<div id="credits${res.credits.length + 1}" class="subCredits" style="display: none;"> $('#credits').append(`<div id="credits${res.credits.length + 1}" class="subCredits" style="display: none;">
<div id="githubbers" class="brownBox center supercenter" style="width: 80vh; height: 43%; padding-top: 1.5%; padding-bottom: 3.5%;"> <div id="specialthanks" class="brownBox center supercenter" style="width: 80vh; height: 43%; padding-top: 1.5%; padding-bottom: 3.5%;">
<h1>GitHub Contributors</h1><br> <h1>Special Thanks!</h1><br>
</div> </div>
<div class="supercenter" style="top: 71.5%"><h2 class="smaller gdButton"><a href="https://github.com/GDColon/GDBrowser">View on GitHub!</a></h2></div>
<img class="gdButton" src="../assets/arrow-left.png" width="60vh" style="position: absolute; top: 45%; right: 75%" onclick="page -= 1; loadCredits()"> <img class="gdButton" src="../assets/arrow-left.png" width="60vh" style="position: absolute; top: 45%; right: 75%" onclick="page -= 1; loadCredits()">
</div>`) </div>`)
res.contributors.forEach((x, y) => { res.specialThanks.forEach((x, y) => {
$('#githubbers').append(`<div class="githubChad"> $('#specialthanks').append(`<div class="specialThanks">
<h2 class="gdButton smaller"><a href="./profile/${x[1]}">${x[0]}</h2></a> <h2 class="gdButton smaller"><a href="./profile/${x[1]}">${x[0]}</h2></a>
<img src="./icon/${x[1]}" height=85%><br> <img src="./icon/${x[1]}" height=85%><br>
</div>`) </div>`)

View file

@ -187,8 +187,8 @@ if ([[COINS]] > 1) $("#coins").append(`<img class="squeeze" src="../assets/${coi
if ([[COINS]] > 2) $("#coins").append(`<img class="squeeze" src="../assets/${coinColor}.png" height="5%">`) if ([[COINS]] > 2) $("#coins").append(`<img class="squeeze" src="../assets/${coinColor}.png" height="5%">`)
if ("[[ACCOUNTID]]" == "0") { if ("[[ACCOUNTID]]" == "0") {
$("#authorName").addClass("green").removeClass('gdButton') $("#authorName").addClass("green").addClass("unregistered")
$("#authorLink").removeAttr('href') $("#authorLink").attr('href', '/search/[[AUTHORID]]?user')
} }
if (window.location.pathname == "/weekly") $('body').addClass('darkBG') if (window.location.pathname == "/weekly") $('body').addClass('darkBG')

View file

@ -130,14 +130,14 @@ function Append() {
res.forEach((x, y) => { res.forEach((x, y) => {
let hasAuthor = (x.accountID != "0") let hasAuthor = (x.accountID != "0")
if (y == 0 && (type == 5 || typeof userMode == 'string')) { if (y == 0 && (type == 5 || typeof userMode == 'string')) {
$('#header').text(x.author + (x.author.toLowerCase().endsWith('s') ? "'" : "'s") + " levels") $('#header').text(((x.author == "-" ? "Someone" : x.author)) + (x.author.toLowerCase().endsWith('s') ? "'" : "'s") + " levels")
document.title = $('#header').text() document.title = $('#header').text()
accID = x.authorID accID = x.authorID
} }
$('#searchBox').append(`<div class="searchresult"> $('#searchBox').append(`<div class="searchresult">
<h1 class="lessspaced">${x.name}</h1> <h1 class="lessspaced">${x.name}</h1>
<h2 class="lessSpaced smaller inline ${hasAuthor ? "gdButton" : "green"}">${hasAuthor ? `<a href="../profile/${x.author}">By ${x.author}</a>` : `By ${x.author}`}</h2><h2 class="inline" style="margin-left: 1.5%; transform:translateY(30%)"> ${x.copiedID == '0' ? "" : '<img class="valign sideSpace" src="../assets/copied.png" height="12%">'}${x.large ? '<img class="valign sideSpaceD" src="../assets/large.png" height="12%">' : ''}</h2> <h2 class="lessSpaced smaller inline gdButton ${hasAuthor ? "" : "green unregistered"}">${hasAuthor ? `<a href="../profile/${x.author}">By ${x.author}</a>` : `<a href="../search/${x.authorID}?user">By ${x.author}</a>`}</h2><h2 class="inline" style="margin-left: 1.5%; transform:translateY(30%)"> ${x.copiedID == '0' ? "" : '<img class="valign sideSpace" src="../assets/copied.png" height="12%">'}${x.large ? '<img class="valign sideSpaceD" src="../assets/large.png" height="12%">' : ''}</h2>
<h3 class="lessSpaced ${x.customSong == 0 ? "blue" : "whatIfItWasPurple"}" style="overflow: hidden;">${x.songName}</h3> <h3 class="lessSpaced ${x.customSong == 0 ? "blue" : "whatIfItWasPurple"}" style="overflow: hidden;">${x.songName}</h3>
<h3 class="lessSpaced"> <h3 class="lessSpaced">
<img class="valign" src="../assets/time.png" height="14%"> ${x.length} <img class="valign" src="../assets/time.png" height="14%"> ${x.length}

View file

@ -25,14 +25,6 @@
"github": ["https://github.com/Altenhh", "github"] "github": ["https://github.com/Altenhh", "github"]
}, },
{
"header": "Level Analyzing Help",
"name": "AlFas",
"youtube": ["https://youtube.com/user/Alex100077", "youtube"],
"twitter": ["https://twitter.com/AlFas6237", "twitter"],
"github": ["https://github.com/AlFasGD", "github"]
},
{ {
"header": "Accurate Leaderboard", "header": "Accurate Leaderboard",
"name": "SMJSGaming", "name": "SMJSGaming",
@ -75,7 +67,9 @@
} }
], ],
"contributors": [ "specialThanks": [
["Qufyy", "qufy"] ["Qufyy", "qufy"],
["AlFas", "AlFas"],
["ViPriN", "ViPriN"]
] ]
} }