├── src ├── Resources │ ├── app │ │ └── storefront │ │ │ ├── src │ │ │ ├── scss │ │ │ │ └── base.scss │ │ │ ├── main.js │ │ │ └── aos-animation │ │ │ │ └── aos-animation.plugin.js │ │ │ ├── build │ │ │ └── webpack.config.js │ │ │ ├── package.json │ │ │ ├── package-lock.json │ │ │ └── dist │ │ │ └── storefront │ │ │ └── js │ │ │ └── sas-aos.js │ ├── config │ │ ├── plugin.png │ │ ├── services.xml │ │ └── config.xml │ └── views │ │ └── storefront │ │ └── section │ │ └── cms-section-block-container.html.twig └── SasAos.php ├── .gitignore ├── README.md └── composer.json /src/Resources/app/storefront/src/scss/base.scss: -------------------------------------------------------------------------------- 1 | @import '../../node_modules/aos/src/sass/aos.scss'; 2 | -------------------------------------------------------------------------------- /src/Resources/config/plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shape-and-Shift/shopware-aos/HEAD/src/Resources/config/plugin.png -------------------------------------------------------------------------------- /src/SasAos.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Resources/views/storefront/section/cms-section-block-container.html.twig: -------------------------------------------------------------------------------- 1 | {% sw_extends '@Storefront/storefront/section/cms-section-block-container.html.twig' %} 2 | 3 | {% set aos = shopware.config.SasAos.config %} 4 | 5 | {% block section_content_block %} 6 |
12 | {{ parent() }} 13 |
14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sas/aos", 3 | "description": "Animate on scroll for CMS elements", 4 | "version": "v1.0.0", 5 | "type": "shopware-platform-plugin", 6 | "license": "proprietary", 7 | "authors": [ 8 | { 9 | "name": "Shape & Shift", 10 | "role": "Manufacturer", 11 | "homepage": "https://shapeandshift.dev" 12 | } 13 | ], 14 | "require": { 15 | "shopware/core": "^6.1|^6.2", 16 | "shopware/administration": "^6.1|^6.2", 17 | "shopware/storefront":"^6.1|^6.2" 18 | }, 19 | "autoload": { 20 | "psr-4": { 21 | "Sas\\Aos\\": "src/" 22 | } 23 | }, 24 | "extra": { 25 | "shopware-plugin-class": "Sas\\Aos\\SasAos", 26 | "label": { 27 | "de-DE": "Animate on scroll for CMS elements", 28 | "en-GB": "Animate on scroll for CMS elements" 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Resources/app/storefront/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "storefront", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "aos": { 8 | "version": "3.0.0-beta.6", 9 | "resolved": "https://registry.npmjs.org/aos/-/aos-3.0.0-beta.6.tgz", 10 | "integrity": "sha512-VLWrpq8bfAWcetynVHMMrqdC+89Qq/Ym6UBJbHB4crIwp3RR8uq1dNGgsFzoDl03S43rlVMK+na3r5+oUCZsYw==", 11 | "requires": { 12 | "classlist-polyfill": "^1.2.0", 13 | "lodash.debounce": "^4.0.8", 14 | "lodash.throttle": "^4.1.1" 15 | } 16 | }, 17 | "classlist-polyfill": { 18 | "version": "1.2.0", 19 | "resolved": "https://registry.npmjs.org/classlist-polyfill/-/classlist-polyfill-1.2.0.tgz", 20 | "integrity": "sha1-k1vC39lFiodrJ5YXUUY4vKqWSi4=" 21 | }, 22 | "lodash.debounce": { 23 | "version": "4.0.8", 24 | "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", 25 | "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" 26 | }, 27 | "lodash.throttle": { 28 | "version": "4.1.1", 29 | "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", 30 | "integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=" 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Resources/config/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Configuration 7 | 8 | aosAnimation 9 | 10 | 14 | 18 | 22 | 26 | 30 | 34 | 38 | 42 | 46 | 50 | 54 | 58 | 62 | 66 | 70 | 74 | 78 | 82 | 86 | 90 | 94 | 98 | 99 | fade-in 100 | 101 | 102 | 103 | 104 | aosDuration 105 | 106 | 3000 107 | 108 | 109 | 110 | aosOffset 111 | 112 | 500 113 | 114 | 115 | 116 | aosDelay 117 | 118 | 300 119 | 120 | 121 | 122 | aosAnchorPlacement 123 | 124 | 128 | 132 | 136 | 140 | 144 | 145 | 146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /src/Resources/app/storefront/dist/storefront/js/sas-aos.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([["sas-aos"],{b4gR:function(t,e,n){(function(e){t.exports=function(){"use strict";var t="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},n="Expected a function",o=NaN,i="[object Symbol]",r=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt,f="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,d=f||l||Function("return this")(),m=Object.prototype.toString,p=Math.max,b=Math.min,v=function(){return d.Date.now()};function y(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function w(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&m.call(t)==i}(t))return o;if(y(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=y(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(r,"");var n=c.test(t);return n||s.test(t)?u(t.slice(2),n?2:8):a.test(t)?o:+t}var g=function(t,e,o){var i=!0,r=!0;if("function"!=typeof t)throw new TypeError(n);return y(o)&&(i="leading"in o?!!o.leading:i,r="trailing"in o?!!o.trailing:r),function(t,e,o){var i,r,a,c,s,u,f=0,l=!1,d=!1,m=!0;if("function"!=typeof t)throw new TypeError(n);function g(e){var n=i,o=r;return i=r=void 0,f=e,c=t.apply(o,n)}function h(t){var n=t-u;return void 0===u||n>=e||n<0||d&&t-f>=a}function k(){var t=v();if(h(t))return O(t);s=setTimeout(k,function(t){var n=e-(t-u);return d?b(n,a-(t-f)):n}(t))}function O(t){return s=void 0,m&&i?g(t):(i=r=void 0,c)}function j(){var t=v(),n=h(t);if(i=arguments,r=this,u=t,n){if(void 0===s)return function(t){return f=t,s=setTimeout(k,e),l?g(t):c}(u);if(d)return s=setTimeout(k,e),g(u)}return void 0===s&&(s=setTimeout(k,e)),c}return e=w(e)||0,y(o)&&(l=!!o.leading,a=(d="maxWait"in o)?p(w(o.maxWait)||0,e):a,m="trailing"in o?!!o.trailing:m),j.cancel=function(){void 0!==s&&clearTimeout(s),f=0,i=u=r=s=void 0},j.flush=function(){return void 0===s?c:O(v())},j}(t,e,{leading:i,maxWait:e,trailing:r})},h=NaN,k="[object Symbol]",O=/^\s+|\s+$/g,j=/^[-+]0x[0-9a-f]+$/i,x=/^0b[01]+$/i,E=/^0o[0-7]+$/i,N=parseInt,A="object"==typeof t&&t&&t.Object===Object&&t,C="object"==typeof self&&self&&self.Object===Object&&self,z=A||C||Function("return this")(),S=Object.prototype.toString,T=Math.max,q=Math.min,L=function(){return z.Date.now()};function M(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function _(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&S.call(t)==k}(t))return h;if(M(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=M(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(O,"");var n=x.test(t);return n||E.test(t)?N(t.slice(2),n?2:8):j.test(t)?h:+t}var D=function(t,e,n){var o,i,r,a,c,s,u=0,f=!1,l=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function m(e){var n=o,r=i;return o=i=void 0,u=e,a=t.apply(r,n)}function p(t){var n=t-s;return void 0===s||n>=e||n<0||l&&t-u>=r}function b(){var t=L();if(p(t))return v(t);c=setTimeout(b,function(t){var n=e-(t-s);return l?q(n,r-(t-u)):n}(t))}function v(t){return c=void 0,d&&o?m(t):(o=i=void 0,a)}function y(){var t=L(),n=p(t);if(o=arguments,i=this,s=t,n){if(void 0===c)return function(t){return u=t,c=setTimeout(b,e),f?m(t):a}(s);if(l)return c=setTimeout(b,e),m(s)}return void 0===c&&(c=setTimeout(b,e)),a}return e=_(e)||0,M(n)&&(f=!!n.leading,r=(l="maxWait"in n)?T(_(n.maxWait)||0,e):r,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==c&&clearTimeout(c),u=0,o=s=i=c=void 0},y.flush=function(){return void 0===c?a:v(L())},y},H=function(){};function P(t){t&&t.forEach((function(t){var e=Array.prototype.slice.call(t.addedNodes),n=Array.prototype.slice.call(t.removedNodes);if(function t(e){var n=void 0,o=void 0;for(n=0;n=o.out&&!n.once?r():e>=o.in?t.animated||(function(t,e){e&&e.forEach((function(e){return t.classList.add(e)}))}(i,n.animatedClassNames),V("aos:in",i),t.options.id&&V("aos:in:"+t.options.id,i),t.animated=!0):t.animated&&!n.once&&r()}(t,window.pageYOffset)}))},Z=function(t){for(var e=0,n=0;t&&!isNaN(t.offsetLeft)&&!isNaN(t.offsetTop);)e+=t.offsetLeft-("BODY"!=t.tagName?t.scrollLeft:0),n+=t.offsetTop-("BODY"!=t.tagName?t.scrollTop:0),t=t.offsetParent;return{top:n,left:e}},tt=function(t,e,n){var o=t.getAttribute("data-aos-"+e);if(void 0!==o){if("true"===o)return!0;if("false"===o)return!1}return o||n},et=function(t,e){return t.forEach((function(t,n){var o=tt(t.node,"mirror",e.mirror),i=tt(t.node,"once",e.once),r=tt(t.node,"id"),a=e.useClassNames&&t.node.getAttribute("data-aos"),c=[e.animatedClassName].concat(a?a.split(" "):[]).filter((function(t){return"string"==typeof t}));e.initClassName&&t.node.classList.add(e.initClassName),t.position={in:function(t,e,n){var o=window.innerHeight,i=tt(t,"anchor"),r=tt(t,"anchor-placement"),a=Number(tt(t,"offset",r?0:e)),c=r||n,s=t;i&&document.querySelectorAll(i)&&(s=document.querySelectorAll(i)[0]);var u=Z(s).top-o;switch(c){case"top-bottom":break;case"center-bottom":u+=s.offsetHeight/2;break;case"bottom-bottom":u+=s.offsetHeight;break;case"top-center":u+=o/2;break;case"center-center":u+=o/2+s.offsetHeight/2;break;case"bottom-center":u+=o/2+s.offsetHeight;break;case"top-top":u+=o;break;case"bottom-top":u+=o+s.offsetHeight;break;case"center-top":u+=o+s.offsetHeight/2}return u+a}(t.node,e.offset,e.anchorPlacement),out:o&&function(t,e){window.innerHeight;var n=tt(t,"anchor"),o=tt(t,"offset",e),i=t;return n&&document.querySelectorAll(n)&&(i=document.querySelectorAll(n)[0]),Z(i).top+i.offsetHeight-o}(t.node,e.offset)},t.options={once:i,mirror:o,animatedClassNames:c,id:r}})),t},nt=function(){var t=document.querySelectorAll("[data-aos]");return Array.prototype.map.call(t,(function(t){return{node:t}}))},ot=[],it=!1,rt={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,mirror:!1,anchorPlacement:"top-bottom",startEvent:"DOMContentLoaded",animatedClassName:"aos-animate",initClassName:"aos-init",useClassNames:!1,disableMutationObserver:!1,throttleDelay:99,debounceDelay:50},at=function(){return document.all&&!window.atob},ct=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(it=!0),it&&(ot=et(ot,rt),X(ot),window.addEventListener("scroll",g((function(){X(ot,rt.once)}),rt.throttleDelay)))},st=function(){if(ot=nt(),ft(rt.disable)||at())return ut();ct()},ut=function(){ot.forEach((function(t,e){t.node.removeAttribute("data-aos"),t.node.removeAttribute("data-aos-easing"),t.node.removeAttribute("data-aos-duration"),t.node.removeAttribute("data-aos-delay"),rt.initClassName&&t.node.classList.remove(rt.initClassName),rt.animatedClassName&&t.node.classList.remove(rt.animatedClassName)}))},ft=function(t){return!0===t||"mobile"===t&&U.mobile()||"phone"===t&&U.phone()||"tablet"===t&&U.tablet()||"function"==typeof t&&!0===t()};return{init:function(t){return rt=R(rt,t),ot=nt(),rt.disableMutationObserver||W()||(console.info('\n aos: MutationObserver is not supported on this browser,\n code mutations observing has been disabled.\n You may have to call "refreshHard()" by yourself.\n '),rt.disableMutationObserver=!0),rt.disableMutationObserver||Y("[data-aos]",st),ft(rt.disable)||at()?ut():(document.querySelector("body").setAttribute("data-aos-easing",rt.easing),document.querySelector("body").setAttribute("data-aos-duration",rt.duration),document.querySelector("body").setAttribute("data-aos-delay",rt.delay),-1===["DOMContentLoaded","load"].indexOf(rt.startEvent)?document.addEventListener(rt.startEvent,(function(){ct(!0)})):window.addEventListener("load",(function(){ct(!0)})),"DOMContentLoaded"===rt.startEvent&&["complete","interactive"].indexOf(document.readyState)>-1&&ct(!0),window.addEventListener("resize",D(ct,rt.debounceDelay,!0)),window.addEventListener("orientationchange",D(ct,rt.debounceDelay,!0)),ot)},refresh:ct,refreshHard:st}}()}).call(this,n("pCvA"))},p31h:function(t,e,n){"use strict";n.r(e);var o=n("FGIj"),i=n("b4gR"),r=n.n(i);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){for(var n=0;n