{"id":38,"date":"2026-01-04T16:07:02","date_gmt":"2026-01-04T16:07:02","guid":{"rendered":"https:\/\/ingelical.com\/?page_id=38"},"modified":"2026-01-04T16:18:31","modified_gmt":"2026-01-04T16:18:31","slug":"hiragana","status":"publish","type":"page","link":"https:\/\/ingelical.com\/index.php\/hiragana\/","title":{"rendered":"Hiragana"},"content":{"rendered":"\n\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>Hiragana App<\/title>\n    <style>\n        body {{\n            display: flex;\n            flex-direction: column;\n            height: 100vh;\n            margin: 0;\n            font-family: Arial, sans-serif;\n        }}\n        .input-area {{\n            flex: 1;\n            padding: 20px;\n            overflow-y: auto;\n        }}\n        .game {{\n            margin-bottom: 20px;\n            text-align: center;\n        }}\n        .char {{\n            font-size: 3em;\n            margin-bottom: 10px;\n        }}\n        input {{\n            font-size: 1.5em;\n            padding: 10px;\n            width: 200px;\n        }}\n    <\/style>\n<\/head>\n<body>\n    <div class=\"input-area\">\n    <\/div>\n    <script>\n        \/\/ Hiragana dictionary: romanji to hiragana characters\n        const hiragana = {\n            'a':'\u3042','i':'\u3044','u':'\u3046','e':'\u3048','o':'\u304a',\n            'ka':'\u304b','ki':'\u304d','ku':'\u304f','ke':'\u3051','ko':'\u3053',\n            'sa':'\u3055','shi':'\u3057','su':'\u3059','se':'\u305b','so':'\u305d',\n            'ta':'\u305f','chi':'\u3061','tsu':'\u3064','te':'\u3066','to':'\u3068',\n            'na':'\u306a','ni':'\u306b','nu':'\u306c','ne':'\u306d','no':'\u306e',\n            'ha':'\u306f','hi':'\u3072','hu':'\u3075','he':'\u3078','ho':'\u307b',\n            'ma':'\u307e','mi':'\u307f','mu':'\u3080','me':'\u3081','mo':'\u3082',\n            'ya':'\u3084','yu':'\u3086','yo':'\u3088',\n            'ra':'\u3089','ri':'\u308a','ru':'\u308b','re':'\u308c','ro':'\u308d',\n            'wa':'\u308f','wo':'\u3092',\n            'n':'\u3093'\n        };\n\n        let gameCount = 1; \/\/ Counter for game IDs\n\n        \/\/ Returns a random hiragana character and its romanji\n        function getRandomHiragana() {\n            const keys = Object.keys(hiragana);\n            const randomKey = keys[Math.floor(Math.random() * keys.length)];\n            return { char: hiragana[randomKey], romanji: randomKey };\n        }\n\n        \/\/ Creates a new game section with hiragana, input, and feedback\n        function createGame() {\n            const random = getRandomHiragana();\n            const inputArea = document.querySelector('.input-area');\n            const gameDiv = document.createElement('div');\n            gameDiv.className = 'game';\n            \/\/ Display the hiragana character\n            const charDiv = document.createElement('div');\n            charDiv.className = 'char';\n            charDiv.textContent = random.char;\n            gameDiv.appendChild(charDiv);\n            \/\/ Input field for guess\n            const input = document.createElement('input');\n            input.type = 'text';\n            input.id = 'guess' + gameCount;\n            input.placeholder = 'Enter romanji';\n            gameDiv.appendChild(input);\n            \/\/ Feedback div for results\n            const feedback = document.createElement('div');\n            feedback.id = 'feedback' + gameCount;\n            feedback.style.marginTop = '10px';\n            feedback.style.fontSize = '1.2em';\n            gameDiv.appendChild(feedback);\n            inputArea.appendChild(gameDiv);\n            \/\/ Add Enter key listener to input\n            input.addEventListener('keypress', (event) => {\n                if (event.key === 'Enter') checkGuess(gameCount, random.romanji);\n            });\n            return random.romanji;\n        }\n\n        \/\/ Checks the guess, displays feedback, and creates the next game\n        function checkGuess(gameId, correct) {\n            const guess = document.getElementById('guess' + gameId).value.trim().toLowerCase();\n            const feedback = document.getElementById('feedback' + gameId);\n            feedback.textContent = guess === correct ? 'Correct!' : 'Incorrect. The correct answer is: ' + correct;\n            feedback.style.color = guess === correct ? 'green' : 'red';\n            gameCount++; \/\/ Increment for next game\n            createGame(); \/\/ Add new game below\n        }\n\n        \/\/ Initialize the first game on page load\n        window.onload = () => createGame();\n    <\/script>\n<\/body>\n<\/html>&#8220;&#8216;\n\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hiragana App &#8220;&#8216;<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-38","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ingelical.com\/index.php\/wp-json\/wp\/v2\/pages\/38","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ingelical.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ingelical.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ingelical.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ingelical.com\/index.php\/wp-json\/wp\/v2\/comments?post=38"}],"version-history":[{"count":3,"href":"https:\/\/ingelical.com\/index.php\/wp-json\/wp\/v2\/pages\/38\/revisions"}],"predecessor-version":[{"id":43,"href":"https:\/\/ingelical.com\/index.php\/wp-json\/wp\/v2\/pages\/38\/revisions\/43"}],"wp:attachment":[{"href":"https:\/\/ingelical.com\/index.php\/wp-json\/wp\/v2\/media?parent=38"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}