chanind / hanzi-writer

Chinese character stroke order animations and practice quizzes
https://hanziwriter.org
MIT License
3.44k stars 534 forks source link

Is it possible to add numbers at the beggining of the strokes? #311

Open DavidGarciaManzana opened 5 months ago

DavidGarciaManzana commented 5 months ago

I was wondering if its possible to add little numbers at the beggining of each stroke, this way when you see a new hanzi, it would be possible to know where to start and also how many strokes it has . Something like this :

Screenshot 2024-02-16 at 9 25 00 p m
chanind commented 5 months ago

There's not a built-in way, but you could do this using the Raw Character SVG from the library. The codepen below demos how to do this, adding the SVG text manually to the SVG strokes:

https://codepen.io/David-Chanin/pen/dyrLPde

If you wanted to have this be integrated into a stroke animation that might be a bit harder. You could try manually drawing the stroke numbers onto a SVG element directly above the writer and handle showing / hiding it before starting animation I suppose.