Guest User

Untitled

a guest
Mar 19th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.14 KB | None | 0 0
  1. .slide-right {
  2. animation-duration : 1s;
  3. animation-name : slide-right !important;
  4. animation-timing-function: ease;
  5. opacity : 1!important;
  6. visibility : visible !important;
  7. animation-iteration-count: 1;
  8. backface-visibility: hidden;
  9.  
  10. }
  11.  
  12. .slide-left {
  13. animation-duration : 1s;
  14. animation-name : slide-left !important;
  15. animation-timing-function: ease;
  16. opacity : 0 !important;
  17. visibility : hidden !important;
  18. animation-iteration-count: 1;
  19. backface-visibility: hidden;
  20.  
  21. }
  22. @keyframes spin {
  23. 0% {
  24. transform: rotate(0deg);
  25. }
  26.  
  27. 100% {
  28. transform: rotate(1turn);
  29. }
  30. }
  31. @keyframes slide-right {
  32. 0% {
  33. opacity : 0;
  34. transform : translatex(-50%);
  35. visibility: visible;
  36.  
  37. }
  38.  
  39. 100% {
  40. opacity : 1;
  41. transform : translateX(0%);
  42. visibility: visible;
  43. }
  44. }
  45. @keyframes slide-left {
  46. 0% {
  47. opacity : 0;
  48. transform : translatex(0%);
  49. visibility: visible;
  50. }
  51. //
  52. // 95% {
  53. // transform : translateX(-50%);
  54. // visibility: visible;
  55. // }
  56.  
  57. 100% {
  58. opacity : 0;
  59. transform : translateX(-50%);
  60. visibility: hidden;
  61. }
  62. }
  63.  
  64. function whatWeDoAccordion() {
  65. var $button = $( '.ion-button' );
  66.  
  67. $button.on( 'click mouseover', function( event ) {
  68. var $this = $( this ),
  69. $accordionRow = $this.parents( '.ion-accordion-row' ),
  70. $text = $accordionRow.find( '.ion-accordion-text' );
  71.  
  72. $( '.ion-accordion-text' ).not( $text ).addClass( 'slide-left' ).removeClass( 'slide-right' );
  73.  
  74. $( '.ion-color--white' ).removeClass( 'ion-color--white' );
  75. $this.toggleClass( 'ion-color--white' );
  76. $button.not( $this ).removeClass( 'ion-color--white' );
  77. $text.toggleClass( 'slide-left' ).toggleClass( 'slide-right' );
  78. } );
  79. }
  80.  
  81. function tokenika_waypoints_setup( callback ) {
  82. var tokenikaWaypointCounter = 1;
  83. var tokenikaWaypointArray = [];
  84.  
  85. // Adding classes to waypoint ellemens dynamicly
  86. $( ".tokenika_waypoint" ).each( function( index, el ) {
  87.  
  88. var tokenikaWaypointIndex = index,
  89. currentItemClass = 'tokenika-waypoint-item-' + tokenikaWaypointCounter;
  90. $( this ).addClass( currentItemClass );
  91. tokenikaWaypointArray.push( "." + currentItemClass );
  92.  
  93. tokenikaWaypointCounter++;
  94. } );
  95.  
  96. // Seting up waypoints for each '.tokenika_waypoint'
  97. $( tokenikaWaypointArray ).each( function( index, el ) {
  98.  
  99. $( el ).waypoint( function( direction ) {
  100.  
  101. if ( direction == "down" ) {
  102. $( '.tokenika_waypoint' ).find( '.ion-color--primary' ).removeClass( 'ion-color--white' );
  103. $( '.tokenika_waypoint' ).find( '.ion-accordion-text' ).removeClass( 'slide-right' ).addClass( 'slide-left' );
  104. $( el ).find( '.ion-color--primary' ).addClass( 'ion-color--white' );
  105. $( el ).find( '.ion-accordion-text' ).removeClass( 'slide-left' ).addClass( 'slide-right' );
  106. }
  107.  
  108. }, {
  109. offset: function() {
  110. return this.context.innerHeight() - this.adapter.outerHeight() - 150;
  111. }
  112. } );
  113.  
  114. $( el ).waypoint( function( direction ) {
  115.  
  116. if ( direction == "up" ) {
  117. $( '.tokenika_waypoint' ).find( '.ion-color--primary' ).removeClass( 'ion-color--white' );
  118. $( '.tokenika_waypoint' ).find( '.ion-accordion-text' ).removeClass( 'slide-right' ).addClass( 'slide-left' );
  119. $( el ).find( '.ion-color--primary' ).addClass( 'ion-color--white' );
  120. $( el ).find( '.ion-accordion-text' ).removeClass( 'slide-left' ).addClass( 'slide-right' );
  121. }
  122.  
  123. }, {
  124. offset: function() {
  125. return this.context.innerHeight() - this.adapter.outerHeight() - 200;
  126. }
  127. } );
  128.  
  129. } );
  130. } //tokenika_waypoints_setup
Add Comment
Please, Sign In to add comment