import React from 'react' import { ParallaxBanner, ParallaxProvider } from 'react-scroll-parallax' import { Box, Grid, IconButton, Typography, useTheme } from '@mui/material' import { ExpandMore } from '@mui/icons-material' import { useViewport } from 'components/utils/viewport/index.js' type AnchorType = 'left' | 'top' | 'right' | 'bottom' type Props = { image: string title: string caption: React.ReactNode children: React.ReactNode mobileImage?: string ref?: React.ForwardedRef anchor?: AnchorType scrollTarget?: React.ForwardedRef } const Description = (props: Props) => { switch (props.anchor) { case 'bottom': return ( ({ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center', position: 'absolute', bgcolor: 'background.default', opacity: 0.9, bottom: '0', borderTopStyle: 'solid', borderTopWidth: theme.spacing(0.5), borderTopColor: theme.palette.primary.main, p: `${theme.spacing(7)} ${theme.spacing(5)} ${theme.spacing(5.5)} ${theme.spacing(5)}`, })}> {props.title} {props.caption} {props.children} ) case 'top': return ( ({ display: 'flex', position: 'absolute', bgcolor: 'background.default', opacity: 0.9, top: '0', ml: 'auto', borderBottomWidth: theme.spacing(0.5), // borderTopWidth: '0.35em', borderBottomStyle: 'solid', borderBottomColor: theme.palette.primary.main, p: `${theme.spacing(5)} ${theme.spacing(5)} ${theme.spacing(3)} ${theme.spacing(5)}`, // p: '5.1em 3.1em 3.1em 3.1em', })}> {props.title} {props.caption} {props.children} ) case 'right': return ( ({ height: '102%', width: '28em', position: 'absolute', bgcolor: 'background.default', opacity: 0.9, right: '0', borderLeftWidth: theme.spacing(0.5), // borderLeftWidth: '0.35em', borderLeftStyle: 'solid', borderLeftColor: theme.palette.primary.main, p: `${theme.spacing(10)} ${theme.spacing(5)} ${theme.spacing(5)} ${theme.spacing(5)}`, // p: '5.1em 3.1em 3.1em 3.1em', })}> {props.title} {props.caption} {props.children} ) case 'left': return ( ({ height: '102%', width: '28em', position: 'absolute', bgcolor: 'background.default', opacity: 0.9, left: '0', borderRightWidth: theme.spacing(0.5), // borderLeftWidth: '0.35em', borderRightStyle: 'solid', borderRightColor: theme.palette.primary.main, p: `${theme.spacing(10)} ${theme.spacing(5)} ${theme.spacing(5)} ${theme.spacing(5)}`, // p: '5.1em 3.1em 3.1em 3.1em', })}> {props.title} {props.caption} {props.children} ) } } const DesktopComponent = React.forwardRef((props, ref) => { return (
{props.scrollTarget && ( (props.scrollTarget as React.RefObject).current?.scrollIntoView()} sx={{ position: 'absolute', p: 1, bottom: 2, left: '50%', transform: 'translate(-50%, 0)' }}> )}
) }) const MobileComponent = React.forwardRef((props, ref) => { return ( ({ mt: theme.spacing(-1.05), borderTopStyle: 'solid', borderTopWidth: theme.spacing(0.5), borderTopColor: theme.palette.primary.main, p: `${theme.spacing(7)} ${theme.spacing(5)} ${theme.spacing(5.5)} ${theme.spacing(5)}`, })}> {props.title} {props.caption} {props.children} ) }) const ProjectSpotlight = React.forwardRef((props, ref) => { const { width } = useViewport() const theme = useTheme() return width < theme.breakpoints.values.md ? : }) export default ProjectSpotlight