@@ -63,24 +63,42 @@ for (const releaseCardContainer of releaseCardContainers) {
6363 } ) ;
6464 }
6565
66- releaseCardContainer . classList . add ( "overflow-y-hidden" ) ;
66+ // releaseCardContainer.classList.add("overflow-y-hidden");
6767}
6868const sectionContainers = Array . from (
69- document . querySelectorAll ( ".section-title" ) ,
69+ document . querySelectorAll ( ".section:has(.section -title) " ) ,
7070) ;
7171for ( const sectionContainer of sectionContainers ) {
7272 elements . push ( {
73- element : sectionContainer . querySelector ( "h3" ) ,
74- container : sectionContainer ,
73+ element : sectionContainer . querySelector (
74+ ".section-title h3, .section-title h4" ,
75+ ) ,
76+ container : sectionContainer . querySelector ( ".section-title" ) ,
7577 isLastOfType : true ,
7678 } ) ;
7779
78- sectionContainer . classList . add ( "overflow-y-hidden" ) ;
80+ const sectionLinks = sectionContainer . querySelector ( ".section-links" ) ;
81+ if ( sectionLinks == null ) {
82+ continue ;
83+ }
84+
85+ elements . push ( {
86+ element : sectionLinks ,
87+ container : sectionContainer . querySelector ( ".section-title" ) ,
88+ isLastOfType : true ,
89+ } ) ;
90+
91+ // sectionContainer.classList.add("overflow-y-hidden");
7992}
93+ elements . sort ( ( a , b ) => {
94+ const aRect = a . element . getBoundingClientRect ( ) ;
95+ const bRect = b . element . getBoundingClientRect ( ) ;
96+ return aRect . top - bRect . top ;
97+ } ) ;
8098for ( const element of elements ) {
8199 if ( element . element . getBoundingClientRect ( ) . top < windowHeight ) {
82100 if ( element . isLastOfType ) {
83- element . container . classList . remove ( "overflow-y-hidden" ) ;
101+ // element.container.classList.remove("overflow-y-hidden");
84102 }
85103 continue ;
86104 }
0 commit comments