<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>HanziWriter on 张佳轩的博客</title>
    <link>https://jaxon.ccwu.cc/tags/hanziwriter/</link>
    <description>Recent content in HanziWriter on 张佳轩的博客</description>
    <generator>Hugo</generator>
    <language>zh-CN</language>
    <lastBuildDate>Mon, 30 Nov 2026 14:50:00 +0800</lastBuildDate>
    <atom:link href="https://jaxon.ccwu.cc/tags/hanziwriter/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>给网页加个田字格：HanziWriter 汉字笔顺动画与手写练习</title>
      <link>https://jaxon.ccwu.cc/posts/hanzi-writer-guide/</link>
      <pubDate>Mon, 30 Nov 2026 14:50:00 +0800</pubDate>
      <guid>https://jaxon.ccwu.cc/posts/hanzi-writer-guide/</guid>
      <description>&lt;h2 id=&#34;起因&#34;&gt;&#xA;  起因&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e8%b5%b7%e5%9b%a0&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;我一直在想把汉字笔顺这件事搬到网页上。两个场景：给小孩做认字页面，或者纯粹自己查——&amp;ldquo;这个字第一笔到底从哪儿起？&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;网上搜出来的方案基本分两类。一类是拿现成的笔顺 GIF 或者视频，字写死了，想换字得重新找素材。另一类是直接上 SVG 路径数据，能画，但你只是看到一条线在动，没有任何交互。&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;HanziWriter&lt;/code&gt; 走的是第三条路：&lt;strong&gt;它知道每一笔的走向、顺序，也知道判定规则&lt;/strong&gt;。所以它不光能&amp;quot;播放笔顺&amp;quot;，还能让你在格子里自己写，写错了它会告诉你——这一笔方向不对，重来。&lt;/p&gt;&#xA;&lt;p&gt;下面这个就是我嵌在文章里的真实演示，不是截图，你现在就能上手写：&lt;/p&gt;&#xA;&lt;div class=&#34;hz-demo&#34; id=&#34;hanzi-demo&#34;&#xA;     data-base=&#34;/hanzi-data/&#34;&#xA;     data-common=&#34;永你我好学习汉字中国大小上下天地日月水火山木&#34;&#xA;     data-initial=&#34;永&#34;&gt;&#xA;&#xA;  &lt;div class=&#34;hz-head&#34;&gt;&#xA;    &lt;span class=&#34;hz-current&#34; id=&#34;hz-current&#34;&gt;永&lt;/span&gt;&#xA;    &lt;span class=&#34;hz-sub&#34;&gt;左边看笔顺怎么走，右边你自己写一遍&lt;/span&gt;&#xA;  &lt;/div&gt;&#xA;&#xA;  &lt;div class=&#34;hz-chars&#34; id=&#34;hz-chars&#34; role=&#34;group&#34; aria-label=&#34;选择汉字&#34;&gt;&lt;/div&gt;&#xA;&#xA;  &lt;div class=&#34;hz-stages&#34;&gt;&#xA;    &lt;div class=&#34;hz-stage&#34;&gt;&#xA;      &lt;span class=&#34;hz-label&#34;&gt;笔顺演示&lt;/span&gt;&#xA;      &lt;div class=&#34;hz-grid&#34; id=&#34;hz-anim&#34;&gt;&lt;/div&gt;&#xA;      &lt;button class=&#34;hz-btn&#34; id=&#34;hz-play&#34; type=&#34;button&#34;&gt;播放笔顺&lt;/button&gt;&#xA;    &lt;/div&gt;&#xA;&#xA;    &lt;div class=&#34;hz-stage&#34;&gt;&#xA;      &lt;span class=&#34;hz-label&#34;&gt;手写练习&lt;/span&gt;&#xA;      &lt;div class=&#34;hz-grid&#34; id=&#34;hz-quiz&#34;&gt;&lt;/div&gt;&#xA;      &lt;div class=&#34;hz-stage-actions&#34;&gt;&#xA;        &lt;button class=&#34;hz-btn hz-btn-primary&#34; id=&#34;hz-start&#34; type=&#34;button&#34;&gt;开始书写&lt;/button&gt;&#xA;        &lt;button class=&#34;hz-btn&#34; id=&#34;hz-reset&#34; type=&#34;button&#34;&gt;重置&lt;/button&gt;&#xA;      &lt;/div&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/div&gt;&#xA;&#xA;  &lt;div class=&#34;hz-status&#34; id=&#34;hz-status&#34;&gt;正在加载字库…&lt;/div&gt;&#xA;&#xA;  &lt;div class=&#34;hz-custom&#34;&gt;&#xA;    &lt;input id=&#34;hz-custom-input&#34; type=&#34;text&#34; maxlength=&#34;1&#34; placeholder=&#34;任意字&#34; aria-label=&#34;输入任意汉字&#34;&gt;&#xA;    &lt;button class=&#34;hz-btn&#34; id=&#34;hz-custom-btn&#34; type=&#34;button&#34;&gt;换这个字&lt;/button&gt;&#xA;  &lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;左边点&amp;quot;播放笔顺&amp;quot;看它怎么走，右边点&amp;quot;开始书写&amp;quot;自己写一遍。用鼠标拖或者手指划都行，笔画方向、起笔位置错了它不会放你过去。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
