UNPKG

@alzintani/superevents

Version:

JavaScript library that handling any events in websites.

1 lines 1.92 kB
function _classCallCheck(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var o=0;o<r.length;o++){var t=r[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}function _createClass(e,r,o){return r&&_defineProperties(e.prototype,r),o&&_defineProperties(e,o),e}!function(){"use strict";(new(function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"init",value:function(){var e,r,o,t;e={scale:.5},r={scale:1},o=document.querySelector(".click-example-source"),t=document.querySelectorAll(".click-example-target"),new SuperEvents({source:o,target:t}).click().fromTo(e,r).easing({timing:"ease-out",duration:.3,delay:.1});o=document.querySelector(".mousemove-example-source"),t=document.querySelectorAll(".mousemove-example-target"),o&&new SuperEvents({source:o,target:t}).mousemove().fromTo({backgroundColor:"#FF4971"},{backgroundColor:"#4693FF"}),e={translateX:"300px",opacity:.1},r={translateX:"0",opacity:1},o=document.querySelector(".hover-example-source"),t=document.querySelectorAll(".hover-example-target"),o&&new SuperEvents({source:o,target:t}).hover().fromTo(e,r).easing({timing:"ease-out",duration:.3,delay:.3,cubicBezier:!1}),e={backgroundColor:"#FF5549",scale:.2},r={backgroundColor:"#464EFF",scale:1};var a=document.querySelectorAll(".scroll-example-target-2");a&&new SuperEvents(a).scroll({indicator:"80%",duration:"50%"}).fromTo(e,r).easing({timing:"ease-out",duration:.3,delay:.05,cubicBezier:!1}),e={backgroundColor:"#FFAAA4",scale:.2},r={backgroundColor:"#9BA0FF",scale:1};var n=document.querySelector(".scroll-div-container"),c=n.querySelectorAll(".scroll2-example-target");n&&new SuperEvents({source:n,target:c}).scroll({indicator:"80%",duration:"20%"}).fromTo(e,r).easing({timing:"ease-out",duration:.3,delay:.05,cubicBezier:!1})}}]),e}())).init()}();