2024-02-01 17:40:14 +00:00
|
|
|
function updateMonsterSprite() {
|
2024-02-05 16:13:22 +00:00
|
|
|
var selectedMonster = document.getElementById("monsterDropdown").value.toLowerCase();
|
2024-02-05 15:47:21 +00:00
|
|
|
var spriteUrl = `/img/monster/${selectedMonster}.png`;
|
2024-02-01 17:40:14 +00:00
|
|
|
|
|
|
|
var iframe = document.getElementById("monsterSpriteIframe");
|
|
|
|
iframe.src = "about:blank"; // Clear the iframe content
|
|
|
|
|
2024-02-02 03:21:27 +00:00
|
|
|
var content = `<!DOCTYPE html>
|
|
|
|
<style>
|
2024-02-01 17:40:14 +00:00
|
|
|
body {
|
|
|
|
margin: 0;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
height: 100vh;
|
|
|
|
}
|
|
|
|
|
|
|
|
img {
|
|
|
|
max-width: 100%;
|
|
|
|
max-height: 100%;
|
|
|
|
object-fit: contain;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<body>
|
|
|
|
<img src="${spriteUrl}" alt="Monster Sprite">
|
|
|
|
</body>`;
|
|
|
|
|
|
|
|
iframe.contentWindow.document.open();
|
|
|
|
iframe.contentWindow.document.write(content);
|
|
|
|
iframe.contentWindow.document.close();
|
|
|
|
}
|