-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1001 from Applefrittr/main
Issue #1000 Responsive design changes and element overhaul to Player Loadout in tarkov.dev/players/* pages
- Loading branch information
Showing
10 changed files
with
5,878 additions
and
516 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { useState, useEffect } from 'react'; | ||
|
||
const useResponsiveScaling = () => { | ||
const [scaler, setScaler] = useState(1); | ||
useEffect(() => { | ||
const adjustScaler = () => { | ||
const width = window.innerWidth; | ||
if (width >= 1000) { | ||
setScaler(1); | ||
} else if (width <= 500) { | ||
setScaler(2); | ||
} else setScaler(1.5); | ||
}; | ||
|
||
adjustScaler(); | ||
|
||
window.addEventListener('resize', adjustScaler, false); | ||
return () => { | ||
window.removeEventListener('resize', adjustScaler); | ||
}; | ||
}, []); | ||
return scaler; | ||
}; | ||
|
||
export default useResponsiveScaling; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.