Skip to content

Commit

Permalink
1.2.0
Browse files Browse the repository at this point in the history
- Added export as png button
  • Loading branch information
valentine195 committed Jul 2, 2021
1 parent e856008 commit e85947b
Show file tree
Hide file tree
Showing 8 changed files with 678 additions and 637 deletions.
1 change: 1 addition & 0 deletions @types/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { MarkdownPostProcessorContext, Plugin } from "obsidian";

export declare abstract class StatblockMonsterPlugin extends Plugin {
exportAsPng(name: string, containerEl: HTMLElement): void;
data: Map<string, Monster>;
abstract postprocessor(
source: string,
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-5e-statblocks",
"name": "5e Statblocks",
"version": "1.1.0",
"version": "1.2.0",
"description": "Create 5e styled statblocks in Obsidian.md",
"minAppVersion": "0.12.0",
"author": "Jeremy Valentine",
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-5e-statblocks",
"version": "1.1.0",
"version": "1.2.0",
"description": "Create 5e styled statblocks in Obsidian.md",
"main": "main.js",
"scripts": {
Expand All @@ -14,7 +14,9 @@
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-typescript": "^6.0.0",
"@types/dom-to-image": "^2.6.2",
"@types/node": "^14.14.2",
"dom-to-image": "^2.6.0",
"fast-sort": "^3.0.2",
"obsidian": "https://github.com/obsidianmd/obsidian-api/tarball/master",
"rollup": "^2.32.1",
Expand Down
5 changes: 4 additions & 1 deletion src/data/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,7 @@ export const AbilityAliases: { [key: string]: string } = {
};

export const SAVE_ICON = `<svg aria-hidden="true" focusable="false" data-prefix="far" data-icon="save" class="svg-inline--fa fa-save fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM272 80v80H144V80h128zm122 352H54a6 6 0 0 1-6-6V86a6 6 0 0 1 6-6h42v104c0 13.255 10.745 24 24 24h176c13.255 0 24-10.745 24-24V83.882l78.243 78.243a6 6 0 0 1 1.757 4.243V426a6 6 0 0 1-6 6zM224 232c-48.523 0-88 39.477-88 88s39.477 88 88 88 88-39.477 88-88-39.477-88-88-88zm0 128c-22.056 0-40-17.944-40-40s17.944-40 40-40 40 17.944 40 40-17.944 40-40 40z"></path></svg>`;
export const SAVE_SYMBOL = Symbol("save");
export const SAVE_SYMBOL = "statblock-save";

export const EXPORT_ICON = `<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="download" class="svg-inline--fa fa-download fa-w-16" role="img" viewBox="0 0 512 512"><path fill="currentColor" d="M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"/></svg>`
export const EXPORT_SYMBOL = "statblock-export-as-png"
7 changes: 7 additions & 0 deletions src/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@
justify-content: space-between;
align-items: center;
}
.obsidian-statblock-plugin .creature-heading .statblock-icons {
display: flex;
justify-content: flex-end;
align-items: center;

}

.obsidian-statblock-plugin .creature-heading > .subheading {
font-weight: normal;
font-style: italic;
Expand Down
Loading

0 comments on commit e85947b

Please sign in to comment.