Skip to content

Commit

Permalink
fixed the scrolling issue with firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
GuidoMr committed Jan 23, 2024
1 parent 77a794b commit a6105c5
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions app/src/routes/24/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// Import types
import type { PageData } from './$types';
import { themeStore, isSmallDevice } from '$lib/stores';
import { onMount } from 'svelte';
// Data provided by the server load function
export let data: PageData;
Expand Down Expand Up @@ -35,16 +36,25 @@
logoWidth = lerp(120, innerWidth / 2, 1 - scrollPercentage * 0.02);
}
// THIS CODE IS RELATED TO SNAPPING TO THE TEAM PRESENTATION
// Element bindings
let scrollSnapStartMarker: HTMLElement;
let scrollSnapEndMarker: HTMLElement;
// Bounds for scroll snapping
let scrollSnapStartAdd: number = 120;
let scrollSnapStartRemove: number = 200;
let scrollSnapEndBound: number = 60;
// THIS CODE IS RELATED TO SNAPPING TO THE TEAM PRESENTATION
onMount(() => {
// If we are on firefox, change the scroll snapping
// I dont know why this works now, nor why it didnt work before i did this. All I know is DONT REMOVE THIS
if (navigator.userAgent.search('Firefox') > -1) {
console.log('FIREFOX');
scrollSnapStartRemove = 110;
scrollSnapEndBound = 500;
}
});
// Element bindings
let scrollSnapStartMarker: HTMLElement;
let scrollSnapEndMarker: HTMLElement;
// This event is triggered when the user scrolls the main page
function handleScroll(e: UIEvent) {
// Scrolling should be client-side only, so we disable all the fancy
Expand Down

0 comments on commit a6105c5

Please sign in to comment.