Merged with master

This commit is contained in:
101arrowz 2019-10-23 16:39:43 -07:00
commit bad2388723
14 changed files with 99 additions and 34 deletions

1
.gitignore vendored
View file

@ -1,7 +1,6 @@
# Ew # Ew
extra extra
package-lock.json package-lock.json
icons/cache
misc/secretStuff.json misc/secretStuff.json
# Logs # Logs

BIN
assets/compact-off.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
assets/compact-on.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View file

@ -529,6 +529,10 @@ input::-webkit-inner-spin-button {
border-bottom: 0.18vh rgba(0, 0, 0, 0.4) solid; border-bottom: 0.18vh rgba(0, 0, 0, 0.4) solid;
} }
.compactBG {
height: 14vh;
}
.commentBG:nth-child(odd) { .commentBG:nth-child(odd) {
background-color: rgb(185, 108, 57); background-color: rgb(185, 108, 57);
} }
@ -537,7 +541,7 @@ input::-webkit-inner-spin-button {
margin: 1.5vh auto 0 auto; margin: 1.5vh auto 0 auto;
width: 96%; width: 96%;
height: 18.5vh; height: 18.5vh;
background-color: #934E27; background-color: rgba(147, 79, 39, 0.8);
border-radius: 1.5vh; border-radius: 1.5vh;
text-align: left; text-align: left;
padding-top: 1.5vh; padding-top: 1.5vh;
@ -546,6 +550,13 @@ input::-webkit-inner-spin-button {
user-select: none; user-select: none;
} }
.compact {
background-color: transparent;
padding-left: 0vh;
margin-top: 0.5vh;
transform: scale(0.8) translate(-13%, -12.5%)
}
.comment h2, .smallGold { .comment h2, .smallGold {
width: fit-content; width: fit-content;
vertical-align: top; vertical-align: top;
@ -574,6 +585,10 @@ input::-webkit-inner-spin-button {
color: rgba(0, 0, 0, 0.5) color: rgba(0, 0, 0, 0.5)
} }
.compactDate {
transform: translate(-3vh, -11.5vh);
}
.commentPercent { .commentPercent {
vertical-align: top; vertical-align: top;
margin: 0 0 0 1vh; margin: 0 0 0 1vh;
@ -816,16 +831,16 @@ input::-webkit-inner-spin-button {
} }
} }
@keyframes bounceButton { @keyframes bounceButton {
0% { 0% {
transform: scale(1); transform: scale(1);
} }
50% { 50% {
transform: scale(1.2); transform: scale(1.2);
} }
75% { 75% {
transform: scale(1.15); transform: scale(1.15);
} }
100% { 100% {
transform: scale(1.2); transform: scale(1.2);
} }
} }

View file

@ -5,7 +5,7 @@
<meta id="meta-title" property="og:title" content="Level Analysis"> <meta id="meta-title" property="og:title" content="Level Analysis">
<meta id="meta-desc" property="og:description" content="Analyze a Geometry Dash level and view it's objects, portals, color channels, code, and more!"> <meta id="meta-desc" property="og:description" content="Analyze a Geometry Dash level and view it's objects, portals, color channels, code, and more!">
<meta id="meta-image" name="og:image" itemprop="image" content="https://gdbrowser.com/assets/cp.png"> <meta id="meta-image" name="og:image" itemprop="image" content="https://gdbrowser.com/assets/cp.png">
<link href="../css/level.css" type="text/css" rel="stylesheet"> <link href="../css/browser.css" type="text/css" rel="stylesheet">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script>
<link rel="icon" href="../assets/cp.png"> <link rel="icon" href="../assets/cp.png">
</head> </head>

View file

@ -1,7 +1,7 @@
<head> <head>
<title>Comments</title> <title>Comments</title>
<meta charset="utf-8"> <meta charset="utf-8">
<link href="../css/level.css" type="text/css" rel="stylesheet"> <link href="../css/browser.css" type="text/css" rel="stylesheet">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script>
<link rel="icon" href="../assets/like.png"> <link rel="icon" href="../assets/like.png">
<meta id="meta-title" property="og:title" content="Level Comments"> <meta id="meta-title" property="og:title" content="Level Comments">
@ -29,14 +29,18 @@
<img class="gdButton" id="refresh" src="../assets/refresh.png" height="90%"> <img class="gdButton" id="refresh" src="../assets/refresh.png" height="90%">
</div> </div>
<div class="supercenter" style="left: 3%; top: 20%; height: 10%"> <div class="supercenter" style="left: 3%; top: 15%; height: 10%">
<img class="gdButton" id="topSort" src="../assets/sort-likes.png" height="90%"> <img class="gdButton" id="topSort" src="../assets/sort-likes.png" height="90%">
</div> </div>
<div class="supercenter" style="left: 3%; top: 30.5%; height: 10%"> <div class="supercenter" style="left: 3%; top: 25.5%; height: 10%">
<img class="gdButton" id="timeSort" src="../assets/sort-time-on.png" height="90%"> <img class="gdButton" id="timeSort" src="../assets/sort-time-on.png" height="90%">
</div> </div>
<div class="supercenter" style="left: 3%; top: 36%; height: 10%">
<img class="gdButton" id="compactMode" src="../assets/compact-off.png" height="90%">
</div>
<div class="supercenter" id="pageDown" style="left: 3%; top: 50%; height: 10%; display: none;"> <div class="supercenter" id="pageDown" style="left: 3%; top: 50%; height: 10%; display: none;">
<img class="gdButton" src="../assets/arrow-left.png" height="95%"> <img class="gdButton" src="../assets/arrow-left.png" height="95%">
</div> </div>
@ -71,6 +75,8 @@
let lvlID = window.location.pathname.split('/')[2] let lvlID = window.location.pathname.split('/')[2]
let history = false; let history = false;
let compact = false;
let target = `../api/level/${lvlID}` let target = `../api/level/${lvlID}`
if (lvlID > 99999999 || lvlID < -99999999) window.location.href = window.location.href.replace("comments", "search") if (lvlID > 99999999 || lvlID < -99999999) window.location.href = window.location.href.replace("comments", "search")
@ -103,17 +109,19 @@ fetch(target).then(res => res.json()).then(lvl => {
} }
} }
function appendComments() { function appendComments(dontClear, bump) {
let p = compact ? ((page + 1) * 2) - 2 + (bump||0) : page
if (loadingComments) return; if (loadingComments) return;
else loadingComments = true; else loadingComments = true;
$('#commentBox').html(`<div class="supercenter" id="loading" style="height: 12%;"><img class="spin noSelect" src="../assets/loading.png" height="105%"></div>`) if (!dontClear) $('#commentBox').html(`<div class="supercenter" id="loading" style="height: 12%;"><img class="spin noSelect" src="../assets/loading.png" height="105%"></div>`)
if (page == 0) $('#pageDown').hide() if (page == 0) $('#pageDown').hide()
else $('#pageDown').show() else $('#pageDown').show()
fetch(`../api${!history ? window.location.pathname : "/comments/" + lvl.playerID}?page=${page}${history ? "&type=commentHistory" : ""}${mode == "top" ? "&top" : ""}`).then(res => res.json()).then(res => { fetch(`../api${!history ? window.location.pathname : "/comments/" + lvl.playerID}?page=${p}${history ? "&type=commentHistory" : ""}${mode == "top" ? "&top" : ""}`).then(res => res.json()).then(res => {
if (res.length < 9 || (history && lvl.commentHistory == "off")) $('#pageUp').hide() if (res.length < 9 || (history && lvl.commentHistory == "off")) $('#pageUp').hide()
else $('#pageUp').show() else $('#pageUp').show()
@ -123,6 +131,10 @@ fetch(`../api${!history ? window.location.pathname : "/comments/" + lvl.playerID
} }
res.forEach(x => { res.forEach(x => {
if (!compact) {
////// NORMAL MODE //////
$('#commentBox').append(` $('#commentBox').append(`
<div class="commentBG"> <div class="commentBG">
<div class="comment"> <div class="comment">
@ -141,7 +153,31 @@ fetch(`../api${!history ? window.location.pathname : "/comments/" + lvl.playerID
<img id="likeImg" class="inline" ${x.likes < 0 ? "style='transform: translateY(25%)'" : ""} src="../assets/${x.likes < 0 ? "dis" : ""}like.png" height=20% style="margin-right: 0.4%"> <img id="likeImg" class="inline" ${x.likes < 0 ? "style='transform: translateY(25%)'" : ""} src="../assets/${x.likes < 0 ? "dis" : ""}like.png" height=20% style="margin-right: 0.4%">
<h3 class="inline">${x.likes}</h3> <h3 class="inline">${x.likes}</h3>
</div> </div>
</div>`) </div>`) }
else {
////// COMPACT MODE //////
$('#commentBox').append(`
<div class="commentBG compactBG">
<div class="comment compact">
<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>
${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>
<div class="commentAlign">
<p class="commentText" style="color: ${!history && x.playerID == lvl.authorID ? "rgb(255, 255, 75)" : x.playerID == "16" ? "rgb(50, 255, 255)" : x.modColor || lvl.moderator == "2" ? `rgb(75, 255, 75)` : "white"}">${x.content}</p>
</div>
</div>
<p class="commentDate compactDate">${x.date}</p>
<div class="commentLikes">
${history ? `<h3 style="margin-right: 0.5vh; pointer-events: all;" class="gold inline"><a href="../${x.levelID}">(${x.levelID})</a></h3>` : ""}
<img id="likeImg" class="inline" ${x.likes < 0 ? "style='transform: translateY(15%)'" : ""} src="../assets/${x.likes < 0 ? "dis" : ""}like.png" height=27% style="margin-right: 0.4%">
<h3 class="inline">${x.likes}</h3>
</div>
</div>`) }
}) })
$('.commentText').each(function() { $('.commentText').each(function() {
@ -149,10 +185,18 @@ fetch(`../api${!history ? window.location.pathname : "/comments/" + lvl.playerID
let overflow = ($(this).text().length - 100) * 0.01 let overflow = ($(this).text().length - 100) * 0.01
$(this).css('font-size', (3.5 - (overflow)) + 'vh') $(this).css('font-size', (3.5 - (overflow)) + 'vh')
} }
});
$('#loading').hide() });
})
loadingComments = false; if (compact && p % 2 == 0) {
return appendComments(true, 1)
}
$('#loading').hide()
})
return loadingComments = false;
} }
let mode = "time" let mode = "time"
@ -181,6 +225,13 @@ $('#timeSort').click(function() {
appendComments() appendComments()
}) })
$('#compactMode').click(function() {
compact = !compact
page = 0;
$('#compactMode').attr('src', `../assets/compact-${compact ? "on" : "off"}.png`)
appendComments()
})
$('#refresh').click(function() { $('#refresh').click(function() {
page = 0; page = 0;
appendComments() appendComments()

View file

@ -1,7 +1,7 @@
<head> <head>
<title>Level Search</title> <title>Level Search</title>
<meta charset="utf-8"> <meta charset="utf-8">
<link href="../css/level.css" type="text/css" rel="stylesheet"> <link href="../css/browser.css" type="text/css" rel="stylesheet">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script>
<link rel="icon" href="../assets/coin.png"> <link rel="icon" href="../assets/coin.png">
<meta id="meta-title" property="og:title" content="Level Search"> <meta id="meta-title" property="og:title" content="Level Search">

View file

@ -1,7 +1,7 @@
<head> <head>
<title>Gauntlets</title> <title>Gauntlets</title>
<meta charset="utf-8"> <meta charset="utf-8">
<link href="../css/level.css" type="text/css" rel="stylesheet"> <link href="../css/browser.css" type="text/css" rel="stylesheet">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script>
<link rel="icon" href="../assets/gauntlet.png"> <link rel="icon" href="../assets/gauntlet.png">
<meta id="meta-title" property="og:title" content="Gauntlets"> <meta id="meta-title" property="og:title" content="Gauntlets">

View file

@ -1,7 +1,7 @@
<head> <head>
<title>Geometry Dash Browser!</title> <title>Geometry Dash Browser!</title>
<meta charset="utf-8"> <meta charset="utf-8">
<link href="../css/level.css" type="text/css" rel="stylesheet"> <link href="../css/browser.css" type="text/css" rel="stylesheet">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script>
<link rel="icon" href="../assets/coin.png"> <link rel="icon" href="../assets/coin.png">
<meta id="meta-title" property="og:title" content="Geometry Dash Browser!"> <meta id="meta-title" property="og:title" content="Geometry Dash Browser!">

View file

@ -1,7 +1,7 @@
<head> <head>
<title>Leaderboard</title> <title>Leaderboard</title>
<meta charset="utf-8"> <meta charset="utf-8">
<link href="../css/level.css" type="text/css" rel="stylesheet"> <link href="../css/browser.css" type="text/css" rel="stylesheet">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script>
<link rel="icon" href="../assets/trophy.png"> <link rel="icon" href="../assets/trophy.png">
<meta id="meta-title" property="og:title" content="Leaderboards"> <meta id="meta-title" property="og:title" content="Leaderboards">

View file

@ -1,7 +1,7 @@
<head> <head>
<title>[[NAME]] ([[ID]])</title> <title>[[NAME]] ([[ID]])</title>
<meta charset="utf-8"> <meta charset="utf-8">
<link href="../css/level.css" type="text/css" rel="stylesheet"> <link href="../css/browser.css" type="text/css" rel="stylesheet">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script>
<link rel="icon" href="../difficulty/[[DIFFICULTYFACE]].png"> <link rel="icon" href="../difficulty/[[DIFFICULTYFACE]].png">
<meta id="meta-title" property="og:title" content="[[NAME]] by [[AUTHOR]]"> <meta id="meta-title" property="og:title" content="[[NAME]] by [[AUTHOR]]">

View file

@ -1,7 +1,7 @@
<head> <head>
<title>Map Packs</title> <title>Map Packs</title>
<meta charset="utf-8"> <meta charset="utf-8">
<link href="../css/level.css" type="text/css" rel="stylesheet"> <link href="../css/browser.css" type="text/css" rel="stylesheet">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script>
<link rel="icon" href="../assets/folder.png"> <link rel="icon" href="../assets/folder.png">
<meta id="meta-title" property="og:title" content="Map Packs"> <meta id="meta-title" property="og:title" content="Map Packs">

View file

@ -1,7 +1,7 @@
<head> <head>
<title>[[USERNAME]]'s Profile</title> <title>[[USERNAME]]'s Profile</title>
<meta charset="utf-8"> <meta charset="utf-8">
<link href="../css/level.css" type="text/css" rel="stylesheet"> <link href="../css/browser.css" type="text/css" rel="stylesheet">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script>
<link rel="icon" href="../icon/[[USERNAME]]"> <link rel="icon" href="../icon/[[USERNAME]]">
<meta id="meta-title" property="og:title" content="[[USERNAME]]'s profile"> <meta id="meta-title" property="og:title" content="[[USERNAME]]'s profile">

View file

@ -1,7 +1,7 @@
<head> <head>
<title>Level Search</title> <title>Level Search</title>
<meta charset="utf-8"> <meta charset="utf-8">
<link href="../css/level.css" type="text/css" rel="stylesheet"> <link href="../css/browser.css" type="text/css" rel="stylesheet">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-135255146-3"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-135255146-3');</script>
<link rel="icon" href="../assets/coin.png"> <link rel="icon" href="../assets/coin.png">
<meta id="meta-title" property="og:title" content="Level Search"> <meta id="meta-title" property="og:title" content="Level Search">