Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
EspectroW94 committed Dec 28, 2024
1 parent 424a4ad commit 76dca88
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 2 deletions.
Binary file added items/assets/items/Items_057.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added items/assets/items/Items_058.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added items/assets/items/Items_059.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added items/assets/items/Items_060.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added items/assets/items/Items_061.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added items/assets/items/Items_062.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added items/assets/items/Items_063.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added items/assets/items/Items_064.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added items/assets/items/Items_065.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions items/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ Papa.parse('items.csv', {
// Expresión regular para encontrar palabras separadas por guiones bajos
const regex = /_(\w)/g;
// Capitalizar la primera letra de cada palabra
const imageName = item.Icon.replace(regex, (match, p1) => p1.toUpperCase());
itemImage.src = `assets/items/${imageName}`;
const imageName = item.Icon.replace(regex, (match, p1) =>"_"+p1.toUpperCase());

const firstLetter = imageName[0].toUpperCase();
const imageName2 = firstLetter + imageName.slice(1);


itemImage.src = `assets/items/${imageName2}`;
} else {
console.error("El nombre de la imagen no está definido.");
}
Expand Down

0 comments on commit 76dca88

Please sign in to comment.