Improved [redacted], added routes and navigation
This commit is contained in:
@@ -39,27 +39,45 @@
|
|||||||
<v-icon>mdi-dots-vertical</v-icon>
|
<v-icon>mdi-dots-vertical</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</template>
|
</template>
|
||||||
<v-list v-if="editPermission">
|
<v-list>
|
||||||
<v-list-item @click="deleteCharacter">
|
<v-list-item :to="printUrl">
|
||||||
<v-list-item-title>
|
<v-list-item-title>
|
||||||
<v-icon>mdi-delete</v-icon> Delete
|
<v-icon left>
|
||||||
|
mdi-printer
|
||||||
|
</v-icon> Print
|
||||||
</v-list-item-title>
|
</v-list-item-title>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
<v-list-item @click="showCharacterForm">
|
<template v-if="editPermission">
|
||||||
|
<v-list-item @click="deleteCharacter">
|
||||||
|
<v-list-item-title>
|
||||||
|
<v-icon left>
|
||||||
|
mdi-delete
|
||||||
|
</v-icon> Delete
|
||||||
|
</v-list-item-title>
|
||||||
|
</v-list-item>
|
||||||
|
<v-list-item @click="showCharacterForm">
|
||||||
|
<v-list-item-title>
|
||||||
|
<v-icon left>
|
||||||
|
mdi-pencil
|
||||||
|
</v-icon> Edit details
|
||||||
|
</v-list-item-title>
|
||||||
|
</v-list-item>
|
||||||
|
<v-list-item @click="showShareDialog">
|
||||||
|
<v-list-item-title>
|
||||||
|
<v-icon left>
|
||||||
|
mdi-share-variant
|
||||||
|
</v-icon> Sharing
|
||||||
|
</v-list-item-title>
|
||||||
|
</v-list-item>
|
||||||
|
</template>
|
||||||
|
<v-list-item
|
||||||
|
v-else
|
||||||
|
@click="unshareWithMe"
|
||||||
|
>
|
||||||
<v-list-item-title>
|
<v-list-item-title>
|
||||||
<v-icon>mdi-pencil</v-icon> Edit details
|
<v-icon left>
|
||||||
</v-list-item-title>
|
mdi-delete
|
||||||
</v-list-item>
|
</v-icon> Unshare with me
|
||||||
<v-list-item @click="showShareDialog">
|
|
||||||
<v-list-item-title>
|
|
||||||
<v-icon>mdi-share-variant</v-icon> Sharing
|
|
||||||
</v-list-item-title>
|
|
||||||
</v-list-item>
|
|
||||||
</v-list>
|
|
||||||
<v-list v-else>
|
|
||||||
<v-list-item @click="unshareWithMe">
|
|
||||||
<v-list-item-title>
|
|
||||||
<v-icon>mdi-delete</v-icon> Unshare with me
|
|
||||||
</v-list-item-title>
|
</v-list-item-title>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</v-list>
|
</v-list>
|
||||||
@@ -144,6 +162,7 @@ import isDarkColor from '/imports/client/ui/utility/isDarkColor.js';
|
|||||||
import CharacterSheetFab from '/imports/client/ui/creature/character/CharacterSheetFab.vue';
|
import CharacterSheetFab from '/imports/client/ui/creature/character/CharacterSheetFab.vue';
|
||||||
import getThemeColor from '/imports/client/ui/utility/getThemeColor.js';
|
import getThemeColor from '/imports/client/ui/utility/getThemeColor.js';
|
||||||
import SharedIcon from '/imports/client/ui/components/SharedIcon.vue';
|
import SharedIcon from '/imports/client/ui/components/SharedIcon.vue';
|
||||||
|
import getCreatureUrlName from '/imports/api/creature/creatures/getCreatureUrlName.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -167,6 +186,9 @@ export default {
|
|||||||
isDark() {
|
isDark() {
|
||||||
return isDarkColor(this.toolbarColor);
|
return isDarkColor(this.toolbarColor);
|
||||||
},
|
},
|
||||||
|
printUrl() {
|
||||||
|
return `/print-character/${this.creature._id}/${getCreatureUrlName(this.creature)}`;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations([
|
...mapMutations([
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
{{ creature.alignment }} {{ background }}
|
{{ creature.alignment }} {{ background }}
|
||||||
</div>
|
</div>
|
||||||
<dir v-if="race || creature.gender">
|
<dir v-if="race || creature.gender">
|
||||||
{{ race }} {{ creature.gender }}
|
{{ creature.gender }} {{ race }}
|
||||||
</dir>
|
</dir>
|
||||||
<div v-if="level && classes && classes.length === 1">
|
<div v-if="level && classes && classes.length === 1">
|
||||||
Level {{ level }} {{ classes[0].name }}
|
Level {{ level }} {{ classes[0].name }}
|
||||||
@@ -236,9 +236,41 @@ export default {
|
|||||||
color: black;
|
color: black;
|
||||||
font-size: 11pt;
|
font-size: 11pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.character-sheet-printed * {
|
||||||
|
print-color-adjust: exact;
|
||||||
|
-webkit-print-color-adjust: exact;
|
||||||
|
cursor: unset !important;
|
||||||
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.character-sheet-printed .column-layout, .character-sheet-printed .column-layout.wide-columns {
|
||||||
|
position:relative;
|
||||||
|
width: 100%;
|
||||||
|
widows: 0;
|
||||||
|
orphans: 0;
|
||||||
|
-webkit-column-fill: balance-all;
|
||||||
|
column-fill: balance-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.character-sheet-printed .column-layout>div {
|
||||||
|
position:relative;
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
-webkit-backface-visibility: hidden;
|
||||||
|
-webkit-column-break-inside: avoid;
|
||||||
|
break-inside: avoid;
|
||||||
|
page-break-inside: avoid;
|
||||||
|
}
|
||||||
|
.character-sheet-printed .column-layout>div>* {
|
||||||
|
-webkit-column-break-inside: avoid;
|
||||||
|
break-inside: avoid;
|
||||||
|
page-break-inside: avoid;
|
||||||
|
}
|
||||||
.character-sheet-printed .inactive {
|
.character-sheet-printed .inactive {
|
||||||
opacity: 1 !important;
|
opacity: 1 !important;
|
||||||
}
|
}
|
||||||
@@ -253,8 +285,6 @@ export default {
|
|||||||
background-image: url(/crown-dice-logo-cropped-transparent.png);
|
background-image: url(/crown-dice-logo-cropped-transparent.png);
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
background-position: 0 center;
|
background-position: 0 center;
|
||||||
print-color-adjust: exact;
|
|
||||||
-webkit-print-color-adjust: exact;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.character-sheet-printed .v-divider {
|
.character-sheet-printed .v-divider {
|
||||||
@@ -265,7 +295,6 @@ export default {
|
|||||||
.character-sheet-printed .double-border {
|
.character-sheet-printed .double-border {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 11px 10px;
|
padding: 11px 10px;
|
||||||
page-break-inside: avoid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.character-sheet-printed .double-border::before {
|
.character-sheet-printed .double-border::before {
|
||||||
@@ -286,8 +315,8 @@ export default {
|
|||||||
.character-sheet-printed .octagon-border {
|
.character-sheet-printed .octagon-border {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 4px 20px;
|
padding: 4px 20px;
|
||||||
page-break-inside: avoid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.character-sheet-printed .octagon-border::before {
|
.character-sheet-printed .octagon-border::before {
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -326,6 +355,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media print {
|
@media print {
|
||||||
|
.v-main, .v-application, .v-application--wrap, .character-sheet-printed {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
header {
|
header {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,97 @@
|
|||||||
|
<template>
|
||||||
|
<v-app-bar
|
||||||
|
app
|
||||||
|
class="character-sheet-printed-toolbar"
|
||||||
|
:color="toolbarColor"
|
||||||
|
:dark="isDark"
|
||||||
|
:light="!isDark"
|
||||||
|
clipped-right
|
||||||
|
:extended="$vuetify.breakpoint.smAndUp"
|
||||||
|
:tabs="$vuetify.breakpoint.smAndUp"
|
||||||
|
dense
|
||||||
|
>
|
||||||
|
<v-app-bar-nav-icon @click="toggleDrawer" />
|
||||||
|
<v-btn
|
||||||
|
icon
|
||||||
|
:to="characterUrl"
|
||||||
|
>
|
||||||
|
<v-icon>mdi-arrow-left</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
<v-toolbar-title>
|
||||||
|
<v-fade-transition mode="out-in">
|
||||||
|
<div :key="$store.state.pageTitle">
|
||||||
|
{{ $store.state.pageTitle }}
|
||||||
|
</div>
|
||||||
|
</v-fade-transition>
|
||||||
|
</v-toolbar-title>
|
||||||
|
<v-spacer />
|
||||||
|
<div
|
||||||
|
slot="extension"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<v-btn
|
||||||
|
class="print-fab"
|
||||||
|
color="accent"
|
||||||
|
elevation="4"
|
||||||
|
fab
|
||||||
|
@click="print"
|
||||||
|
>
|
||||||
|
<v-icon>mdi-printer</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
|
</v-app-bar>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="js">
|
||||||
|
import Creatures from '/imports/api/creature/creatures/Creatures.js';
|
||||||
|
import { mapMutations } from 'vuex';
|
||||||
|
import isDarkColor from '/imports/client/ui/utility/isDarkColor.js';
|
||||||
|
import getThemeColor from '/imports/client/ui/utility/getThemeColor.js';
|
||||||
|
import getCreatureUrlName from '/imports/api/creature/creatures/getCreatureUrlName.js';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
inject: {
|
||||||
|
context: { default: {} }
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
creatureId() {
|
||||||
|
return this.$route.params.id;
|
||||||
|
},
|
||||||
|
toolbarColor() {
|
||||||
|
if (this.creature && this.creature.color) {
|
||||||
|
return this.creature.color;
|
||||||
|
} else {
|
||||||
|
return getThemeColor('secondary');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isDark() {
|
||||||
|
return isDarkColor(this.toolbarColor);
|
||||||
|
},
|
||||||
|
characterUrl() {
|
||||||
|
if (!this.creature) return;
|
||||||
|
return `/character/${this.creature._id}/${getCreatureUrlName(this.creature)}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapMutations([
|
||||||
|
'toggleDrawer',
|
||||||
|
]),
|
||||||
|
print() {
|
||||||
|
print();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
meteor: {
|
||||||
|
creature() {
|
||||||
|
return Creatures.findOne(this.creatureId);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.print-fab {
|
||||||
|
position: absolute;
|
||||||
|
bottom: -24px;
|
||||||
|
right: 24px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
:key="container._id"
|
:key="container._id"
|
||||||
class="span-all container-header"
|
class="span-all"
|
||||||
>
|
>
|
||||||
<printed-container
|
<printed-container
|
||||||
class="octagon-border"
|
class="octagon-border"
|
||||||
@@ -232,22 +232,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="css" scoped>
|
<style lang="css" scoped>
|
||||||
.octagon-border {
|
|
||||||
position: relative;
|
|
||||||
padding: 4px 20px;
|
|
||||||
page-break-inside: avoid;
|
|
||||||
}
|
|
||||||
.octagon-border::before {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
border-image: url(/images/print/octagonBorder.png) 124 118 fill;
|
|
||||||
border-image-width: 22px;
|
|
||||||
z-index: -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.label {
|
.label {
|
||||||
font-size: 14pt;
|
font-size: 14pt;
|
||||||
@@ -262,9 +246,4 @@ export default {
|
|||||||
.inventory-stat > .v-icon {
|
.inventory-stat > .v-icon {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container-header {
|
|
||||||
page-break-after: avoid;
|
|
||||||
page-break-inside: avoid;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -2,97 +2,104 @@
|
|||||||
<div class="stats">
|
<div class="stats">
|
||||||
<column-layout>
|
<column-layout>
|
||||||
<div
|
<div
|
||||||
v-if="abilities.length"
|
v-for="ability in abilities"
|
||||||
class="ability-scores"
|
:key="ability._id"
|
||||||
>
|
>
|
||||||
<div class="layout flex column">
|
<div
|
||||||
<div
|
class="ability"
|
||||||
v-for="ability in abilities"
|
>
|
||||||
:key="ability._id"
|
<div class="score">
|
||||||
class="ability"
|
<div class="double-border top big-number">
|
||||||
>
|
<template v-if="creature.settings.swapScoresAndMods">
|
||||||
<div class="score">
|
{{ ability.total }}
|
||||||
<div class="double-border top big-number">
|
</template>
|
||||||
<template v-if="creature.settings.swapScoresAndMods">
|
<template v-else>
|
||||||
{{ ability.total }}
|
{{ numberToSignedString(ability.modifier) }}
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
|
||||||
{{ numberToSignedString(ability.modifier) }}
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
<div class="bottom">
|
|
||||||
<template v-if="creature.settings.swapScoresAndMods">
|
|
||||||
{{ numberToSignedString(ability.modifier) }}
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
{{ ability.total }}
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="double-border name label">
|
<div class="bottom">
|
||||||
{{ ability.name }}
|
<template v-if="creature.settings.swapScoresAndMods">
|
||||||
|
{{ numberToSignedString(ability.modifier) }}
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
{{ ability.total }}
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="double-border name label">
|
||||||
|
{{ ability.name }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-for="toggle in toggles"
|
v-for="toggle in toggles"
|
||||||
:key="toggle._id"
|
:key="toggle._id"
|
||||||
class="number-label"
|
|
||||||
>
|
>
|
||||||
<div class="box double-border" />
|
<div
|
||||||
<div class="label double-border">
|
class="number-label"
|
||||||
{{ toggle.name }}
|
>
|
||||||
|
<div class="box double-border" />
|
||||||
|
<div class="label double-border">
|
||||||
|
{{ toggle.name }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-for="stat in stats"
|
v-for="stat in stats"
|
||||||
:key="stat._id"
|
:key="stat._id"
|
||||||
class="number-label"
|
|
||||||
:class="stat.variableName == 'armor' && 'shield-number-label'"
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
:class="stat.variableName == 'armor' ? 'shield-border' : 'octagon-border'"
|
class="number-label"
|
||||||
class="number big-number"
|
:class="stat.variableName == 'armor' && 'shield-number-label'"
|
||||||
>
|
>
|
||||||
{{ stat.value }}
|
<div
|
||||||
</div>
|
:class="stat.variableName == 'armor' ? 'shield-border' : 'octagon-border'"
|
||||||
<div class="label double-border">
|
class="number big-number"
|
||||||
{{ stat.name }}
|
>
|
||||||
|
{{ stat.value }}
|
||||||
|
</div>
|
||||||
|
<div class="label double-border">
|
||||||
|
{{ stat.name }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-for="modifier in modifiers"
|
v-for="modifier in modifiers"
|
||||||
:key="modifier._id"
|
:key="modifier._id"
|
||||||
class="number-label"
|
|
||||||
>
|
>
|
||||||
<div class="number octagon-border big-number">
|
<div
|
||||||
{{ numberToSignedString(modifier.value) }}
|
class="number-label"
|
||||||
</div>
|
>
|
||||||
<div class="label double-border">
|
<div class="number octagon-border big-number">
|
||||||
{{ modifier.name }}
|
{{ numberToSignedString(modifier.value) }}
|
||||||
|
</div>
|
||||||
|
<div class="label double-border">
|
||||||
|
{{ modifier.name }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-for="check in checks"
|
v-for="check in checks"
|
||||||
:key="check._id"
|
:key="check._id"
|
||||||
class="number-label"
|
|
||||||
>
|
>
|
||||||
<div class="number octagon-border big-number">
|
<div
|
||||||
{{ numberToSignedString(check.value) }}
|
class="number-label"
|
||||||
</div>
|
>
|
||||||
<div class="label double-border">
|
<div class="number octagon-border big-number">
|
||||||
{{ check.name }}
|
{{ numberToSignedString(check.value) }}
|
||||||
|
</div>
|
||||||
|
<div class="label double-border">
|
||||||
|
{{ check.name }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-for="healthBar in healthBars"
|
v-for="healthBar in healthBars"
|
||||||
:key="healthBar._id"
|
:key="healthBar._id"
|
||||||
class="m-2"
|
|
||||||
>
|
>
|
||||||
<div class="double-border">
|
<div class="double-border">
|
||||||
<div class="label">
|
<div class="label">
|
||||||
@@ -115,7 +122,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="hitDice.length"
|
v-if="hitDice.length"
|
||||||
class="hit-dice m-2"
|
|
||||||
>
|
>
|
||||||
<div class="double-border">
|
<div class="double-border">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="container">
|
<div class="inventory-container">
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
<property-icon
|
<property-icon
|
||||||
class="ml-2"
|
class="ml-2"
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ const CharacterSheetPage = () => import('/imports/client/ui/pages/CharacterSheet
|
|||||||
const CharacterSheetToolbar = () => import('/imports/client/ui/creature/character/CharacterSheetToolbar.vue');
|
const CharacterSheetToolbar = () => import('/imports/client/ui/creature/character/CharacterSheetToolbar.vue');
|
||||||
const CharacterSheetRightDrawer = () => import('/imports/client/ui/creature/character/CharacterSheetRightDrawer.vue');
|
const CharacterSheetRightDrawer = () => import('/imports/client/ui/creature/character/CharacterSheetRightDrawer.vue');
|
||||||
const CharacterSheetPrinted = () => import('/imports/client/ui/creature/character/printedCharacterSheet/CharacterSheetPrinted.vue');
|
const CharacterSheetPrinted = () => import('/imports/client/ui/creature/character/printedCharacterSheet/CharacterSheetPrinted.vue');
|
||||||
|
const CharacterSheetPrintedToolbar = () => import('/imports/client/ui/creature/character/printedCharacterSheet/CharacterSheetPrintedToolbar.vue');
|
||||||
const SignIn = () => import('/imports/client/ui/pages/SignIn.vue');
|
const SignIn = () => import('/imports/client/ui/pages/SignIn.vue');
|
||||||
const Register = () => import('/imports/client/ui/pages/Register.vue');
|
const Register = () => import('/imports/client/ui/pages/Register.vue');
|
||||||
const IconAdmin = () => import('/imports/client/ui/icons/IconAdmin.vue');
|
const IconAdmin = () => import('/imports/client/ui/icons/IconAdmin.vue');
|
||||||
@@ -185,6 +186,7 @@ RouterFactory.configure(router => {
|
|||||||
alias: '/print-character/:id/:urlName',
|
alias: '/print-character/:id/:urlName',
|
||||||
components: {
|
components: {
|
||||||
default: CharacterSheetPrinted,
|
default: CharacterSheetPrinted,
|
||||||
|
toolbar: CharacterSheetPrintedToolbar,
|
||||||
},
|
},
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Print Character Sheet',
|
title: 'Print Character Sheet',
|
||||||
|
|||||||
Reference in New Issue
Block a user