{"id":32,"date":"2026-05-22T16:34:20","date_gmt":"2026-05-22T16:34:20","guid":{"rendered":"https:\/\/tinbamien.com\/?page_id=32"},"modified":"2026-05-22T16:34:20","modified_gmt":"2026-05-22T16:34:20","slug":"32-2","status":"publish","type":"page","link":"https:\/\/tinbamien.com\/?page_id=32","title":{"rendered":""},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"vi\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Cloud Data Pro<\/title>\n    <script src=\"https:\/\/cdn.tailwindcss.com\"><\/script>\n    <style>\n        body { background: #f1f5f9; font-family: system-ui, sans-serif; }\n        .card { background: white; border-radius: 1rem; border: 1px solid #e2e8f0; }\n        .btn-primary { background: #2563eb; transition: transform 0.1s; }\n        .btn-primary:active { transform: scale(0.98); }\n        textarea { width: 100%; height: 250px; padding: 1rem; border: 1px solid #e2e8f0; border-radius: 0.75rem; outline: none; }\n        textarea:focus { border-color: #2563eb; }\n    <\/style>\n<\/head>\n<body class=\"p-4\">\n    <div class=\"max-w-md mx-auto\">\n        <div class=\"flex justify-between items-center mb-4\">\n            <span class=\"text-xs font-bold text-slate-500 uppercase tracking-widest\">Cloud Sync: <span id=\"sync-status\">\u0110ang t\u1ea3i&#8230;<\/span><\/span>\n            <span id=\"item-count\" class=\"text-xs font-bold bg-slate-200 px-2 py-1 rounded\">0 m\u1ee5c<\/span>\n        <\/div>\n\n        <div class=\"card p-4 mb-4\">\n            <textarea id=\"input-list\" placeholder=\"Nh\u1eadp d\u1eef li\u1ec7u:&#10;1. N\u1ed9i dung... | M\u00e3&#10;2. N\u1ed9i dung... | M\u00e3\"><\/textarea>\n            <button id=\"next-btn\" class=\"w-full mt-3 text-white font-bold py-3 rounded-lg btn-primary\">TR\u00cdCH XU\u1ea4T NG\u1eaaU NHI\u00caN<\/button>\n        <\/div>\n\n        <div id=\"result-area\" class=\"card p-5 hidden animate-in fade-in duration-300\">\n            <p class=\"text-[10px] text-slate-400 font-bold uppercase mb-1\">N\u1ed9i dung:<\/p>\n            <div id=\"content-display\" class=\"text-sm font-medium text-slate-800 whitespace-pre-wrap mb-2\"><\/div>\n            <button onclick=\"copyContent()\" class=\"w-full bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold py-1.5 rounded-lg text-xs mb-4 transition\">CH\u00c9P N\u1ed8I DUNG<\/button>\n            \n            <p class=\"text-[10px] text-slate-400 font-bold uppercase mb-1\">M\u00e3:<\/p>\n            <div id=\"code-display\" class=\"text-lg font-black text-emerald-600 bg-emerald-50 p-2 rounded-lg text-center mb-2\"><\/div>\n            <button onclick=\"copyCode()\" class=\"w-full bg-emerald-600 hover:bg-emerald-700 text-white font-bold py-1.5 rounded-lg text-xs transition\">CH\u00c9P M\u00c3<\/button>\n        <\/div>\n    <\/div>\n\n    <script type=\"module\">\n        import { initializeApp } from \"https:\/\/www.gstatic.com\/firebasejs\/11.0.1\/firebase-app.js\";\n        import { getFirestore, doc, setDoc, onSnapshot } from \"https:\/\/www.gstatic.com\/firebasejs\/11.0.1\/firebase-firestore.js\";\n\n        const firebaseConfig = {\n            apiKey: \"AIzaSyAJpoRBDXNKOdP2oxzIH1W52hvipCEQdn4\",\n            projectId: \"nams-10e14\",\n            storageBucket: \"nams-10e14.firebasestorage.app\",\n            messagingSenderId: \"153250500161\",\n            appId: \"1:153250500161:web:cb98d359d10c2a873840c0\"\n        };\n\n        const app = initializeApp(firebaseConfig);\n        const db = getFirestore(app);\n        const APP_ID = 'data-manager-nams-v2';\n\n        const textarea = document.getElementById('input-list');\n        const countEl = document.getElementById('item-count');\n\n        const parseData = () => {\n            const text = textarea.value;\n            const regex = \/\\d+\\.\\s*([\\s\\S]*?)\\|([\\s\\S]*?)(?=\\n\\s*\\d+\\.|$)\/g;\n            return [...text.matchAll(regex)];\n        };\n\n        const updateCount = () => {\n            const matches = parseData();\n            countEl.innerText = `${matches.length} m\u1ee5c`;\n        };\n\n        onSnapshot(doc(db, 'data', APP_ID), (snap) => {\n            if (snap.exists() && document.activeElement !== textarea) {\n                textarea.value = snap.data().text || '';\n                updateCount();\n                document.getElementById('sync-status').innerText = '\u0110\u00e3 \u0111\u1ed3ng b\u1ed9';\n            }\n        });\n\n        textarea.oninput = () => {\n            updateCount();\n            setDoc(doc(db, 'data', APP_ID), { text: textarea.value }, { merge: true });\n        };\n\n        document.getElementById('next-btn').onclick = () => {\n            const matches = parseData();\n            if (matches.length === 0) return alert(\"Ch\u01b0a c\u00f3 d\u1eef li\u1ec7u h\u1ee3p l\u1ec7 (ph\u1ea3i c\u00f3 d\u1ea1ng 1. N\u1ed9i dung|M\u00e3)\");\n\n            const randomMatch = matches[Math.floor(Math.random() * matches.length)];\n            document.getElementById('content-display').innerText = randomMatch[1].trim();\n            document.getElementById('code-display').innerText = randomMatch[2].trim();\n            document.getElementById('result-area').classList.remove('hidden');\n        };\n\n        window.copyContent = () => {\n            const content = document.getElementById('content-display').innerText;\n            navigator.clipboard.writeText(content).then(() => alert(\"\u0110\u00e3 ch\u00e9p n\u1ed9i dung!\"));\n        };\n\n        window.copyCode = () => {\n            const code = document.getElementById('code-display').innerText;\n            navigator.clipboard.writeText(code).then(() => alert(\"\u0110\u00e3 ch\u00e9p m\u00e3!\"));\n        };\n    <\/script>\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Cloud Data Pro Cloud Sync: \u0110ang t\u1ea3i&#8230; 0 m\u1ee5c TR\u00cdCH XU\u1ea4T NG\u1eaaU NHI\u00caN N\u1ed9i dung: CH\u00c9P N\u1ed8I DUNG M\u00e3: CH\u00c9P M\u00c3<\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-32","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/tinbamien.com\/index.php?rest_route=\/wp\/v2\/pages\/32","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tinbamien.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/tinbamien.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/tinbamien.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tinbamien.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=32"}],"version-history":[{"count":2,"href":"https:\/\/tinbamien.com\/index.php?rest_route=\/wp\/v2\/pages\/32\/revisions"}],"predecessor-version":[{"id":34,"href":"https:\/\/tinbamien.com\/index.php?rest_route=\/wp\/v2\/pages\/32\/revisions\/34"}],"wp:attachment":[{"href":"https:\/\/tinbamien.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}