{"id":958,"date":"2025-12-20T13:54:59","date_gmt":"2025-12-20T05:54:59","guid":{"rendered":"https:\/\/liyangyi.com\/?page_id=958"},"modified":"2025-12-20T13:54:59","modified_gmt":"2025-12-20T05:54:59","slug":"daily-english-writing","status":"publish","type":"page","link":"https:\/\/liyangyi.com\/index.php\/daily-english-writing\/","title":{"rendered":"Daily English Writing"},"content":{"rendered":"    <style>\n        .writing-container { max-width: 600px; margin: 20px auto; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif; border: 1px solid #e0e0e0; padding: 25px; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); background: #fff; }\n        .writing-field { margin-bottom: 20px; }\n        .writing-field label { display: block; font-weight: 600; margin-bottom: 8px; color: #333; }\n        .writing-field input, .writing-field textarea { width: 100%; padding: 12px; border: 2px solid #eee; border-radius: 8px; font-size: 16px; transition: border-color 0.3s; box-sizing: border-box; line-height: 1.6; }\n        .writing-field textarea:focus { border-color: #0073aa; outline: none; }\n\n        \/* \u62fc\u5199\u9519\u8bef\u63d0\u793a\u8f85\u52a9\u6837\u5f0f *\/\n        .spellcheck-hint { font-size: 12px; color: #666; margin-top: 4px; display: block; }\n\n        .word-count-wrapper { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; font-size: 14px; }\n        #word-counter { font-weight: bold; color: #d63638; }\n        #word-counter.goal-met { color: #00a32a; }\n        .count-hint { color: #666; }\n\n        .writing-submit { background: #0073aa; color: white; padding: 14px; border: none; border-radius: 8px; cursor: pointer; font-size: 16px; width: 100%; font-weight: bold; transition: background 0.3s; margin-top: 10px; }\n        .writing-submit:disabled { background: #ccc; cursor: not-allowed; }\n\n        .writing-success { color: #00a32a; background: #ecf7ed; padding: 15px; border-radius: 8px; margin-bottom: 20px; text-align: center; border: 1px solid #00a32a; }\n        .autosave-msg { font-size: 11px; color: #999; text-align: right; margin-top: 5px; }\n    <\/style>\n\n    <div class=\"writing-container\">\n        \n        <form id=\"writingForm\" action=\"https:\/\/liyangyi.com\/wp-admin\/admin-post.php\" method=\"post\">\n            <input type=\"hidden\" name=\"action\" value=\"submit_writing_action\">\n            <input type=\"hidden\" id=\"writing_nonce\" name=\"writing_nonce\" value=\"19dc523e52\" \/><input type=\"hidden\" name=\"_wp_http_referer\" value=\"\/index.php\/wp-json\/wp\/v2\/pages\/958\" \/>\n            <div class=\"writing-field\">\n                <label for=\"title\">Topic \/ Title (\u4e3b\u9898)<\/label>\n                <input type=\"text\" name=\"writing_title\" id=\"title\" required placeholder=\"What are you writing about today?\">\n            <\/div>\n\n            <div class=\"writing-field\">\n                <label for=\"content\">English Content (\u82f1\u6587\u6b63\u6587)<\/label>\n                <textarea name=\"writing_content\" id=\"writing_content\" rows=\"12\" required\n                          spellcheck=\"true\" lang=\"en\"\n                          placeholder=\"Type your story here...\"><\/textarea>\n                <small class=\"spellcheck-hint\">\ud83d\udca1 Red wavy lines mean spelling mistakes. Right-click to fix! (\u7ea2\u8272\u6ce2\u6d6a\u7ebf\u8868\u793a\u62fc\u5199\u9519\u8bef\uff0c\u53f3\u952e\u53ef\u4fee\u6b63)<\/small>\n\n                <div class=\"word-count-wrapper\">\n                    <span class=\"count-hint\">Words: <span id=\"word-counter\">0<\/span> \/ 80<\/span>\n                    <span id=\"submit-msg\" style=\"color:#d63638; font-size:12px;\">Need more words to send<\/span>\n                <\/div>\n                <div id=\"autosave-status\" class=\"autosave-msg\"><\/div>\n            <\/div>\n\n            <button type=\"submit\" id=\"submit_btn\" class=\"writing-submit\" disabled>Send to Parents<\/button>\n        <\/form>\n    <\/div>\n\n    <script>\n    document.addEventListener('DOMContentLoaded', function() {\n        const titleInput = document.getElementById('title');\n        const textarea = document.getElementById('writing_content');\n        const counter = document.getElementById('word-counter');\n        const submitBtn = document.getElementById('submit_btn');\n        const submitMsg = document.getElementById('submit-msg');\n        const autosaveStatus = document.getElementById('autosave-status');\n\n        \/\/ --- 1. \u6062\u590d\u81ea\u52a8\u4fdd\u5b58\u7684\u5185\u5bb9 ---\n        if (localStorage.getItem('writing_title')) titleInput.value = localStorage.getItem('writing_title');\n        if (localStorage.getItem('writing_content')) {\n            textarea.value = localStorage.getItem('writing_content');\n            updateCount(); \/\/ \u6062\u590d\u540e\u66f4\u65b0\u4e00\u6b21\u8ba1\u5b57\n        }\n\n        \/\/ --- 2. \u8ba1\u5b57\u903b\u8f91\u4e0e\u81ea\u52a8\u4fdd\u5b58 ---\n        function updateCount() {\n            const text = textarea.value.trim();\n            const words = text ? text.split(\/\\s+\/).filter(word => word.length > 0).length : 0;\n            counter.innerText = words;\n\n            \/\/ \u5b57\u6570\u8fbe\u6807\u903b\u8f91\n            if (words >= 80) {\n                counter.classList.add('goal-met');\n                submitBtn.disabled = false;\n                submitMsg.style.display = 'none';\n                counter.innerHTML = words + ' \u2705 Done!';\n            } else {\n                counter.classList.remove('goal-met');\n                submitBtn.disabled = true;\n                submitMsg.style.display = 'inline';\n                submitMsg.innerText = 'Need ' + (80 - words) + ' more words';\n            }\n\n            \/\/ \u5b58\u5165\u672c\u5730\u7f13\u5b58\n            localStorage.setItem('writing_title', titleInput.value);\n            localStorage.setItem('writing_content', textarea.value);\n            autosaveStatus.innerText = 'Draft saved at ' + new Date().toLocaleTimeString();\n        }\n\n        textarea.addEventListener('input', updateCount);\n        titleInput.addEventListener('input', updateCount);\n\n        \/\/ --- 3. \u63d0\u4ea4\u540e\u6e05\u9664\u7f13\u5b58 ---\n        document.getElementById('writingForm').onsubmit = function() {\n            localStorage.removeItem('writing_title');\n            localStorage.removeItem('writing_content');\n        };\n    });\n    <\/script>\n    \n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-958","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/liyangyi.com\/index.php\/wp-json\/wp\/v2\/pages\/958","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liyangyi.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/liyangyi.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/liyangyi.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/liyangyi.com\/index.php\/wp-json\/wp\/v2\/comments?post=958"}],"version-history":[{"count":1,"href":"https:\/\/liyangyi.com\/index.php\/wp-json\/wp\/v2\/pages\/958\/revisions"}],"predecessor-version":[{"id":959,"href":"https:\/\/liyangyi.com\/index.php\/wp-json\/wp\/v2\/pages\/958\/revisions\/959"}],"wp:attachment":[{"href":"https:\/\/liyangyi.com\/index.php\/wp-json\/wp\/v2\/media?parent=958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}