Skip to content

Commit

Permalink
Merge pull request PortalNetwork#34 from PortalNetwork/apifix
Browse files Browse the repository at this point in the history
add link
  • Loading branch information
MikeCheng1208 authored Jul 24, 2018
2 parents ca6b03c + 70ecb3e commit eb51763
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 39 deletions.
Binary file modified dapp/public/favicon.ico
Binary file not shown.
7 changes: 0 additions & 7 deletions dapp/src/components/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,6 @@ img {
.App .index .titlebox a.getCard:after {
content: "";
right: -20px; }
.App .index img.logo {
position: absolute;
width: 90px;
height: 47px;
bottom: 13%;
left: 50%;
margin-left: -45px; }
.App .index .ladder {
position: absolute;
width: 133px;
Expand Down
16 changes: 2 additions & 14 deletions dapp/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { MetaMask } from './MetaMask/MetaMask';
import { TweenMax } from "gsap/TweenMax";
import { Warning } from './Warning/Warning';
import { doGetTokenProperty, doMint } from '../lib/cryptoHerosTokenService';

import LoadingCoin from './LoadingCoin';

class App extends Component {
Expand Down Expand Up @@ -52,22 +53,16 @@ class App extends Component {

//撈回所有的卡片
TimeOutGoTokens = res =>{
console.log('撈回所有的卡片');
this.setState({brand: res.split(","), isLoading: false},()=>{
console.log("Card idx:",res.split(","));
})
this.setState({brand: res.split(","), isLoading: false});
}

//進入卡牌畫面
gotoAndPlayGame = async () =>{
console.log('進入卡牌畫面');
const { brand, } = this.state;
const { network } = this.props.metaMask;

const promises = brand.map(cur => doGetTokenProperty(network, cur));
const result = await Promise.all(promises);

console.log('進入卡牌畫面 result:',result);
this.setState({
brandItem: result.map(cur => cur),
isGetCardPage: true,
Expand Down Expand Up @@ -123,13 +118,6 @@ class App extends Component {
const { isLoading, brandItem, isGetCardPage, isShowArena, isLoadingCoinLoading, } = this.state;
return (
<div className="App">
{/*
<Top/>
<Health {...this.props} />
<SendTransactoin {...this.props} {...this.state}/>
<Card {...this.props}/>
<Contract {...this.props} {...this.state} />
*/}
<div className="index">
<div className="titlebox">
<img className="title" src={title}/>
Expand Down
8 changes: 0 additions & 8 deletions dapp/src/components/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ img{
}
}

img.logo{
position: absolute;
width: 90px;
height: 47px;
bottom: 13%;
left: 50%;
margin-left: -(90px / 2);
}

.ladder{
position: absolute;
Expand Down
11 changes: 3 additions & 8 deletions dapp/src/components/Card/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import React, { Component } from 'react';
import classnames from 'classnames/bind';
import testCard1 from '../../images/testCard1.png';
import cardtitle from '../../images/cardtitle.png';
import style from './Card.css';
import {TweenMax} from "gsap/TweenMax";
import { getCryptoHerosTokenAddress } from '../../lib/web3Service';
import axios from 'axios';

import LoadingCoin from '../LoadingCoin';
const cx = classnames.bind(style);
function ipfsUrl(hash) {
// console.log('https://ipfs.infura.io/ipfs/' + hash);
return 'https://ipfs.infura.io/ipfs/' + hash;
// return "https://ipfs.infura.io/ipfs/QmeVXWcHeV5dFmeUWezMUah5p6JGKMH4qRLXNCoV4Tgfnj";
}

class Card extends Component {
Expand Down Expand Up @@ -49,10 +44,7 @@ class Card extends Component {
console.log('status:', result.data.result.status);
if(result.data.result.status === "1") {
this.ReloadDataFn();
console.log('===END===');
this.setState({isLoading: false},()=> this.props.gotoAndPlayGame());
window.clearInterval(t);
console.log('===clearInterval===');
}
},3000);
}
Expand All @@ -61,6 +53,9 @@ class Card extends Component {
const {network, account} = this.props.metaMask;
//抓卡牌編號
this.props.handleCryptoHerosTokenGetOwnedTokens(network, account, this.props.TimeOutGoTokens);
setTimeout(() => {
this.setState({isLoading: false},()=> this.props.gotoAndPlayGame());
}, 6000);
}

render() {
Expand Down
8 changes: 7 additions & 1 deletion dapp/src/components/IndexUi.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import React, { Component } from 'react';
import logo from '../images/logo.png';
import githublogo from '../images/github-icon2.png';
import './indexUi.css';
export default class className extends Component{
render() {
return (
<div className="ui_item">
<a className="logo" href="https://www.portal.network/" target="_blank">
<img className="logo" src={logo} />
</a>
<div className="ui cloud"></div>
<div className="ui cloud2"></div>
<div className="ui ladder"></div>
Expand All @@ -14,7 +18,9 @@ export default class className extends Component{
<div className="ui start1"></div>
<div className="ui start2"></div>
<div className="ui start3"></div>
<img className="logo" src={logo} />
<a className="github" href="https://github.com/PortalNetwork/nifty-game" target="_blank">
<img className="githublogo" src={githublogo} />
</a>
<div className="ui Elf0"></div>
<div className="ui Elf1"></div>
<div className="ui Elf2"></div>
Expand Down
23 changes: 23 additions & 0 deletions dapp/src/components/indexUi.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,29 @@
to {
transform: scale(1); } }

.ui_item a.logo {
display: block;
position: absolute;
width: 90px;
height: 47px;
bottom: 13%;
left: 50%;
margin-left: -45px; }
.ui_item a.logo > img {
width: 100%; }

.ui_item a.github {
display: block;
position: absolute;
width: 50px;
height: 50px;
bottom: 10%;
left: 8%;
background-size: 100% 100%;
animation: loading_coin_breath 1s infinite linear; }
.ui_item a.github > img {
width: 100%; }

.ui_item .ui {
position: absolute; }
.ui_item .ui.footer {
Expand Down
28 changes: 27 additions & 1 deletion dapp/src/components/indexUi.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
@import "./_mixinKeyframes.scss";

.ui_item{
a.logo{
display: block;
position: absolute;
width: 90px;
height: 47px;
bottom: 13%;
left: 50%;
margin-left: -(90px / 2);
>img{
width: 100%;
}
}

a.github{
display: block;
position: absolute;
width: 50px;
height: 50px;
bottom: 10%;
left: 8%;
background-size: 100% 100%;
animation: loading_coin_breath 1s infinite linear;
>img{
width: 100%;
}
}

.ui{
position: absolute;
&.footer{
Expand Down
Binary file added dapp/src/images/github-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dapp/src/images/github-icon2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit eb51763

Please sign in to comment.