hanzi-writer

Chinese character stroke order animations and practice quizzes

MIT License

Downloads
3.9K
Stars
3.5K
Committers
9

Bot releases are hidden (Show)

hanzi-writer - v0.9.0

Published by chanind over 6 years ago

This release improves stroke matching, and adds a leniency param which can be set to increase or decrease the leniency of the stroke matcher in quizzes.

hanzi-writer - v0.8.2

Published by chanind over 6 years ago

Rounding points returned in drawnPath to be max 1 decimal point of precision.

hanzi-writer - v0.8.1

Published by chanind over 6 years ago

Fixing a bug where if a user finishes a quiz successfully, then restarts, then when a stroke is highlighted the entire character highlight becomes visible.

hanzi-writer - v0.8.0

Published by chanind over 6 years ago

  • Added info about the stroke drawn by the user to onCorrectStroke and onMistake callbacks during quizzes
  • Fixed a bug in the default data loader where onError is called twice in the event of a network failure
  • Removed auto-retry behavior when an animation method is called after character data failed to load
  • Removed some dead code and reduced minified file size to 24KB
hanzi-writer - v0.7.0

Published by chanind over 6 years ago

  • Uses stroke-capped SVG data, so strokes no longer end in hard edges when they intersect other strokes.
  • Performance improvements (use clip-path instead of mask everywhere, smaller file-size)
  • character opacity is controlled at the character level, so stroke overlap points no longer appear when hiding/showing characters (#48)
hanzi-writer - v0.6.0

Published by chanind over 6 years ago

This release fixes a bug where if a character animation is looping, and a new character is loaded, the new character would either start looping as well or throw an error. Pointed out by @vaab

This release adds more robust error handling for loading character data, and adds onLoadCharDataSuccess and onLoadCharDataError callbacks that will be called in the event of char data loading successfully or error. More discussion at https://github.com/chanind/hanzi-writer/pull/42. Thanks again to @vaab!

hanzi-writer - v0.5.1

Published by chanind over 6 years ago

  • Fixes a bug in setCharacter() #40 thanks @vaab!
  • Fixes a bug where strokes can have partial opacity when drawing really quickly in quizzes
  • Fixes a bug where subsequent calls to animatable methods would chain them one after another instead of each canceling the previous call

Thanks again to @vaab for pointing out all these issues and contributing fixes!

hanzi-writer - v0.5.0

Published by chanind over 6 years ago

This release contains several feature enhancements and changes:

  • The character radical can be drawn in a different color by passing a radicalColor option, for characters where radical data is available in Make me a Hanzi.
  • strokeAnimationDuration and strokeHighlightDuration options have been removed and replaced with strokeAnimationSpeed and strokeHighlightSpeed, respectively. This was changed because if all strokes take the same duration to draw, then short strokes appear to be drawn very slowly and long strokes appear to be drawn very quickly, which looks strange. Now, strokes appear to be drawn at a similar speed which looks a lot more natural. strokeAnimationDuration and strokeHighlightDuration will continue to work for backwards compatibility.
  • character data has been removed from this repo and moved into a new repo, https://github.com/chanind/hanzi-writer-data. This data is also on published on NPM under the name hanzi-writer-data. You can now load this in NPM by directly requiring character data via, for example: var wo = require('hanzi-writer-data/ζˆ‘');
  • Hanzi Writer will now by default load character data from https://www.jsdelivr.com/package/npm/hanzi-writer-data. This should have better performance than the github pages CDN which was used previously, especially in China. Plus using github pages as a CDN was kind of sketchy.
hanzi-writer - v0.4.0

Published by chanind over 6 years ago

  • Adds a loopCharacterAnimation() method which makes it easy to animate a character over and over.
  • Returns a promise from animateCharacter(), hideCharacter(), showCharacter(), hideOutline(), and showOutline() which resolves when the action completes, instead of needing to pass an onComplete callback (but passing onComplete will still work).
  • If no width or height is provided, they will be inferred from the size of the parent element
  • Adds stroke-linecap: round and stroke-linejoin: round to the user-stroke drawn during quizzing which makes it look slightly nicer.
  • Adds a comment to the compiled JS with the current version number and a link to the website
hanzi-writer - v0.3.3

Published by chanind over 6 years ago

This release fixes a nasty bug that cause Hanzi writer to not work in Microsoft browsers (IE and Edge) due to their poor handling of SVG masks.

hanzi-writer - v0.3.2

Published by chanind over 6 years ago

  • Bug fix for flickering during animation in Safari
  • fixing animation start position so the full stroke gets animated
  • using performance.now() instead of Date.now() for timing during animation
hanzi-writer - v0.3.1

Published by chanind almost 7 years ago

Further reducing filesize from 97kb to 22kb minified. This is accomplished by removing svg.js and removing bloat from babel.

hanzi-writer - v0.3.0

Published by chanind almost 7 years ago

Removing babel-polyfill from HanziWriter. This reduces minified filesize by half from 184kb to 97kb. This polyfill should no longer be necessary anyway as all current browsers support all JS features used in HanziWriter. If users need to still support very old versions of IE they should include a polyfill themselves.

hanzi-writer - v0.2.2

Published by chanind almost 7 years ago

This release makes stroke recognition in quizzes more lenient. This should make the quiz feature a lot more usable, especially for characters with a lot of small details.

hanzi-writer - v0.2.1

Published by chanind about 7 years ago

Using https to load character data from the github CDN