-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from JollyGrin/feat/token-customization
Feat/token customization
- Loading branch information
Showing
16 changed files
with
265 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const Image = ({ imageUrl }: { imageUrl: string }) => | ||
`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 24 24"> | ||
<image href="${imageUrl}" height='100%' > | ||
</svg>`; | ||
|
||
const Circle = ({ | ||
color, | ||
size, | ||
}: { | ||
color?: string; | ||
size?: number; | ||
}) => `<svg fill="${color ?? "black"}" stroke="2" viewBox="0 0 100 100" width="${size ?? 72}" height="${size ?? 72}" xmlns="http://www.w3.org/2000/svg"> | ||
<circle cx="50" cy="50" r="50" /> | ||
</svg>`; | ||
|
||
export const TokenIcon = { | ||
Image, | ||
Circle, | ||
}; | ||
|
||
/** | ||
* WIP | ||
* | ||
* - cannot have more than 2 props with defaults. If one is not empty, then the default on the other will break | ||
* - need a cleaner version for adding svgs with this function wrapper. Too much repetition | ||
* - how can I create an enum for this | ||
* | ||
* */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* Default Tokens for the board! | ||
* | ||
* To add to this list, add the file to /public/tokens/... | ||
* | ||
* Then add the filename to IMAGES | ||
* */ | ||
|
||
const IMAGES = [ | ||
"Alien.svg", | ||
"BrickWall.svg", | ||
"CloudFog.svg", | ||
"Fire.svg", | ||
"Flag.svg", | ||
"HandShield.svg", | ||
"ShieldHalf.svg", | ||
"Totem.svg", | ||
"Trap.svg", | ||
]; | ||
|
||
export const DEFAULT_TOKEN_IMAGES = IMAGES.map((img) => `/tokens/${img}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.