Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DND Spell Cards

This project is a simple D&D spell card generator. The online editor is here.

⚠️ There may be some text extraction errors, so please review them before using.

PDF Generator

The DNDSpellCards is the main class for generating spell cards. The spells are an Array following spell structure. nodeElement is the target DOM element where the PDF preview (iframe) will be added.

The function returns a PDFDocument.

const doc = DNDSpellCards.CreatePDF( spells, nodeElement );

/// open a new window - can be block popup
doc.open();

/// download pdf file
doc.download( "file-name" );

Spell Structure

The DNDSpellCards accepts the following spell structure:

{
    "name": "...",
		"type": "...",
		"casting": "...",
		"range": "...",
		"components": "...",
		"duration": "...",
		"level": "...",
		"classes": [
			"...",
			"..."
		],
		"content": [
			"Paragraph ...",
			"Paragraph ...",
			"Paragraph ... $Bold And Italic$ ..."
		],
		"tables":  [{
			"sizes": [ 0.25, 0.75 ],
			"header": [
				[ "#title#", "#title#" ]
			],
			"body": [
				["td ...", "td ..."],
				["td ...", "td ..."],
				["td ...", "td ..."]
			]
		}],
		"statblock": {
			"title": "...",
			"subtitle": "...",
			"AC": "..",
			"HP": "...",
			"Speed": "...",
			"attributes": {
				"STR": ["0", "+0", "+0"],
				"DEX": ["0", "+0", "+0"],
				"CON": ["0", "+0", "+0"],
				"INT": ["0", "-0", "-0"],
				"WIS": ["0", "-0", "-0"],
				"CHA": ["0", "-0", "-0"]
			},
			"addons": {
				"Immunities": "...",
				"Senses": "...",
				"Languages": "...",
				"CR": "..."
			},
			"Actions": [
				"Paragraph ..."
			]
		}

Supported Text Styles

Syntax Style
TEXT Normal
#TEXT# Bold
_TEXT_ Italic
$TEXT$ Bold + Italic

Editor Setup

The editor has been built with Vue.js.

cd editor/
npm install

Compile and Hot-Reload for Development

npm run build

Running localhost

npm run preview

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages