cards
This commit is contained in:
		
							
								
								
									
										41
									
								
								src/cards.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								src/cards.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,41 @@ | |||||||
|  | import { | ||||||
|  | 	DominionCard, | ||||||
|  | 	TYPE_ACTION, | ||||||
|  | 	TYPE_DURATION, | ||||||
|  | 	TYPE_REACTION, | ||||||
|  | 	TYPE_TREASURE, | ||||||
|  | 	TYPE_VICTORY, | ||||||
|  | } from "./types.ts"; | ||||||
|  |  | ||||||
|  | const expansionIcon = ""; | ||||||
|  | const author = "Dylan"; | ||||||
|  |  | ||||||
|  | export const cards: DominionCard[] = [ | ||||||
|  | 	{ | ||||||
|  | 		orientation: "card", | ||||||
|  | 		title: "Flask", | ||||||
|  | 		description: | ||||||
|  | 			"+2 Cards\n\nAt the start of your Clean-up phase, you may put a card from your hand onto your deck.", | ||||||
|  | 		types: [TYPE_TREASURE], | ||||||
|  | 		image: "", | ||||||
|  | 		artist: "", | ||||||
|  | 		author, | ||||||
|  | 		version: "0.1", | ||||||
|  | 		cost: "$6", | ||||||
|  | 		preview: "", | ||||||
|  | 		expansionIcon, | ||||||
|  | 	}, | ||||||
|  | 	{ | ||||||
|  | 		orientation: "card", | ||||||
|  | 		title: "Promising Land", | ||||||
|  | 		description: "Worth 1% per 3 cards you have that cost $4 or $5.", | ||||||
|  | 		types: [TYPE_VICTORY], | ||||||
|  | 		image: "", | ||||||
|  | 		artist: "", | ||||||
|  | 		author, | ||||||
|  | 		version: "", | ||||||
|  | 		cost: "$3", | ||||||
|  | 		preview: "", | ||||||
|  | 		expansionIcon, | ||||||
|  | 	}, | ||||||
|  | ]; | ||||||
| @@ -1,12 +1,12 @@ | |||||||
| import { useState } from "react"; | import { useState } from "react"; | ||||||
| import { sampleCards } from "../sampleData.ts"; | import { cards } from "../cards.ts"; | ||||||
| import { Card } from "./Card.tsx"; | import { Card } from "./Card.tsx"; | ||||||
|  |  | ||||||
| export const App = () => { | export const App = () => { | ||||||
| 	const [count, setCount] = useState(0); | 	const [count, setCount] = useState(0); | ||||||
| 	return <div> | 	return <div> | ||||||
| 		{sampleCards.map((sampleCard) => { | 		{cards.map((card) => { | ||||||
| 			return <Card key={`${sampleCard.title}-${count}`} card={sampleCard}/> | 			return <Card key={`${card.title}-${count}`} card={card}/> | ||||||
| 		})} | 		})} | ||||||
| 		<button onClick={() => {setCount(c => c+1)}}>Rerender (for fonts)</button> | 		<button onClick={() => {setCount(c => c+1)}}>Rerender (for fonts)</button> | ||||||
| 	</div>; | 	</div>; | ||||||
|   | |||||||
| @@ -15,6 +15,7 @@ export const sampleCards: DominionCard[] = [ | |||||||
| 			"+*\n\nReveal the top card of your deck. If it's an Action card, +1 Action. If it has ^ in its cost, +1 Card.", | 			"+*\n\nReveal the top card of your deck. If it's an Action card, +1 Action. If it has ^ in its cost, +1 Card.", | ||||||
| 		types: [TYPE_ACTION, TYPE_DURATION, TYPE_REACTION], | 		types: [TYPE_ACTION, TYPE_DURATION, TYPE_REACTION], | ||||||
| 		image: "https://wiki.dominionstrategy.com/images/7/76/AdventurerArt.jpg", | 		image: "https://wiki.dominionstrategy.com/images/7/76/AdventurerArt.jpg", | ||||||
|  | 		expansionIcon: "", | ||||||
| 		artist: "Dall-E", | 		artist: "Dall-E", | ||||||
| 		author: "John Doe", | 		author: "John Doe", | ||||||
| 		version: "", | 		version: "", | ||||||
| @@ -27,6 +28,7 @@ export const sampleCards: DominionCard[] = [ | |||||||
| 		description: "+1 Card\n+1 Action\n+1 Buy\n+$1", | 		description: "+1 Card\n+1 Action\n+1 Buy\n+$1", | ||||||
| 		types: [TYPE_ACTION], | 		types: [TYPE_ACTION], | ||||||
| 		image: "", | 		image: "", | ||||||
|  | 		expansionIcon: "", | ||||||
| 		artist: "Leonardo DaVinci", | 		artist: "Leonardo DaVinci", | ||||||
| 		author: "Jane Smith", | 		author: "Jane Smith", | ||||||
| 		version: "", | 		version: "", | ||||||
| @@ -40,6 +42,7 @@ export const sampleCards: DominionCard[] = [ | |||||||
| 			"+2 Cards\n\nAt the start of your Clean-up phase, you may put a card from your hand onto your deck.", | 			"+2 Cards\n\nAt the start of your Clean-up phase, you may put a card from your hand onto your deck.", | ||||||
| 		types: [TYPE_TREASURE], | 		types: [TYPE_TREASURE], | ||||||
| 		image: "", | 		image: "", | ||||||
|  | 		expansionIcon: "", | ||||||
| 		artist: "", | 		artist: "", | ||||||
| 		author: "", | 		author: "", | ||||||
| 		version: "", | 		version: "", | ||||||
| @@ -52,6 +55,7 @@ export const sampleCards: DominionCard[] = [ | |||||||
| 		description: "Worth 1% per 3 cards you have that cost $4 or $5.", | 		description: "Worth 1% per 3 cards you have that cost $4 or $5.", | ||||||
| 		types: [TYPE_VICTORY], | 		types: [TYPE_VICTORY], | ||||||
| 		image: "", | 		image: "", | ||||||
|  | 		expansionIcon: "", | ||||||
| 		artist: "", | 		artist: "", | ||||||
| 		author: "", | 		author: "", | ||||||
| 		version: "", | 		version: "", | ||||||
| @@ -64,6 +68,7 @@ export const sampleCards: DominionCard[] = [ | |||||||
| 		description: "Choose one: +3 Cards, or +2 Actions.\n\n\n-\n\n\n2%", | 		description: "Choose one: +3 Cards, or +2 Actions.\n\n\n-\n\n\n2%", | ||||||
| 		types: [TYPE_ACTION, TYPE_VICTORY], | 		types: [TYPE_ACTION, TYPE_VICTORY], | ||||||
| 		image: "", | 		image: "", | ||||||
|  | 		expansionIcon: "", | ||||||
| 		artist: "", | 		artist: "", | ||||||
| 		author: "", | 		author: "", | ||||||
| 		version: "", | 		version: "", | ||||||
|   | |||||||
| @@ -43,6 +43,7 @@ export type DominionCard = | |||||||
| 			author: string; | 			author: string; | ||||||
| 			version: string; | 			version: string; | ||||||
| 			cost: DominionText; | 			cost: DominionText; | ||||||
|  | 			expansionIcon: string; | ||||||
| 			preview?: DominionText; | 			preview?: DominionText; | ||||||
| 	  } | 	  } | ||||||
| 	| { | 	| { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user