gammatools/web/index.html
2024-06-27 19:15:28 +01:00

45 lines
1.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Gamma World Gaming Tools</title>
</head>
<body>
<div style="text-align: center">
<h1>Gamma World Gaming Tools</h1>
</div>
<div id="button-panel" style="text-align: center">
<button id="dieroller">Dice</button>
<button id="chargen">Characters</button>
<button id="encounter">Encounters</button>
</div>
<hr/>
<div id="toolPanel"></div>
<script>
document.getElementById("dieroller").addEventListener("click", function() {
loadContent("rolldice.html");
});
document.getElementById("chargen").addEventListener("click", function() {
loadContent("chargen.html");
});
document.getElementById("encounter").addEventListener("click", function() {
loadContent("encounter.html");
});
function loadContent(pageUrl) {
var iframe = document.createElement('iframe');
iframe.src = pageUrl;
iframe.style.width = '100%'; // make the iframe take full width of the container
iframe.style.border = 'none'; // hide the border
iframe.style.overflow = 'hidden'; // hide scrollbars, can be 'auto' if you prefer automatic scrollbars
iframe.style.height = '750px'; // set a height so that the iframe is visible, adjust as per your needs
document.getElementById("toolPanel").innerHTML = '';
document.getElementById("toolPanel").appendChild(iframe);
}
</script>
</body>
</html>