-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
9,660 additions
and
13,364 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 |
---|---|---|
@@ -1 +1,12 @@ | ||
# AptoStrike | ||
|
||
Revolutionary play and earn space adventure game with NFT planets and DeFi mechanics built on Aptos blockchain. | ||
|
||
https://aptostrike.space/ | ||
|
||
https://aptostrike.space/dashboard | ||
|
||
Pages: | ||
- https://aptostrike.space/leaderboard | ||
- https://aptostrike.space/waiting-room | ||
- https://aptostrike.space/last-game-stats |
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,19 @@ | ||
import React from "react"; | ||
import Image from "next/legacy/image"; | ||
import BgImg from "../../public/img/bg.jpg"; | ||
|
||
const BackgroundImage = () => { | ||
return ( | ||
<div className="bg-image-wrapper"> | ||
<Image | ||
src={BgImg} | ||
layout="fill" | ||
objectFit="cover" | ||
priority | ||
|
||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BackgroundImage; |
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,43 @@ | ||
import React, { useState, useEffect, useMemo } from "react"; | ||
|
||
const Button = ({ className, onClick, disabled, loading, label }) => { | ||
const [ dotCount, setDotCount ] = useState(1); | ||
|
||
useEffect(() => { | ||
const updateDotCount = () => { | ||
setDotCount((currentDotCount) => { | ||
if (currentDotCount === 3) { | ||
return 1; | ||
} else { | ||
return currentDotCount + 1; | ||
} | ||
}); | ||
}; | ||
|
||
let dotsUpdateInterval; | ||
|
||
if (loading) { | ||
dotsUpdateInterval = setInterval(updateDotCount, 500); | ||
}; | ||
|
||
return () => clearInterval(dotsUpdateInterval); | ||
}, [ loading ]); | ||
|
||
const labelToDisplay = useMemo(() => { | ||
if (!loading) return label; | ||
|
||
return label + ".".repeat(dotCount); | ||
}, [loading, label, dotCount]); | ||
|
||
return ( | ||
<button | ||
className={className} | ||
onClick={onClick} | ||
disabled={disabled || loading} | ||
> | ||
{labelToDisplay} | ||
</button> | ||
); | ||
}; | ||
|
||
export default Button; |
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,48 @@ | ||
import React, { useEffect } from "react"; | ||
import Script from "next/script"; | ||
import Head from "next/head"; | ||
import { useRouter } from "next/router"; | ||
import { pageview } from "@lib/gtag"; | ||
import { GA_TRACKING_ID } from "../../constants"; | ||
|
||
const GoogleAnalytics = () => { | ||
const router = useRouter(); | ||
|
||
useEffect(() => { | ||
const handleRouteChange = (url) => { | ||
pageview(url); | ||
}; | ||
router.events.on("routeChangeComplete", handleRouteChange); | ||
|
||
return () => { | ||
router.events.off("routeChangeComplete", handleRouteChange); | ||
}; | ||
}, [router.events]); | ||
|
||
return ( | ||
<> | ||
<Head> | ||
<script | ||
dangerouslySetInnerHTML={{ | ||
__html: ` | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', '${GA_TRACKING_ID}', { | ||
page_path: window.location.pathname, | ||
}); | ||
`, | ||
}} | ||
/> | ||
</Head> | ||
{/* Global site tag (gtag.js) - Google Analytics */} | ||
<Script | ||
strategy="afterInteractive" | ||
src={`https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}`} | ||
/> | ||
</> | ||
); | ||
}; | ||
|
||
export default GoogleAnalytics; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from "react"; | ||
import CircularProgress from "@mui/material/CircularProgress"; | ||
|
||
export function Message({ text, shouldDisplayProgress }) { | ||
return ( | ||
<div className="message"> | ||
{shouldDisplayProgress && ( | ||
<CircularProgress size="1em" sx={{ color: "#9D7C14" }} /> | ||
)} | ||
<span>{text}</span> | ||
</div> | ||
); | ||
} |
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,7 @@ | ||
.message { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 0.375rem; | ||
font-size: clamp(1rem, 1.2vw, 1.5rem); | ||
}; |
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.