RC-25 | Initialize the Hero Summary Sheet application
This commit is contained in:
parent
2fc3b86792
commit
b10535eceb
7 changed files with 155 additions and 1 deletions
24
Apps/HeroSummaryCardV1/content.hbs
Normal file
24
Apps/HeroSummaryCardV1/content.hbs
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
<div class="HeroSummaryCardV1">
|
||||||
|
{{!-- * Header --}}
|
||||||
|
<div class="header">
|
||||||
|
<div class="image">Logo Image</div>
|
||||||
|
<label class="row-alt" for="{{meta.idp}}-name">
|
||||||
|
Hero
|
||||||
|
</label>
|
||||||
|
<div>
|
||||||
|
Player
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input id="{{meta.idp}}-name" class="hero_name row-alt" value="Hugo">
|
||||||
|
|
||||||
|
{{!-- * Armour --}}
|
||||||
|
<div class="armour"></div>
|
||||||
|
|
||||||
|
{{!-- * Fate & Advancement --}}
|
||||||
|
|
||||||
|
{{!-- * Weapons --}}
|
||||||
|
|
||||||
|
{{!-- * Skills --}}
|
||||||
|
|
||||||
|
{{!-- * Equipment --}}
|
||||||
|
</div>
|
||||||
50
Apps/HeroSummaryCardV1/style.css
Normal file
50
Apps/HeroSummaryCardV1/style.css
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
.ripcrypt .HeroSummaryCardV1 {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 2.5fr);
|
||||||
|
grid-template-rows: repeat(15, minmax(0, 1fr));
|
||||||
|
column-gap: var(--col-gap);
|
||||||
|
|
||||||
|
background: white;
|
||||||
|
color: black;
|
||||||
|
|
||||||
|
.row-alt {
|
||||||
|
background: rgba(0,0,0, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 2px 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
box-sizing: border-box;
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
&[type="text"],
|
||||||
|
&[type="number"] {
|
||||||
|
padding: 2px 4px;
|
||||||
|
border-bottom: 2px dashed blueviolet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero_name {
|
||||||
|
grid-column: span 3;
|
||||||
|
margin-left: calc(var(--col-gap) * -1);
|
||||||
|
padding-left: var(--col-gap);
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
grid-row: span 2;
|
||||||
|
grid-column: span 1;
|
||||||
|
display: grid;
|
||||||
|
grid-template-rows: subgrid;
|
||||||
|
grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
|
||||||
|
|
||||||
|
.image {
|
||||||
|
grid-row: span 2;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Apps/common.css
Normal file
12
Apps/common.css
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
.ripcrypt {
|
||||||
|
.window-content {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.HeroSummaryCardV1 {
|
||||||
|
height: 270px;
|
||||||
|
width: 680px;
|
||||||
|
--col-gap: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,5 +3,10 @@
|
||||||
"Actor": {
|
"Actor": {
|
||||||
"hero": "Hero"
|
"hero": "Hero"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"RipCrypt": {
|
||||||
|
"sheet-names": {
|
||||||
|
"HeroSummaryCardV1": "Hero Stat Card"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
53
module/Apps/ActorSheets/HeroSummaryCardV1.mjs
Normal file
53
module/Apps/ActorSheets/HeroSummaryCardV1.mjs
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
import { filePath } from "../../consts.mjs";
|
||||||
|
|
||||||
|
const { DocumentSheetV2, HandlebarsApplicationMixin } = foundry.applications.api;
|
||||||
|
|
||||||
|
export class HeroSummaryCardV1 extends HandlebarsApplicationMixin(DocumentSheetV2) {
|
||||||
|
|
||||||
|
// #region Options
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
classes: [
|
||||||
|
`ripcrypt`,
|
||||||
|
`ripcrypt--actor`,
|
||||||
|
`ripcrypt--HeroSummaryCardV1`,
|
||||||
|
`ripcrypt-theme--dark`,
|
||||||
|
],
|
||||||
|
position: {
|
||||||
|
width: `auto`,
|
||||||
|
height: `auto`,
|
||||||
|
},
|
||||||
|
window: {
|
||||||
|
resizable: false,
|
||||||
|
},
|
||||||
|
actions: {},
|
||||||
|
form: {
|
||||||
|
submitOnChange: true,
|
||||||
|
closeOnSubmit: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static PARTS = {
|
||||||
|
content: {
|
||||||
|
template: filePath(`Apps/HeroSummaryCardV1/content.hbs`),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
// #endregion
|
||||||
|
|
||||||
|
// #region Lifecycle
|
||||||
|
async _preparePartContext(partId, ctx, opts) {
|
||||||
|
ctx = await super._preparePartContext(partId, ctx, opts);
|
||||||
|
|
||||||
|
ctx.meta ??= {};
|
||||||
|
ctx.meta.idp = this.document.uuid;
|
||||||
|
|
||||||
|
partId = partId.slice(0,1).toUpperCase() + partId.slice(1);
|
||||||
|
if (this[`_prepare${partId}Context`] != null) {
|
||||||
|
ctx = await this[`_prepare${partId}Context`](ctx, opts);
|
||||||
|
};
|
||||||
|
return ctx;
|
||||||
|
};
|
||||||
|
// #endregion
|
||||||
|
|
||||||
|
// #region Actions
|
||||||
|
// #endregion
|
||||||
|
};
|
||||||
7
module/consts.mjs
Normal file
7
module/consts.mjs
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
// MARK: filePath
|
||||||
|
export function filePath(path) {
|
||||||
|
if (path.startsWith(`/`)) {
|
||||||
|
path = path.slice(1);
|
||||||
|
};
|
||||||
|
return `systems/ripcrypt/${path}`;
|
||||||
|
};
|
||||||
|
|
@ -17,7 +17,10 @@
|
||||||
"esmodules": [
|
"esmodules": [
|
||||||
"module/main.mjs"
|
"module/main.mjs"
|
||||||
],
|
],
|
||||||
"styles": [],
|
"styles": [
|
||||||
|
"Apps/common.css",
|
||||||
|
"Apps/HeroSummaryCardV1/style.css"
|
||||||
|
],
|
||||||
"languages": [
|
"languages": [
|
||||||
{
|
{
|
||||||
"lang": "en",
|
"lang": "en",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue