-
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 #310 from BinaryStudioAcademy/task/OV-308-add-play…
…er-modal OV-308: Add player modal
- Loading branch information
Showing
36 changed files
with
194 additions
and
103 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
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,24 @@ | ||
import { | ||
LibraryModal, | ||
ModalBody, | ||
ModalCloseButton, | ||
ModalContent, | ||
ModalOverlay, | ||
} from '~/bundles/common/components/components.js'; | ||
import { type ModalProps } from '~/bundles/common/types/types.js'; | ||
|
||
import styles from './styles.module.css'; | ||
|
||
const Modal: React.FC<ModalProps> = ({ children, ...properties }) => { | ||
return ( | ||
<LibraryModal {...properties} isCentered> | ||
<ModalOverlay /> | ||
<ModalContent className={styles['modal-content']}> | ||
<ModalCloseButton margin="20px" zIndex={10} /> | ||
<ModalBody padding={0}>{children}</ModalBody> | ||
</ModalContent> | ||
</LibraryModal> | ||
); | ||
}; | ||
|
||
export { Modal }; |
7 changes: 7 additions & 0 deletions
7
frontend/src/bundles/common/components/modal/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,7 @@ | ||
.modal-content { | ||
border-radius: 17px; | ||
max-width: 90%; | ||
max-height: 90%; | ||
height: 100%; | ||
overflow: auto; | ||
} |
1 change: 0 additions & 1 deletion
1
frontend/src/bundles/common/components/upload-video/components/components.ts
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,3 +1,2 @@ | ||
export { CheckboxForm } from './checkbox-form/checkbox-form.js'; | ||
export { VideoDropzone } from './dropzone/video-dropzone.js'; | ||
export { VideoPlayer } from './video-player/video-player.js'; |
27 changes: 27 additions & 0 deletions
27
frontend/src/bundles/common/components/upload-video/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,27 @@ | ||
.container { | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 20px; | ||
max-width: 864px; | ||
width: 100%; | ||
min-height: 550px; | ||
background-color: white; | ||
border-radius: 12px; | ||
padding: 20px 20px 50px; | ||
} | ||
|
||
.video-player { | ||
height: 278px; | ||
width: 570px; | ||
border: 2px solid transparent; | ||
box-sizing: content-box; | ||
position: relative; | ||
border-radius: 12px; | ||
background-color: var(--chakra-colors-gray-200); | ||
overflow: hidden; | ||
transition: 0.3s; | ||
} | ||
|
||
.video-player:hover { | ||
border-color: var(--chakra-colors-background-900); | ||
} |
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
24 changes: 24 additions & 0 deletions
24
frontend/src/bundles/home/components/player-modal/player-modal.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,24 @@ | ||
import { Modal, VideoPlayer } from '~/bundles/common/components/components.js'; | ||
|
||
import styles from './style.module.css'; | ||
|
||
type Properties = { | ||
videoUrl: string; | ||
isOpen: boolean; | ||
onClose: () => void; | ||
}; | ||
|
||
const PlayerModal: React.FC<Properties> = ({ videoUrl, isOpen, onClose }) => { | ||
return ( | ||
<Modal isOpen={isOpen} onClose={onClose}> | ||
<VideoPlayer | ||
videoSource={videoUrl} | ||
className={styles['video-player'] ?? ''} | ||
playerWidth="100%" | ||
playerHeight="100%" | ||
/> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export { PlayerModal }; |
6 changes: 6 additions & 0 deletions
6
frontend/src/bundles/home/components/player-modal/style.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,6 @@ | ||
.video-player { | ||
height: 100%; | ||
width: 100%; | ||
position: relative; | ||
background-color: var(--chakra-colors-gray-200); | ||
} |
22 changes: 22 additions & 0 deletions
22
frontend/src/bundles/home/components/video-card/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,6 +1,28 @@ | ||
.overlay { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
border-radius: 5px; | ||
opacity: 0; | ||
transition: opacity 0.3s ease; | ||
background-color: rgba(53, 57, 154, 0.3); | ||
} | ||
|
||
.menu-button { | ||
position: absolute; | ||
background-color: white; | ||
top: 5px; | ||
right: 5px; | ||
} | ||
|
||
.action-button { | ||
position: absolute; | ||
background-color: white; | ||
top: 50%; | ||
left: calc(50% - 12.5px); | ||
transform: translate(-50%, -50%); | ||
opacity: 0; | ||
transition: opacity 0.3s ease; | ||
} |
Oops, something went wrong.