PageSourceSearch

https://dc-tools.cc/assets/TextSocialPostCounterTool-DdHPYunT.js

js dc-tools.cc collected 2026-10-02 01:20:04 UTC 3,312 bytes, 1 lines download raw bytes

1import{r as n,j as e}from"./index-Cp6oVmJn.js";import{T as w}from"./ToolSeoSection-RrG1c4TM.js";import{g as E,r as R}from"./generatedTextTransforms-DWxAXewb.js";/* empty css                     */const p="text_social_post_counter",B={name:"text"},y=[],T={},N={zh:{title:"社群貼文字數檢查",subtitle:"統計社群貼文字數與行數,快速檢查 X、Threads、LinkedIn 或 IG 文案長度。",inputPlaceholder:"在此輸入或貼上內容...",processBtn:"開始處理",processing:"處理中...",copyBtn:"複製結果",downloadBtn:"下載結果",reset:"重置",empty:"請先輸入要處理的內容。",copied:"已複製"},en:{title:"Social Post Counter",subtitle:"Count characters and lines for social posts across X, Threads, LinkedIn, and Instagram captions.",inputPlaceholder:"Enter or paste content here...",processBtn:"Process",processing:"Processing...",copyBtn:"Copy Result",downloadBtn:"Download Result",reset:"Reset",empty:"Enter content before processing.",copied:"Copied"}},L=i=>String(i).toLowerCase().startsWith("en")?N.en:N.zh;function O({language:i="zh"}){const[c,d]=n.useState(""),[u,m]=n.useState(T),[a,x]=n.useState(""),[h,l]=n.useState(""),[g,b]=n.useState(!1),s=L(i),j=n.useMemo(()=>c.trim().length>0,[c]),C=(t,o)=>{m(r=>({...r,[t]:o}))},v=()=>{if(!j){l(s.empty);return}b(!0);try{const t=R(p,{text:c,...u});x(t),l("")}catch(t){l(t.message||"Failed to process input.")}finally{b(!1)}},P=async()=>{a&&(await navigator.clipboard.writeText(a),l(s.copied))},S=()=>{if(!a)return;const t=new Blob([a],{type:"text/plain;charset=utf-8"}),o=URL.createObjectURL(t),r=document.createElement("a");r.href=o,r.download=`${p}-result.txt`,r.click(),URL.revokeObjectURL(o)},f=()=>{d(""),m(T),x(""),l("")};return e.jsxs("div",{className:"tool-page",children:[e.jsxs("div",{className:"tool-page-content",children:[e.jsx("h1",{className:"tool-page-title",children:s.title}),e.jsx("p",{className:"tool-page-subtitle",children:s.subtitle}),e.jsxs("div",{className:"tool-page-body",children:[y.length>0&&e.jsx("div",{className:"tool-page-actions","aria-label":"Tool options",children:y.map(t=>e.jsxs("label",{style:{display:"grid",gap:"6px",minWidth:"180px"},children:[e.jsx("span",{className:"tool-page-stat-label",children:t.name}),e.jsx("input",{className:"tool-page-textarea",style:{minHeight:"auto",resize:"none"},type:"text",value:u[t.name]??"",onChange:o=>C(t.name,o.target.value)})]},t.name))}),e.jsx("textarea",{className:"tool-page-textarea",value:c,onChange:t=>d(t.target.value),placeholder:s.inputPlaceholder,"aria-label":B.name,rows:10}),e.jsxs("div",{className:"tool-page-actions",children:[e.jsx("button",{className:"tool-page-btn primary",onClick:v,disabled:!j||g,children:g?s.processing:s.processBtn}),a&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"tool-page-btn secondary",onClick:P,children:s.copyBtn}),e.jsx("button",{className:"tool-page-btn secondary",onClick:S,children:s.downloadBtn}),e.jsx("button",{className:"tool-page-btn secondary",onClick:f,children:s.reset})]})]}),h&&e.jsx("p",{className:"tool-page-subtitle","aria-live":"polite",children:h}),a&&e.jsx("div",{className:"tool-page-result",children:e.jsx("textarea",{className:"tool-page-textarea output",value:a,readOnly:!0,rows:10,"aria-label":"result"})})]})]}),e.jsx(w,{seoData:E[p]})]})}export{O as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.