2019-10-15 23:42:47 -03:00
< head >
< title > [[NAME]] ([[ID]])< / title >
< meta charset = "utf-8" >
2021-01-19 02:56:21 -03:00
< link href = "../assets/css/browser.css?" type = "text/css" rel = "stylesheet" >
2019-10-15 23:42:47 -03:00
< 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 >
2021-01-04 12:21:58 -03:00
< link rel = "icon" href = "../assets/difficulties/[[DIFFICULTYFACE]].png" >
2019-10-15 23:42:47 -03:00
< meta id = "meta-title" property = "og:title" content = "[[NAME]] by [[AUTHOR]]" >
< meta id = "meta-desc" property = "og:description" content = "ID: [[ID]] | Stars: [[STARS]] | Difficulty: [[DIFFICULTY]] | Downloads: [[DOWNLOADS]] | Likes: [[LIKES]] | Length: [[LENGTH]] | Song: [[SONGNAME]] ([[SONGID]])" >
2021-01-04 12:21:58 -03:00
< meta id = "meta-image" name = "og:image" itemprop = "image" content = "https://gdbrowser.com/assets/difficulties/[[DIFFICULTYFACE]].png" >
2019-10-15 23:42:47 -03:00
< / head >
2019-10-22 20:54:19 -03:00
< body class = "levelBG" onbeforeunload = "saveUrl()" >
2019-10-15 23:42:47 -03:00
< div id = "everything" >
< div class = "popup" id = "infoDiv" >
2019-10-21 12:40:56 -03:00
< div class = "fancybox bounce center supercenter" >
2019-10-15 23:42:47 -03:00
< h2 class = "smaller center" style = "font-size: 5.5vh" > Level Info< / h2 >
< p class = "bigger center" id = "levelInfo" style = "line-height: 5vh; margin-top: 1.5vh;" >
2020-11-02 01:11:37 -03:00
< span class = "pre" style = "color:lime" > [[NAME]]< / span > < br >
2020-11-16 13:38:03 -03:00
ID: < span style = "color:yellow" > [[ID]]< / span > [[ORIGINALINFO]][[LOWDETAIL]][[PASS]][[UPLOAD]][[UPDATE]][[TIME1]][[TIME2]][[EXTRA]]
2019-10-21 12:20:25 -03:00
< br > Version: < span style = "color:yellow" > [[VERSION]]< / span >
2020-02-20 22:09:40 -03:00
< br > GD Version: < span style = "color:yellow" > [[GAMEVERSION]]< / span >
2019-10-15 23:42:47 -03:00
[[OBJECTINFO]][[REQUESTED]]
< / p >
< img src = "../assets/ok.png" width = 20%; class = "gdButton center closeWindow" >
< / div >
< / div >
< div class = "popup" id = "saveDiv" >
2019-10-21 12:40:56 -03:00
< div class = "fancybox bounce center supercenter" >
2019-10-15 23:42:47 -03:00
< h2 class = "smaller center" style = "font-size: 5.5vh" > Saved!< / h2 >
< p class = "bigger center" style = "line-height: 5vh; margin-top: 1.5vh;" >
2020-11-02 01:11:37 -03:00
< span class = "pre" style = "color:yellow" > [[NAME]]< / span > has been added to your < a class = "youCanClickThis2" style = "color:lime" href = "../search/levels?type=saved" > saved levels< / a > list.
2019-10-15 23:42:47 -03:00
< / p >
< img src = "../assets/ok.png" width = 20%; class = "gdButton center" onclick = "location.reload()" >
< / div >
< / div >
< div class = "popup" id = "deleteDiv" >
2019-10-21 12:40:56 -03:00
< div class = "fancybox bounce center supercenter" style = "width: 60vh; height: 28%" >
2019-10-15 23:42:47 -03:00
< h2 class = "smaller center" style = "font-size: 5.5vh" > Delete Level< / h2 >
< p class = "bigger center" style = "line-height: 5vh; margin-top: 1.5vh;" >
2019-10-21 12:20:25 -03:00
Are you sure you want to < span style = "color:#C67A7E" > delete< / span > this level from your < a class = "youCanClickThis2" style = "color:lime" href = "../search/levels?type=saved" > saved levels < / a > list?
2019-10-15 23:42:47 -03:00
< / p >
< img src = "../assets/btn-no.png" height = 25%; class = "gdButton center closeWindow" >
< img src = "../assets/btn-yes.png" height = 25%; class = "gdButton center sideSpaceB" onclick = "deleteLevel()" >
< / div >
< / div >
2019-11-18 20:39:17 -03:00
<!-- <div class="popup" id="likeDiv">
< div class = "brownbox bounce center supercenter" style = "height: 75%; width: 100vh" >
< h1 class = "smaller center" style = "font-size: 5.5vh" > Vote< / h1 >
< img src = "../assets/smashLike.png" id = "likebtn" class = "inline gdButton likeButton" >
< img src = "../assets/smashDislike.png" id = "dislikebtn" class = "inline gdButton likeButton youAreNotTheOne" >
< form action = "nothing lol" >
< h3 class = "center" > GD Username< / h3 >
< input type = "text" name = "gdbrowser" id = "like-username" maxlength = "50" style = "height: 8vh; width: 90%; text-align: center; margin-top: 0.5%" >
< h3 class = "center" style = "margin-top: 2%" > GD Password< / h3 >
< input type = "password" id = "like-password" maxlength = "50" style = "height: 8vh; width: 90%; text-align: center; margin-top: 0.5%" >
< / form >
< div style = "min-height: 18%; max-height: 18%" >
< p id = "message" style = "padding: 0% 10%; margin-top: 2.5%" > < / p >
< / div >
< img src = "../assets/btn-cancel.png" height = 10%; class = "postButton gdButton center" style = "margin-right: 1%" onclick = "$('#likeDiv').hide(); $('#likebtn').trigger('click');" >
< img src = "../assets/btn-submit.png" type = "submit" height = 10%; class = "postButton gdButton center" style = "margin-left: 1%" id = "submitVote" >
< / div >
< / div > -->
2019-10-15 23:42:47 -03:00
< div style = "position:absolute; bottom: 0%; left: 0%; width: 100%" >
2019-10-18 17:48:33 -03:00
< img class = "cornerPiece" src = "../assets/corner.png" width = 7%; >
2019-10-15 23:42:47 -03:00
< / div >
< div style = "position:absolute; bottom: 0%; right: 0%; width: 100%; text-align: right;" >
2019-10-18 17:48:33 -03:00
< img class = "cornerPiece" src = "../assets/corner.png" width = 7%; style = "transform: scaleX(-1)" >
2019-10-15 23:42:47 -03:00
< / div >
< div class = "center" style = "width: 70%; margin: 1% auto" >
2020-11-02 01:11:37 -03:00
< h1 class = "pre" style = "transform: scale(1.2)" > [[NAME]]< / h1 >
2019-10-15 23:42:47 -03:00
< / div >
< div class = "center" style = "position:absolute; top: 9%; left: 0%; right: 0%; height: 5%;" >
2020-11-02 01:11:37 -03:00
< h2 class = "pre inline slightlySmaller normalCursor gdButton" id = "authorName" > < a class = "linkButton" id = "authorLink" href = "../u/[[AUTHOR]]" > By [[AUTHOR]]< / a > < / h2 >
2019-10-15 23:42:47 -03:00
< h2 class = "inline slightlySmaller normalCursor sideSpaceC" >
< img class = "inline valign" id = "copiedBadge" style = "height: 60%; cursor:help" src = "../assets/copied.png" title = "Level is a copy or a collaboration" >
2020-12-08 15:53:05 -03:00
< img class = "inline valign" id = "largeBadge" style = "height: 60%; margin-left: -7%; cursor:help" src = "../assets/large.png" title = "Contains more than 40,000 objects" > < / h2 > < br >
2020-12-09 11:28:45 -03:00
< img class = "inline spaced dailyLevel" id = "dailyIcon" style = "height:90%; display: none; margin-right: 0.5%; margin-top: 0.4%; vertical-align: middle;" >
< h1 class = "inline smallerer spaced dailyLevel" style = "display: none; margin: 0 0 0 0" > #[[DAILYNUMBER]]< span style = "font-size: 2.5vh; vertical-align: middle;" class = "h3Size" id = "dailyTime" > < / span > < / h1 >
2019-10-15 23:42:47 -03:00
< / div >
< div class = "transparentBox center" style = "position:absolute; bottom: 32%; left: 0; right: 0; width: 75vh; margin-left: auto; margin-right: auto" >
2020-11-02 01:11:37 -03:00
< p class = "pre" style = "padding: 0 5%; white-space:normal" > [[DESCRIPTION]]< / p >
2019-10-15 23:42:47 -03:00
< / div >
< div class = "center valign" style = "position:absolute; top: 10.5%; left: 27%; transform:scale(0.8); height: 100%; width: 20%" >
2021-01-04 12:21:58 -03:00
< img class = "spaced" src = "../assets/difficulties/[[DIFFICULTYFACE]].png" height = "15%" style = "margin-bottom: 0%" >
2019-10-15 23:42:47 -03:00
< h1 class = "smaller" id = "difficultytext" style = "transform:scale(0.9);" > [[DIFFICULTY]]< / h1 >
< h1 class = "smaller inline stars" style = "transform:scale(0.9)" > [[STARS]]< / h1 > < img class = "inline stars" src = "../assets/star.png" height = 4%; style = "transform:translateY(-12%)" > < br class = "stars" >
< h1 class = "smaller inline diamonds" style = "transform:scale(0.9)" > [[DIAMONDS]]< / h1 > < img class = "inline diamonds" src = "../assets/diamond.png" height = 4%; style = "transform:translateY(-12%)" >
2019-10-17 01:17:55 -03:00
< h1 class = "smaller inline demonList" style = "transform:scale(0.9); display: none;" > #[[DEMONLIST]]< / h1 > < img class = "inline demonList" src = "../assets/demon.png" height = 4.5%; style = "transform:translateY(-7%); display: none; margin-left: 1.5%" >
2019-10-15 23:42:47 -03:00
< div id = "coins" style = "margin-top: 3%" > < / div >
< / div >
< div style = "position:absolute; top: 20%; right: 0%; height: 38%; width: 40%;" >
< img class = "inline spaced" src = "../assets/download.png" height = 15% style = "margin-right: 2%" >
< h1 class = "inline smaller spaced" > [[DOWNLOADS]]< / h1 > < br >
< img id = "likeImg" class = "inline spaced" src = "../assets/like.png" height = 15% style = "margin-right: 2%" >
< h1 class = "inline smaller spaced" > [[LIKES]]< / h1 > < br >
< img class = "inline spaced" src = "../assets/time.png" height = 15% style = "margin-right: 2%" >
< h1 class = "inline smaller spaced" > [[LENGTH]]< / h1 > < br >
< img class = "inline spaced orbs" src = "../assets/orbs.png" height = 15% style = "margin-right: 2%" >
< h1 class = "inline smaller spaced orbs" > [[ORBS]]< / h1 >
< / div >
< div class = "brownBox" id = "songBox" style = "position:absolute; bottom: 4%; left: 0; right: 0; width: 85vh; height: 20%; margin-left: auto; margin-right: auto;" >
< div style = "margin-left: 0.5%" >
2020-11-02 01:11:37 -03:00
< h1 class = "pre slightlySmaller" id = "songname" > [[SONGNAME]]< / h1 >
2021-01-05 13:03:04 -03:00
< h2 class = "pre smaller" > By: [[SONGAUTHOR]]<!--
2021-01-07 12:38:55 -03:00
-->< img id = "scout" title = "Artist is scouted" style = "display: none; cursor: help; margin-left: 1.5%; filter: hue-rotate(-55deg);" class = "artistIcon valign" src = "../assets/check.png" width = "5%" > <!--
-->< img id = "whitelist" title = "Artist is whitelisted" style = "display: none; cursor: help" class = "artistIcon valign" src = "../assets/check.png" width = "5%" > <!--
2021-01-15 12:29:46 -03:00
--> < a class = "songLink" href = "https://[[SONGAUTHOR]].newgrounds.com" target = "_blank" > < img id = "moreSongs" class = "gdButton valign" src = "../assets/more.png" width = "12%" > < / a > < / h2 >
2021-01-05 13:03:04 -03:00
< img id = "checkSong" style = "display: none; margin-top: 1%" class = "gdButton valign" src = "../assets/btn-check.png" width = "16%" >
< h3 id = "songLoading" style = "display: none; margin-top: 0.5%;" > Loading...< / h3 >
< h3 id = "songAllowed" style = "display: none; margin-top: 0.5%; color: lime" > Song is allowed for use< / h3 >
< h3 id = "songNotAllowed" style = "display: none; margin-top: 0.5%; color: red" > Song is not allowed for use< / h3 >
2021-01-07 12:38:55 -03:00
< h3 id = "artistInfo" style = "display: none; margin-top: 0.5%" > < / h3 >
2019-10-15 23:42:47 -03:00
< / div >
2021-01-15 12:29:46 -03:00
< a class = "songLink" href = "https://www.newgrounds.com/audio/listen/[[SONGID]]" target = "_blank" > < img class = "gdButton sideButton" id = "playSong" src = "../assets/playsong.png" style = "position:absolute; right: 1%; top: 50%; width: 11%; height: auto;" > < / a >
2019-10-15 23:42:47 -03:00
< / div >
< div class = "center" style = "position:absolute; bottom: 5%; left: 0; right: 0" >
< h1 id = "songInfo" style = "transform: scale(0.5);" > SongID: [[SONGID]] Size: [[SONGSIZE]]< / h1 >
< / div >
< div class = "center noClick" style = "position:absolute; top: 24%; right: 0%; min-width: 100%" >
< img class = "gdButton yesClick" id = "playButton" src = "../assets/play.png" width = "11%" >
< / div >
< div class = "levelButtons" style = "position:absolute; top: 46%; right: 3.5%; transform: translateY(-50%); height: 75%;" >
< img class = "gdButton sideButton" id = "saveButton" src = "../assets/plus.png" onclick = "$('#saveDiv').show(); saveLevel()" > < br >
< img class = "gdButton sideButton" id = "infoButton" src = "../assets/info.png" onclick = "$('#infoDiv').show()" > < br >
2019-11-18 20:39:17 -03:00
<!-- <img class="gdButton sideButton" id="likeButton" src="../assets/vote.png" onclick="$('#likeDiv').show()"><br> -->
2021-01-18 23:54:18 -03:00
< a href = "./analyze/[[ID]]" > < img id = "analyzeBtn" class = "gdButton sideButton" src = "../assets/edit.png" > < / a > < br >
2019-11-18 20:39:17 -03:00
< a href = "./comments/[[ID]]" > < img class = "gdButton sideButton" src = "../assets/comment.png" > < / a > < br >
2020-10-28 22:25:13 -03:00
< a href = "./leaderboard/[[ID]]" > < img id = "leaderboardbtn" class = "gdButton sideButton" src = "../assets/leaderboard.png" > < / a > < br >
2019-10-15 23:42:47 -03:00
< / div >
< div style = "position:absolute; top: 2%; left: 1.5%; width: 10%; height: 25%; pointer-events: none" >
< img class = "gdButton yesClick" id = "backButton" src = "../assets/back.png" height = "30%" onclick = "backButton()" >
< / div >
< div id = "copied" style = "display: none;" >
2019-11-24 12:29:16 -03:00
< div class = "copied center noClick" style = "position:absolute; top: 36%; left: 50%; transform: translate(-50%,-50%); width: 90vh" >
< h1 class = "smaller noSelect" id = "copiedText" > ID copied to clipboard< / h1 >
2019-10-15 23:42:47 -03:00
< / div >
< / div >
< / div >
< / body >
2019-10-21 12:20:25 -03:00
< script type = "text/javascript" src = "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js" > < / script >
2021-01-18 23:54:18 -03:00
< script type = "text/javascript" src = "../sizecheck.js?" > < / script >
2019-10-15 23:42:47 -03:00
< script >
2020-01-03 19:15:49 -03:00
let messageText = 'Your < span style = "color: yellow" > Geometry Dash password< / span > will < span style = "color: lime" > not be stored< / span > anywhere on the site, both < span style = "color:rgb(113, 234, 255)" > locally and server-side.< / span > You can view the code used for liking a level < a class = "menuLink" target = "_blank" href = "https://github.com/GDColon/GDBrowser/blob/master/api/post/like.js" > here< / a > .'
2019-11-18 20:39:17 -03:00
$('#message').html(messageText)
2020-12-09 11:28:45 -03:00
function colonize(secs, timeUp) {
if (secs < 0 ) {
if (timeUp) return "Time's up!"
else secs = 0
}
let days = Math.floor(secs / 86400)
if (days) secs -= days * 86400
return `${days ? `${days}d + ` : ""}${[Math.floor(+secs / 3600), Math.floor(+secs / 60) % 60, +secs % 60].map(v => v < 10 ? " 0 " + v : v ) . filter ( ( v , i ) = > v !== "00" || i > 0).join(":")}`
2020-11-16 13:38:03 -03:00
}
2019-10-15 23:42:47 -03:00
if (window.location.href.endsWith('?download')) $('#infoDiv').show()
2019-11-24 12:29:16 -03:00
let copyMessages = ["ID copied to clipboard", "ID copied x[C]!", "ID copied again!", "ID copied once more!", "ID clipboard to copied!", "ID copied yet again!", "As you wish", "Copy that!", "This one actually works", "You can't play levels, son", "Keep it coming", "Click again, I dare you", "C-C-C-C-COPIED!",
"Get a life", "...", "bruh moment", "Etched into thy's memory!", "h", "I feel physical pain", "Play it in GD!", "[[ID]]", "go away", "Every copy costs 2 cents!", "Un-copied!", "Copied++", "C O P I E D", "help me please", "Open GD to play the level!", "pretend you're playing it", "Anotha one!"]
let copies = 0
let animated = false;
let freeze = false;
2020-12-09 11:28:45 -03:00
let dailyTime = Number('[[NEXTDAILY]]') || null
2019-11-24 12:29:16 -03:00
$('#playButton').click(function () {
if (!($('#copied').is(':animated')) & & !animated) {
animated = true;
copies += 1
$('#copied').stop().fadeIn(200).delay(500).fadeOut(500, function() {
animated = false
if (copies > 1) $('#copiedText').text(copyMessages[Math.floor(Math.random()*(copies > 4 ? copyMessages.length : 6))].replace("[C]", copies))
})
}
var temp = $("< input > ");
$("body").append(temp);
temp.val('[[ID]]').select();
document.execCommand("copy"); temp.remove()
})
$('.closeWindow').click(function () { if (!freeze) $(".popup").attr('style', 'display: none;') })
2019-10-15 23:42:47 -03:00
$('#difficultytext').html('[[DIFFICULTY]]'.replace(' ', "< br > "))
$('#levelInfo').html($('#levelInfo').html()
2019-10-26 00:08:54 -03:00
.replace('[[ORIGINALINFO]]', [[COPIEDID]] == "0" ? "" : `< br > Original: < a class = "youCanClickThis" href = "/[[COPIEDID]]" > < span style = "color:aqua" > [[COPIEDID]]< / span > < / a > `)
2020-09-29 22:58:25 -03:00
.replace('[[OBJECTINFO]]', '[[OBJECTS]]' == "0" ? "" : `< br > Objects: < span style = "color:yellow" > ${'[[OBJECTS]]' == "65535" ? "65535+" : '[[OBJECTS]]'}< / span > `)
2019-10-26 00:08:54 -03:00
.replace('[[REQUESTED]]', [[STARSREQUESTED]] == "0" ? "" : `< br > Stars Requested: < span style = "color:yellow" > [[STARSREQUESTED]]< / span > `))
2019-10-15 23:42:47 -03:00
if (!'[[UPLOADED]]'.startsWith('[')) {
$('#levelInfo').html($('#levelInfo').html()
2021-01-14 20:18:19 -03:00
.replace('[[PASS]]', `< br > Password: < span style = "color:orange" > ${'[[PASSWORD]]' == '0' || '[[PASSWORD]]'.startsWith("[") ? "No copy" : '[[PASSWORD]]' == 1 ? "Free copy" : '[[PASSWORD]]'}< / span > `)
2019-10-26 00:08:54 -03:00
.replace('[[LOWDETAIL]]', `< br > Low Detail: < span style = "color:orange" > ${[[LDM]] ? "Yes" : "No"}< / span > `)
2020-11-16 13:38:03 -03:00
.replace('[[TIME1]]', [[EDITORTIME]] == 0 ? "" : `< br > Editor Time: < span style = "color:lightgreen" > ${colonize([[EDITORTIME]])}< / span > `)
.replace('[[TIME2]]', [[TOTALEDITORTIME]] == 0 ? "" : `< br > Editor Time (+copies): < span style = "color:lightgreen" > ${colonize([[TOTALEDITORTIME]])}< / span > `)
.replace('[[EXTRA]]', `< br > Extra String: < span style = "color:lightgreen" > ${'[[EXTRASTRING]]'.length} chars< / span > `)
2019-10-26 00:08:54 -03:00
.replace('[[UPLOAD]]', '[[UPLOADED]]' == "0" ? "" : `< br > Uploaded: < span style = "color:orange" > [[UPLOADED]]< / span > `)
.replace('[[UPDATE]]', '[[UPDATED]]' == "0" ? "" : `< br > Updated: < span style = "color:orange" > [[UPDATED]]< / span > `))}
2019-10-15 23:42:47 -03:00
else {
$('#levelInfo').html($('#levelInfo').html()
.replace('[[PASS]]', "")
.replace('[[LOWDETAIL]]', "")
2020-11-16 13:38:03 -03:00
.replace('[[EXTRA]]', "")
.replace('[[TIME1]]', "")
.replace('[[TIME2]]', "")
2019-10-15 23:42:47 -03:00
.replace('[[UPLOAD]]', "")
.replace('[[UPDATE]]', "") +
2021-01-18 23:54:18 -03:00
`< br > < a id = "additional" class = "youCanClickThis" href = "/[[ID]]?download" > < span style = "color:aqua" > Download additional info< / span > < / a > `
2019-10-15 23:42:47 -03:00
)}
if (![[LARGE]]) $('#largeBadge').hide()
2019-10-25 17:41:16 -03:00
if ([[COPIEDID]] == 0) $('#copiedBadge').hide()
2019-10-15 23:42:47 -03:00
if ([[ORBS]] == 0) $('.orbs').hide()
if ([[STARS]] == 0) $('.stars').hide()
2019-10-17 01:17:55 -03:00
if ([[DIAMONDS]] == 0 || !'[[DEMONLIST]]'.startsWith("[")) $('.diamonds').hide()
2020-10-28 22:25:13 -03:00
if (!'[[DEMONLIST]]'.startsWith("[")) {
$('.demonList').show()
$('#leaderboardbtn').attr('src', '../assets/demonleaderboard.png').parent().attr('href', '../demon/[[DEMONLIST]]')
}
2019-10-17 01:17:55 -03:00
else $('.demonList').remove()
2020-12-08 15:53:05 -03:00
if (!'[[DAILYNUMBER]]'.startsWith("[")) {
$('#dailyIcon').attr('src', `../assets/crown-${'[[WEEKLY]]'.startsWith("[") ? "daily" : "weekly"}.png`)
2020-12-09 11:28:45 -03:00
$('.dailyLevel').show()
2021-01-04 12:21:58 -03:00
if (dailyTime) {
2020-12-09 11:28:45 -03:00
$('#dailyTime').html(` (${colonize(dailyTime, true)})`)
2021-01-04 12:21:58 -03:00
setInterval(() => {
dailyTime -= 1
$('#dailyTime').html(` (${colonize(dailyTime, true)})`)
}, 1000);
}
2020-12-08 15:53:05 -03:00
}
2020-12-09 11:28:45 -03:00
else $('.dailyLevel').remove()
2020-12-08 15:53:05 -03:00
2019-10-15 23:42:47 -03:00
if ("[[SONGID]]".startsWith("Level")) {
$('#songInfo').text('[[SONGID]]')
2021-01-15 12:29:46 -03:00
$('.songLink').hide()
}
2021-01-18 23:54:18 -03:00
else $('#checkSong').show()
if (!"[[GDPS]]".startsWith("[")) {
2021-01-15 12:29:46 -03:00
$('#playSong').hide()
$('#moreSongs').hide()
2021-01-18 23:54:18 -03:00
$('#leaderboardbtn').hide()
$('#checkSong').remove()
2021-01-15 12:29:46 -03:00
}
2019-10-15 23:42:47 -03:00
2021-01-05 16:12:25 -03:00
if ("[[SONGAUTHOR]]" == "Unknown" || "[[INVALIDSONG]]" == "true") $('.songLink').hide()
2019-10-15 23:42:47 -03:00
if ("[[DISLIKED]]" == "true") $('#likeImg').attr('src', '../assets/dislike.png').css('transform', 'translateY(20%)')
let coinColor = [[VERIFIEDCOINS]] ? "silvercoin" : "browncoin"
if ([[COINS]] > 0) $("#coins").append(`< img src = "../assets/${coinColor}.png" height = "5%" > `)
if ([[COINS]] > 1) $("#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%" > `)
2021-01-18 23:54:18 -03:00
if ("[[GDPS]]".startsWith("1.9/")) $("#authorLink").attr('href', '/search/[[AUTHORID]]?user')
2019-10-15 23:42:47 -03:00
if ("[[ACCOUNTID]]" == "0") {
2020-10-28 22:25:13 -03:00
$("#authorName").addClass("green").addClass("unregistered")
$("#authorLink").attr('href', '/search/[[AUTHORID]]?user')
}
2019-10-15 23:42:47 -03:00
2020-10-28 22:25:13 -03:00
if (window.location.pathname == "/weekly") {
$('body').addClass('darkBG')
$('.cornerPiece').addClass('grayscale')
}
2019-10-15 23:42:47 -03:00
$(window).on('load', function() {
if ($('#songname')[0].scrollWidth > $('#songBox')[0].scrollWidth) {
let overflow = ($('#songname')[0].scrollWidth - $('#songBox')[0].scrollWidth) * 0.007
2019-11-02 18:37:48 -03:00
if (overflow > 3) overflow = 3
2019-10-15 23:42:47 -03:00
$('#songname').addClass('smaller').css('font-size', (6 - (overflow)) + 'vh')
}
});
2019-10-24 01:51:20 -03:00
let savedLevels = JSON.parse(localStorage.getItem('saved') || '[]');
2019-10-15 23:42:47 -03:00
let deleteMode = false;
2019-10-24 01:51:20 -03:00
if (savedLevels.includes('[[ID]]')) {
$('#saveButton').attr('src', '../assets/delete.png').attr('onclick', '$("#deleteDiv").show()')
2019-10-15 23:42:47 -03:00
}
function saveLevel() {
2019-10-24 01:51:20 -03:00
savedLevels.push('[[ID]]');
localStorage.setItem('saved', JSON.stringify(savedLevels));
2019-10-15 23:42:47 -03:00
}
function deleteLevel() {
2019-10-24 02:03:40 -03:00
savedLevels = savedLevels.filter(function(el) {return el != '[[ID]]'})
2019-10-24 01:51:20 -03:00
localStorage.setItem('saved', JSON.stringify(savedLevels));
location.reload()
2019-11-18 20:39:17 -03:00
freeze = true;
2019-10-15 23:42:47 -03:00
}
2021-01-05 13:03:04 -03:00
$('#checkSong').click(function() {
$('#checkSong').hide()
$('#songLoading').show()
fetch(`../api/song/[[SONGID]]`).then(res => res.json()).then(info => {
$('#songLoading').hide()
2021-01-07 12:38:55 -03:00
$(info.song.allowed ? '#songAllowed' : '#songNotAllowed').show().addClass('songStatus')
2021-01-05 13:03:04 -03:00
if (!info.artist.scouted) {
$('#scout').attr('src', '../assets/x.png')
$('#scout').attr('title', $('#scout').attr('title').replace('is ', 'is NOT '))
$('#scout').css('filter', 'saturate(0.4)')
}
if (!info.artist.whitelisted) {
$('#whitelist').attr('src', '../assets/x.png')
$('#whitelist').attr('title', $('#whitelist').attr('title').replace('is ', 'is NOT '))
}
$('#scout').show(); $('#whitelist').show()
})
})
2021-01-07 12:38:55 -03:00
$('.artistIcon').hover(function() {
let title = $(this).attr('title')
$('#artistInfo').css('color', title.includes("NOT") ? "red" : "lime")
$('.songStatus').hide()
$('#artistInfo').show()
$('#artistInfo').text(title)
}, function() {
$('#artistInfo').hide()
$('.songStatus').show()
})
2019-11-18 20:39:17 -03:00
// let like;
// let likedLevels = localStorage.likedLevels ? JSON.parse(localStorage.likedLevels) : []
// if (likedLevels.includes('[[ID]]')) $('#likeButton').attr('src', '../assets/voted.png').removeClass('gdButton').prop("onclick", null)
// $('#likebtn').click(function() {
// $('#likebtn').removeClass('youAreNotTheOne')
// $('#dislikebtn').addClass('youAreNotTheOne')
// like = true
// })
// $('#dislikebtn').click(function() {
// $('#likebtn').addClass('youAreNotTheOne')
// $('#dislikebtn').removeClass('youAreNotTheOne')
// like = false
// })
// $('#submitVote').click(function() {
// if (likedLevels.includes('[[ID]]')) return $('#message').text("You've already liked/disliked this level!");
// let ID = '[[ID]]'
// let username = $('#like-username').val()
// let password = $('#like-password').val()
// let accountID = 0
// let likeType = like ? "1" : "0"
// if (!ID || !username || !password) return $('#commentDiv').hide()
// $('#message').text(like ? "Liking..." : "Disliking... :(")
// $('.postbutton').hide()
// allowEsc = false
// fetch(`../api/profile/${username}`).then(res => res.json()).then(res => {
// if (!res || res == "-1") {$('.postbutton').show(); return $('#message').text("The username you provided doesn't exist!")}
// else accountID = res.accountID
// $.post("../like", { ID, accountID, password, like: likeType, type: 1, extraID: 0 })
// .done(x => {
// likedLevels.push('[[ID]]')
// localStorage.setItem('likedLevels', JSON.stringify(likedLevels))
// location.reload()
// })
// .fail(e => {$('.postbutton').show();$('#message').text(e.responseText.includes("DOCTYPE") ? "Something went wrong..." : e.responseText)})
// })
// })
2019-10-15 23:42:47 -03:00
< / script >