mml-io / mml

Metaverse Markup Language
https://mml.io
MIT License
120 stars 13 forks source link

m-attr-lerp #165 #171

Closed MarcusLongmuir closed 3 months ago

MarcusLongmuir commented 3 months ago

Resolves #165

This PR adds a new element, m-attr-lerp that allows smoothly lerping between element attribute values similarly to m-attr-anim, but without having to specify document-time based timings and explicit start and end attributes.

Example usage:

<m-cube x="-3" onclick="this.setAttribute('x','3');">
  <m-attr-lerp attr="x" duration="2000" easing="easeInOutCubic"></m-attr-lerp>
</m-cube>

The "attr" attribute also allows specifying multiple comma-separated attributes or all to apply to all attributes at once (which is also the default if attr is not provided).


What kind of changes does your PR introduce? (check at least one)

Does your PR introduce a breaking change? (check one)

Does your PR fulfill the following requirements?