mirror of
https://github.com/stronk-dev/RandomChad.git
synced 2025-07-05 02:35:08 +02:00
Chadified Assets
This commit is contained in:
parent
502aa93f23
commit
b2f153f897
Binary file not shown.
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 14 MiB After Width: | Height: | Size: 14 MiB |
@ -13,7 +13,6 @@ const svgFromAttributes = require("./svg-generator");
|
||||
// Rocketeer generator
|
||||
// ///////////////////////////////
|
||||
async function generateRocketeer(id) {
|
||||
|
||||
// The base object of a new Rocketeer
|
||||
const rocketeer = {
|
||||
name: `${name.first()} ${name.middle()} ${name.last()} of ${
|
||||
@ -81,13 +80,11 @@ async function generateRocketeer(id) {
|
||||
const { NODE_ENV: mode } = process.env;
|
||||
let path;
|
||||
if (mode == "production") {
|
||||
path = '/var/www/avatars/' + id
|
||||
path = "/var/www/avatars/" + id;
|
||||
} else {
|
||||
path = './output/' + id
|
||||
path = "./output/" + id;
|
||||
}
|
||||
rocketeer.image = await svgFromAttributes(
|
||||
rocketeer.attributes, path
|
||||
);
|
||||
rocketeer.image = await svgFromAttributes(rocketeer.attributes, path);
|
||||
|
||||
// Namify the attributes
|
||||
rocketeer.attributes = rocketeer.attributes.map((attribute) => {
|
||||
|
@ -75,9 +75,16 @@ module.exports = async function svgFromAttributes(attributes = [], path = "") {
|
||||
(p) => p !== helmet
|
||||
);
|
||||
for (let i = obsoleteHelmets.length - 1; i >= 0; i--) {
|
||||
const element = document.querySelector(`#${obsoleteHelmets[i]}`);
|
||||
{
|
||||
let element = document.querySelector(`#${obsoleteHelmets[i]}` + "_front");
|
||||
if (element) element.remove();
|
||||
else console.log(`Could not find #${obsoleteHelmets[i]}`);
|
||||
else console.log(`#${obsoleteHelmets[i]}` + "_front");
|
||||
}
|
||||
{
|
||||
let element = document.querySelector(`#${obsoleteHelmets[i]}` + "_back");
|
||||
if (element) element.remove();
|
||||
else console.log(`#${obsoleteHelmets[i]}` + "_back");
|
||||
}
|
||||
}
|
||||
|
||||
// Remove panel if need be
|
||||
@ -161,7 +168,6 @@ module.exports = async function svgFromAttributes(attributes = [], path = "") {
|
||||
console.log("Writing to `" + path + ".svg`...");
|
||||
await fs.writeFile(`${path}.svg`, bakedSvg);
|
||||
|
||||
|
||||
// Return public url
|
||||
return "Paths: '" + `${path}.svg` + "'";
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user