Skip to content

Commit

Permalink
Expand issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
nirnejak committed Oct 24, 2024
1 parent d490592 commit 570926c
Show file tree
Hide file tree
Showing 21 changed files with 5,939 additions and 5,923 deletions.
71 changes: 3 additions & 68 deletions app/details/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,82 +2,17 @@ import * as React from "react"

import { type Metadata } from "next"

import * as motion from "framer-motion/client"

import DataChangeAlertIllustration from "components/illustration/DataChangeAlert"
import DataSourceConnectionIllustration from "components/illustration/DataSourceConnection"
import DataThresholdAlertIllustration from "components/illustration/DataThresholdAlert"
import GroupDashboardIllustration from "components/illustration/GroupDashboard"
import TimelyUpdatesIllustration from "components/illustration/TimelyUpdates"
import { gridContainerVariants, gridItemVariants } from "utils/animationConfig"
import DetailsGallery from "components/DetailsGallery"
import { generateMetadata } from "utils/seo"

export const metadata: Metadata = generateMetadata({
path: "/",
path: "/details/",
title: "Details | SVG Animations",
description: "SVG Animations with Framer Motion",
})

const Details: React.FC = () => {
return (
<motion.main
variants={gridContainerVariants}
initial="hidden"
animate="visible"
className="grid grid-cols-1 gap-3 p-3 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4"
>
<motion.div
variants={gridItemVariants}
className="rounded-3xl bg-zinc-50 p-10"
>
<div className="flex">
<div className="m-auto">
<DataSourceConnectionIllustration />
</div>
</div>
</motion.div>
<motion.div
variants={gridItemVariants}
className="rounded-3xl bg-zinc-50 p-10"
>
<div className="flex">
<div className="m-auto">
<DataChangeAlertIllustration />
</div>
</div>
</motion.div>
<motion.div
variants={gridItemVariants}
className="rounded-3xl bg-zinc-50 p-10"
>
<div className="flex">
<div className="m-auto">
<DataThresholdAlertIllustration />
</div>
</div>
</motion.div>
<motion.div
variants={gridItemVariants}
className="rounded-3xl bg-zinc-50 p-10"
>
<div className="flex">
<div className="m-auto">
<TimelyUpdatesIllustration />
</div>
</div>
</motion.div>
<motion.div
variants={gridItemVariants}
className="rounded-3xl bg-zinc-50 p-10"
>
<div className="flex">
<div className="m-auto">
<GroupDashboardIllustration />
</div>
</div>
</motion.div>
</motion.main>
)
return <DetailsGallery />
}

export default Details
28 changes: 2 additions & 26 deletions app/others/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import * as React from "react"

import { type Metadata } from "next"

import * as motion from "framer-motion/client"

import SetAlertsIllustration from "components/illustration/SetAlerts"
import SlackAlertIllustration from "components/illustration/SlackAlert"
import { gridContainerVariants, gridItemVariants } from "utils/animationConfig"
import OthersGallery from "components/OthersGallery"
import { generateMetadata } from "utils/seo"

export const metadata: Metadata = generateMetadata({
Expand All @@ -16,27 +12,7 @@ export const metadata: Metadata = generateMetadata({
})

const Others: React.FC = () => {
return (
<motion.main
variants={gridContainerVariants}
initial="hidden"
animate="visible"
className="grid grid-cols-1 gap-3 p-3 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4"
>
<motion.div
variants={gridItemVariants}
className="rounded-3xl bg-zinc-50 p-10"
>
<SetAlertsIllustration />
</motion.div>
<motion.div
variants={gridItemVariants}
className="rounded-3xl bg-zinc-50 p-10"
>
<SlackAlertIllustration />
</motion.div>
</motion.main>
)
return <OthersGallery />
}

export default Others
76 changes: 2 additions & 74 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@ import * as React from "react"

import { type Metadata } from "next"

import * as motion from "framer-motion/client"

import AlertsIllustration from "components/illustration/Alerts"
import DashboardIllustration from "components/illustration/Dashboard"
import DataExportIllustration from "components/illustration/DataExport"
import PermissionsIllustration from "components/illustration/Permissions"
import QueryBuilderIllustration from "components/illustration/QueryBuilder"
import SavedQueryIllustration from "components/illustration/SavedQuery"
import SharingIllustration from "components/illustration/Sharing"
import VisualizeIllustration from "components/illustration/Visualize"
import { gridContainerVariants, gridItemVariants } from "utils/animationConfig"
import HomeGallery from "components/HomeGallery"
import { generateMetadata } from "utils/seo"

export const metadata: Metadata = generateMetadata({
Expand All @@ -22,69 +12,7 @@ export const metadata: Metadata = generateMetadata({
})

const Home: React.FC = () => {
return (
<motion.main
variants={gridContainerVariants}
initial="hidden"
animate="visible"
className="mb-20 grid min-h-screen grid-cols-1 gap-3 p-3 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4"
>
<motion.div
variants={gridItemVariants}
className="rounded-3xl bg-zinc-50 p-10"
>
<QueryBuilderIllustration />
</motion.div>
<motion.div
variants={gridItemVariants}
className="rounded-3xl bg-zinc-50 p-10"
>
<VisualizeIllustration />
</motion.div>
<motion.div
variants={gridItemVariants}
className="rounded-3xl bg-zinc-50 p-10"
>
<SavedQueryIllustration />
</motion.div>
<motion.div
variants={gridItemVariants}
className="rounded-3xl bg-zinc-50 p-10"
>
<DataExportIllustration />
</motion.div>
<motion.div
variants={gridItemVariants}
className="rounded-3xl bg-zinc-50 p-10"
>
<PermissionsIllustration />
</motion.div>
<motion.div
variants={gridItemVariants}
className="rounded-3xl bg-zinc-50 p-10"
>
<PermissionsIllustration />
</motion.div>
<motion.div
variants={gridItemVariants}
className="rounded-3xl bg-zinc-50 p-10"
>
<DashboardIllustration />
</motion.div>
<motion.div
variants={gridItemVariants}
className="rounded-3xl bg-zinc-50 p-10"
>
<AlertsIllustration />
</motion.div>
<motion.div
variants={gridItemVariants}
className="rounded-3xl bg-zinc-50 p-10"
>
<SharingIllustration />
</motion.div>
</motion.main>
)
return <HomeGallery />
}

export default Home
156 changes: 156 additions & 0 deletions components/DetailsGallery.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
"use client"
import * as React from "react"

import { AnimatePresence } from "framer-motion"
import * as motion from "framer-motion/client"

import ExpandButton from "components/ExpandButton"
import DataChangeAlertIllustration from "components/illustration/DataChangeAlert"
import DataSourceConnectionIllustration from "components/illustration/DataSourceConnection"
import DataThresholdAlertIllustration from "components/illustration/DataThresholdAlert"
import GroupDashboardIllustration from "components/illustration/GroupDashboard"
import TimelyUpdatesIllustration from "components/illustration/TimelyUpdates"
import { gridContainerVariants, gridItemVariants } from "utils/animationConfig"

const DetailsGallery: React.FC = () => {
const [isOpen, setIsOpen] = React.useState(false)
const [content, setContent] = React.useState<React.ReactNode>(null)

React.useEffect(() => {
const handleEsc = (event: KeyboardEvent): void => {
if (event.key === "Escape") {
setIsOpen(false)
setContent(null)
}
}

if (isOpen) {
document.body.style.overflowY = "hidden"
document.addEventListener("keydown", handleEsc)
}

return () => {
document.body.style.overflowY = "unset"
document.removeEventListener("keydown", handleEsc)
}
}, [isOpen, setIsOpen])

return (
<>
<motion.main
variants={gridContainerVariants}
initial="hidden"
animate="visible"
className="mb-20 grid grid-cols-1 gap-3 p-3 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4"
>
<motion.div
variants={gridItemVariants}
className="relative rounded-3xl bg-zinc-50 p-10"
>
<div className="flex">
<div className="m-auto">
<DataSourceConnectionIllustration />
<ExpandButton
isOpen={isOpen}
onClick={() => {
setIsOpen(!isOpen)
setContent(<DataSourceConnectionIllustration isExpanded />)
}}
/>
</div>
</div>
</motion.div>
<motion.div
variants={gridItemVariants}
className="relative rounded-3xl bg-zinc-50 p-10"
>
<div className="flex">
<div className="m-auto">
<DataChangeAlertIllustration />
<ExpandButton
isOpen={isOpen}
onClick={() => {
setIsOpen(!isOpen)
setContent(<DataChangeAlertIllustration isExpanded />)
}}
/>
</div>
</div>
</motion.div>
<motion.div
variants={gridItemVariants}
className="relative rounded-3xl bg-zinc-50 p-10"
>
<div className="flex">
<div className="m-auto">
<DataThresholdAlertIllustration />
<ExpandButton
isOpen={isOpen}
onClick={() => {
setIsOpen(!isOpen)
setContent(<DataThresholdAlertIllustration isExpanded />)
}}
/>
</div>
</div>
</motion.div>
<motion.div
variants={gridItemVariants}
className="relative rounded-3xl bg-zinc-50 p-10"
>
<div className="flex">
<div className="m-auto">
<TimelyUpdatesIllustration />
<ExpandButton
isOpen={isOpen}
onClick={() => {
setIsOpen(!isOpen)
setContent(<TimelyUpdatesIllustration isExpanded />)
}}
/>
</div>
</div>
</motion.div>
<motion.div
variants={gridItemVariants}
className="relative rounded-3xl bg-zinc-50 p-10"
>
<div className="flex">
<div className="m-auto">
<GroupDashboardIllustration />
<ExpandButton
isOpen={isOpen}
onClick={() => {
setIsOpen(!isOpen)
setContent(<GroupDashboardIllustration isExpanded />)
}}
/>
</div>
</div>
</motion.div>
</motion.main>

<AnimatePresence>
{isOpen && (
<motion.div
initial={{ translateY: 10, opacity: 0 }}
animate={{ translateY: 0, opacity: 1 }}
exit={{ translateY: 10, opacity: 0 }}
className="fixed left-0 top-0 z-10 grid h-screen w-screen place-content-center bg-zinc-100/80 backdrop-blur"
>
{content}
<ExpandButton
isOpen={isOpen}
onClick={() => {
setIsOpen(!isOpen)
setContent(null)
}}
/>
</motion.div>
)}
</AnimatePresence>
</>
)
}

export default DetailsGallery
Loading

0 comments on commit 570926c

Please sign in to comment.