npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

yugioh-card-react

v0.2.0

Published

<h1 align="center">游戏王卡片 - Yugioh Card React</h1> <div align="center"> <p>简体中文 | <a href="./README-US.md">English</a></p> </div> <p align="center">一个使用React + HTML渲染游戏王卡片的工具。</p>

Downloads

36

Readme

这是对 yugioh-card 的一个模仿。
不使用Canvas而纯粹使用HTML完成。
目前只支持标准游戏王卡片。

使用方法

React

<Card 
  card={card} 
  image={alt} 
  lang={Language.zh_CN} 
  asset_prefix="https://xxx" 
  furigana?

  ...DivElements 
/>
  • card, Data.Card对象(下详)
  • image, 卡片图像
  • lang, 语言(Data.Language枚举)
  • asset_prefix, 图片源,请将yugioh-card的静态文件部署至合适的位置。本项目暂无分叉。
  • furigana, 是否强制启用振假名渲染。如果未强制启用,仅在lang设为JP时强制启用。

缩放参数

  • scale, 整张卡片的缩放。不设置的场合,会根据所在容器自动缩放。
  • name_scale, 卡名的横向缩放。不设置的场合,会根据剩余长度自动缩放。
  • desc_scale, 卡片效果的字体大小缩放。不设置的场合,会根据文本长度自动缩放(会闪烁)。最小缩放至0.5倍。
  • pdesc_scale, 灵摆效果的字体大小缩放。不设置的场合,会根据文本长度自动缩放(会闪烁)。最小缩放至0.5倍。

Data.Card 对象

字段名|类型|说明 ----|----|---- code|number|八位密码 name|string|卡名 desc|string|效果描述 type|number|卡片类型,数值遵循ygopro,你可以用Data.Type进行拼接 attribute|number|属性,数值遵循ygopro,你可以用Data.Attribute进行拼接 level|number|等级,对于连接怪兽此处为连接符号,数值遵循ygopro,你可以用Data.Linkmarker进行拼接 subtype_text?|string|子类型文本(即怪兽效果栏的第一行) attack?|number|攻击力 defense?|number|防御力 pendulum_text?|string|灵摆效果文本,仅在type包含灵摆时有效 lscale?|number|左刻度,仅在type包含灵摆时有效 rscale?|number|右刻读,仅在type包含灵摆时有效 pack_info?|string|卡包名 name_color?|string|string[]|卡名颜色,如有多个值则为渐变色 flavor_text?|string|风味文字 image?|string|卡片图像(会被prop.image覆盖) copyright?|'auto'|'sc'|'jp'|'en'|版权文字,auto则根据lang推测 laser?|'laser1'|'laser2'|'laser3'|'laser4'|激光镭射标识 rare?|'dt'|'ur'|'gr'|'hr'|'ser'|'gser'|'pser'|罕贵 twentieth?|boolean|20周年标记

日语注音

使用[汉字(平假名)]{汉字(片假名)}进行注音。
方括号包裹的内容居中对齐,大括号包裹的内容两端对齐,请参考卡片实际应有的对齐方式。

注释

简体中文卡片的字体为custom1,如需使用ygo-sc或其他字体请自行修改CSS文件。