{"id":14686,"date":"2025-04-01T10:45:04","date_gmt":"2025-04-01T07:45:04","guid":{"rendered":"https:\/\/technodar.group\/?page_id=14686"},"modified":"2025-04-01T11:04:20","modified_gmt":"2025-04-01T08:04:20","slug":"golosovalka-za-slogan-dlya-marifleet-npo-tehnodar","status":"publish","type":"page","link":"https:\/\/technodar.group\/en\/golosovalka-za-slogan-dlya-marifleet-npo-tehnodar\/","title":{"rendered":"\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u043a\u0430 \u0437\u0430 \u0441\u043b\u043e\u0433\u0430\u043d \u0434\u043b\u044f marifleet (\u041d\u041f\u041e \u0422\u0435\u0445\u043d\u043e\u0434\u0430\u0440)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0432\u0430\u0448\u0438 \u0424\u0418\u041e. \u041f\u0440\u043e\u0439\u0434\u0438\u0442\u0435 \u0442\u0435\u0441\u0442 &#8212; \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u0432 \u0433\u0443\u0433\u043b-\u0442\u0430\u0431\u043b\u0438\u0446\u0443.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u0432\u044b \u043f\u0440\u0438\u043d\u044f\u043b\u0438 \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0432 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0438 \u0437\u0430 \u0441\u043b\u043e\u0433\u0430\u043d \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u041d\u041f\u041e \u0422\u0435\u0445\u043d\u043e\u0434\u0430\u0440!<\/p>\n\n\n\n<!DOCTYPE html>\n<html lang=\"ru\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430 \u0441\u043b\u043e\u0433\u0430\u043d<\/title>\n    <style>\n        body { font-family: Arial, sans-serif; text-align: center; padding: 20px; }\n        .container { max-width: 600px; margin: auto; }\n        .slogan { font-size: 20px; margin: 20px 0; padding: 10px; border: 1px solid #ddd; border-radius: 5px; }\n        .btn { padding: 10px 20px; margin: 10px; font-size: 16px; cursor: pointer; }\n        .btn:disabled { background-color: #ccc; cursor: not-allowed; }\n        #nameInput { padding: 8px; width: 80%; margin-bottom: 15px; }\n    <\/style>\n<\/head>\n<body>\n    <div class=\"container\">\n        <h2>\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043b\u043e\u0433\u0430\u043d<\/h2>\n        <input type=\"text\" id=\"nameInput\" placeholder=\"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0432\u0430\u0448\u0435 \u0424\u0418\u041e\" required>\n        <div id=\"slogan1\" class=\"slogan\"><\/div>\n        <div id=\"slogan2\" class=\"slogan\"><\/div>\n        <button class=\"btn\" onclick=\"vote(1)\">\u0412\u044b\u0431\u0440\u0430\u0442\u044c 1<\/button>\n        <button class=\"btn\" onclick=\"vote(2)\">\u0412\u044b\u0431\u0440\u0430\u0442\u044c 2<\/button>\n        <h3 id=\"result\"><\/h3>\n    <\/div>\n    \n    <script>\n        let slogans = [\n            \"\u0418\u043d\u043d\u043e\u0432\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0444\u043b\u043e\u0442\u0430 \u043d\u043e\u0432\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.\",\n            \"\u0412\u0430\u0448 \u043d\u0430\u0432\u0438\u0433\u0430\u0442\u043e\u0440 \u0432 \u043c\u0438\u0440\u0435 \u0443\u043c\u043d\u043e\u0433\u043e \u0441\u0443\u0434\u043e\u0445\u043e\u0434\u0441\u0442\u0432\u0430.\",\n            \"\u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0434\u043b\u044f \u0444\u043b\u043e\u0442\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e.\",\n            \"\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0443\u0434\u043d\u0430 \u0441 \u0422\u0435\u0445\u043d\u043e\u0434\u0430\u0440.\",\n            \"\u0426\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0443\u0434\u043e\u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430.\",\n            \"\u0418\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0444\u043b\u043e\u0442\u0430.\",\n            \"\u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0434\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043c\u043e\u0440\u0435.\",\n            \"\u0418\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043c\u043e\u0440\u0441\u043a\u043e\u0439 \u043e\u0442\u0440\u0430\u0441\u043b\u0438.\",\n            \"\u041f\u0435\u0440\u0435\u0434\u043e\u0432\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0434\u043b\u044f \u043c\u043e\u0440\u0441\u043a\u043e\u0433\u043e \u0431\u0438\u0437\u043d\u0435\u0441\u0430.\",\n            \"\u0426\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u0443\u0434\u043e\u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u0432.\",\n            \"\u0418\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u043b\u043e\u0442\u043e\u043c.\",\n            \"\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0441\u0443\u0434\u043d\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.\",\n            \"\u0418\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0434\u043b\u044f \u0441\u0443\u0434\u043e\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u043d\u043e\u0432\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.\",\n            \"\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0443\u0434\u043e\u0445\u043e\u0434\u0441\u0442\u0432\u0430 \u2014 \u043e\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e.\",\n\t\t\t\"\u0414\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u2014 \u0432\u0430\u0448\u0435 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e!\",\n\t\t\t\"\u0428\u0430\u0433\u043d\u0438\u0442\u0435 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u0435 \u0441 \u043d\u0430\u043c\u0438.\",\n\t\t\t\"\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0442\u043e\u0447\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439\",\n\t\t\t\"\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0442\u043e\u043f\u043b\u0438\u0432\u0430 \u2013 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0442\u0440\u0430\u0442\u0430\u043c\u0438\",\n\n        ];\n\n        let scores = Array(slogans.length).fill(0);\n        let rounds = 18;\n        let currentRound = 0;\n        let usedPairs = new Set();\n        let currentPair;\n        let userName = \"\";\n\n        async function sendWinnerToGoogleSheet(name, winner) {\n            const scriptURL = 'https:\/\/script.google.com\/macros\/s\/AKfycbzP1U8NYuMSnHgInUvCbl2emsPEojUnUNsTDAe0UT_9YhX5i408nPMVqAZeKV7BYGxs\/exec'; \/\/ \u0417\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 URL\n            \n            try {\n                const formData = new FormData();\n                formData.append('name', name);\n                formData.append('slogan', \"\u041f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044c: \" + winner);\n\n                const response = await fetch(scriptURL, {\n                    method: 'POST',\n                    body: formData\n                });\n                \n                console.log('\u041f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043d!');\n            } catch (error) {\n                console.error('\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044f:', error);\n            }\n        }\n\n        function getNextPair() {\n            if (usedPairs.size >= (slogans.length * (slogans.length - 1)) \/ 2) {\n                usedPairs.clear();\n            }\n\n            let pair;\n            do {\n                let idx1 = Math.floor(Math.random() * slogans.length);\n                let idx2;\n                do {\n                    idx2 = Math.floor(Math.random() * slogans.length);\n                } while (idx1 === idx2);\n                pair = [idx1, idx2].sort().toString();\n            } while (usedPairs.has(pair));\n\n            usedPairs.add(pair);\n            return pair.split(',').map(Number);\n        }\n\n        function showPair() {\n            currentPair = getNextPair();\n            document.getElementById('slogan1').innerText = slogans[currentPair[0]];\n            document.getElementById('slogan2').innerText = slogans[currentPair[1]];\n        }\n\n        function vote(choice) {\n            userName = document.getElementById('nameInput').value.trim();\n            if (!userName) {\n                alert(\"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0432\u0430\u0448\u0435 \u0424\u0418\u041e!\");\n                return;\n            }\n\n            scores[currentPair[choice - 1]]++;\n            currentRound++;\n            \n            if (currentRound >= rounds) {\n                showWinner();\n            } else {\n                showPair();\n            }\n        }\n\n        function showWinner() {\n            let maxScore = Math.max(...scores);\n            let winners = slogans.filter((_, index) => scores[index] === maxScore);\n\n            let winner;\n            if (winners.length > 1) {\n                winner = winners[Math.floor(Math.random() * winners.length)];\n            } else {\n                winner = winners[0];\n            }\n\n            const winnerText = \"\u041f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044c: \" + winner;\n            document.getElementById('result').innerText = winnerText;\n            document.querySelectorAll('.btn').forEach(btn => btn.disabled = true);\n            \n            \/\/ \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443\n            sendWinnerToGoogleSheet(userName, winner);\n        }\n\n        if (slogans.length >= 2) {\n            showPair();\n        } else {\n            document.getElementById('result').innerText = \"\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u043e\u0433\u0430\u043d\u043e\u0432 \u0434\u043b\u044f \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u044f.\";\n        }\n    <\/script>\n<\/body>\n<\/html>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0432\u0430\u0448\u0438 \u0424\u0418\u041e. \u041f\u0440\u043e\u0439\u0434\u0438\u0442\u0435 \u0442\u0435\u0441\u0442 &#8212; \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u0432 \u0433\u0443\u0433\u043b-\u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u0432\u044b \u043f\u0440\u0438\u043d\u044f\u043b\u0438 \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0432 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0438 \u0437\u0430 \u0441\u043b\u043e\u0433\u0430\u043d \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u041d\u041f\u041e \u0422\u0435\u0445\u043d\u043e\u0434\u0430\u0440! \u0413\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430 \u0441\u043b\u043e\u0433\u0430\u043d \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043b\u043e\u0433\u0430\u043d \u0412\u044b\u0431\u0440\u0430\u0442\u044c 1 \u0412\u044b\u0431\u0440\u0430\u0442\u044c 2<\/p>","protected":false},"author":19,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-14686","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/technodar.group\/en\/wp-json\/wp\/v2\/pages\/14686","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/technodar.group\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/technodar.group\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/technodar.group\/en\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/technodar.group\/en\/wp-json\/wp\/v2\/comments?post=14686"}],"version-history":[{"count":0,"href":"https:\/\/technodar.group\/en\/wp-json\/wp\/v2\/pages\/14686\/revisions"}],"wp:attachment":[{"href":"https:\/\/technodar.group\/en\/wp-json\/wp\/v2\/media?parent=14686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}