mirror of
https://github.com/koodiklinikka/koodiklinikka.fi.git
synced 2026-02-12 18:52:09 +00:00
fix: use a fixed brightness value in ssr
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user