{"id":33,"date":"2025-10-06T15:44:19","date_gmt":"2025-10-06T15:44:19","guid":{"rendered":"https:\/\/nicharu.com\/?page_id=33"},"modified":"2025-10-06T16:21:54","modified_gmt":"2025-10-06T16:21:54","slug":"33-2","status":"publish","type":"page","link":"https:\/\/nicharu.com\/index.php\/33-2\/","title":{"rendered":"\u30ad\u30e3\u30e9\u80b2\u6210\u30b2\u30fc\u30e0"},"content":{"rendered":"<style>\n\/* ====================================\n   CSS: \u30b9\u30bf\u30a4\u30eb\u3068\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\n   ==================================== *\/\n.game-container {\n    text-align: center;\n    font-family: 'Arial', sans-serif;\n    padding: 20px;\n    max-width: 600px;\n    margin: 0 auto;\n    border: 1px solid #ccc;\n    border-radius: 10px;\n    background-color: #f9f9f9;\n}\nh1 {\n    color: #4CAF50;\n}\n#strength {\n    font-size: 2em;\n    font-weight: bold;\n    color: #E91E63;\n}\n#timer {\n    margin-bottom: 20px;\n    font-size: 1.2em;\n}\n.character-area {\n    position: relative;\n    margin: 40px 0;\n    padding: 20px;\n}\n#character {\n    width: 250px; \/* \u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u753b\u50cf\u30b5\u30a4\u30ba *\/\n    height: auto;\n    cursor: pointer;\n    border: 5px solid #FFC107;\n    border-radius: 50%;\n    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n    transition: transform 0.1s; \/* \u30af\u30ea\u30c3\u30af\u6642\u306e\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u7528 *\/\n}\n#character:active {\n    transform: scale(0.95) rotate(5deg); \/* \u30af\u30ea\u30c3\u30af\u6642\u306b\u5c11\u3057\u7e2e\u307f\u3001\u56de\u8ee2 *\/\n}\n#feed-message {\n    position: absolute;\n    top: 50%;\n    left: 50%;\n    transform: translate(-50%, -50%);\n    color: #4CAF50;\n    font-size: 1.5em;\n    font-weight: 900;\n    opacity: 0;\n    pointer-events: none; \/* \u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u30af\u30ea\u30c3\u30af\u3092\u90aa\u9b54\u3057\u306a\u3044\u3088\u3046\u306b *\/\n    text-shadow: 1px 1px 2px white;\n}\n.hidden {\n    display: none !important;\n}\n#game-over-screen {\n    background-color: #ffe0b2;\n    border: 3px solid #FF9800;\n    padding: 30px;\n    border-radius: 15px;\n    margin-top: 20px;\n    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);\n}\n#game-over-screen h2 {\n    color: #D32F2F;\n}\n#game-over-screen p {\n    font-size: 1.1em;\n}\n#game-over-screen button {\n    padding: 10px 20px;\n    font-size: 1.2em;\n    cursor: pointer;\n    background-color: #FF5722;\n    color: white;\n    border: none;\n    border-radius: 5px;\n    margin-top: 15px;\n    transition: background-color 0.3s;\n}\n#game-over-screen button:hover {\n    background-color: #E64A19;\n}\n<\/style>\n<div class=\"game-container\" id=\"game-main\">\n<h1>\u80b2\u6210\u30af\u30ea\u30c3\u30af\u30b2\u30fc\u30e0<\/h1>\n<p>\u76ee\u6a19\u5f37\u3055: 10000<\/p>\n<p>\u5f37\u3055: <span id=\"strength\">0<\/span><\/p>\n<p id=\"timer\">\u30bf\u30a4\u30e0: 0.00 \u79d2<\/p>\n<div class=\"character-area\">\n        <img decoding=\"async\" id=\"character\" src=\"https:\/\/via.placeholder.com\/250\/FFC107\/333333?text=Character\" alt=\"\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\" onclick=\"clickCharacter()\"><\/p>\n<p id=\"feed-message\">+1 \u5f37\u3055\u30a2\u30c3\u30d7\uff01<\/p>\n<\/p><\/div>\n<\/div>\n<div id=\"game-over-screen\" class=\"hidden\">\n<h2>\u30b2\u30fc\u30e0\u30af\u30ea\u30a2\uff01\ud83c\udf89<\/h2>\n<p>\u6700\u7d42\u5f37\u3055: <span id=\"final-strength\"><\/span><\/p>\n<p>\u30af\u30ea\u30a2\u30bf\u30a4\u30e0: <span id=\"clear-time\"><\/span> \u79d2<\/p>\n<hr>\n<h3>\u2728 \u30d9\u30b9\u30c8\u30bf\u30a4\u30e0: <span id=\"best-time\">&#8212;<\/span> \u79d2 \u2728<\/h3>\n<p>    <button onclick=\"resetGame()\">\u3082\u3046\u4e00\u5ea6\u30d7\u30ec\u30a4<\/button>\n<\/div>\n<p><script>\nconst GOAL_STRENGTH = 10000;\nlet strength = 0;\nlet startTime;\nlet timerInterval;\nlet isGameRunning = false;<\/p>\n<p>\/\/ \u30d9\u30b9\u30c8\u30bf\u30a4\u30e0\u306e\u521d\u671f\u30ed\u30fc\u30c9 (localStorage\u304b\u3089)\nlet bestTime = localStorage.getItem('bestTime') || '---';\ndocument.getElementById('best-time').textContent = bestTime;<\/p>\n<p>\/\/ === \u30bf\u30a4\u30de\u30fc\u51e6\u7406 ===\nfunction startTimer() {\n    startTime = Date.now();\n    isGameRunning = true;\n    timerInterval = setInterval(updateTimer, 100);\n}<\/p>\n<p>function updateTimer() {\n    if (isGameRunning) {\n        const elapsedTime = (Date.now() - startTime) \/ 1000;\n        document.getElementById('timer').textContent = `\u30bf\u30a4\u30e0: ${elapsedTime.toFixed(2)} \u79d2`;\n    }\n}<\/p>\n<p>function stopTimer() {\n    clearInterval(timerInterval);\n    isGameRunning = false;\n}<\/p>\n<p>\/\/ === \u30af\u30ea\u30c3\u30af\u51e6\u7406 (\u30e1\u30a4\u30f3\u95a2\u6570) ===\nfunction clickCharacter() {\n    if (strength >= GOAL_STRENGTH) return; \/\/ \u30af\u30ea\u30a2\u5f8c\u306f\u30af\u30ea\u30c3\u30af\u7121\u52b9<\/p>\n<p>    if (!isGameRunning) {\n        startTimer(); \/\/ \u6700\u521d\u306e\u30af\u30ea\u30c3\u30af\u3067\u30bf\u30a4\u30de\u30fc\u3092\u30b9\u30bf\u30fc\u30c8\n    }<\/p>\n<p>    strength++;\n    document.getElementById('strength').textContent = strength;\n    showFeedMessage();<\/p>\n<p>    if (strength === GOAL_STRENGTH) {\n        gameOver();\n    }\n}<\/p>\n<p>\/\/ === \u30d5\u30a3\u30fc\u30c9\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3 ===\nfunction showFeedMessage() {\n    const messageElement = document.getElementById('feed-message');\n    \/\/ \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u30ea\u30bb\u30c3\u30c8\u3057\u3001\u958b\u59cb\u4f4d\u7f6e\u306b\u8a2d\u5b9a\n    messageElement.style.transition = 'none';\n    messageElement.style.opacity = 1;\n    messageElement.style.transform = 'translate(-50%, 0%)'; \/\/ \u958b\u59cb\u4f4d\u7f6e (\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3088\u308a\u5c11\u3057\u4e0b)<\/p>\n<p>    \/\/ \u5f37\u5236\u7684\u306b\u518d\u63cf\u753b (\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u30ea\u30bb\u30c3\u30c8\u3092\u9069\u7528\u3055\u305b\u308b\u305f\u3081)\n    void messageElement.offsetWidth;<\/p>\n<p>    \/\/ \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u9069\u7528\n    messageElement.style.transition = 'opacity 0.6s ease-out, transform 0.6s ease-out';\n    messageElement.style.opacity = 0;\n    messageElement.style.transform = 'translate(-50%, -100%)'; \/\/ \u7d42\u4e86\u4f4d\u7f6e (\u4e0a\u3078\u30d5\u30a7\u30fc\u30c9\u30a2\u30a6\u30c8)\n}<\/p>\n<p>\/\/ === \u30b2\u30fc\u30e0\u30af\u30ea\u30a2\u51e6\u7406 ===\nfunction gameOver() {\n    stopTimer();\n    const finalTime = (Date.now() - startTime) \/ 1000;\n    const finalTimeRounded = finalTime.toFixed(2);<\/p>\n<p>    document.getElementById('final-strength').textContent = GOAL_STRENGTH;\n    document.getElementById('clear-time').textContent = finalTimeRounded;<\/p>\n<p>    \/\/ \u30d9\u30b9\u30c8\u30bf\u30a4\u30e0\u306e\u66f4\u65b0\u3068\u4fdd\u5b58\n    let currentBestTime = localStorage.getItem('bestTime');\n    if (currentBestTime === null || finalTime < parseFloat(currentBestTime)) {\n        localStorage.setItem('bestTime', finalTimeRounded);\n        document.getElementById('best-time').textContent = finalTimeRounded;\n    } else {\n        document.getElementById('best-time').textContent = currentBestTime;\n    }\n\n    \/\/ \u753b\u9762\u306e\u5207\u308a\u66ff\u3048\n    document.getElementById('game-main').classList.add('hidden');\n    document.getElementById('game-over-screen').classList.remove('hidden');\n}\n\n\/\/ === \u30b2\u30fc\u30e0\u30ea\u30bb\u30c3\u30c8 ===\nfunction resetGame() {\n    strength = 0;\n    document.getElementById('strength').textContent = strength;\n    document.getElementById('timer').textContent = '\u30bf\u30a4\u30e0: 0.00 \u79d2';\n    \n    \/\/ \u30d9\u30b9\u30c8\u30bf\u30a4\u30e0\u3092\u518d\u30ed\u30fc\u30c9\n    let currentBestTime = localStorage.getItem('bestTime') || '---';\n    document.getElementById('best-time').textContent = currentBestTime;\n\n    \/\/ \u753b\u9762\u306e\u5207\u308a\u66ff\u3048\n    document.getElementById('game-main').classList.remove('hidden');\n    document.getElementById('game-over-screen').classList.add('hidden');\n\n    \/\/ \u6b21\u306e\u30af\u30ea\u30c3\u30af\u3067\u30bf\u30a4\u30de\u30fc\u304c\u30b9\u30bf\u30fc\u30c8\u3059\u308b\u72b6\u614b\u306b\u623b\u308b\n}\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u80b2\u6210\u30af\u30ea\u30c3\u30af\u30b2\u30fc\u30e0 \u76ee\u6a19\u5f37\u3055: 10000 \u5f37\u3055: 0 \u30bf\u30a4\u30e0: 0.00 \u79d2 +1 \u5f37\u3055\u30a2\u30c3\u30d7\uff01 \u30b2\u30fc\u30e0\u30af\u30ea\u30a2\uff01\ud83c\udf89 \u6700\u7d42\u5f37\u3055: \u30af\u30ea\u30a2\u30bf\u30a4\u30e0: \u79d2 \u2728 \u30d9\u30b9\u30c8\u30bf\u30a4\u30e0: &#8212; \u79d2 \u2728 \u3082\u3046\u4e00\u5ea6\u30d7\u30ec\u30a4<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-33","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/nicharu.com\/index.php\/wp-json\/wp\/v2\/pages\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nicharu.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/nicharu.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/nicharu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nicharu.com\/index.php\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":14,"href":"https:\/\/nicharu.com\/index.php\/wp-json\/wp\/v2\/pages\/33\/revisions"}],"predecessor-version":[{"id":48,"href":"https:\/\/nicharu.com\/index.php\/wp-json\/wp\/v2\/pages\/33\/revisions\/48"}],"wp:attachment":[{"href":"https:\/\/nicharu.com\/index.php\/wp-json\/wp\/v2\/media?parent=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}