Requires

Provides

Fx.js

Very basic tweening for SVG

License:
Public domain (http://unlicense.org).
Authors:
Yaroslaff Fedin
  1. 22
  2. 23
  3. 24
  4. 25
  5. 26
  6. 27
  7. 28
  8. 29
  9. 30
  10. 31
  11. 32
  12. 33
  13. 34
  14. 35
  15. 36
  16. 37
  17. 38
  18. 39
  19. 40
  20. 41
  21. 42
  22. 43
  23. 44
  24. 45
  25. 46
  26. 47
  27. 48
  28. 49
  29. 50
  30. 51
  31. 52
  32. 53
  33. 54
  34. 55
  35. 56
  36. 57
  37. 58
  38. 59
  39. 60
  40. 61
LSD.Fx = new Class({ Extends: Fx.CSS, initialize: function(widget, options){ this.widget = widget; this.element = this.subject = document.id(widget); this.parent(options); }, prepare: function(widget, property, values){ values = Array.from(values); var values1 = values[1]; if (!$chk(values1)){ values[1] = values[0]; values[0] = widget.getStyle(property); } var parsed = values.map(this.parse); return {from: parsed[0], to: parsed[1]}; }, set: function(property, now){ if (arguments.length == 1){ now = property; property = this.property || this.options.property; } this.widget.setStyle(property, now[0].value); this.widget.render(); return this; }, start: function(property, from, to){ if (!this.check(property, from, to)) return this; var args = Array.flatten(arguments); this.property = this.options.property || args.shift(); var parsed = this.prepare(this.widget, this.property, args); return this.parent(parsed.from, parsed.to); } });