From 7778a4babc9ea00f53c3c476c8f46de91204e1df Mon Sep 17 00:00:00 2001 From: lza_menace Date: Thu, 29 Dec 2022 23:34:23 -0800 Subject: [PATCH] updating map --- src/styles/sections.css | 32 ++++++++++++++++-- src/template/Sections.jsx | 69 ++++++++++++++++++--------------------- 2 files changed, 61 insertions(+), 40 deletions(-) diff --git a/src/styles/sections.css b/src/styles/sections.css index e1adb4c..6e2a737 100644 --- a/src/styles/sections.css +++ b/src/styles/sections.css @@ -71,9 +71,31 @@ margin: 0 auto 1em auto; } +#gameMapTitle { + margin: 1em 0 0 0; +} + +#gameStats { + margin: .5em 0 .5em 0; + position: absolute; + z-index: 99; + background-color: rgba(0,0,0,.6); + padding: 2px; + border-radius: 4px; + text-align: left; +} + +#gameStats ul { + padding: 0 .5em; +} +#gameStats ul li { + list-style: none; + font-size: 1.25em; +} + .map { cursor: crosshair; - margin: 2em 0 0 0; + /* margin: 2em 0 0 0; */ position: relative; overflow: hidden; width: 100%; @@ -91,7 +113,13 @@ height: 7px; position: absolute; border-radius: 50%; - filter: drop-shadow(0 0 4px rgb(255, 230, 0, .5)); + animation: pulse .75s ease infinite alternate; +} + +.squares { + width: 7px; + height: 7px; + position: absolute; animation: pulse .75s ease infinite alternate; } diff --git a/src/template/Sections.jsx b/src/template/Sections.jsx index 3753344..3978684 100644 --- a/src/template/Sections.jsx +++ b/src/template/Sections.jsx @@ -50,7 +50,7 @@ export class Section1 extends React.Component { Pixelated police sketch of the Unabomber suspect.
- scroll.scrollToBottom({duration: 4500})} className="fadeIn"> + scroll.scrollTo(window.scrollMaxY - '450', {duration: 5000})} className="fadeIn"> continue
@@ -95,7 +95,6 @@ class GenerateBombOverlay extends React.Component { componentDidUpdate(prevProps) { if (this.props.amount !== prevProps.amount) { - console.log('updating game map'); let bombCoords = this.generateCoords(this.props.amount); this.setState({ coords: bombCoords @@ -104,7 +103,7 @@ class GenerateBombOverlay extends React.Component { } render() { - return this.state.coords.map((obj) =>
) + return this.state.coords.map((obj) =>
) } } @@ -114,7 +113,9 @@ class GameMap extends React.Component { this.state = { bombSupply: 0, bombBalance: 0, - bombsExploded: 0 + bombsExploded: 0, + unaboomerSupply: 0, + unaboomersKilled: 0 } } @@ -126,7 +127,9 @@ class GameMap extends React.Component { this.setState({ bombSupply: this.props.bombSupply, bombBalance: this.props.bombBalance, - bombsExploded: this.props.bombsExploded + bombsExploded: this.props.bombsExploded, + unaboomerSupply: this.props.unaboomerSupply, + unaboomersKilled: this.props.unaboomersKilled }); } } @@ -135,14 +138,22 @@ class GameMap extends React.Component { return ( <>

Game Map

+
+
    +
  • _ Alive Unaboomers: {this.state.unaboomerSupply - this.state.unaboomersKilled}
  • +
  • _ Dead Unaboomers: {this.state.unaboomersKilled}
  • +
  • _ Active Bombs: {this.state.bombSupply - this.state.bombsExploded}
  • +
  • _ Exploded Bombs: {this.state.bombsExploded}
  • +
  • _ Dud Bombs: {this.state.bombsExploded}
  • +
+
- {/* show active bombs held by other players */} - - {/* show bombs that have exploded */} - - {/* show player bombs */} - + + + + +
) @@ -268,7 +279,7 @@ function Section3() { }); const sendBombsWrite = useContractWrite(sendBombsPrepare.config); return ( -
+
{isConnected && <>
@@ -309,7 +320,13 @@ function Section3() { handleStateChange({sendBombAmount: v})} />
- + ||
@@ -328,28 +345,4 @@ export function AllSections() { ) -} - -// export function Panel({ opacity, panelText, mintButtonText }) { -// const { isConnected } = useAccount(); -// const { config } = usePrepareSendTransaction({ -// request: { -// to: '0x653D2d1D10c79017b2eA5F5a6F02D9Ab6e725395', -// value: ethers.utils.parseEther('.1'), -// } -// }); -// const { isLoading, isSuccess, sendTransaction } = useSendTransaction(config); -// return ( -// -//

-// {panelText} -//

-//     

-// sendTransaction?.()}> -// {isConnected && !isLoading && (<>{mintButtonText})} -// -//

-// {isConnected && !isLoading && isSuccess && (

Thanks, nerd!

)} -// -// ) -// } \ No newline at end of file +} \ No newline at end of file