diff --git a/src/components/DataRoom/SeeMore/SlidingContent.tsx b/src/components/DataRoom/SeeMore/SlidingContent.tsx new file mode 100644 index 00000000..f3e84599 --- /dev/null +++ b/src/components/DataRoom/SeeMore/SlidingContent.tsx @@ -0,0 +1,27 @@ +import type { BaseBlock } from '@/components/Home/types' +import { Typography } from '@mui/material' +import { motion, useScroll, useTransform } from 'framer-motion' +import type { RefObject } from 'react' +import css from './styles.module.css' + +export default function SlidingContent({ + text, + containerRef, +}: { + text: BaseBlock['text'] + containerRef: RefObject +}) { + const { scrollYProgress } = useScroll({ + target: containerRef, + offset: ['start end', 'end start'], + }) + + const textOpacity = useTransform(scrollYProgress, [0, 0.3, 0.5, 0.65], [0, 1, 1, 0]) + const translate = useTransform(scrollYProgress, [0, 0.2, 0.55, 0.75], ['-250px', '0px', '0px', '250px']) + + return ( + + {text} + + ) +} diff --git a/src/components/DataRoom/SeeMore/index.tsx b/src/components/DataRoom/SeeMore/index.tsx new file mode 100644 index 00000000..02140af5 --- /dev/null +++ b/src/components/DataRoom/SeeMore/index.tsx @@ -0,0 +1,20 @@ +import type { BaseBlock } from '@/components/Home/types' +import { useRef } from 'react' +import dynamic from 'next/dynamic' +import css from './styles.module.css' + +const SlidingContent = dynamic(() => import('./SlidingContent')) + +const SeeMore = ({ text }: BaseBlock) => { + const backgroundRef = useRef(null) + + return ( +
+
+ +
+
+ ) +} + +export default SeeMore diff --git a/src/components/DataRoom/SeeMore/styles.module.css b/src/components/DataRoom/SeeMore/styles.module.css new file mode 100644 index 00000000..bf05317d --- /dev/null +++ b/src/components/DataRoom/SeeMore/styles.module.css @@ -0,0 +1,20 @@ +.sectionContainer { + height: 200vh; +} + +.stickyContainer { + height: 100vh; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + position: sticky; + top: 0; +} + +@media (max-width: 900px) { + .text { + padding: 60px; + text-align: center; + } +} diff --git a/src/content/dataroom.json b/src/content/dataroom.json index 43d413b9..4c56d1f4 100644 --- a/src/content/dataroom.json +++ b/src/content/dataroom.json @@ -83,6 +83,10 @@ ], "title": "Safe has more assets secured
than many Fintechs and CEXes" }, + { + "component": "DataRoom/SeeMore", + "text": "Want to see more?" + }, { "component": "DataRoom/ExternalLinksGrid", "title": "Dune Boards",