mirror of
				https://codeberg.org/ashley/poke
				synced 2025-07-17 16:52:11 +00:00 
			
		
		
		
	add IntersectionObserver
This commit is contained in:
		
							parent
							
								
									4c767b2deb
								
							
						
					
					
						commit
						2becd43185
					
				| @ -1621,6 +1621,21 @@ if (/[?&]autoplay=/.test(location.search)) { | ||||
|   } | ||||
| } | ||||
|    | ||||
| const lazyElements = document.querySelectorAll('*'); | ||||
| 
 | ||||
| const observer = new IntersectionObserver((entries, observer) => { | ||||
|   entries.forEach(entry => { | ||||
|     if (entry.isIntersecting) { | ||||
|       entry.target.classList.add('loaded'); | ||||
|       observer.unobserve(entry.target); | ||||
|     } | ||||
|   }); | ||||
| }); | ||||
| 
 | ||||
| lazyElements.forEach(element => { | ||||
|   observer.observe(element); | ||||
| }); | ||||
|    | ||||
| // Function to refresh the page | ||||
| const refreshPage = () => { | ||||
|   location.reload(); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Ashley
						Ashley