|
|
@ -13,6 +13,7 @@ import Newspapers from '../img/newspapers.png';
|
|
|
|
import Bomb from '../img/bomb.png';
|
|
|
|
import Bomb from '../img/bomb.png';
|
|
|
|
import Explosion from '../img/explosion.png';
|
|
|
|
import Explosion from '../img/explosion.png';
|
|
|
|
import SeizedItems from '../img/seizeditems.png';
|
|
|
|
import SeizedItems from '../img/seizeditems.png';
|
|
|
|
|
|
|
|
import Map from '../img/map.png';
|
|
|
|
import MainABI from '../abi/main.json';
|
|
|
|
import MainABI from '../abi/main.json';
|
|
|
|
|
|
|
|
|
|
|
|
import 'rc-slider/assets/index.css';
|
|
|
|
import 'rc-slider/assets/index.css';
|
|
|
@ -71,14 +72,37 @@ export function Section2() {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class GenerateBombOverlay extends React.Component {
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
let bombCoords = [];
|
|
|
|
|
|
|
|
for (let i = 0; i < props.amount; i++) {
|
|
|
|
|
|
|
|
let min = Math.ceil(0);
|
|
|
|
|
|
|
|
let randX = Math.floor(Math.random() * (Math.floor(window.innerWidth) - min) + min);
|
|
|
|
|
|
|
|
let randY = Math.floor(Math.random() * (Math.floor(window.innerHeight) - min) + min);
|
|
|
|
|
|
|
|
let o = {
|
|
|
|
|
|
|
|
x: `${randX}px`,
|
|
|
|
|
|
|
|
y: `${randY}px`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
bombCoords.push(o);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.state = {coords: bombCoords};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
|
|
|
return this.state.coords.map((obj) => <div className="dots" style={{top: obj.y, left: obj.x}} />)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function Section3() {
|
|
|
|
export function Section3() {
|
|
|
|
const [boomerAmount, setBoomerAmount] = useState(1);
|
|
|
|
const [boomerAmount, setBoomerAmount] = useState(1);
|
|
|
|
const [bombAmount, setBombAmount] = useState(1);
|
|
|
|
const [bombAmount, setBombAmount] = useState(1);
|
|
|
|
const [sendBombAmount, setSendBombAmount] = useState(1);
|
|
|
|
const [sendBombAmount, setSendBombAmount] = useState(1);
|
|
|
|
const [boomerPrice, setBoomerPrice] = useState(0);
|
|
|
|
const [boomerPrice, setBoomerPrice] = useState(ethers.utils.parseEther('.01'));
|
|
|
|
const [bombPrice, setBombPrice] = useState(0);
|
|
|
|
const [bombPrice, setBombPrice] = useState(ethers.utils.parseEther('.01'));
|
|
|
|
const [boomerBalance, setBoomerBalance] = useState(0);
|
|
|
|
const [boomerBalance, setBoomerBalance] = useState(0);
|
|
|
|
const [bombBalance, setBombBalance] = useState(0);
|
|
|
|
const [bombBalance, setBombBalance] = useState(0);
|
|
|
|
|
|
|
|
const [bombSupply, setBombSupply] = useState(100);
|
|
|
|
const { isConnected, address } = useAccount();
|
|
|
|
const { isConnected, address } = useAccount();
|
|
|
|
useContractReads({
|
|
|
|
useContractReads({
|
|
|
|
contracts: [
|
|
|
|
contracts: [
|
|
|
@ -142,6 +166,7 @@ export function Section3() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const assembleBombsWrite = useContractWrite(assembleBombsPrepare.config);
|
|
|
|
const assembleBombsWrite = useContractWrite(assembleBombsPrepare.config);
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<section className="section">
|
|
|
|
<section className="section">
|
|
|
|
{isConnected &&
|
|
|
|
{isConnected &&
|
|
|
@ -191,6 +216,10 @@ export function Section3() {
|
|
|
|
borderColor:'rgba(37, 19, 81, .8)'
|
|
|
|
borderColor:'rgba(37, 19, 81, .8)'
|
|
|
|
}} onChange={v => setSendBombAmount(v)} />
|
|
|
|
}} onChange={v => setSendBombAmount(v)} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="map">
|
|
|
|
|
|
|
|
<img src={Map} />
|
|
|
|
|
|
|
|
<GenerateBombOverlay amount={bombSupply} />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
||
|
|
|
|
||
|
|
|
|
<div id="heroText">
|
|
|
|
<div id="heroText">
|
|
|
|