All files / src/shared/Banner BackgroundAnimation.tsx

100% Statements 4/4
100% Branches 0/0
100% Functions 2/2
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53                  25x 784x             784x                                                                      
import { Box } from "@mui/material";
import { styled } from "@theme/v2/Provider";
import GiveAnimationWrapper from "shared/BannerAnimations/GiveAnimationWrapper";
import { PageAnimationsType } from "../BannerAnimations/animations";
 
type Props = {
  page: PageAnimationsType;
};
 
const BackgroundAnimation = ({ page }: Props) => {
  return (
    <StyledWrapper page={page} id="slide-me">
      <Box flexGrow={1} />
    </StyledWrapper>
  );
};
 
const StyledWrapper = styled(GiveAnimationWrapper)(({ theme, paddingTop }) => ({
  zIndex: 0,
  width: "100%",
  position: "absolute",
  height: "258px",
  padding: "64px 64px 0 64px",
  [theme.breakpoints.between("v2_sm", "v2_md")]: {
    height: "222px",
    padding: `${paddingTop}px 20px 0 20px`,
  },
  [theme.breakpoints.down("new_sm")]: {
    height: "fit-content",
    padding: `140px 20px 0 20px`,
  },
  "&::before": {
    content: '""',
    position: "absolute",
    top: 0,
    left: 0,
    right: 0,
    bottom: 0,
    background:
      "linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, #FFFFFF 85.53%)",
    [theme.breakpoints.down("new_sm")]: {
      background: `
      linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, #FFFFFF 59.03%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.09) 20.5%)
    `,
    },
    zIndex: 1,
    pointerEvents: "none",
  },
}));
 
export default BackgroundAnimation;