fix: use a fixed brightness value in ssr

This commit is contained in:
Petri Partio
2024-05-31 14:18:39 +03:00
parent d646681fe3
commit fd05d0d609

View File

@@ -3,6 +3,7 @@
import { useEffect, useState } from 'react';
const calculatedBrightnessValue = () => {
if (typeof window === 'undefined') return 1;
if (window.scrollY > 200) return 0.5;
const amountToDecrease = (window.scrollY / 200) * 0.5;
return 1 - amountToDecrease;