🎨 Put the adaptedText in a variable

This commit is contained in:
Kazhnuz 2025-02-12 20:11:57 +01:00
parent e6cd9c09d5
commit f538c62f4a

View file

@ -9,7 +9,12 @@ const position = {x: 4, y: 2, gravity: "NorthEast"}
const metadatas = [] const metadatas = []
function createFilename(prideflag, text, now = false) { function createFilename(prideflag, text, now = false) {
return `${prideflag.name.en.toLowerCase()}-${text.replaceAll("⋅", "_").replaceAll(" ", "_").replaceAll("\n", '-').toLowerCase()}${now?'-now':''}.png`; const adaptedText = text
.replaceAll("⋅", "_")
.replaceAll(" ", "_")
.replaceAll("\n", '-')
.toLowerCase();
return `${prideflag.name.en.toLowerCase()}-${adaptedText}${now?'-now':''}.png`;
} }
function createButton(source, x, y, text, gravity) { function createButton(source, x, y, text, gravity) {