exmorph v1.0.2 Exmorph.Strings

Summary

Functions

Parses a tween string. The string is broken up into two-word chunks which are converted to key value pairs within a map. This map is eventually merged with %Exmorph.Tween{}

Functions

parse(string)

Parses a tween string. The string is broken up into two-word chunks which are converted to key value pairs within a map. This map is eventually merged with %Exmorph.Tween{}.

Examples

iex> Exmorph.Strings.parse("from 25 to 75 over 1s")
%{duration: 1000000000, from: 25, to: 75}

iex> Exmorph.Strings.parse("from 25 to 75 over 1.5s ease cubic_out")
%{duration: 1.5e9, easing: :cubic_out, from: 25, to: 75}