diff --git a/src/pages/components/animate/index.tsx b/src/pages/components/animate/index.tsx index e77af3ae..48840557 100644 --- a/src/pages/components/animate/index.tsx +++ b/src/pages/components/animate/index.tsx @@ -1,18 +1,14 @@ import { Tabs, TabsProps } from 'antd'; import BackgroundView from './views/background'; -import DialogView from './views/dialog'; import Inview from './views/inview'; -import OtherView from './views/other'; import ScrollView from './views/scroll'; export default function Animate() { const TABS: TabsProps['items'] = [ { key: 'inview', label: 'In View', children: }, { key: 'scroll', label: 'Scroll', children: }, - { key: 'dialog', label: 'Dialog', children: }, { key: 'background', label: 'Background', children: }, - { key: 'other', label: 'Other', children: }, ]; return ; diff --git a/src/pages/components/animate/views/background.tsx b/src/pages/components/animate/views/background.tsx deleted file mode 100644 index 4f163d95..00000000 --- a/src/pages/components/animate/views/background.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function BackgroundView() { - return
; -} diff --git a/src/pages/components/animate/views/background/container.tsx b/src/pages/components/animate/views/background/container.tsx new file mode 100644 index 00000000..1c6ce52a --- /dev/null +++ b/src/pages/components/animate/views/background/container.tsx @@ -0,0 +1,35 @@ +import { m } from 'framer-motion'; +import { useEffect, useMemo } from 'react'; + +import Cover3 from '@/assets/images/cover/cover_3.jpg'; +import MotionContainer from '@/components/animate/motion-container'; +import { getVariant } from '@/components/animate/variants'; +import { useThemeToken } from '@/theme/hooks'; + +type Props = { + variant: string; +}; +export default function ContainerView({ variant }: Props) { + const { colorBgLayout } = useThemeToken(); + const varients = useMemo(() => getVariant(variant), [variant]); + const isKenburns = variant.includes('kenburns'); + + useEffect(() => { + console.log(varients); + }); + return ( +
+ + {isKenburns ? ( + + ) : ( + + )} + +
+ ); +} diff --git a/src/pages/components/animate/views/background/index.tsx b/src/pages/components/animate/views/background/index.tsx new file mode 100644 index 00000000..63b0e060 --- /dev/null +++ b/src/pages/components/animate/views/background/index.tsx @@ -0,0 +1,55 @@ +import { Card, Row, Col } from 'antd'; +import { useMemo, useState } from 'react'; + +import ControlPanel from '../../control-panel'; + +import ContainerView from './container'; +import Toolbar from './toolbar'; + +export default function BackgroundView() { + const defaultValue = useMemo(() => { + return { + selectedVariant: 'kenburnsTop', + }; + }, []); + const [selectedVariant, setSelectedVariant] = useState(defaultValue.selectedVariant); + + const onRefresh = () => { + setSelectedVariant(defaultValue.selectedVariant); + }; + return ( + + + + + + + + + + + + setSelectedVariant(varient)} + /> + + + + ); +} +const variantKey = [ + { + type: 'kenburns', + values: ['kenburnsTop', 'kenburnsBottom', 'kenburnsLeft', 'kenburnsRight'], + }, + { + type: 'pan', + values: ['panTop', 'panBottom', 'panLeft', 'panRight'], + }, + { + type: 'color change', + values: ['color2x', 'color3x', 'color4x', 'color5x'], + }, +]; diff --git a/src/pages/components/animate/views/background/toolbar.tsx b/src/pages/components/animate/views/background/toolbar.tsx new file mode 100644 index 00000000..30e8b2d2 --- /dev/null +++ b/src/pages/components/animate/views/background/toolbar.tsx @@ -0,0 +1,12 @@ +import { ReloadOutlined } from '@ant-design/icons'; + +type Props = { + onRefresh: VoidFunction; +}; +export default function Toolbar({ onRefresh }: Props) { + return ( +
+ +
+ ); +} diff --git a/src/pages/components/animate/views/dialog.tsx b/src/pages/components/animate/views/dialog.tsx deleted file mode 100644 index 61e4f1ef..00000000 --- a/src/pages/components/animate/views/dialog.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function DialogView() { - return
; -} diff --git a/src/pages/components/animate/views/other.tsx b/src/pages/components/animate/views/other.tsx deleted file mode 100644 index f5c047a1..00000000 --- a/src/pages/components/animate/views/other.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function OtherView() { - return
; -}