@@ -35,18 +35,45 @@ <h2>A Global Community, Growing Every Day</h2>
3535 < div class ="photos-wrapper ">
3636 < div class ="photos " data-dsap >
3737 < figure class ="photo large ">
38- < img src ="/images/community/utrecht.webp " alt ="A crowd of people gathering in a bar - Utrecht, Netherlands " />
38+ < img src ="/images/community/utrecht.webp "
39+ alt ="A crowd of people gathering in a bar - Utrecht, Netherlands " />
3940 < figcaption > Community Day 2025 - Utrecht</ figcaption >
4041 </ figure >
4142 < figure class ="photo medium ">
42- < img src ="/images/community/berlin.webp " alt ="A group of 6 people standing in front of a bar - Berlin, Germany " />
43+ < img src ="/images/community/berlin.webp "
44+ alt ="A group of 6 people standing in front of a bar - Berlin, Germany " />
4345 < figcaption > Community Meetup - IFA Berlin 2025</ figcaption >
4446 </ figure >
4547 < figure class ="photo small ">
46- < img src ="/images/community/columbus.webp " alt ="A few people gathering around a table demonstrating ESP32 hardware - Columbus, Ohio " />
48+ < img src ="/images/community/columbus.webp "
49+ alt ="A few people gathering around a table demonstrating ESP32 hardware - Columbus, Ohio " />
4750 < figcaption > Community Day 2025 - Columbus</ figcaption >
4851 </ figure >
4952 </ div >
5053 </ div >
5154 </ div >
52- </ section >
55+ </ section >
56+ < script >
57+ document . addEventListener ( "DOMContentLoaded" , function ( ) {
58+ const observer = new IntersectionObserver ( ( entries ) => {
59+ entries . forEach ( ( entry ) => {
60+ if ( entry . isIntersecting ) {
61+ const stats = document . querySelectorAll ( "#global .stat-value span[data-value]" ) ;
62+ stats . forEach ( ( stat ) => {
63+ let demo = new countUp . CountUp ( stat , stat . getAttribute ( "data-value" ) ) ;
64+ if ( ! demo . error ) {
65+ demo . start ( ) ;
66+ } else {
67+ console . error ( demo . error ) ;
68+ }
69+ } ) ;
70+ observer . unobserve ( entry . target ) ;
71+ }
72+ } ) ;
73+ } , { threshold : 0.1 } ) ;
74+ const statsElement = document . querySelector ( "#global .stats" ) ;
75+ if ( statsElement ) {
76+ observer . observe ( statsElement ) ;
77+ }
78+ } ) ;
79+ </ script >
0 commit comments