Gregory Rudolph
4 years ago
2 changed files with 70 additions and 16 deletions
@ -1,25 +1,37 @@ |
|||||||
import logo from './logo.svg'; |
|
||||||
import './App.css'; |
import './App.css'; |
||||||
|
|
||||||
|
const sqlCards = [{ "CardImg":"https://is4-ssl.mzstatic.com/image/thumb/Purple118/v4/91/43/40/9143401d-5824-5d0a-e559-4872b27602b9/source/256x256bb.jpg", "CardName": "Devouring Dragon", "ManaCost": 5, "Power": 5, "Toughness": 5, "CardDesc": "He does to people what Greg does to booty.", "CreatureType": "Dragon" }, |
||||||
|
{ "CardImg":"https://spellbook.blob.core.windows.net/hodassets/defaultportraits/fighter_default_cultist_female_0_2.jpg", "CardName": "Dragon Worshipper", "ManaCost": 1, "Power": 1, "Toughness": 1, "CardDesc": "He spends his days praying to dragons.", "CreatureType": "Human" }, |
||||||
|
{ "CardImg":"https://a.wattpad.com/useravatar/Angoleth.256.592295.jpg", "CardName": "Dragon Whelp", "ManaCost": 2, "Power": 3, "Toughness": 2, "CardDesc": "He will get there.", "CreatureType": "Dragon" }]; |
||||||
|
|
||||||
|
function Card(props) { |
||||||
|
props = props.props |
||||||
|
return ( |
||||||
|
<div class="card"> |
||||||
|
<h4><b>{props.CardName}</b></h4> |
||||||
|
<img src={props.CardImg !== undefined ? props.CardImg : "https://thiscatdoesnotexist.com/"} alt="Avatar" style={{ width: "100%" }} /> |
||||||
|
<div class="container"> |
||||||
|
<p>{props.CardDesc}</p> |
||||||
|
<p style={{position: "absolute", bottom: -8, left: 8}}>Mana: {props.ManaCost}</p> |
||||||
|
<p style={{position: "absolute", bottom: -8, left: 125}}>Power: {props.Power} </p> |
||||||
|
<p style={{position: "absolute", bottom: -8, right: 8}}>Toughness: {props.Toughness}</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
) |
||||||
|
} |
||||||
|
|
||||||
function App() { |
function App() { |
||||||
return ( |
return ( |
||||||
<div className="App"> |
<div className="App"> |
||||||
<header className="App-header"> |
<ul> |
||||||
<img src={logo} className="App-logo" alt="logo" /> |
{sqlCards.map((props, i) => ( |
||||||
<p> |
<li key={i}> |
||||||
Edit <code>src/App.js</code> and save to reload. |
<Card props={props}/> |
||||||
</p> |
</li> |
||||||
<a |
))} |
||||||
className="App-link" |
</ul> |
||||||
href="https://reactjs.org" |
|
||||||
target="_blank" |
|
||||||
rel="noopener noreferrer" |
|
||||||
> |
|
||||||
Learn React |
|
||||||
</a> |
|
||||||
</header> |
|
||||||
</div> |
</div> |
||||||
); |
); |
||||||
} |
} |
||||||
|
|
||||||
export default App; |
export default App; |
Loading…
Reference in new issue