Skip to content

Instantly share code, notes, and snippets.

@ssj71
Last active February 1, 2023 16:30
Show Gist options
  • Save ssj71/9926ff838b77d01746ab856806013476 to your computer and use it in GitHub Desktop.
Save ssj71/9926ff838b77d01746ab856806013476 to your computer and use it in GitHub Desktop.
Virtual Dice for when I play Loot of Lima solo
<!DOCTYPE html>
<html>
<head>
<title>Loot of Lima Solo Travel Edition!</title>
</head>
<body>
<iframe src = "https://www.kylegillingham.com/loot/" width = 100% height = "1100">
Sorry your browser does not support inline frames.
</iframe>
<div style="display:grid;grid-gap:50px;grid-template-columns:500px 200px 100px 100px 100px;">
<div></div>
<input type="button" value="Re-Roll" onclick="rollall()">
<div id="die1">.</div>
<div id="die2">.</div>
<div id="die3">.</div>
</div>
<script language="javascript">
var d1 = [ "<h3 style=\"color:grey\">N</h3>",
"<h3 style=\"color:green\">SE</h3>",
"<h3 style=\"color:green\">W</h3>",
"<h3 style=\"color:green\">W</h3>",
"<h3 style=\"color:#f5cb4f80\">NW</h3>",
"<h3 style=\"color:#f5cb4f80\">SW</h3>",
"<h3 style=\"color:#f5cb4f80\">E</h3>",
"<h3 style=\"color:#f5cb4f80\">E</h3>",
"<h3 style=\"color:grey\">N</h3>",
"<h3 style=\"color:grey\">S</h3>",
"<h3 style=\"color:grey\">NE</h3>",
"<h3 style=\"color:blue\">S</h3>",
];
var d2 = [ "<h3 style=\"color:blue\">W</h3>",
"<h3 style=\"color:green\">N</h3>",
"<h3 style=\"color:#f5cb4f80\">N</h3>",
"<h3 style=\"color:#f5cb4f80\">W</h3>",
"<h3 style=\"color:grey\">W</h3>",
"<h3 style=\"color:grey\">S</h3>",
"<h3 style=\"color:#f5cb4f80\">S</h3>",
"<h3 style=\"color:grey\">E</h3>",
"<h3 style=\"color:blue\">N</h3>",
"<h3 style=\"color:blue\">E</h3>",
"<h3 style=\"color:green\">S</h3>",
"<h3 style=\"color:green\">E</h3>",
];
var d3 = [ "<h3 style=\"color:green\">SW</h3>",
"<h3 style=\"color:#f5cb4f80\">SW</h3>",
"<h3 style=\"color:#f5cb4f80\">SE</h3>",
"<h3 style=\"color:grey\">NE</h3>",
"<h3 style=\"color:grey\">SW</h3>",
"<h3 style=\"color:grey\">SE</h3>",
"<h3 style=\"color:#f5cb4f80\">NE</h3>",
"<h3 style=\"color:#f5cb4f80\">NW</h3>",
"<h3 style=\"color:grey\">NW</h3>",
"<h3 style=\"color:green\">SE</h3>",
"<h3 style=\"color:green\">NW</h3>",
"<h3 style=\"color:green\">NE</h3>",
];
function rollall(){
var str =
document.getElementById("die1").innerHTML=d1[Math.floor(Math.random()*12)];
document.getElementById("die2").innerHTML=d2[Math.floor(Math.random()*12)];
document.getElementById("die3").innerHTML=d3[Math.floor(Math.random()*12)];
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment