-
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.
- Loading branch information
Showing
54 changed files
with
1,042 additions
and
309 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,24 @@ | ||
'use client'; | ||
|
||
import CaseDetailSidebar from '@/containers/case-detail/sidebar'; | ||
import CasesMap from '@/containers/cases/map'; | ||
import Sidebar from '@/containers/cases/sidebar'; | ||
import { Media } from '@/containers/media'; | ||
|
||
export default function ResponsiveCaseDetailPage() { | ||
return ( | ||
<> | ||
<Media lessThan="md" className="flex-1"> | ||
<CaseDetailSidebar /> | ||
</Media> | ||
<Media greaterThanOrEqual="md" className="relative flex flex-1"> | ||
<> | ||
<Sidebar> | ||
<CaseDetailSidebar /> | ||
</Sidebar> | ||
<CasesMap /> | ||
</> | ||
</Media> | ||
</> | ||
); | ||
} |
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,85 @@ | ||
'use client'; | ||
|
||
import { useRef, useState } from 'react'; | ||
|
||
import { motion, useInView } from 'framer-motion'; | ||
|
||
import CaseStudies from '@/containers/cases'; | ||
import FiltersContent from '@/containers/cases/header/filters/filters-dropdown/content'; | ||
import MobileFiltersDropdown from '@/containers/cases/header/filters/filters-dropdown/mobile'; | ||
import CasesMap from '@/containers/cases/map'; | ||
import Sidebar from '@/containers/cases/sidebar'; | ||
import CaseStudiesTotal from '@/containers/cases/total'; | ||
import { Media } from '@/containers/media'; | ||
|
||
import { ScrollArea } from '@/components/ui/scroll-area'; | ||
|
||
export default function ResponsiveCasesPage() { | ||
const ref = useRef<HTMLDivElement>(null); | ||
const inView = useInView(ref, { amount: 0.15 }); | ||
const [isFiltersOpen, setIsFiltersOpen] = useState(false); | ||
|
||
const handleOpenFilters = () => { | ||
setIsFiltersOpen((prev) => !prev); | ||
}; | ||
|
||
const closeFilters = () => { | ||
setIsFiltersOpen(false); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Media lessThan="md"> | ||
<motion.div | ||
className="fixed top-0 z-20 w-full justify-between border-b border-b-grey-800/20 bg-white duration-75 ease-in-out" | ||
variants={{ | ||
initial: { opacity: 0, y: '-100%', display: 'none' }, | ||
show: { opacity: 1, y: '0', display: 'flex' }, | ||
}} | ||
initial="initial" | ||
animate={inView ? 'initial' : 'show'} | ||
> | ||
<CaseStudiesTotal className="flex w-full items-center justify-between gap-4 px-4 text-lg"> | ||
<MobileFiltersDropdown onClickSearch={() => {}} onClickFilters={handleOpenFilters} /> | ||
</CaseStudiesTotal> | ||
</motion.div> | ||
<div className="px-4 md:p-[50px]" ref={ref}> | ||
<CaseStudiesTotal className="flex items-baseline justify-between gap-4 text-xl"> | ||
<MobileFiltersDropdown onClickSearch={() => {}} onClickFilters={handleOpenFilters} /> | ||
</CaseStudiesTotal> | ||
</div> | ||
<ScrollArea className="pb-8"> | ||
<div className="px-4 md:p-[50px]"> | ||
<CaseStudies /> | ||
</div> | ||
</ScrollArea> | ||
<motion.div | ||
className="fixed h-[calc(100%-128px)] rounded-t-3xl bg-grey-800 px-10 py-4" | ||
variants={{ | ||
initial: { opacity: 0, display: 'none', bottom: '-100%' }, | ||
show: { opacity: 1, display: 'flex', bottom: 0 }, | ||
}} | ||
initial="initial" | ||
animate={isFiltersOpen ? 'show' : 'initial'} | ||
> | ||
<FiltersContent onSetFiltersDone={closeFilters} onClearFiltersDone={closeFilters} /> | ||
</motion.div> | ||
</Media> | ||
<Media greaterThanOrEqual="md" className="relative flex flex-1"> | ||
<> | ||
<Sidebar> | ||
<div className="px-[60px]"> | ||
<CaseStudiesTotal className="text-xl" /> | ||
</div> | ||
<ScrollArea className="pb-8"> | ||
<div className="px-[60px]"> | ||
<CaseStudies /> | ||
</div> | ||
</ScrollArea> | ||
</Sidebar> | ||
<CasesMap /> | ||
</> | ||
</Media> | ||
</> | ||
); | ||
} |
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,13 @@ | ||
'use client'; | ||
|
||
import { mediaStyles } from '@/containers/media'; | ||
|
||
function RootHead() { | ||
return ( | ||
<head> | ||
<style key="fresnel-css" dangerouslySetInnerHTML={{ __html: mediaStyles }} type="text/css" /> | ||
</head> | ||
); | ||
} | ||
|
||
export default RootHead; |
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
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,59 @@ | ||
import { useRef, useEffect } from 'react'; | ||
|
||
import { useCycle, motion } from 'framer-motion'; | ||
|
||
import { MenuToggle } from '@/components/animated-menu/toggle'; | ||
|
||
export const useDimensions = (ref) => { | ||
const dimensions = useRef({ width: 0, height: 0 }); | ||
|
||
useEffect(() => { | ||
dimensions.current.width = ref.current.offsetWidth; | ||
dimensions.current.height = ref.current.offsetHeight; | ||
}, [ref]); | ||
|
||
return dimensions.current; | ||
}; | ||
|
||
const sidebar = { | ||
open: (height = 1000) => ({ | ||
clipPath: `circle(${height * 2 + 200}px at 710px 42px)`, | ||
transition: { | ||
type: 'spring', | ||
stiffness: 20, | ||
restDelta: 2, | ||
}, | ||
}), | ||
closed: { | ||
clipPath: 'circle(30px at 710px 42px)', | ||
transition: { | ||
// delay: 0.5, | ||
type: 'spring', | ||
stiffness: 400, | ||
damping: 40, | ||
}, | ||
}, | ||
}; | ||
|
||
export default function AnimatedMenu() { | ||
const [isOpen, toggleOpen] = useCycle(false, true); | ||
const containerRef = useRef(null); | ||
const { height } = useDimensions(containerRef); | ||
|
||
return ( | ||
<motion.nav | ||
initial={false} | ||
animate={isOpen ? 'open' : 'closed'} | ||
custom={height} | ||
ref={containerRef} | ||
className="absolute bottom-0 right-0 top-0 w-[740px]" | ||
> | ||
<motion.div | ||
className="absolute bottom-0 right-0 top-0 w-[740px] bg-orange-500" | ||
variants={sidebar} | ||
/> | ||
{/*<Navigation />*/} | ||
<MenuToggle toggle={() => toggleOpen()} /> | ||
</motion.nav> | ||
); | ||
} |
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,40 @@ | ||
import * as React from 'react'; | ||
|
||
import { motion } from 'framer-motion'; | ||
|
||
const Path = (props) => ( | ||
<motion.path | ||
fill="transparent" | ||
strokeWidth="3" | ||
stroke="hsl(0, 0%, 18%)" | ||
strokeLinecap="round" | ||
{...props} | ||
/> | ||
); | ||
|
||
export const MenuToggle = ({ toggle }) => ( | ||
<button onClick={toggle} className="absolute right-[18px] top-[33px] rounded-full"> | ||
<svg width="23" height="23" viewBox="0 0 23 23"> | ||
<Path | ||
variants={{ | ||
closed: { d: 'M 2 2.5 L 20 2.5' }, | ||
open: { d: 'M 3 16.5 L 17 2.5' }, | ||
}} | ||
/> | ||
<Path | ||
d="M 2 9.423 L 20 9.423" | ||
variants={{ | ||
closed: { opacity: 1 }, | ||
open: { opacity: 0 }, | ||
}} | ||
transition={{ duration: 0.1 }} | ||
/> | ||
<Path | ||
variants={{ | ||
closed: { d: 'M 2 16.346 L 20 16.346' }, | ||
open: { d: 'M 3 2.5 L 17 16.346' }, | ||
}} | ||
/> | ||
</svg> | ||
</button> | ||
); |
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
Oops, something went wrong.