added ship page

This commit is contained in:
LeeRhodes
2021-08-16 14:38:59 +01:00
parent 09a5d8d0ce
commit b591b65ae0
17 changed files with 3413 additions and 2747 deletions
+70 -2
View File
@@ -573,8 +573,8 @@
.charsheet input[type=radio].progress-page:checked ~ div.progress-page,
.charsheet input[type=radio].oracles:checked ~ div.oracles,
.charsheet input[type=radio].settings:checked ~ div.settings,
.charsheet input[type=radio].sites:checked ~ div.sites,
.charsheet input[type=radio].legacies:checked ~ div.legacies {
.charsheet input[type=radio].legacies:checked ~ div.legacies,
.charsheet input[type=radio].ship:checked ~ div.ship {
display: block;
visibility: visible;
height: auto;
@@ -585,6 +585,73 @@
margin-top: 1em;
border-bottom: 3px solid #4c4d4f;
}
.charsheet .ship-grid {
margin-top: 1em;
display: grid;
justify-content: space-around;
grid-row-gap: 1em;
}
.charsheet .ship-grid h3 {
color: #fff;
background: #4c4d4f;
margin-bottom: 0.6em;
}
.charsheet .ship-grid .asset {
grid-column: 1;
margin: 0;
grid-row: 1;
height: fit-content;
}
.charsheet .ship-grid .ship-category-info {
grid-column: 2;
grid-row: 1;
border: 2px solid #4c4d4f;
border-radius: 1em;
}
.charsheet .ship-grid .ship-category-info .info {
padding: 0em 0.4em;
}
.charsheet .ship-grid .ship-category-info h3:nth-child(1) {
border-top-left-radius: 0.6em;
border-top-right-radius: 0.6em;
}
.charsheet .ship-grid .ship-category-info input[type=text] {
border: 0;
border-bottom: 2px solid #4c4d4f;
border-radius: 0;
padding: 0;
padding-left: 0.3em;
width: 100%;
}
.charsheet .ship-grid .ship-category-support-vehicles {
grid-row: 2;
grid-column: 2;
width: 320px;
}
.charsheet .ship-grid .ship-category-modules {
grid-row: 2;
grid-column: 1;
width: 320px;
}
.charsheet .ship-grid .impact-btn {
width: 45%;
}
.charsheet .ship-grid .impact-group {
width: 100%;
}
.charsheet .ship-btn {
margin: 0;
}
.charsheet input[type=checkbox].modules:checked ~ div.modules,
.charsheet input[type=checkbox].support-vehicles:checked ~ div.support-vehicles,
.charsheet input[type=checkbox].crew:checked ~ div.crew,
.charsheet input[type=checkbox].impacts:checked ~ div.impacts {
display: block;
visibility: visible;
height: auto;
opacity: 1;
transition: 0.2s ease;
}
.charsheet .resources {
display: grid;
justify-content: space-between;
@@ -1961,6 +2028,7 @@
line-height: 1.25;
border-radius: 1em;
box-shadow: 2px 2px 6px 0px;
font-family: 'Encode Sans Condensed', Arial, sans-serif;
}
.charsheet .asset input.border-bottom {
border-bottom-color: #4c4d4f;
File diff suppressed because it is too large Load Diff
@@ -45,35 +45,38 @@ mixin track(track, assetName)
input(type='radio' name=`attr_assettrack_${assetName}` value=`${currentTrack}`)
- currentTrack++
mixin genericBuilder
mixin assetTemplate(asset, options)
- var name = asset.Name.toLowerCase().replace(/\s/g, '-')
- var category = asset.Category.toLowerCase().replace(/\s/g, '-')
if options.visiblityToggle === true
input(class=`${options.classes} ${name}` type='checkbox' name=`attr_${name}`)
div(class=`${options.classes} ${name} category-${category}`)
.asset-content-header
.asset-details
.category=asset.Category
span.asset-name=asset.Name
.background-svg
if asset.Description
+description(asset, name)
if asset.Fields
each field in asset.Fields
+field(field, name)
.flex-wrapper
each ability, index in asset.Abilities
- var abilityNumber = index + 1
+ability(asset, ability, abilityNumber, name)
if asset.Track && options.standalone === false
+track(asset.Track, name)
mixin genericBuilder(assetsArray, listId)
//- Asset Datalist
input.asset-options-header(type='text' list='assetList' name='attr_asset' placeholder='Type Asset Name')
datalist(id='assetList')
each asset in assets.Assets
input.asset-options-header(type='text' list=listId name='attr_asset' placeholder='Type Asset Name')
datalist(id=listId)
each asset in assetsArray
- var name = asset.Name.toLowerCase().replace(/\s/g, '-')
option(data-i18n=`asset-name-${name}` value=name)=translation[`asset-name-${name}`]
option(data-i18n=`asset-name-custom` value='custom')=translation[`asset-name-custom`]
//- Asset Content
each asset in assets.Assets
//- build data list
- var name = asset.Name.toLowerCase().replace(/\s/g, '-')
- var category = asset.Category.toLowerCase().replace(/\s/g, '-')
input(class=`hide-element ${name}` type='checkbox' name=`attr_${name}`)
div(class=`hide-element ${name} category-${category}`)
.asset-content-header
.asset-details
.category=asset.Category
span.asset-name=asset.Name
.background-svg
if asset.Description
+description(asset, name)
if asset.Fields
each field in asset.Fields
+field(field, name)
.flex-wrapper
each ability, index in asset.Abilities
- var abilityNumber = index + 1
+ability(asset, ability, abilityNumber, name)
if asset.Track
+track(asset.Track, name)
each asset in assetsArray
+assetTemplate(asset, { classes: 'hide-element', visiblityToggle: true })
@@ -6,5 +6,6 @@ mixin assets()
.assets
fieldset.repeating_assets.fixed-width
.asset
+genericBuilder
- var assetsArray = assets.Assets.filter(obj => { return obj.Category === 'Path' || obj.Category === 'Companion' || obj.Category === 'Deed' })
+genericBuilder(assetsArray, 'assetList')
+customAssets
@@ -127,6 +127,7 @@ div
line-height 1.25
border-radius 1em
box-shadow 2px 2px 6px 0px
std-font('Encode Sans Condensed')
input
&.border-bottom
border-bottom-color #4C4D4F
@@ -13,16 +13,18 @@ mixin otherImpact(index)
)
mixin impacts(opts)
mixin impacts(impactArray, opts)
.impact-component
each group in impacts
each group in impactArray
.impact-group
.impact-group-title=group.title
if opts.title
.impact-group-title=group.title
.impact-list
each impact in group.list
+btn(impact)
input.hide-element(type='text' name='attr_impact_total' value=0)
.custom-impacts
h4.other-impacts-title Other Impacts
each value in [ 1, 2 ]
+otherImpact(value)
if opts.customImpacts
.custom-impacts
h4.other-impacts-title Other Impacts
each value in [ 1, 2 ]
+otherImpact(value)
+5 -3
View File
@@ -2,22 +2,24 @@
"charRows": [
[
{ "id": "4", "text": "progress" },
{ "id": "7", "text": "oracles" },
{ "id": "6", "text": "moves" },
{ "id": "3", "text": "connections" },
{ "id": "10", "text": "legacies" }
],
[
{ "id": "7", "text": "oracles" },
{ "id": "2", "text": "vows" },
{ "id": "1", "text": "summary", "checked": true },
{ "id": "5", "text": "assets" }
{ "id": "5", "text": "assets" },
{ "id": "8", "text": "ship" }
]
],
"sharedRows": [
[
{ "id": "2", "text": "vows", "checked": true},
{ "id": "4", "text": "progress" },
{ "id": "3", "text": "connections" }
{ "id": "3", "text": "connections" },
{ "id": "8", "text": "ship" }
]
]
}
@@ -3,6 +3,7 @@ include ../../components/resources/resources
include ../common/connections
include ../common/vows
include ../common/progress
include ../common/ship
include ./moves
include ./assets
include ./summary
@@ -29,3 +30,4 @@ include ./legacies
+progressPage(type)
+oraclesPage
+legaciesPage(type)
+shipPage(type)
@@ -8,5 +8,5 @@ mixin summaryPage
.summary.showhide
+stats()
h3.divide(data-i18n='page-summary-impacts')=translation['page-summary-impacts']
+impacts({character: true})
+impacts(impacts, { title: true, customImpacts: true})
include ../../components/notes/notes
@@ -1,4 +1,3 @@
mixin progressPage(sheetType)
div.page-container
input(type='radio' name=`attr_${sheetType}_page` class='progress-page hide-element' value='4')
@@ -0,0 +1,77 @@
include ../../components/assets/asset-builder
-
var
shipCategories = {
modules: {
"type": "checkbox",
"attribute": "ship-modules",
"translationId": "ship-modules",
"classes": "ship-btn"
},
'support-vehicles': {
"type": "checkbox",
"attribute": "ship-support-vehicles",
"translationId": "ship-support-vehicles",
"classes": "ship-btn"
},
crew: {
"type": "checkbox",
"attribute": "ship-crew",
"translationId": "ship-crew",
"classes": "ship-btn"
},
impacts: {
"type": "checkbox",
"attribute": "ship-impacts",
"translationId": "ship-impacts",
"classes": "ship-btn"
}
}
mixin shipPage(sheetType)
div.page-container
input(type='radio' name=`attr_${sheetType}_page` class='ship hide-element' value='8')
div.ship.showhide
.ship-grid
.asset
- const starship = assets.Assets.find(obj => { return obj.Name === 'Starship' })
+assetTemplate(starship, { classes: 'visible', standalone: true })
.ship-category-info
h3 Track
.info
+track(starship.Track, `${sheetType}_ship`)
h3 Impacts
.info
- const shipImpacts = [impacts.find(obj => { return obj.title === 'current vehicle' })]
+impacts(shipImpacts, {character: true})
h3 Crew
.info
fieldset.repeating_ship-crew
input(
type='text'
name=`attr_crew-member`
placeholder='Crew Member'
)
h3 Cargo
.info
fieldset.repeating_ship-cargo
input(
type='text'
name=`attr_cargo`
placeholder='Cargo'
)
.ship-category-modules
h3 Modules
fieldset.repeating_module-assets
- var assetsArray = assets.Assets.filter(obj => { return obj.Category === 'Module' })
.asset
+genericBuilder(assetsArray, 'moduleList')
.ship-category-support-vehicles
h3 Support Vehicles
fieldset.repeating_support-vehicle-assets
- var assetsArray = assets.Assets.filter(obj => { return obj.Category === 'Support Vehicle' })
.asset
+genericBuilder(assetsArray, 'supportVehiclesList')
+59 -3
View File
@@ -76,11 +76,67 @@ input[type=radio].moves:checked ~ div.moves,
input[type=radio].progress-page:checked ~ div.progress-page,
input[type=radio].oracles:checked ~ div.oracles,
input[type=radio].settings:checked ~ div.settings,
input[type=radio].sites:checked ~ div.sites
input[type=radio].legacies:checked ~ div.legacies
input[type=radio].legacies:checked ~ div.legacies,
input[type=radio].ship:checked ~ div.ship
display block
show-hide()
.sub-header
margin-top 1em
border-bottom 3px solid #4C4D4F
border-bottom 3px solid #4C4D4F
.ship-grid
margin-top 1em
display grid
justify-content space-around
grid-row-gap 1em
h3
color white
background #4c4d4f
margin-bottom 0.6em
.asset
grid-column 1
margin 0
grid-row 1
height fit-content
.ship-category-info
grid-column 2
grid-row 1
border 2px solid #4c4d4f
border-radius 1em
.info
padding 0em 0.4em
h3
&:nth-child(1)
border-top-left-radius 0.6em
border-top-right-radius 0.6em
input[type=text]
border 0
border-bottom 2px solid #4c4d4f
border-radius 0
padding 0
padding-left 0.3em
width 100%
.ship-category-support-vehicles
grid-row 2
grid-column 2
width 320px
.ship-category-modules
grid-row 2
grid-column 1
width 320px
.impact-btn
width 45%
.impact-group
width 100%
.ship-btn
margin 0
input[type=checkbox].modules:checked ~ div.modules,
input[type=checkbox].support-vehicles:checked ~ div.support-vehicles,
input[type=checkbox].crew:checked ~ div.crew,
input[type=checkbox].impacts:checked ~ div.impacts
display block
show-hide()
@@ -3,6 +3,7 @@ include ../../components/resources/resources
include ../common/vows
include ../common/connections
include ../common/progress
include ../common/ship
- var type = 'shared'
@@ -13,4 +14,5 @@ div.header
+navBar(type)
+vowsPage(type)
+connectionsPage(type)
+progressPage(type)
+progressPage(type)
+shipPage(type)
@@ -9,4 +9,5 @@ script(type="text/worker")
include ./scripts/vows.js
include ./scripts/connections.js
include ./scripts/legacies.js
include ./scripts/impacts.js
include ./scripts/impacts.js
include ./scripts/ship.js
@@ -12,6 +12,34 @@ on('change:repeating_assets:asset', function(values) {
});
});
on('change:repeating_module-assets:assettype', function(values) {
setAttrs({
['repeating_module-assets_Asset' + values.previousValue]: 'off',
['repeating_module-assets_Asset' + values.newValue]: 'on'
});
});
on('change:repeating_module-assets:asset', function(values) {
setAttrs({
['repeating_module-assets_' + values.previousValue]: 'off',
['repeating_module-assets_' + values.newValue]: 'on'
});
});
on('change:repeating_support-vehicle-assets:assettype', function(values) {
setAttrs({
['repeating_support-vehicle-assets_Asset' + values.previousValue]: 'off',
['repeating_support-vehicle-assets_Asset' + values.newValue]: 'on'
});
});
on('change:repeating_support-vehicle-assets:asset', function(values) {
setAttrs({
['repeating_support-vehicle-assets_' + values.previousValue]: 'off',
['repeating_support-vehicle-assets_' + values.newValue]: 'on'
});
});
on('change:repeating_assets:builder-titles', function(values) {
setAttrs({
['repeating_assets_builder-titles-' + values.previousValue]: 'off',
@@ -0,0 +1,6 @@
on('change:ship-modules_button change:ship-support-vehicles_button change:ship-crew_button change:ship-impacts_button', function(eventinfo) {
const type = eventinfo.sourceAttribute.match(/(.*?)_button/)[1]
setAttrs({
[`${type}`]: eventinfo.newValue
});
});
+6 -1
View File
@@ -20,6 +20,8 @@
"nav-summary": "Summary",
"nav-assets": "Assets",
"nav-legacies": "Legacies",
"nav-vows": "Vows",
"nav-ship": "Ship",
"page-summary-failures": " FAILURES ",
"clear-btn": "CLEAR",
"failures-learn": "LEARN",
@@ -484,5 +486,8 @@
"move-title-take-a-break":"Take a Break",
"move-title-end-a-session":"End a Session",
"progress-challenge": "CHALLENGE",
"nav-vows": "Vows"
"ship-modules": "Modules",
"ship-support-vehicles": "Support Vehicles",
"ship-crew": "Crew",
"ship-impacts": "Impacts"
}