<!DOCTYPE html>
<html>
<head>
<title>SSRキャラガチャ</title>
</head>
<body>
<h1>SSRキャラガチャ</h1>
<button onclick="roll()">ガチャを回す</button>
<p id="result"></p>
<p id="dialogue"></p>
<script>
function roll() {
const chance = Math.random() * 100;
let text = "";
let dialogue = "";
if (chance <= 3) {
text = "SSRキャラ獲得!";
dialogue = "よし、また一つ強くなったぞ!";
} else {
text = "レアキャラ獲得!";
dialogue = "いいキャラだよ!";
}
document.getElementById("result").innerHTML = text;
document.getElementById("dialogue").innerHTML = dialogue;
}
</script>
</body>
</html>