mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-03 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 { debugData } from '../utils/debugData';
|
||||||
|
import { motion } from 'framer-motion';
|
||||||
import TopBar from './NavBars/TopBar';
|
import TopBar from './NavBars/TopBar';
|
||||||
import LeftBar from './NavBars/LeftBar';
|
import LeftBar from './NavBars/LeftBar';
|
||||||
import { Routes, Route } from 'react-router-dom';
|
import { Routes, Route } from 'react-router-dom';
|
||||||
import Resource from './Resource';
|
import Resource from './Resource';
|
||||||
import RightBar from './NavBars/RightBar';
|
import RightBar from './NavBars/RightBar';
|
||||||
import MainContent from './MainContent';
|
import MainContent from './MainContent';
|
||||||
|
import { useVisibility } from '../providers/VisibilityProvider';
|
||||||
|
|
||||||
debugData([
|
debugData([
|
||||||
{
|
{
|
||||||
@@ -14,19 +16,34 @@ debugData([
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const MotionBox = motion<BoxProps>(Box);
|
||||||
|
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
|
const { visible } = useVisibility();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Center w="100%" h="100%">
|
<Center w="100%" h="100%">
|
||||||
<Box width="60%" height="60%" backgroundColor="#191E26" borderRadius="1vh" color="white" fontFamily="Poppins">
|
{visible && (
|
||||||
<TopBar />
|
<MotionBox
|
||||||
<LeftBar />
|
animate={{ y: [100, 0] }}
|
||||||
<RightBar />
|
width="60%"
|
||||||
<MainContent>
|
height="60%"
|
||||||
<Routes>
|
backgroundColor="#191E26"
|
||||||
<Route path="/:resource" element={<Resource />} />
|
borderRadius="1vh"
|
||||||
</Routes>
|
color="white"
|
||||||
</MainContent>
|
fontFamily="Poppins"
|
||||||
</Box>
|
userSelect="none"
|
||||||
|
>
|
||||||
|
<TopBar />
|
||||||
|
<LeftBar />
|
||||||
|
<RightBar />
|
||||||
|
<MainContent>
|
||||||
|
<Routes>
|
||||||
|
<Route path="/:resource" element={<Resource />} />
|
||||||
|
</Routes>
|
||||||
|
</MainContent>
|
||||||
|
</MotionBox>
|
||||||
|
)}
|
||||||
</Center>
|
</Center>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user