Skip to content

Commit

Permalink
Added vimeo facade on load
Browse files Browse the repository at this point in the history
  • Loading branch information
DerCed committed Mar 10, 2024
1 parent 7adceaf commit 9d5bb39
Showing 1 changed file with 34 additions and 8 deletions.
42 changes: 34 additions & 8 deletions src/components/WhatToExpect/WhatToExpect.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import {Box, Container, Grid, Typography} from "@mui/material";
"use client"
import {Box, Container, Grid, IconButton, Typography} from "@mui/material";
import {WindowCard} from "../WindowCard/WindowCard.jsx";
import HackHPIWrapper from "../Theme/HackHPIWrapper.jsx";
import {PlayArrow} from "@mui/icons-material";
import {useState} from "react";

function WhatToExpect() {

const [playVideo, setPlayVideo] = useState(false)

return (
<HackHPIWrapper>

Expand All @@ -28,13 +33,34 @@ function WhatToExpect() {
<Grid item xs={12} md={4} sx={{display: "flex", justifyContent: "center"}}>
<Box sx={{width: "100%"}}>
<WindowCard>
<iframe
src="https://player.vimeo.com/video/867922224?h=30cf0b8b55&title=0&byline=0&portrait=0"
style={{aspectRatio: "16 / 9", borderRadius: "5px", width: "100%"}}
allow="autoPlay; fullscreen; picture-in-picture"
allowFullScreen
title={"Image Movie"}
/>
{playVideo ? (
<iframe
src="https://player.vimeo.com/video/867922224?h=30cf0b8b55&title=0&byline=0&portrait=0&autoplay=1&muted=1"
style={{aspectRatio: "16 / 9", borderRadius: "5px", width: "100%", border: 0}}
allow="autoPlay; fullscreen; picture-in-picture"
allowFullScreen
title={"Image Movie"}
/>
) : (
<Box
style={{
aspectRatio: "16 / 9",
borderRadius: "5px",
width: "100%",
background: `linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,.5)), url(https://vumbnail.com/867922224.jpg)`,
backgroundRepeat: "no-repeat",
backgroundSize: "cover",
display: "flex",
alignItems: "center",
justifyContent: "center",
}}
>
<IconButton onClick={() => setPlayVideo(true)}>
<PlayArrow sx={{fontSize: "3rem"}}/>
</IconButton>
</Box>
)}

</WindowCard>
</Box>
</Grid>
Expand Down

0 comments on commit 9d5bb39

Please sign in to comment.