From 1108e5573a6289670b47675d2eedd9dc5787fd05 Mon Sep 17 00:00:00 2001 From: Mornieur Date: Tue, 8 Aug 2023 17:04:47 -0300 Subject: [PATCH] feat: add motion div into initial transition --- src/components/Header/index.tsx | 54 ++++---- src/components/VideoComponent/index.tsx | 54 +++++--- src/components/ViewComponent/index.tsx | 157 +++++++++++++----------- 3 files changed, 151 insertions(+), 114 deletions(-) diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index cbc5e55..2555c70 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -3,6 +3,7 @@ import * as S from './styles'; import logo from '../../assets/images/logo.png'; import assetHeader from '../../assets/images/asset-header.png'; import { FC } from 'react'; +import { motion } from 'framer-motion'; interface HeaderProps { minText?: string; @@ -17,28 +18,39 @@ export const Header: FC = ({ }) => { return ( -
- logo -
- - {minText} - {minTitle} - - {maxTitle} - asset - + +
+ logo +
+ + {minText} + {minTitle} + + {maxTitle} + asset + - - Conheça as estratégias que mudaram o jogo e como aplicá-las no - seu negócio - - + + Conheça as estratégias que mudaram o jogo e como aplicá-las + no seu negócio + +
+
); }; diff --git a/src/components/VideoComponent/index.tsx b/src/components/VideoComponent/index.tsx index 775ac76..cecfa0d 100644 --- a/src/components/VideoComponent/index.tsx +++ b/src/components/VideoComponent/index.tsx @@ -4,6 +4,7 @@ import videos from './data.json'; import { useEffect, useState } from 'react'; import { ModalView } from './ModalView'; import { BsFillPlayFill } from 'react-icons/bs'; +import { motion } from 'framer-motion'; export const VideoComponent = () => { const [isModalOpen, setIsModalOpen] = useState(false); @@ -26,26 +27,39 @@ export const VideoComponent = () => { )} {videos.map((video, index) => ( - - - - - - - - {video.title} - - - + <> + + + + + + + + + {video.title} + + + + + ))} diff --git a/src/components/ViewComponent/index.tsx b/src/components/ViewComponent/index.tsx index a150891..c6ebfec 100644 --- a/src/components/ViewComponent/index.tsx +++ b/src/components/ViewComponent/index.tsx @@ -35,83 +35,94 @@ export const ViewComponent: FC = ({ return ( - - {menuItems.map((item, index) => ( - { - setActiveButton(activeButton === item ? null : item); - }} - > - {item} - - ))} - -

{orderList}

- - setIsOpen(!isOpen)} + + + {menuItems.map((item, index) => ( + { + setActiveButton(activeButton === item ? null : item); + }} > - {dropDownText} - + ))} + +

{orderList}

+ + setIsOpen(!isOpen)} > - - - -
-
- + + + + + + - {itemText} - {itemText} - {itemText} - {itemText} - {itemText} - -
-
-
+ }} + style={{ + pointerEvents: isOpen ? 'auto' : 'none', + zIndex: isOpen ? '999' : 'none', + position: 'absolute', + maxWidth: '300px', + width: '100%', + }} + > + {itemText} + {itemText} + {itemText} + {itemText} + {itemText} + + + + +
); };