{"id":219,"date":"2025-02-04T20:32:52","date_gmt":"2025-02-04T20:32:52","guid":{"rendered":"https:\/\/oidsdnd.com\/?page_id=219"},"modified":"2025-02-04T22:40:56","modified_gmt":"2025-02-04T22:40:56","slug":"dice","status":"publish","type":"page","link":"https:\/\/oidsdnd.com\/index.php\/dice\/","title":{"rendered":"Dice Roller"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Dice Roller<\/title>\n    <style>\n        body {\n            font-family: Arial, sans-serif;\n            text-align: center;\n            margin-top: 50px;\n        }\n        button {\n            margin: 10px;\n            padding: 10px;\n            font-size: 16px;\n        }\n        .flash-icon {\n            display: none;\n            margin-top: 20px;\n        }\n        #result {\n            margin-top: 48px; \/* Approximately 0.5 inches in most cases *\/\n            padding: 10px;\n            width: 300px;\n            height: 50px;\n            font-size: 16px;\n        }\n    <\/style>\n<\/head>\n<body>\n    <h1>Dice Roller<\/h1>\n    <button onclick=\"rollDice(6)\">Roll d6<\/button>\n    <button onclick=\"rollDice(8)\">Roll d8<\/button>\n    <button onclick=\"rollDice(12)\">Roll d12<\/button>\n    <button onclick=\"rollDice(20)\">Roll d20<\/button>\n    <button onclick=\"rollDice(100)\">Roll Percentile<\/button>\n    <button onclick=\"rollThreeD6()\">Roll 3d6<\/button>\n    <input type=\"text\" id=\"result\" readonly>\n    <img decoding=\"async\" id=\"flash-icon\" class=\"flash-icon\" src=\"http:\/\/oidsdnd.com\/wp-content\/uploads\/2025\/02\/ziggy-roll-small.jpg\" alt=\"Flashing Icon\">\n\n    <script>\n        function rollDice(sides) {\n            const result = Math.floor(Math.random() * sides) + 1;\n            document.getElementById('result').value = `You rolled a ${result} on a d${sides}!`;\n\n            if (sides === 100 && result < 30) {\n                flashIcon();\n            } else {\n                hideIcon();\n            }\n        }\n\n        function rollThreeD6() {\n            const result1 = Math.floor(Math.random() * 6) + 1;\n            const result2 = Math.floor(Math.random() * 6) + 1;\n            const result3 = Math.floor(Math.random() * 6) + 1;\n            const total = result1 + result2 + result3;\n            document.getElementById('result').value = `You rolled a total of ${total} with three d6!`;\n        }\n\n        function flashIcon() {\n            const icon = document.getElementById('flash-icon');\n            let flashCount = 0;\n            icon.style.display = 'block';\n            const interval = setInterval(() => {\n                icon.style.display = (icon.style.display === 'block') ? 'none' : 'block';\n                flashCount++;\n                if (flashCount >= 4) {\n                    clearInterval(interval);\n                    icon.style.display = 'none';\n                }\n            }, 500);\n        }\n\n        function hideIcon() {\n            const icon = document.getElementById('flash-icon');\n            icon.style.display = 'none';\n        }\n    <\/script>\n<\/body>\n<\/html>\n\n","protected":false},"excerpt":{"rendered":"<p>Dice Roller Dice Roller Roll d6 Roll d8 Roll d12 Roll d20 Roll Percentile Roll 3d6<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"class_list":["post-219","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/oidsdnd.com\/index.php\/wp-json\/wp\/v2\/pages\/219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oidsdnd.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/oidsdnd.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/oidsdnd.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oidsdnd.com\/index.php\/wp-json\/wp\/v2\/comments?post=219"}],"version-history":[{"count":7,"href":"https:\/\/oidsdnd.com\/index.php\/wp-json\/wp\/v2\/pages\/219\/revisions"}],"predecessor-version":[{"id":232,"href":"https:\/\/oidsdnd.com\/index.php\/wp-json\/wp\/v2\/pages\/219\/revisions\/232"}],"wp:attachment":[{"href":"https:\/\/oidsdnd.com\/index.php\/wp-json\/wp\/v2\/media?parent=219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}