File tree Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 33 < head >
44 {% gtm head %}
55 < meta charset ="utf-8 ">
6+ < meta name ="color-scheme " content ="dark ">
67
78 {% if page.json-ld %}
89 {% for item in site.data.seo[page.json-ld] %}
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ ul, ol { margin-left: 0; }
202202 top : 0 ;
203203 height : 100% ;
204204 width : 70vw ;
205- padding : 5vw 0 0 10 vw ;
205+ padding : 5vw 5 vw 0 5 vw ;
206206 scroll-snap-align : start ;
207207 scroll-snap-stop : always ;
208208 z-index : 3 ;
Original file line number Diff line number Diff line change @@ -87,9 +87,15 @@ const setCarousel = (scroller) => {
8787 const offsetWidth = target . offsetWidth ;
8888
8989 const checkPos = ( ) => {
90- [ ...target . children ] . map ( e => {
91- const toCenter = Math . abs ( window . outerWidth / 2 - e . getBoundingClientRect ( ) . left - e . getBoundingClientRect ( ) . width / 2 ) ;
92- const toCenter2 = window . outerWidth / 2 - e . getBoundingClientRect ( ) . left - e . getBoundingClientRect ( ) . width / 2 ;
90+ [ ...target . children ] . forEach ( e => {
91+ const childRect = e . getBoundingClientRect ( ) ;
92+ // Optimization: Only process elements currently visible on screen.
93+ if ( childRect . right < 0 || childRect . left > window . innerWidth ) {
94+ return ; // Skip heavy calculations for off-screen elements
95+ }
96+
97+ const toCenter = Math . abs ( window . innerWidth / 2 - childRect . left - childRect . width / 2 ) ;
98+ const toCenter2 = window . innerWidth / 2 - childRect . left - childRect . width / 2 ;
9399 const viewport = toCenter / offsetWidth * 100 ;
94100 const viewport2 = toCenter2 / offsetWidth * 100 ;
95101 e . style . setProperty ( '--viewport' , viewport ) ;
Original file line number Diff line number Diff line change @@ -6,6 +6,13 @@ function innitMobileNavbar() {
66 const navButton = document . querySelector ( '.menu-icon' ) ;
77 const closeMobileNavButton = document . querySelector ( '.menu-close-ico' )
88 const scroller = document . querySelector ( '.body-content' )
9+ const mainContent = document . querySelector ( '.body-content__main-section' ) ;
10+
11+ mainContent . addEventListener ( 'click' , ( ) => {
12+ if ( scroller . scrollLeft > 0 ) {
13+ scroller . scroll ( { left : 0 , behavior : "smooth" } ) ;
14+ }
15+ } ) ;
916
1017 closeMobileNavButton . addEventListener ( 'click' , ( ) => {
1118 scroller . scroll ( { left : 0 , behavior : "smooth" , } ) ;
You can’t perform that action at this time.
0 commit comments