-
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.
- Loading branch information
1 parent
e35cb7f
commit 17bf4d6
Showing
16 changed files
with
265 additions
and
114 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
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,43 @@ | ||
import { Box } from "theme-ui"; | ||
import Image from "next/image"; | ||
|
||
/* | ||
* Use this component inside a container with CSS: | ||
* `position: relative; overflow: hidden;` | ||
* then pass width/height/alt/src as usual | ||
* (you can pass `gradient` valueless to avoid gradient) | ||
*/ | ||
|
||
const BGImg = ({ | ||
gradient = "linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.5))", | ||
alt = "", | ||
...props | ||
}) => ( | ||
<Box | ||
sx={{ | ||
position: "absolute", | ||
display: "block", | ||
top: 0, | ||
left: 0, | ||
right: 0, | ||
bottom: 0, | ||
zIndex: 0, | ||
"&:after": { | ||
content: '""', | ||
position: "absolute", | ||
backgroundImage: gradient, | ||
top: 0, | ||
left: 0, | ||
right: 0, | ||
bottom: 0, | ||
}, | ||
"> span": { height: "100% !important", width: "100% !important" }, | ||
img: { objectFit: "cover", objectPosition: "center center" }, | ||
"~ *": { position: "relative" }, | ||
}} | ||
> | ||
<Image layout="responsive" alt={alt} {...props} /> | ||
</Box> | ||
); | ||
|
||
export default BGImg; |
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,5 @@ | ||
export default function Comma({ children }) { | ||
return children | ||
? children.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") | ||
: ""; | ||
} |
File renamed without changes.
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
Empty file.
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.