test005<br />
<img id="dice" src="https://ik.imagekit.io/nlcynsjwm/dice/dice1.png"><br />
<button id="btn1" onclick="roll()">振る</button>
<script>
function rollDice() {
const dn = Math.floor(Math.random() * 6) + 1; // 1〜6
const diceImage = "https://ik.imagekit.io/nlcynsjwm/dice/dice"+dn+".png?rnd="+Math.floor(Math.random() * 10000);
document.getElementById("dice").src = diceImage;
}
function roll() {
document.getElementById("btn1").disabled = true;
rollDice();
setTimeout(function() {
rollDice();
setTimeout(function() {
rollDice();
setTimeout(function() {
document.getElementById("btn1").disabled = false;
}, 1000);
}, 1000);
}, 1000);
}
</script>