Last active
October 2, 2018 15:44
-
-
Save thatkookooguy/0352b6415191312d91ccd8608857e99a to your computer and use it in GitHub Desktop.
Will add game names to the launchbox database. See comment for instructions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function() { $('.box-item').each(function(){ let qElm = $(this); let boxWidth = this.clientWidth; let imgWidth = qElm.find('img')[0].clientWidth; let boxHeight = this.clientHeight; let imgHeight = qElm.find('img')[0].clientHeight; let hSpace = (boxHeight - imgHeight) / 2; let wSpace = (boxWidth - imgWidth) / 2; let name = $.trim(qElm.next().find('h3').text()); qElm.append(`<div style="position: absolute;bottom: ${hSpace + 5}px;left: ${wSpace}px;right: ${wSpace}px;color: white;display: flex;align-items: center;text-align: center;justify-content: center;background: rgba(0, 0, 0, 0.5)">${name}</div>`); });})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function() { | |
$('.box-item').each(function(){ | |
let qElm = $(this); | |
let boxWidth = this.clientWidth; | |
let imgWidth = qElm.find('img')[0].clientWidth; | |
let boxHeight = this.clientHeight; | |
let imgHeight = qElm.find('img')[0].clientHeight; | |
let hSpace = (boxHeight - imgHeight) / 2; | |
let wSpace = (boxWidth - imgWidth) / 2; | |
let name = $.trim(qElm.next().find('h3').text()); | |
qElm.append( | |
`<div style="position: absolute;bottom: ${hSpace + 5}px;left: ${wSpace}px;right: ${wSpace}px;color: white;display: flex;align-items: center;text-align: center;justify-content: center;background: rgba(0, 0, 0, 0.5)">${name}</div>` | |
); | |
}); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HOW TO USE
name: Launchbox - Inject game names
URL: the content of the
add-game-names.js
snippet