-
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.
Merge pull request #228 from BinaryStudioAcademy/task/OV-144-add-scri…
…pt-generation-for-videos OV-144: Add Script Generation For Videos
- Loading branch information
Showing
17 changed files
with
324 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,10 @@ export { | |
Spinner, | ||
Stack, | ||
Tab, | ||
TabList, | ||
TabPanel, | ||
TabPanels, | ||
Tabs, | ||
Text, | ||
Tooltip, | ||
VStack, | ||
|
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
29 changes: 29 additions & 0 deletions
29
...nt/components/generate-script-placeholder-content/generate-script-placeholder-content.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,29 @@ | ||
import { type ComponentWithAs, type IconProps } from '@chakra-ui/react'; | ||
|
||
import { Flex, Icon, Text } from '~/bundles/common/components/components.js'; | ||
|
||
import styles from './styles.module.css'; | ||
|
||
type Properties = { | ||
message: string; | ||
icon?: ComponentWithAs<'svg', IconProps>; | ||
}; | ||
|
||
const GenerateScriptPlaceholderContent: React.FC<Properties> = ({ | ||
message, | ||
icon, | ||
}) => ( | ||
<Flex className={styles['scriptPlaceholderContentContainer']}> | ||
{icon && ( | ||
<Icon | ||
as={icon} | ||
className={styles['scriptPlaceholderContentIcon']} | ||
/> | ||
)} | ||
<Text className={styles['scriptPlaceholderContentText']} variant="H3"> | ||
{message} | ||
</Text> | ||
</Flex> | ||
); | ||
|
||
export { GenerateScriptPlaceholderContent }; |
20 changes: 20 additions & 0 deletions
20
...ents/video-modal-content/components/generate-script-placeholder-content/styles.module.css
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,20 @@ | ||
.scriptPlaceholderContentContainer { | ||
gap: 10px; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
.scriptPlaceholderContentIcon { | ||
color: var(--chakra-colors-brand-secondary-300); | ||
opacity: 0.5; | ||
font-size: 2rem; | ||
} | ||
.scriptPlaceholderContentText { | ||
color: var(--chakra-colors-gray-400); | ||
width: 40%; | ||
min-width: 175px; | ||
text-align: center; | ||
font-style: italic; | ||
} |
58 changes: 47 additions & 11 deletions
58
...ideo-modal-content/components/generate-script-placeholder/generate-script-placeholder.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
18 changes: 4 additions & 14 deletions
18
...l/components/video-modal-content/components/generate-script-placeholder/styles.module.css
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 |
---|---|---|
@@ -1,19 +1,9 @@ | ||
.scriptPlaceholderContainer { | ||
width: 100%; | ||
height: 100vh; | ||
min-height: 480px; | ||
max-height: 480px; | ||
overflow-y: auto; | ||
padding: 40px; | ||
gap: 10px; | ||
} | ||
|
||
.scriptPlaceholderIcon { | ||
color: var(--chakra-colors-brand-secondary-300); | ||
opacity: 0.5; | ||
font-size: 2rem; | ||
} | ||
|
||
.scriptPlaceholderText { | ||
color: var(--chakra-colors-gray-400); | ||
width: 40%; | ||
min-width: 175px; | ||
text-align: center; | ||
font-style: italic; | ||
} |
39 changes: 39 additions & 0 deletions
39
...components/video-modal-content/components/generate-script-scene/generate-script-scene.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,39 @@ | ||
import { Box, Heading } from '~/bundles/common/components/components.js'; | ||
import { useCallback, useState } from '~/bundles/common/hooks/hooks.js'; | ||
import { type VideoScript } from '~/bundles/common/types/types.js'; | ||
|
||
import styles from './styles.module.css'; | ||
|
||
type Properties = { | ||
videoScript: VideoScript; | ||
}; | ||
|
||
const GenerateScriptScene: React.FC<Properties> = ({ videoScript }) => { | ||
const { title, description } = videoScript; | ||
const [animationDone, setAnimationDone] = useState(false); | ||
|
||
const handleAnimationEnd = useCallback(() => { | ||
setAnimationDone(true); | ||
}, [setAnimationDone]); | ||
|
||
return ( | ||
<Box mb="10" width="100%"> | ||
<Heading as="h4" variant="H4" color="typography.600"> | ||
{title} | ||
</Heading> | ||
<Box | ||
as="p" | ||
className={ | ||
animationDone | ||
? styles['typing-effect--done'] | ||
: styles['typing-effect'] | ||
} | ||
onAnimationEnd={handleAnimationEnd} | ||
> | ||
{description} | ||
</Box> | ||
</Box> | ||
); | ||
}; | ||
|
||
export { GenerateScriptScene }; |
32 changes: 32 additions & 0 deletions
32
...o-modal/components/video-modal-content/components/generate-script-scene/styles.module.css
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,32 @@ | ||
.typing-effect { | ||
overflow: hidden; | ||
border-right: 2px solid black; | ||
width: 0; | ||
animation: | ||
typing 3s steps(30, end) forwards, | ||
blink-caret 0.75s step-end infinite; | ||
} | ||
.typing-effect--done { | ||
white-space: normal; | ||
overflow: visible; | ||
border-right: none; | ||
} | ||
|
||
@keyframes typing { | ||
from { | ||
width: 0; | ||
} | ||
to { | ||
width: 100%; | ||
} | ||
} | ||
|
||
@keyframes blink-caret { | ||
from, | ||
to { | ||
border-color: transparent; | ||
} | ||
50% { | ||
border-color: black; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -26,4 +26,5 @@ | |
|
||
.scriptViewHStack { | ||
justify-content: space-between; | ||
align-items: flex-start; | ||
} |
Oops, something went wrong.