mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 14:38:50 +00:00
feat(nui): Entry animation
This commit is contained in:
1 parent
33969f57b0
commit
110cf81213
1 file changed
+28
-11
+28
-11
@@ -1,11 +1,13 @@
|
||||
import { Center, Box } from '@chakra-ui/react';
|
||||
import { Center, Box, BoxProps } from '@chakra-ui/react';
|
||||
import { debugData } from '../utils/debugData';
|
||||
import { motion } from 'framer-motion';
|
||||
import TopBar from './NavBars/TopBar';
|
||||
import LeftBar from './NavBars/LeftBar';
|
||||
import { Routes, Route } from 'react-router-dom';
|
||||
import Resource from './Resource';
|
||||
import RightBar from './NavBars/RightBar';
|
||||
import MainContent from './MainContent';
|
||||
import { useVisibility } from '../providers/VisibilityProvider';
|
||||
|
||||
debugData([
|
||||
{
|
||||
@@ -14,19 +16,34 @@ debugData([
|
||||
},
|
||||
]);
|
||||
|
||||
const MotionBox = motion<BoxProps>(Box);
|
||||
|
||||
const App: React.FC = () => {
|
||||
const { visible } = useVisibility();
|
||||
|
||||
return (
|
||||
<Center w="100%" h="100%">
|
||||
<Box width="60%" height="60%" backgroundColor="#191E26" borderRadius="1vh" color="white" fontFamily="Poppins">
|
||||
<TopBar />
|
||||
<LeftBar />
|
||||
<RightBar />
|
||||
<MainContent>
|
||||
<Routes>
|
||||
<Route path="/:resource" element={<Resource />} />
|
||||
</Routes>
|
||||
</MainContent>
|
||||
</Box>
|
||||
{visible && (
|
||||
<MotionBox
|
||||
animate={{ y: [100, 0] }}
|
||||
width="60%"
|
||||
height="60%"
|
||||
backgroundColor="#191E26"
|
||||
borderRadius="1vh"
|
||||
color="white"
|
||||
fontFamily="Poppins"
|
||||
userSelect="none"
|
||||
>
|
||||
<TopBar />
|
||||
<LeftBar />
|
||||
<RightBar />
|
||||
<MainContent>
|
||||
<Routes>
|
||||
<Route path="/:resource" element={<Resource />} />
|
||||
</Routes>
|
||||
</MainContent>
|
||||
</MotionBox>
|
||||
)}
|
||||
</Center>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user