-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(web): image and video blocks (#708)
Co-authored-by: nina992 <[email protected]>
- Loading branch information
Showing
11 changed files
with
69 additions
and
17 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { styled } from "@reearth/services/theme"; | ||
|
||
type Props = { | ||
show?: boolean; | ||
strong?: boolean; | ||
}; | ||
|
||
const Overlay = styled.div<Props>` | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
background: ${({ theme }) => theme.bg[1]}; | ||
opacity: ${({ show, strong }) => (show ? (strong ? 0.7 : 0.3) : 0)}; | ||
visibility: ${({ show }) => (show ? "visible" : "hidden")}; | ||
transition: all 0.2s; | ||
transition-timing-function: ${({ show }) => (show ? "ease-in" : "ease-out")}; | ||
z-index: 1; | ||
top: 0; | ||
left: 0; | ||
`; | ||
|
||
export default Overlay; |
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
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
25 changes: 25 additions & 0 deletions
25
web/src/beta/lib/core/StoryPanel/Block/builtin/Video/VideoPlayer.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,25 @@ | ||
import Player from "react-player"; | ||
|
||
import Overlay from "@reearth/beta/components/Overlay"; | ||
import { styled } from "@reearth/services/theme"; | ||
|
||
type Props = { | ||
isSelected?: boolean; | ||
src?: string; | ||
inEditor?: boolean; | ||
}; | ||
const VideoPlayer: React.FC<Props> = ({ isSelected, src, inEditor }) => { | ||
return ( | ||
<StyledWrapper> | ||
<Overlay show={inEditor} /> | ||
<Player url={src} width="100%" playsinline pip controls light isselected={isSelected} /> | ||
</StyledWrapper> | ||
); | ||
}; | ||
|
||
export default VideoPlayer; | ||
|
||
const StyledWrapper = styled.div` | ||
position: relative; | ||
width: 100%; | ||
`; |
19 changes: 14 additions & 5 deletions
19
web/src/beta/lib/core/StoryPanel/Block/builtin/Video/index.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
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