ygo-card
ygo-card copied to clipboard
ygo-card is a javascript SDK for rendering YuGiOh card
ygo-card
This is a javascript SDK for rendering YU-GI-OH card. Import ygo-card
in your website, you can easily paint the standard YU-GI-OH cards!
![](https://github.com/ymssx/ygo-card/blob/master/demo/%E9%BB%91%E9%AD%94%E6%9C%AF%E5%B0%91%E5%A5%B3.jpg)
![](https://github.com/ymssx/ygo-card/blob/master/demo/%E9%BB%91%E9%AD%94%E6%9C%AF%E5%B8%88.jpg)
![](https://github.com/ymssx/ygo-card/blob/master/demo/%E6%AD%BB%E8%80%85%E8%8B%8F%E7%94%9F.jpg)
![](https://github.com/ymssx/ygo-card/blob/master/demo/%E7%A5%9E%E5%9C%A3%E9%98%B2%E6%8A%A4%E7%BD%A9%20-%E5%8F%8D%E5%B0%84%E9%95%9C%E5%8A%9B-.jpg)
![](https://github.com/ymssx/ygo-card/blob/master/demo/%E5%85%83%E7%B4%A0%E8%8B%B1%E9%9B%84%20%E7%A5%9E%C2%B7%E6%96%B0%E5%AE%87%E4%BE%A0.jpg)
![](https://github.com/ymssx/ygo-card/blob/master/demo/%E6%B5%81%E5%A4%A9%E7%B1%BB%E6%98%9F%E9%BE%99.jpg)
Usage
$ yarn add ygo-card
# or
$ npm i ygo-card -D --save
import { Card } from 'ygo-card';
const canvas = document.getElementById('card');
const data = {
name: 'Ghost Ogre & Snow Rabbit',
_id: '59438930',
type: 'monster',
type2: 'effect',
type3: 'tuner',
attribute: 'light',
level: 3,
race: 'Psychic',
desc: 'When a monster on the field activates its effect, or when a Spell/Trap that is already face-up on the field activates its effect (Quick Effect): You can send this card from your hand or field to the GY; destroy that card on the field. You can only use this effect of "Ghost Ogre & Snow Rabbit" once per turn',
attack: 0,
defend: 1800,
};
const card = new Card({ data, canvas, moldPath: './dist/mold'});
card.render();