-
Notifications
You must be signed in to change notification settings - Fork 25
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 #740 from centrifuge/april-2024-update
New homepage hero + various content updates
- Loading branch information
Showing
16 changed files
with
175 additions
and
165 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,38 @@ | ||
import * as React from 'react'; | ||
import { FullscreenOverlay, CloseIcon, ThumbnailImage } from './style'; | ||
|
||
type FullscreenVideoOverlayProps = { | ||
thumbnail: string; | ||
videoId: string; | ||
}; | ||
|
||
const FullscreenVideoOverlay: React.FC<FullscreenVideoOverlayProps> = ({ thumbnail, videoId }) => { | ||
const [isOpen, setIsOpen] = React.useState(false); | ||
|
||
//Close if user clicks outside of vid iframe | ||
const overlayRef = React.useRef<HTMLDivElement>(null); | ||
const handleOverlayClick = (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => { | ||
if (overlayRef.current === event.target) { | ||
setIsOpen(false); | ||
} | ||
}; | ||
|
||
return ( | ||
<> | ||
<ThumbnailImage src={thumbnail} alt="Play Video" onClick={() => setIsOpen(true)} /> | ||
{isOpen && ( | ||
<FullscreenOverlay ref={overlayRef} onClick={handleOverlayClick}> | ||
<CloseIcon onClick={() => setIsOpen(false)}>×</CloseIcon> | ||
<iframe | ||
src={`https://player.vimeo.com/video/${videoId}?autoplay=1&badge=0&autopause=0&player_id=0&app_id=58479`} | ||
frameBorder="0" | ||
allow="autoplay; fullscreen; picture-in-picture; clipboard-write" | ||
title="Introduction to Centrifuge" | ||
/> | ||
</FullscreenOverlay> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default FullscreenVideoOverlay; |
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 styled from 'styled-components'; | ||
|
||
export const FullscreenOverlay = styled.div` | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
background-color: rgba(0, 0, 0, 0.9); | ||
z-index: 1000; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
iframe { | ||
width: 70%; | ||
height: 70%; | ||
} | ||
`; | ||
|
||
export const CloseIcon = styled.button` | ||
font-family: Inter, sans-serif; | ||
position: absolute; | ||
top: 1%; | ||
right: 3%; | ||
background: none; | ||
border: none; | ||
color: white; | ||
font-size: 80px; | ||
cursor: pointer; | ||
`; | ||
|
||
export const ThumbnailImage = styled.img` | ||
border-radius: 15px; | ||
width: 100%; | ||
height: 100%; | ||
cursor: pointer; | ||
aspect-ratio: 4/3; | ||
`; |
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
Oops, something went wrong.