-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SOEOPSFY24-296 | explore framer motion hero multi-overlay (#4)
* SOEOPSFY24-296 | explore framer motion hero multi-overlay * fixup formatting * adjust hero height * tweak feature
- Loading branch information
1 parent
780c52b
commit d32a35b
Showing
19 changed files
with
118 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const root = 'h-full max-h-[1200px] relative overflow-hidden'; | ||
export const wrapper = 'mr-0 au-ml-auto flex-col lg:flex-row'; | ||
export const gradient = 'absolute top-0 left-0 bg-feature-gradient-rl bg-feature-gradient-bt w-full h-full z-30'; | ||
export const contentWrapper = 'lg:rs-pr-9 ml-0 *:text-white z-50'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
'use client' | ||
|
||
import { HTMLAttributes } from 'react'; | ||
import { Container } from '../Container'; | ||
import { FlexBox } from '../FlexBox'; | ||
// import * as styles from './FeatureHero.styles'; | ||
import Image from 'next/image'; | ||
import ShapeA from '../images/shape-a'; | ||
import { motion, useScroll, useTransform } from 'framer-motion'; | ||
|
||
type FeatureHeroProps = HTMLAttributes<HTMLDivElement> & { | ||
children: React.ReactNode; | ||
imageSrc?: string; | ||
}; | ||
|
||
export const FeatureHero = ({ | ||
children, | ||
...props | ||
}: FeatureHeroProps) => { | ||
const { scrollYProgress } = useScroll(); | ||
const opacity = useTransform(scrollYProgress, [0, 0.05], [1, 0]); | ||
|
||
|
||
return ( | ||
<FlexBox {...props} as="section" alignItems="start" justifyContent="between" className="relative flex-col bg-soe-black h-auto w-full aspect-[16/9]"> | ||
<Container width="full" className='order-last flex flex-col rs-p-9 *:text-white z-50 lg:max-w-[50%] *:font-dm-sans bg-soe-black lg:bg-transparent'> | ||
{children} | ||
</Container> | ||
<div className="relative w-full bg-cool-grey lg:absolute lg:top-0 lg:left-0 h-auto z-10"> | ||
<Image className="absolute top-0 left-0 lg:left-[300px] z-0 w-full h-auto" | ||
alt="" | ||
src={`soe-centennial-nextjs/assets/images/Hawa-Racine-Thiam.jpg`} | ||
width={0} | ||
height={0} | ||
sizes="100vw" /> | ||
<motion.div className="absolute w-full h-full top-0 left-0 z-10" style={{ opacity }} > | ||
<div className="w-full h-full bg-plum-dark absolute top-0 left-0 z-10" /> | ||
<ShapeA className="absolute bottom-10 left-10 lg:left-[300px] z-20 *:stroke-plum" height={1200} /> | ||
</motion.div> | ||
<div className='absolute top-0 left-0 bg-transparent lg:bg-feature-gradient-rl bg-feature-gradient-bt w-full h-full z-50' /> | ||
<Image className="absolute top-0 left-0 lg:left-[300px] z-20 w-full h-auto" | ||
alt="" | ||
src={`soe-centennial-nextjs/assets/images/Hawa-Racine-Thiam_silhouette.png`} | ||
width={0} | ||
height={0} | ||
sizes="100vw" /> | ||
<div className='absolute top-0 left-0 bg-feature-gradient-bt w-full h-full z-50' /> | ||
</div> | ||
</FlexBox> | ||
)}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './FeatureHero'; | ||
export * from './FeatureHero.styles'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
export const root = 'overflow-hidden'; | ||
export const wrapper = 'mr-0 au-ml-auto flex-col lg:flex-row'; | ||
export const contentWrapper = 'lg:rs-pr-9 ml-0'; | ||
export const contentWrapper = 'lg:rs-pr-9 ml-0 flex flex-col'; | ||
export const heading = '2xl:whitespace-pre-line -mt-01em rs-mb-2 xl:max-w-1200'; | ||
export const superhead = 'order-first'; | ||
export const superhead = 'order-first mb-38'; | ||
export const body = 'max-w-[50ch] rs-mb-3 *:*:leading-snug'; | ||
export const imageWrapper = 'group relative w-300 h-300 perspective-600'; | ||
export const image = 'object-cover w-full h-full transform rotate-y-30 group-hocus:-rotate-y-30 skew-y-12 ease-in duration-300 rounded-[30px]'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { HtmlHTMLAttributes } from 'react'; | ||
|
||
type Props = HtmlHTMLAttributes<SVGSVGElement> & { | ||
height?: number | ||
width?: number | string | ||
} | ||
|
||
const ShapeA = ({ height = 900, width = '100%', ...props }: Props) => { | ||
return ( | ||
<svg {...props} width={width} height={height} viewBox="0 0 1106 1678" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M2.00037 408.703C2.00037 241.336 0.326884 187.778 222.899 187.778C445.471 187.778 699.839 187.778 781.839 187.778C929.104 187.778 930.778 2 781.839 2C632.9 2 408.654 2 335.021 2C130.857 2 149.266 355.145 335.021 355.145C520.777 355.145 833.716 355.145 907.349 355.145C1133.27 355.145 1149.15 505.985 1032.86 674.817C929.104 825.448 509.063 1392.82 432.083 1494.92C384.638 1557.84 326.401 1636.94 264.735 1660.61C135.222 1710.32 2.00037 1635.51 2.00037 1494.92C2.00037 1122.69 2.00037 615.681 2.00037 408.703Z" stroke="#F83535" stroke-width="3" /> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default ShapeA; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters