diff --git a/src/assets/css/tailwind.css b/src/assets/css/tailwind.css index 27c09f9..d4c61ab 100644 --- a/src/assets/css/tailwind.css +++ b/src/assets/css/tailwind.css @@ -134,8 +134,9 @@ input[type='search']::-webkit-search-results-decoration { scroll-behavior: smooth; } -.scroll-pt-20 { - scroll-padding-top: 5rem; +.scroll-mt-20 { + scroll-snap-margin-top: 5rem; + scroll-margin-top: 5rem; } .bg-angled-yellow { diff --git a/src/assets/js/polyfills.js b/src/assets/js/polyfills.js index d024993..e6a1896 100644 --- a/src/assets/js/polyfills.js +++ b/src/assets/js/polyfills.js @@ -1,7 +1,9 @@ 'use strict' ;(function loadPolyfills(doc, base) { if (!('scrollBehavior' in doc.documentElement.style)) { - insertScript(base + 'smoothscroll-polyfill.min.js') + insertScript(base + 'seamless-scroll-polyfill.min.js', function () { + window.seamless.polyfill() + }) insertScript(base + 'smoothscroll-anchor-polyfill.min.js') } diff --git a/src/assets/js/vendor/seamless-scroll-polyfill.min.js b/src/assets/js/vendor/seamless-scroll-polyfill.min.js new file mode 100644 index 0000000..3085c5b --- /dev/null +++ b/src/assets/js/vendor/seamless-scroll-polyfill.min.js @@ -0,0 +1,17 @@ +/*! npm.im/seamless-scroll-polyfill 2.1.8 */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).seamless={})}(this,(function(t){"use strict"; +/*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */var e=function(){return e=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0)&&!(o=l.next()).done;)i.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}return i}var o=function(t){return void 0===t||"auto"===t||"instant"===t||"smooth"===t};function r(t,e){this.scrollLeft=t,this.scrollTop=e}var l=function(t,e,n){return void 0===n&&(n="cannot convert to dictionary."),"Failed to execute '".concat(t,"' on '").concat(e,"': ").concat(n)},i=function(t,e,n){return l(t,e,"The provided value '".concat(n,"' is not a valid enum value of type ScrollBehavior."))},c=function(t,e,n){var o,r="__SEAMLESS.BACKUP$".concat(e);return t[r]||!t[e]||(null===(o=t[e])||void 0===o?void 0:o.__isPolyfill)||(t[r]=t[e]),t[r]||n},u=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)},a=function(){return"scrollBehavior"in window.document.documentElement.style},f=function(t){Object.defineProperty(t,"__isPolyfill",{value:!0})},s=function(t,e){f(e),[HTMLElement.prototype,SVGElement.prototype,Element.prototype].forEach((function(n){c(n,t),n[t]=e}))},d=function(t){return t.ownerDocument.scrollingElement||t.ownerDocument.documentElement},v=function(t){return.5*(1-Math.cos(Math.PI*t))};function w(){var t,e;return w=e=(null===(t=window.performance)||void 0===t?void 0:t.now)?function(){return window.performance.now()}:function(){return window.Date.now()},e()}var m=function(t){var e=(w()-t.timeStamp)/(t.duration||500);if(e>1)return t.method(t.targetX,t.targetY),void t.callback();var n=(t.timingFunc||v)(e),o=t.startX+(t.targetX-t.startX)*n,r=t.startY+(t.targetY-t.startY)*n;t.method(o,r),t.rafId=window.requestAnimationFrame((function(){m(t)}))},h=function(t){return isFinite(t)?Number(t):0},p=function(t){return function(a,f,s){var v,p=n((v=a).window===v?[d(a.document.documentElement),"Window"]:[a,"Element"],2),y=p[0],g=p[1],b=null!=f?f:{};if(!u(b))throw new TypeError(l(t,g));if(!o(b.behavior))throw new TypeError(i(t,g,b.behavior));"scrollBy"===t&&(b.left=h(b.left)+y.scrollLeft,b.top=h(b.top)+y.scrollTop),function(t,n,o){var l,i;if(function(t){var e;return null!==(e=t.isConnected)&&void 0!==e?e:!(t.ownerDocument&&1&t.ownerDocument.compareDocumentPosition(t))}(t)){var u=t.scrollLeft,a=t.scrollTop,f=h(null!==(l=n.left)&&void 0!==l?l:u),s=h(null!==(i=n.top)&&void 0!==i?i:a);if(f!==u||s!==a){var d=c(HTMLElement.prototype,"scroll",r),v=c(Object.getPrototypeOf(t),"scroll",d).bind(t);if("smooth"===n.behavior){var p=function(){window.removeEventListener("wheel",g),window.removeEventListener("touchmove",g)},y=e(e({},o),{timeStamp:w(),startX:u,startY:a,targetX:f,targetY:s,rafId:0,method:v,callback:p}),g=function(){window.cancelAnimationFrame(y.rafId),p()};window.addEventListener("wheel",g,{passive:!0,once:!0}),window.addEventListener("touchmove",g,{passive:!0,once:!0}),m(y)}else v(f,s)}}}(y,b,s)}},y=p("scroll"),g=p("scrollTo"),b=p("scrollBy"),T=y,E=g,S=b,P=y,L=g,B=b,V=function(t){switch(t){case"horizontal-tb":case"lr":case"lr-tb":case"rl":case"rl-tb":return 0;case"vertical-rl":case"tb":case"tb-rl":return 1;case"vertical-lr":case"tb-lr":return 2;case"sideways-rl":return 3;case"sideways-lr":return 4}return 0},M=function(t,e,o,r){var l,i=0;switch(e||(i^=2),t){case 0:i=i>>1|(1&i)<<1,o=(l=n([r,o],2))[0],r=l[1];break;case 1:case 3:i^=1;break;case 4:i^=2}return[i,o,r]},D=function(t){return 1==(1&M(V(t.writingMode),"rtl"!==t.direction,void 0,void 0)[0])},I=function(t,e,n,o,r,l,i){return 0!==t?t:rn||r>e&&l=n&&i>=o?2:l>n&&io?3:null},W=function(t){return"visible"!==t&&"clip"!==t},H=function(t,e){return(t.clientHeightn?n:t},_=function(t,e,n){switch(t){case 1:return(e+n)/2;case 3:return n;case 2:case 0:return e}},j=function(t,e){var o,r,l,i=null===(o=t.ownerDocument.defaultView)||void 0===o?void 0:o.visualViewport,c=n(t===d(t)?[0,0,null!==(r=null==i?void 0:i.width)&&void 0!==r?r:t.clientWidth,null!==(l=null==i?void 0:i.height)&&void 0!==l?l:t.clientHeight]:[e.left,e.top,t.clientWidth,t.clientHeight],4),u=c[0],a=c[1],f=c[2],s=c[3],v=u+t.clientLeft,w=a+t.clientTop;return[w,v+f,w+s,v]},C=function(t,e){var o=[],r=t.ownerDocument,l=r.defaultView;if(!l)return o;for(var i=window.getComputedStyle(t),c="rtl"!==i.direction,u=n(function(t,e,o){var r=n(M(e,o,t.block||"start",t.inline||"nearest"),3),l=r[0];return[r[1],r[2]].map((function(t,e){switch(t){case"center":return 1;case"nearest":return 0;default:return"start"===t==!(l>>e&1)?2:3}}))}(e,V(i.writingMode||i.getPropertyValue("-webkit-writing-mode")||i.getPropertyValue("-ms-writing-mode")),c),2),a=u[0],f=u[1],s=n(function(t,e,n){var o,r=e.top,l=e.right,i=e.bottom,c=e.left,u=(o=t.ownerDocument,["scroll-margin","scroll-snap-margin"].filter((function(t){return t in o.documentElement.style}))[0]);if(!u)return[r,l,i,c];var a=function(t){var e=n.getPropertyValue("".concat(u,"-").concat(t));return parseInt(e,10)||0};return[r-a("top"),l+a("right"),i+a("bottom"),c-a("left")]}(t,t.getBoundingClientRect(),i),4),d=s[0],v=s[1],w=s[2],m=s[3],h=k(t);null!==h;h=k(h)){if(r!==h.ownerDocument){if(!(l=(r=h.ownerDocument).defaultView))break;var p=h.getBoundingClientRect(),y=p.left,g=p.top;d+=g,v+=y,w+=g,m+=y}var b=l.getComputedStyle(h);if("fixed"===b.position)break;if(H(h,b)){var T=h.getBoundingClientRect(),E=n(j(h,T),4),S=E[0],P=E[1],L=E[2],B=E[3],W=I(a,B,P,h.clientWidth,m,v,v-m),C=I(f,S,L,h.clientHeight,d,w,w-d),O=null===W?0:_(W,m,v)-_(W,B,P),X=null===C?0:_(C,d,w)-_(C,S,L),Y=D(b)?x(O,-h.scrollWidth+h.clientWidth-h.scrollLeft,-h.scrollLeft):x(O,-h.scrollLeft,h.scrollWidth-h.clientWidth-h.scrollLeft),F=x(X,-h.scrollTop,h.scrollHeight-h.clientHeight-h.scrollTop);o.push([h,{left:h.scrollLeft+Y,top:h.scrollTop+F,behavior:e.behavior}]),d=Math.max(d-F,S),v=Math.min(v-Y,P),w=Math.min(w-F,L),m=Math.max(m-Y,B)}}return o},O=function(t,e,r){var l=e||{};if(!o(l.behavior))throw new TypeError(i("scrollIntoView","Element",l.behavior));C(t,l).forEach((function(t){var e=n(t,2),o=e[0],l=e[1];T(o,l,r)}))},X=O,Y=function(t,e){return function(n){if(!a()){var o={scroll:y,scrollTo:g,scrollBy:b}[t];e(t,(function(){var t=arguments;if(1!==arguments.length){var e=t[0],r=t[1];o(this,{left:e,top:r})}else o(this,t[0],n)}))}}},F=Y("scroll",s),A=Y("scrollTo",s),R=Y("scrollBy",s),N=function(t,e){f(e),c(window,t),window[t]=e},q=Y("scroll",N),z=Y("scrollTo",N),G=Y("scrollBy",N);function K(t){X(this,{block:null==t||t?"start":"end",inline:"nearest"})}var U=function(t){if(!a()){var e=c(window.HTMLElement.prototype,"scrollIntoView",K);s("scrollIntoView",(function(){var n=arguments,o=n[0];1===n.length&&u(o)?X(this,o,t):e.apply(this,n)}))}};t.elementScroll=T,t.elementScrollBy=S,t.elementScrollByPolyfill=R,t.elementScrollIntoView=X,t.elementScrollIntoViewPolyfill=U,t.elementScrollPolyfill=F,t.elementScrollTo=E,t.elementScrollToPolyfill=A,t.modifyWindow=N,t.polyfill=function(t){a()||(F(t),A(t),R(t),U(t),q(t),z(t),G(t))},t.scroll=y,t.scrollBy=b,t.scrollIntoView=O,t.scrollTo=g,t.windowScroll=P,t.windowScrollBy=B,t.windowScrollByPolyfill=G,t.windowScrollPolyfill=q,t.windowScrollTo=L,t.windowScrollToPolyfill=z,Object.defineProperty(t,"__esModule",{value:!0})})); +//# sourceMappingURL=bundle.min.cjs.map \ No newline at end of file diff --git a/src/assets/js/vendor/smoothscroll-anchor-polyfill.min.js b/src/assets/js/vendor/smoothscroll-anchor-polyfill.min.js index 6bcfb4f..c5ee9fd 100644 --- a/src/assets/js/vendor/smoothscroll-anchor-polyfill.min.js +++ b/src/assets/js/vendor/smoothscroll-anchor-polyfill.min.js @@ -1 +1,2 @@ -var e,t;e=function(){return(new function(){var e=this,t="undefined"!=typeof window;if(t)var n=window,o=document,r=o.documentElement,i=o.createElement("a");if(this.polyfill=function(r){if(r=r||{},t){var l=n.__forceSmoothscrollAnchorPolyfill__,a="boolean"==typeof r.force?r.force:l;if("scrollBehavior"in i.style&&!a)return e;e.destroy(),o.addEventListener("click",p,!1),o.addEventListener("scroll",S),n.addEventListener("hashchange",b)}return e},this.destroy=function(r){return r=r||{},t&&(o.removeEventListener("click",p,!1),o.removeEventListener("scroll",S),n.removeEventListener("hashchange",b)),e},t){var l=!1;try{var a=Object.defineProperty({},"preventScroll",{get:function(){l=!0}});i.focus(a)}catch(e){}var c,s=/scroll-behavior:[\s]*([^;"`'\s]+)/,u=getComputedStyle(r),f=[]}function h(){for(var e=[r.style.scrollBehavior,(s.exec(r.getAttribute("style"))||[])[1],u.getPropertyValue("--scroll-behavior"),(s.exec(u.fontFamily)||[])[1]],t=0;t0&&void 0!==arguments[0]?arguments[0]:{};if(m(),o){var t=n.__forceSmoothscrollAnchorPolyfill__,l="boolean"==typeof e.force?e.force:t;if(a()&&!l)return;r.addEventListener("click",b,!1),r.addEventListener("scroll",x),n.addEventListener("hashchange",S)}return y}function m(){return o&&(r.removeEventListener("click",b,!1),r.removeEventListener("scroll",x),n.removeEventListener("hashchange",S)),y}function b(e){var t=e.metaKey||e.ctrlKey||e.shiftKey||0!==e.button;if(!e.defaultPrevented&&!t&&v()){var o=s(e.target);if(o){var n=c(o.hash);n&&(e.preventDefault(),h(n),history.pushState&&history.pushState(null,r.title,o.href))}}}e.default=y;var g=[],E=function(){return l.scrollTop||r.body.scrollTop};function S(){if(r.body&&v()){var e=c(location.hash);if(e){var t=E(),o=g[g[1]===t?0:1];n.scroll({top:o,behavior:"instant"}),h(e)}}}function x(){r.body&&(g[0]=g[1],g[1]=E())}p()})); \ No newline at end of file diff --git a/src/assets/js/vendor/smoothscroll-polyfill.min.js b/src/assets/js/vendor/smoothscroll-polyfill.min.js deleted file mode 100644 index 0170c77..0000000 --- a/src/assets/js/vendor/smoothscroll-polyfill.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){"use strict";function o(){var o=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==o.__forceSmoothScrollPolyfill__)){var l,e=o.HTMLElement||o.Element,r=468,i={scroll:o.scroll||o.scrollTo,scrollBy:o.scrollBy,elementScroll:e.prototype.scroll||n,scrollIntoView:e.prototype.scrollIntoView},s=o.performance&&o.performance.now?o.performance.now.bind(o.performance):Date.now,c=(l=o.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(l)?1:0);o.scroll=o.scrollTo=function(){void 0!==arguments[0]&&(!0!==f(arguments[0])?h.call(o,t.body,void 0!==arguments[0].left?~~arguments[0].left:o.scrollX||o.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:o.scrollY||o.pageYOffset):i.scroll.call(o,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:o.scrollX||o.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:o.scrollY||o.pageYOffset))},o.scrollBy=function(){void 0!==arguments[0]&&(f(arguments[0])?i.scrollBy.call(o,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(o,t.body,~~arguments[0].left+(o.scrollX||o.pageXOffset),~~arguments[0].top+(o.scrollY||o.pageYOffset)))},e.prototype.scroll=e.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==f(arguments[0])){var o=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===o?this.scrollLeft:~~o,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},e.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==f(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},e.prototype.scrollIntoView=function(){if(!0!==f(arguments[0])){var l=function(o){for(;o!==t.body&&!1===(e=p(l=o,"Y")&&a(l,"Y"),r=p(l,"X")&&a(l,"X"),e||r);)o=o.parentNode||o.host;var l,e,r;return o}(this),e=l.getBoundingClientRect(),r=this.getBoundingClientRect();l!==t.body?(h.call(this,l,l.scrollLeft+r.left-e.left,l.scrollTop+r.top-e.top),"fixed"!==o.getComputedStyle(l).position&&o.scrollBy({left:e.left,top:e.top,behavior:"smooth"})):o.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function n(o,t){this.scrollLeft=o,this.scrollTop=t}function f(o){if(null===o||"object"!=typeof o||void 0===o.behavior||"auto"===o.behavior||"instant"===o.behavior)return!0;if("object"==typeof o&&"smooth"===o.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+o.behavior+" is not a valid value for enumeration ScrollBehavior.")}function p(o,t){return"Y"===t?o.clientHeight+c1?1:n,l=.5*(1-Math.cos(Math.PI*c)),e=t.startX+(t.x-t.startX)*l,i=t.startY+(t.y-t.startY)*l,t.method.call(t.scrollable,e,i),e===t.x&&i===t.y||o.requestAnimationFrame(d.bind(o,t))}function h(l,e,r){var c,f,p,a,h=s();l===t.body?(c=o,f=o.scrollX||o.pageXOffset,p=o.scrollY||o.pageYOffset,a=i.scroll):(c=l,f=l.scrollLeft,p=l.scrollTop,a=n),d({scrollable:c,method:a,startTime:h,startX:f,startY:p,x:e,y:r})}}"object"==typeof exports&&"undefined"!=typeof module?module.exports={polyfill:o}:o()}(); \ No newline at end of file diff --git a/src/site/config/asset-manifest.php b/src/site/config/asset-manifest.php index cf41e4c..cf28396 100644 --- a/src/site/config/asset-manifest.php +++ b/src/site/config/asset-manifest.php @@ -12,7 +12,7 @@ '/assets/js/vendor/alpine.min.js', '/assets/js/vendor/focus-visible.min.js', '/assets/js/vendor/object-fit-images.min.js', - '/assets/js/vendor/smoothscroll-polyfill.min.js', + '/assets/js/vendor/seamless-scroll-polyfill.min.js', '/assets/js/vendor/smoothscroll-anchor-polyfill.min.js', '/assets/fonts/Chivo_Light-Italic.woff2', '/assets/fonts/Chivo_Regular.woff2', diff --git a/src/site/snippets/head.php b/src/site/snippets/head.php index 3df5d1f..7f9e6fd 100644 --- a/src/site/snippets/head.php +++ b/src/site/snippets/head.php @@ -1,7 +1,7 @@
-
+

@@ -143,7 +143,7 @@ class="absolute object-cover w-full h-full transition-opacity ease-in"

-
+

@@ -173,7 +173,7 @@ class="absolute object-cover w-full h-full transition-opacity ease-in" ?> -
+