Skip to content

Commit

Permalink
fix: use a fixed brightness value in ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
peritpatrio committed May 31, 2024
1 parent d646681 commit fd05d0d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions components/TopFade.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fd05d0d

Please sign in to comment.