BackgroundImage.tsx 923 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { makeStyles } from "@material-ui/core";
  2. // import { useRouteMatch } from "react-router";
  3. const useStyles = makeStyles((theme) => ({
  4. holeOuterContainer: {
  5. maxWidth: "100%",
  6. width: "100%",
  7. position: "relative",
  8. },
  9. holeInnerContainer: {
  10. position: "absolute",
  11. zIndex: -1,
  12. left: "50%",
  13. transform: "translate(-50%, 0)",
  14. width: "100%",
  15. maxWidth: "100%",
  16. overflow: "hidden",
  17. display: "flex",
  18. justifyContent: "center",
  19. },
  20. holeImage: {
  21. width: "max(1200px, 100vw)",
  22. maxWidth: "1600px",
  23. },
  24. blurred: {
  25. filter: "blur(2px)",
  26. opacity: ".9",
  27. },
  28. }));
  29. const BackgroundImage = () => {
  30. const classes = useStyles();
  31. // const isHomepage = useRouteMatch({ path: "/", exact: true });
  32. return (
  33. <div className={classes.holeOuterContainer}>
  34. <div className={classes.holeInnerContainer}></div>
  35. </div>
  36. );
  37. };
  38. export default BackgroundImage;