Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Tarot Card Reading</title>
- </head>
- <body>
- <h1>Tarot Card Reading</h1>
- <img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Ffermentationwineblog.com%2Fwp-content%2Fuploads%2Fpredictions.jpg&f=1&nofb=1&ipt=41e54d29f1b274ad1f3fc844ebefed5d8ecc7b4d6dd132d41e82dafd4e1e6c06" alt = "A cartoon of a man looking into a crystal ball labeled, 'The Future.'" height=250 width=250>
- <br>
- <br>
- <h3>Enter a number that speaks to you today:</h3>
- <input id = "entered-number" type = "number">
- <br>
- <br>
- <button type="button" onclick = "enterNumber()">Take a card</button>
- <br>
- <br>
- <p id="outputFortune"></p>
- <script>
- function enterNumber() {
- let chosenNumber = document.getElementById("entered-number").value;
- const fortune1 = "The Sun";
- const fortune2 = "The Hanged Man";
- const fortune3 = "The Tower";
- const fortune4 = "Judgement";
- const fortune5 = "The Fool";
- const fortune6 = "The Lovers";
- const fortune7 = "The Moon";
- const fortune8 = "The Hermit";
- const fortune9 = "The High Priestess";
- const fortune10 = "The Emperor";
- const fortune11 = "The Chariot";
- const fortune12 = "Strength";
- const fortune13 = "Wheel of Fortune";
- const fortune14 = "The Star";
- const fortune15 = "Temperance";
- const fortune16 = "The World";
- const fortune17 = "Justice";
- const fortune18 = "The Empress";
- const fortune19 = "The Hierophant";
- const fortune20 = "The Devil";
- const fortune21 = "The Magician";
- const fortune22 = "The Fool";
- let selectedFortune;
- if (chosenNumber >= 98838172) {selectedFortune = fortune1
- } else if (chosenNumber >= 8838190) {let selectedFortune = fortune2
- } else if (chosenNumber >= 8875172) {let selectedFortune = fortune3
- } else if (chosenNumber >= 90172) {let selectedFortune = fortune4
- } else if (chosenNumber >= 50000) {let selectedFortune = fortune5
- } else {let selectedFortune = fortune6;}
- document.getElementById("outputFortune").innerHTML =
- `You have turned over ${selectedFortune}.`;
- };
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment