{"id":25565,"date":"2024-10-10T15:30:40","date_gmt":"2024-10-10T06:30:40","guid":{"rendered":"http:\/\/www.tyosuke20xx.com\/blog\/?p=25565"},"modified":"2024-10-10T15:30:42","modified_gmt":"2024-10-10T06:30:42","slug":"%e3%83%89%e3%83%a1%e3%82%a4%e3%83%b3%e5%8f%96%e5%be%97%e3%82%b5%e3%82%a4%e3%83%88-html","status":"publish","type":"post","link":"http:\/\/www.tyosuke20xx.com\/blog\/?p=25565","title":{"rendered":"\u30c9\u30e1\u30a4\u30f3\u53d6\u5f97\u30b5\u30a4\u30c8.html"},"content":{"rendered":"\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!DOCTYPE html>\n&lt;html lang=\"en\">\n&lt;head>\n    &lt;meta charset=\"UTF-8\">\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    &lt;title>Domain Acquisition&lt;\/title>\n    &lt;style>\n        body {\n            font-family: Arial, sans-serif;\n            background-color: #f4f4f4;\n            margin: 0;\n            padding: 0;\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            height: 100vh;\n        }\n        .container {\n            background-color: #fff;\n            padding: 20px;\n            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);\n            border-radius: 8px;\n            text-align: center;\n            width: 100%;\n            max-width: 600px;\n        }\n        h1 {\n            margin-bottom: 20px;\n        }\n        input[type=\"text\"] {\n            width: 80%;\n            padding: 10px;\n            margin: 10px 0;\n            border: 1px solid #ccc;\n            border-radius: 5px;\n            font-size: 16px;\n        }\n        button {\n            padding: 10px 20px;\n            border: none;\n            background-color: #007BFF;\n            color: white;\n            font-size: 16px;\n            border-radius: 5px;\n            cursor: pointer;\n        }\n        button:hover {\n            background-color: #0056b3;\n        }\n        .result {\n            margin-top: 20px;\n        }\n        .loading {\n            display: none;\n            margin-top: 20px;\n        }\n        .domain-list {\n            margin-top: 20px;\n        }\n        .domain-list ul {\n            list-style-type: none;\n            padding: 0;\n        }\n        .domain-list li {\n            background-color: #f9f9f9;\n            margin: 10px 0;\n            padding: 10px;\n            border-radius: 5px;\n            border: 1px solid #ddd;\n            text-align: left;\n            display: flex;\n            justify-content: space-between;\n        }\n        .price {\n            color: green;\n        }\n        .purchase-link {\n            text-decoration: none;\n            background-color: #28a745;\n            color: white;\n            padding: 5px 10px;\n            border-radius: 5px;\n        }\n        .error {\n            color: red;\n            margin-top: 20px;\n        }\n        @media (max-width: 600px) {\n            input[type=\"text\"] {\n                width: 100%;\n            }\n        }\n    &lt;\/style>\n&lt;\/head>\n&lt;body>\n    &lt;div class=\"container\">\n        &lt;h1>Check Domain Availability&lt;\/h1>\n        &lt;form id=\"domain-form\">\n            &lt;input type=\"text\" id=\"domain-name\" placeholder=\"Enter domain name\" required>\n            &lt;button type=\"submit\">Search&lt;\/button>\n        &lt;\/form>\n        &lt;div class=\"loading\" id=\"loading\">\n            &lt;p>Searching...&lt;\/p>\n            &lt;img src=\"https:\/\/i.gifer.com\/ZZ5H.gif\" alt=\"Loading\" width=\"50\">\n        &lt;\/div>\n        &lt;div class=\"result\" id=\"result\">&lt;\/div>\n        &lt;div class=\"error\" id=\"error\">&lt;\/div>\n        &lt;div class=\"domain-list\" id=\"domain-list\">&lt;\/div>\n    &lt;\/div>\n\n    &lt;script>\n        const form = document.getElementById('domain-form');\n        const resultDiv = document.getElementById('result');\n        const loadingDiv = document.getElementById('loading');\n        const errorDiv = document.getElementById('error');\n        const domainListDiv = document.getElementById('domain-list');\n\n        form.addEventListener('submit', function (event) {\n            event.preventDefault();\n\n            const domainName = document.getElementById('domain-name').value.trim();\n\n            \/\/ \u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u30ea\u30bb\u30c3\u30c8\n            resultDiv.innerHTML = '';\n            errorDiv.innerHTML = '';\n            domainListDiv.innerHTML = '';\n            loadingDiv.style.display = 'block'; \/\/ \u30ed\u30fc\u30c7\u30a3\u30f3\u30b0\u8868\u793a\n\n            if (validateDomainName(domainName)) {\n                \/\/ \u30c0\u30df\u30fc\u30c7\u30fc\u30bf\u306e\u4f7f\u7528\u4f8b\uff08\u5b9f\u969b\u306b\u306fAPI\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\uff09\n                setTimeout(() => {\n                    loadingDiv.style.display = 'none'; \/\/ \u30ed\u30fc\u30c7\u30a3\u30f3\u30b0\u7d42\u4e86\n\n                    \/\/ \u691c\u7d22\u7d50\u679c\u306e\u4eee\u8868\u793a\n                    const available = Math.random() > 0.5; \/\/ \u30e9\u30f3\u30c0\u30e0\u306b\u7d50\u679c\u3092\u751f\u6210\n\n                    if (available) {\n                        resultDiv.innerHTML = `&lt;strong>${domainName}&lt;\/strong> is available!`;\n\n                        \/\/ \u4ed6\u306eTLD\u3092\u63d0\u6848\u3057\u3001\u4fa1\u683c\u3068\u8cfc\u5165\u30ea\u30f3\u30af\u3092\u8868\u793a\n                        const suggestions = [\n                            { tld: '.com', price: '$10.99', link: 'https:\/\/buydomain.com\/com' },\n                            { tld: '.net', price: '$9.99', link: 'https:\/\/buydomain.com\/net' },\n                            { tld: '.org', price: '$11.99', link: 'https:\/\/buydomain.com\/org' },\n                            { tld: '.info', price: '$8.99', link: 'https:\/\/buydomain.com\/info' },\n                            { tld: '.co', price: '$12.99', link: 'https:\/\/buydomain.com\/co' }\n                        ];\n                        let domainList = '&lt;ul>';\n                        suggestions.forEach(({ tld, price, link }) => {\n                            domainList += `&lt;li>${domainName}${tld} &lt;span class=\"price\">${price}&lt;\/span> &lt;a href=\"${link}\" target=\"_blank\" class=\"purchase-link\">Buy&lt;\/a>&lt;\/li>`;\n                        });\n                        domainList += '&lt;\/ul>';\n                        domainListDiv.innerHTML = domainList;\n\n                    } else {\n                        resultDiv.innerHTML = `&lt;strong>${domainName}&lt;\/strong> is already taken.`;\n                    }\n\n                }, 2000); \/\/ \u5b9f\u969b\u306eAPI\u3067\u306f\u3053\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u7d50\u679c\u3092\u53d6\u5f97\n            } else {\n                errorDiv.innerHTML = 'Please enter a valid domain name. It should follow the format: example.com';\n                loadingDiv.style.display = 'none'; \/\/ \u30a8\u30e9\u30fc\u6642\u306f\u30ed\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u505c\u6b62\n            }\n        });\n\n        \/\/ \u30c9\u30e1\u30a4\u30f3\u540d\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u95a2\u6570\n        function validateDomainName(domain) {\n            const domainPattern = \/^[a-zA-Z0-9-]{1,63}\\.[a-zA-Z]{2,}$\/;\n            return domainPattern.test(domain);\n        }\n    &lt;\/script>\n&lt;\/body>\n&lt;\/html>\n<\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[80],"tags":[42,3],"class_list":["post-25565","post","type-post","status-publish","format-standard","hentry","category-html","tag-html","tag-programming"],"aioseo_notices":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.tyosuke20xx.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/25565","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.tyosuke20xx.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.tyosuke20xx.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.tyosuke20xx.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.tyosuke20xx.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=25565"}],"version-history":[{"count":1,"href":"http:\/\/www.tyosuke20xx.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/25565\/revisions"}],"predecessor-version":[{"id":25566,"href":"http:\/\/www.tyosuke20xx.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/25565\/revisions\/25566"}],"wp:attachment":[{"href":"http:\/\/www.tyosuke20xx.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=25565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.tyosuke20xx.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=25565"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.tyosuke20xx.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=25565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}