Skip to content

Commit

Permalink
Merge pull request #141 from HackHPI/feature/website-2.0-vimeo-facade
Browse files Browse the repository at this point in the history
Added vimeo facade on load
  • Loading branch information
DerCed authored Mar 18, 2024
2 parents b4b8a85 + fd855c5 commit e0865f0
Showing 1 changed file with 35 additions and 8 deletions.
43 changes: 35 additions & 8 deletions src/components/WhatToExpect/WhatToExpect.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
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)
const vimeoVideoId = "867922224"

return (
<HackHPIWrapper>

Expand All @@ -28,13 +34,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/${vimeoVideoId}?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/${vimeoVideoId}.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 e0865f0

Please sign in to comment.