-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improved crossfader + favicons + stuff
- Loading branch information
1 parent
f2408f5
commit 0dcc593
Showing
13 changed files
with
128 additions
and
12 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file not shown.
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
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,11 @@ | ||
export const FONT_WEIGHTS = new Map([ | ||
["Thin", "100"], | ||
["Extra Light", "200"], | ||
["Light", "300"], | ||
["Regular", "400"], | ||
["Medium", "500"], | ||
["Semi Bold", "600"], | ||
["Bold", "700"], | ||
["Extra Bold", "800"], | ||
["Black", "900"], | ||
]); |
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,37 @@ | ||
import { ComputedOpacity } from "../types"; | ||
|
||
export const getComputedOpacity = (value: number): ComputedOpacity => { | ||
// the idea of this method is to reproduce a crossfader effect | ||
// example: | ||
// original value 50: 100% + 100% | ||
// original value 25: 100% + 50% | ||
// original value 75: 50% + 100% | ||
|
||
if (value === 50) { | ||
return { | ||
finalFontOpacity: 100, | ||
fallbackFontOpacity: 100, | ||
}; | ||
} | ||
|
||
const convertedPercentage = (100 * value) / 50; | ||
|
||
if (value < 50) { | ||
return { | ||
finalFontOpacity: 100, | ||
fallbackFontOpacity: convertedPercentage, | ||
}; | ||
} | ||
|
||
if (value > 50) { | ||
return { | ||
finalFontOpacity: 100 - (convertedPercentage - 100), | ||
fallbackFontOpacity: 100, | ||
}; | ||
} | ||
|
||
return { | ||
finalFontOpacity: 100, | ||
fallbackFontOpacity: 100, | ||
}; | ||
}; |