Skip to content

Commit

Permalink
feat: add animated background
Browse files Browse the repository at this point in the history
  • Loading branch information
irisdv committed Jul 15, 2024
1 parent fb82c88 commit bfa1674
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 1 deletion.
43 changes: 43 additions & 0 deletions app/components/videoBackground.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from "react";

const VideoBackground = () => {
return (
<div style={containerStyle}>
<video autoPlay muted loop style={videoStyle}>
<source src="/background/output.webm" type="video/webm" />
Your browser does not support HTML5 video.
</video>
<div style={overlayStyle} />
</div>
);
};

const videoStyle: any = {
width: "100%",
height: "100%",
objectFit: "cover",
};

const containerStyle: any = {
position: "fixed",
right: "0",
bottom: "0",
minWidth: "100%",
minHeight: "100%",
zIndex: "0",
overflow: "hidden",
};

const overlayStyle: any = {
position: "absolute",
top: "0",
left: "0",
width: "100%",
height: "100%",
background: "rgba(17, 24, 39, 0.80)",
boxShadow: "0px 2.488px 30.481px 0px rgba(0, 7, 72, 0.08)",
backdropFilter: "blur(7.77584171295166px)",
zIndex: "1",
};

export default VideoBackground;
4 changes: 3 additions & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import WrongNetworkModal from "./components/wrongNetwork";
import { Skeleton, useMediaQuery } from "@mui/material";
import { StarknetIdNavigator } from "starknetid.js";
import LeaderboardWrapper from "./components/leaderboard/leaderboardWrapper";
import VideoBackground from "./components/videoBackground";

export default function Home() {
const [isLoaded, setIsLoaded] = useState(false);
Expand Down Expand Up @@ -516,6 +517,7 @@ export default function Home() {
) : (
<>
<main className={styles.main}>
<VideoBackground />
<div className={styles.leftContainer}>
{isFinished && isLoaded ? (
<>
Expand Down Expand Up @@ -672,7 +674,7 @@ export default function Home() {
>
<>
Counter successfully reset, if it reaches zero before someone
resets it again, you will win 5 eth
resets it again, you will win 5 eth.
</>
</Notification>
</>
Expand Down
1 change: 1 addition & 0 deletions app/styles/components/stats.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
justify-content: center;
padding: 0 20px;
gap: 24px;
z-index: 1;
}

.statsSection {
Expand Down
2 changes: 2 additions & 0 deletions app/styles/home.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
align-items: center;
gap: 16px;
justify-content: center;
z-index: 1;
}

.centralSection {
Expand All @@ -26,6 +27,7 @@
position: relative;
height: 598px;
margin: auto;
z-index: 1;
}

.backgroundWrapper {
Expand Down
Binary file added public/background/output.webm
Binary file not shown.

0 comments on commit bfa1674

Please sign in to comment.