Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to be OCD with the formatting of your code (indenting and spacing) #107

Open
joostf opened this issue Jan 17, 2025 · 1 comment
Open

Comments

@joostf
Copy link
Member

joostf commented Jan 17, 2025

	function handleScroll() {
  		if (pastHalfScrollWidth()) { 
			backToHalfScrollWidth()
  		}
	}
	
	function pastHalfScrollWidth() {
		return scrollContainer.scrollLeft >= scrollContainer.scrollWidth / 2
	}
	
	function backToHalfScrollWidth(){
		scrollContainer.scrollLeft -= scrollContainer.scrollWidth / 2;
	}


	onMount(() => {
	// Initialize Lenis
	lenis = new Lenis({ infinite: true, syncTouch: true });


	// Define the requestAnimationFrame function
	function onRaf(time) {
	lenis.raf(time);
	requestAnimationFrame(onRaf);
	}


	// Start the animation frame loop
	requestAnimationFrame(onRaf);
	});


	onDestroy(() => {
		// Cleanup if necessary (e.g., stop the animation frame)
		lenis = null; // or any other cleanup logic if required
	});console.log('Scroll container:', scrollContainer);
	// console.log('Active filter:', $activeFilter);
	// console.log('Techniques:', techniques);
	console.log('Lenis:', lenis);
@joostf
Copy link
Member Author

joostf commented Jan 17, 2025

Agree on a convention!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant