From cd6be3258331012c1cdfe6dd5e8070eee3ba5fb1 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Sun, 11 Jul 2021 05:04:05 +0200 Subject: [PATCH] Clean up character sheet --- src/module/handlebars/handlebars-partials.ts | 2 + src/scss/components/_character_header.scss | 53 ++++++++++++ .../components/_character_progression.scss | 61 +++++++------- .../components/_character_properties.scss | 30 +++++++ src/scss/components/_sheet.scss | 11 +++ .../{_tabs.scss => _sheet_tab_nav.scss} | 10 +-- src/scss/ds4.scss | 5 +- .../sheets/actor/character-sheet.hbs | 84 ++----------------- .../actor/components/character-header.hbs | 25 ++++++ .../components/character-progression.hbs | 30 +++---- .../actor/components/character-properties.hbs | 59 +++++++++++++ src/templates/sheets/actor/creature-sheet.hbs | 13 +-- src/templates/sheets/item/components/body.hbs | 8 +- 13 files changed, 251 insertions(+), 140 deletions(-) create mode 100644 src/scss/components/_character_header.scss create mode 100644 src/scss/components/_character_properties.scss create mode 100644 src/scss/components/_sheet.scss rename src/scss/components/{_tabs.scss => _sheet_tab_nav.scss} (70%) create mode 100644 src/templates/sheets/actor/components/character-header.hbs create mode 100644 src/templates/sheets/actor/components/character-properties.hbs diff --git a/src/module/handlebars/handlebars-partials.ts b/src/module/handlebars/handlebars-partials.ts index 82e58e8..a5f7466 100644 --- a/src/module/handlebars/handlebars-partials.ts +++ b/src/module/handlebars/handlebars-partials.ts @@ -8,6 +8,8 @@ export default async function registerHandlebarsPartials(): Promise { const templatePaths = [ "systems/ds4/templates/sheets/actor/components/biography.hbs", "systems/ds4/templates/sheets/actor/components/character-progression.hbs", + "systems/ds4/templates/sheets/actor/components/character-properties.hbs", + "systems/ds4/templates/sheets/actor/components/character-header.hbs", "systems/ds4/templates/sheets/actor/components/check.hbs", "systems/ds4/templates/sheets/actor/components/checks.hbs", "systems/ds4/templates/sheets/actor/components/combat-value.hbs", diff --git a/src/scss/components/_character_header.scss b/src/scss/components/_character_header.scss new file mode 100644 index 0000000..f69efd2 --- /dev/null +++ b/src/scss/components/_character_header.scss @@ -0,0 +1,53 @@ +/* + * SPDX-FileCopyrightText: 2021 Johannes Loher + * + * SPDX-License-Identifier: MIT + */ + +@use "../utils/typography"; + +.ds4-character-header { + display: flex; + flex-grow: 0; + flex-shrink: 0; + gap: 1em; + + &__img { + border: none; + cursor: pointer; + height: 100px; + width: 100px; + } + + &__data { + display: flex; + flex-direction: column; + } + + &__data-row { + align-content: center; + display: flex; + flex: 1; + flex-direction: row; + gap: 0.5em; + > * { + flex: 1; + } + } + + &__name { + display: flex; + align-items: center; + border-bottom: 0; + margin: 0; + } + + &__name-input { + @include typography.font-heading-upper; + background-color: transparent; + border: none; + flex: 1; + font-size: 1.25em; + height: auto; + } +} diff --git a/src/scss/components/_character_progression.scss b/src/scss/components/_character_progression.scss index 8e316a8..d1d03d8 100644 --- a/src/scss/components/_character_progression.scss +++ b/src/scss/components/_character_progression.scss @@ -10,42 +10,39 @@ @use "../utils/variables"; @use "../utils/mixins"; -.progression { - .progression-entry { - @include mixins.mark-invalid-or-disabled-input; +.ds4-character-progression { + @include mixins.mark-invalid-or-disabled-input; + display: flex; + gap: 0.5em; - display: flex; - flex-direction: row; - flex-wrap: wrap; - justify-content: flex-end; + &__entry { align-items: center; + display: flex; + flex: 1; + gap: 0.25em; + justify-content: flex-end; + } - padding-right: 3px; - h2.progression-label { - @include typography.font-heading-upper; - display: block; - height: 50px; - padding: 0; - color: colors.$c-light-grey; - border: none; - line-height: 50px; - margin: variables.$margin-sm 0; - text-align: right; - } - input.progression-value { - margin-left: 5px; - flex: 0 0 40px; - text-align: left; + &__label { + @include typography.font-heading-upper; + border: none; + color: colors.$c-light-grey; + margin: 0; + padding: 0; + text-align: right; + } - &--slayer-points { - &::-webkit-inner-spin-button, - &::-webkit-outer-spin-button { - -webkit-appearance: auto; - } - &:hover, - &:focus { - -moz-appearance: auto; - } + &__input { + flex: 0 0 5ch; + + &--slayer-points { + &::-webkit-inner-spin-button, + &::-webkit-outer-spin-button { + -webkit-appearance: auto; + } + &:hover, + &:focus { + -moz-appearance: auto; } } } diff --git a/src/scss/components/_character_properties.scss b/src/scss/components/_character_properties.scss new file mode 100644 index 0000000..1962afd --- /dev/null +++ b/src/scss/components/_character_properties.scss @@ -0,0 +1,30 @@ +/* + * SPDX-FileCopyrightText: 2021 Johannes Loher + * SPDX-FileCopyrightText: 2021 Oliver Rümpelein + * SPDX-FileCopyrightText: 2021 Gesina Schwalbe + * + * SPDX-License-Identifier: MIT + */ + +@use "../utils/mixins"; + +.ds4-character-properties { + @include mixins.mark-invalid-or-disabled-input; + display: flex; + gap: 0.25em; + + &__property { + flex: 1; + } + + &__property-label { + font-size: 0.9em; + font-weight: bold; + white-space: nowrap; + } + + &__property-multi-input { + display: flex; + gap: 0.125em; + } +} diff --git a/src/scss/components/_sheet.scss b/src/scss/components/_sheet.scss new file mode 100644 index 0000000..2308aef --- /dev/null +++ b/src/scss/components/_sheet.scss @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2021 Johannes Loher + * + * SPDX-License-Identifier: MIT + */ + +.ds4-sheet { + display: flex; + flex-direction: column; + flex-wrap: nowrap; +} diff --git a/src/scss/components/_tabs.scss b/src/scss/components/_sheet_tab_nav.scss similarity index 70% rename from src/scss/components/_tabs.scss rename to src/scss/components/_sheet_tab_nav.scss index a16447a..9d86fd9 100644 --- a/src/scss/components/_tabs.scss +++ b/src/scss/components/_sheet_tab_nav.scss @@ -6,16 +6,12 @@ @use "../utils/variables"; -nav.tabs { +.ds4-sheet-tab-nav { height: auto; border-top: variables.$border-groove; border-bottom: variables.$border-groove; - .item { - font-weight: bold; - white-space: nowrap; - } - .item.active { - text-decoration: none; + &__item { + font-weight: bold; } } diff --git a/src/scss/ds4.scss b/src/scss/ds4.scss index 7e33edd..1185def 100644 --- a/src/scss/ds4.scss +++ b/src/scss/ds4.scss @@ -23,6 +23,7 @@ @include meta.load-css("components/apps"); @include meta.load-css("components/basic_property"); @include meta.load-css("components/character_progression"); + @include meta.load-css("components/character_properties"); @include meta.load-css("components/character_values"); @include meta.load-css("components/check"); @include meta.load-css("components/checks"); @@ -33,10 +34,12 @@ @include meta.load-css("components/currency"); @include meta.load-css("components/description"); @include meta.load-css("components/forms"); + @include meta.load-css("components/character_header"); @include meta.load-css("components/item_list"); @include meta.load-css("components/profile"); @include meta.load-css("components/rollable_image"); - @include meta.load-css("components/tabs"); + @include meta.load-css("components/sheet"); + @include meta.load-css("components/sheet_tab_nav"); @include meta.load-css("components/talent_rank_equation"); @include meta.load-css("tabs/biography"); } diff --git a/src/templates/sheets/actor/character-sheet.hbs b/src/templates/sheets/actor/character-sheet.hbs index 8e5eb27..6fc20bc 100644 --- a/src/templates/sheets/actor/character-sheet.hbs +++ b/src/templates/sheets/actor/character-sheet.hbs @@ -6,83 +6,17 @@ SPDX-FileCopyrightText: 2021 Gesina Schwalbe SPDX-License-Identifier: MIT --}} -
- {{!-- Sheet Header --}} -
- Actor Icon -
-

- - -

- {{> systems/ds4/templates/sheets/actor/components/character-progression.hbs}} - -
-
- - -
-
- - -
-
- -
- - / - - -
-
-
- -
- - / - - -
-
-
- - -
-
- - -
-
-
-
+ + {{!-- Character Header --}} + {{> systems/ds4/templates/sheets/actor/components/character-header.hbs}} {{!-- Sheet Tab Navigation --}} -