-
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.
Merge pull request #17 from bibudem/feature/footer
Feature/footer
- Loading branch information
Showing
23 changed files
with
581 additions
and
392 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# >0.25%, not dead | ||
last 2 versions | ||
>0.25%, not dead | ||
#last 2 versions |
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,8 @@ | ||
{ | ||
"conventionalCommits.scopes": [ | ||
"icons", | ||
"coquille", | ||
"theme", | ||
"accessibilite" | ||
] | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,73 @@ | ||
import { useEffect, useState } from 'react' | ||
import { Box, useMediaQuery, useTheme } from '@mui/material' | ||
import Color from 'color' | ||
import ContrastColor from 'contrast-color' | ||
|
||
export default function Debug() { | ||
const [resolution, setResolution] = useState('') | ||
const theme = useTheme() | ||
const cc = new ContrastColor() | ||
const queriesLength = theme.breakpoints.keys.length | ||
const queries = theme.breakpoints.keys.map((key, i) => { | ||
// `hsl(from red calc(h + ${(360 / queries.length) * resolution.i}) s l)` | ||
const bg = Color('#ff0000') | ||
.rotate((360 / queriesLength) * i) | ||
.hex() | ||
return { | ||
i, | ||
key, | ||
match: useMediaQuery(theme.breakpoints.only(key)), | ||
range: `${theme.breakpoints.values[key]} - ${i + 1 === theme.breakpoints.keys.length ? '' : theme.breakpoints.values[theme.breakpoints.keys[i + 1]]}`, | ||
color: cc.contrastColor({ bgColor: bg }), | ||
bg, | ||
} | ||
}) | ||
|
||
useEffect(() => { | ||
const newResolution = queries.find((query) => query.match) | ||
if (resolution.key !== newResolution.key) { | ||
setResolution(newResolution) | ||
} | ||
}, queries) | ||
|
||
return ( | ||
<Box | ||
sx={{ | ||
position: 'fixed', | ||
top: '0', | ||
left: '0', | ||
zIndex: 9999999, | ||
fontSize: '.7rem', | ||
lineHeight: 1, | ||
textAlign: 'center', | ||
backgroundColor: 'rgb(255 255 255 / 76%)', | ||
}} | ||
> | ||
<Box sx={{ padding: '.5em .35em .35em .5em' }}> | ||
<Box | ||
sx={{ | ||
color: resolution.color, | ||
backgroundColor: resolution.bg, | ||
borderRadius: '2px', | ||
lineHeight: 1, | ||
padding: '.325em', | ||
}} | ||
> | ||
{resolution.key} | ||
</Box> | ||
<Box | ||
pt={0.25} | ||
sx={{ | ||
fontSize: '.85em', | ||
color: '#000', | ||
backgroundColor: '#fff', | ||
borderRadius: '0 0 2px 2px', | ||
padding: '2px 3px', | ||
}} | ||
> | ||
{resolution.range} | ||
</Box> | ||
</Box> | ||
</Box> | ||
) | ||
} |
Oops, something went wrong.