mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-22 23:49:15 +00:00
refactor: remove usages of framer-motion
This commit is contained in:
committed by
Carlos Valente
parent
a4b15970de
commit
24d3bf05ca
@@ -1,4 +1,3 @@
|
|||||||
import { AnimatePresence } from 'framer-motion';
|
|
||||||
import {
|
import {
|
||||||
CustomFields,
|
CustomFields,
|
||||||
MessageState,
|
MessageState,
|
||||||
@@ -11,6 +10,7 @@ import {
|
|||||||
|
|
||||||
import { FitText } from '../../common/components/fit-text/FitText';
|
import { FitText } from '../../common/components/fit-text/FitText';
|
||||||
import MultiPartProgressBar from '../../common/components/multi-part-progress-bar/MultiPartProgressBar';
|
import MultiPartProgressBar from '../../common/components/multi-part-progress-bar/MultiPartProgressBar';
|
||||||
|
import TitleCard from '../../common/components/title-card/TitleCard';
|
||||||
import ViewLogo from '../../common/components/view-logo/ViewLogo';
|
import ViewLogo from '../../common/components/view-logo/ViewLogo';
|
||||||
import ViewParamsEditor from '../../common/components/view-params-editor/ViewParamsEditor';
|
import ViewParamsEditor from '../../common/components/view-params-editor/ViewParamsEditor';
|
||||||
import { useWindowTitle } from '../../common/hooks/useWindowTitle';
|
import { useWindowTitle } from '../../common/hooks/useWindowTitle';
|
||||||
@@ -21,7 +21,6 @@ import SuperscriptTime from '../../features/viewers/common/superscript-time/Supe
|
|||||||
import { getFormattedTimer, getTimerByType } from '../../features/viewers/common/viewUtils';
|
import { getFormattedTimer, getTimerByType } from '../../features/viewers/common/viewUtils';
|
||||||
import { useTranslation } from '../../translation/TranslationProvider';
|
import { useTranslation } from '../../translation/TranslationProvider';
|
||||||
|
|
||||||
import { MotionTitleCard, titleVariants } from './timer.animations';
|
|
||||||
import { getTimerOptions, useTimerOptions } from './timer.options';
|
import { getTimerOptions, useTimerOptions } from './timer.options';
|
||||||
import {
|
import {
|
||||||
getCardData,
|
getCardData,
|
||||||
@@ -189,37 +188,8 @@ export default function Timer(props: TimerProps) {
|
|||||||
|
|
||||||
{!hideCards && (
|
{!hideCards && (
|
||||||
<>
|
<>
|
||||||
<AnimatePresence>
|
{showNow && <TitleCard className='event now' label='now' title={nowMain} secondary={nowSecondary} />}
|
||||||
{showNow && (
|
{showNext && <TitleCard className='event next' label='next' title={nextMain} secondary={nextSecondary} />}
|
||||||
<MotionTitleCard
|
|
||||||
className='event now'
|
|
||||||
key='now'
|
|
||||||
variants={titleVariants}
|
|
||||||
initial='hidden'
|
|
||||||
animate='visible'
|
|
||||||
exit='exit'
|
|
||||||
label='now'
|
|
||||||
title={nowMain}
|
|
||||||
secondary={nowSecondary}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</AnimatePresence>
|
|
||||||
|
|
||||||
<AnimatePresence>
|
|
||||||
{showNext && (
|
|
||||||
<MotionTitleCard
|
|
||||||
className='event next'
|
|
||||||
key='next'
|
|
||||||
variants={titleVariants}
|
|
||||||
initial='hidden'
|
|
||||||
animate='visible'
|
|
||||||
exit='exit'
|
|
||||||
label='next'
|
|
||||||
title={nextMain}
|
|
||||||
secondary={nextSecondary}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</AnimatePresence>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
import { motion } from 'framer-motion';
|
|
||||||
|
|
||||||
import TitleCard from '../../common/components/title-card/TitleCard';
|
|
||||||
|
|
||||||
export const titleVariants = {
|
|
||||||
hidden: {
|
|
||||||
x: -2500,
|
|
||||||
},
|
|
||||||
visible: {
|
|
||||||
x: 0,
|
|
||||||
transition: {
|
|
||||||
duration: 1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
exit: {
|
|
||||||
x: -2500,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const MotionTitleCard = motion(TitleCard);
|
|
||||||
Reference in New Issue
Block a user