Files
twenty/packages/twenty-website-new/src/sections/HomeStepper/components/StepperVisualFrame/StepperVisualFrame.tsx
T
Abdullah. 94e019f012 Complete the structure for homepage in new website. (#19162)
This PR completes the sections we need for the Homepage. Assets, such as
images, are still placeholder, and will be replaced as they become
available. We're still waiting on Lottie and 3d asset files from the
design team.
2026-03-31 17:19:50 +00:00

81 lines
1.6 KiB
TypeScript

import { css } from '@linaria/core';
import { styled } from '@linaria/react';
import NextImage from 'next/image';
import type { ReactNode } from 'react';
const FrameRoot = styled.div`
position: relative;
width: 100%;
aspect-ratio: 672 / 705;
`;
const PatternBackdrop = styled.div`
inset: 0;
opacity: 0.55;
pointer-events: none;
position: absolute;
z-index: 0;
`;
const patternImageClassName = css`
object-fit: cover;
object-position: center;
`;
const SlideArea = styled.div`
inset: 0;
position: absolute;
z-index: 1;
`;
const ShapeOverlay = styled.div`
inset: 0;
pointer-events: none;
position: absolute;
z-index: 2;
`;
const shapeImageClassName = css`
height: 100%;
object-fit: fill;
object-position: center;
width: 100%;
`;
type StepperVisualFrameProps = {
backgroundSrc: string;
children?: ReactNode;
shapeSrc: string;
};
export function StepperVisualFrame({
backgroundSrc,
children,
shapeSrc,
}: StepperVisualFrameProps) {
return (
<FrameRoot>
<PatternBackdrop aria-hidden>
<NextImage
alt=""
className={patternImageClassName}
fill
sizes="(min-width: 921px) 672px, 100vw"
src={backgroundSrc}
/>
</PatternBackdrop>
<SlideArea>{children}</SlideArea>
<ShapeOverlay aria-hidden>
<NextImage
alt=""
className={shapeImageClassName}
fill
priority={false}
sizes="(min-width: 921px) 672px, 100vw"
src={shapeSrc}
/>
</ShapeOverlay>
</FrameRoot>
);
}