Guest User

Untitled

a guest
Jun 28th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. # CSSY engine
  2.  
  3. ## What it is
  4. An animation engine that lets you write you animation in sheets instead
  5. of polluting your code.
  6.  
  7. ## Based on CSS
  8. A `cssy` file is an a animation sheet that describe how to animate the HTML elements or the components of a web page.
  9. Basic idea of the syntax:
  10. ```css
  11. myElement {
  12. animationName {
  13. a_command: some_args;
  14. another_command: arg1, arg2;
  15. [
  16. command1: arg1;
  17. command2: arg2;
  18. ]
  19. complex_command: (
  20. arg1: value;
  21. arg2: value;
  22. );
  23. call: versatilAnimation, 5, 2;
  24. }
  25.  
  26. versatilAnimation {
  27. ~argument: $a, 0;
  28. ~argument: $b, 0;
  29. ~another_option: arg;
  30. command: arg1, $a;
  31. command2: arg1, $b - $a;
  32. }
  33.  
  34. @eventName {
  35. }
  36.  
  37. @eventName .child_selector {
  38. }
  39. }
  40. ```
  41.  
  42. ## Animation Options
  43. ### Overriding options when calling an animation
  44. ```css
  45. myElement {
  46. @loaded {
  47. call: animation_name (
  48. ~option: override_value;
  49. );
  50. }
  51. }
  52. ```
  53. ### Options list
  54. * `argument: label, defaultValue`
  55. Declare that this animation can accept an argument.
  56.  
  57. ## Events
  58. ### Targeting children
  59. It's possible to target children within the current element with events
  60. ```css
  61. myElement {
  62. @loaded .child_class {
  63. }
  64. @loaded div {
  65. }
  66. }
  67. ```
  68. ### List
  69. * `loaded`
  70. Called when the selected element is loaded on the page.
  71. * `onViewport(target)`
  72. Called when the selected element is visible on the specified viewport (e.g screen).
  73. * `enteringViewport(target)`
  74. Called while the selected element is entering on the specified viewport. This events contains some built-in arguments to specify how much the element is close to the viewport.
  75. * `leavingViewport(target)`
  76. * All supported HTML events, such as `mouseenter`, `click`.
  77.  
  78. ## Commands
  79. ### List
  80. * `spawn`
  81. Inject an HTML element relative to the current element. Ex: make animations like http://freebbble.com/2018/11/20/page-indicator-exploration/.
Advertisement
Add Comment
Please, Sign In to add comment