-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
261 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
front-end/src/apps/audience-display/displays/seasons/fgc_default/components/match-title.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import styled from '@emotion/styled'; | ||
import { Match } from '@toa-lib/models'; | ||
|
||
const InfoContainer = styled.div` | ||
grid-area: info; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: #ffffff; | ||
border-radius: 0.5em; | ||
margin-left: 15%; | ||
margin-right: 15%; | ||
padding-top: .1em; | ||
padding-bottom: .1em; | ||
color: black; | ||
line-height: 0.95; | ||
font-size: 4vh; | ||
font-weight: 800; | ||
`; | ||
|
||
const MatchTitle = ({ match }: { match: Match<any> }) => { | ||
return ( | ||
<InfoContainer> | ||
<div>{match.name}</div> | ||
<div>Field {match.fieldNumber}</div> | ||
</InfoContainer> | ||
); | ||
}; | ||
|
||
export default MatchTitle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { Box } from '@mui/material'; | ||
import React, { useEffect, useState } from 'react'; | ||
|
||
interface AnimationProps { | ||
in: boolean; | ||
children: React.ReactNode; | ||
duration?: number; | ||
inDelay?: number; | ||
outDelay?: number; | ||
} | ||
|
||
const FadeInOut: React.FC<AnimationProps> = ({ | ||
in: elementIn, | ||
children, | ||
duration, | ||
inDelay, | ||
outDelay | ||
}) => { | ||
const [localIn, setLocalIn] = useState(false); | ||
|
||
useEffect(() => { | ||
let timeoutId: NodeJS.Timeout; | ||
|
||
const delay = elementIn ? inDelay : outDelay; | ||
|
||
if (typeof delay === 'number') { | ||
timeoutId = setTimeout(() => { | ||
setLocalIn(elementIn); | ||
}, delay * 1000); | ||
} else { | ||
setLocalIn(elementIn); | ||
} | ||
|
||
return () => { | ||
if (timeoutId) { | ||
clearTimeout(timeoutId); | ||
} | ||
}; | ||
}, [elementIn, inDelay, outDelay]); | ||
return ( | ||
<Box | ||
sx={{ | ||
opacity: localIn ? 1 : 0, | ||
transition: `opacity ${duration ?? 0.3}s ease-in-out` | ||
}} | ||
> | ||
{children} | ||
</Box> | ||
); | ||
}; | ||
|
||
export default FadeInOut; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import FadeInOut from "./fade-in-out"; | ||
import SlideInBottom from "./slide-in-bottom"; | ||
|
||
export { | ||
FadeInOut, | ||
SlideInBottom | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { Box } from '@mui/material'; | ||
import React, { useEffect, useState } from 'react'; | ||
|
||
interface AnimationProps { | ||
in: boolean; | ||
children: React.ReactNode; | ||
duration?: number; | ||
inDelay?: number; | ||
outDelay?: number; | ||
} | ||
|
||
const SlideInBottom: React.FC<AnimationProps> = ({ | ||
in: elementIn, | ||
children, | ||
duration, | ||
inDelay, | ||
outDelay | ||
}) => { | ||
const [localIn, setLocalIn] = useState(false); | ||
|
||
useEffect(() => { | ||
let timeoutId: NodeJS.Timeout; | ||
|
||
const delay = elementIn ? inDelay : outDelay; | ||
|
||
if (typeof delay === 'number') { | ||
timeoutId = setTimeout(() => { | ||
setLocalIn(elementIn); | ||
}, delay * 1000); | ||
} else { | ||
setLocalIn(elementIn); | ||
} | ||
|
||
return () => { | ||
if (timeoutId) { | ||
clearTimeout(timeoutId); | ||
} | ||
}; | ||
}, [elementIn, inDelay, outDelay]); | ||
|
||
return ( | ||
<Box | ||
sx={{ | ||
transform: `translateY(${localIn ? '0' : '100vh'})`, | ||
transition: `transform ${duration ?? 0.3}s ease-in-out`, | ||
overflow: 'hidden', | ||
height: '100vh', | ||
width: '100vw' | ||
}} | ||
> | ||
{children} | ||
</Box> | ||
); | ||
}; | ||
|
||
export default SlideInBottom; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
|
||
interface AbsoluteLodatorProps { | ||
children: React.ReactNode; | ||
top?: number; | ||
left?: number; | ||
right?: number; | ||
bottom?: number; | ||
} | ||
|
||
const AbsoluteLodator: React.FC<AbsoluteLodatorProps> = ({ | ||
children, | ||
top, | ||
left, | ||
bottom, | ||
right | ||
}) => { | ||
return ( | ||
<div style={{ position: 'absolute', top, left, bottom, right }}> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
export default AbsoluteLodator; |
Oops, something went wrong.