-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
462099a
commit 6acd838
Showing
7 changed files
with
151 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,6 @@ | |
"icon": "/icon.svg", | ||
"popover": "/tags", | ||
"height": 600, | ||
"width": 800 | ||
"width": 1000 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,132 @@ | ||
<template> | ||
<div class="container"> | ||
<label>{{ label }}</label> | ||
<div class="title"> | ||
<div class="label">{{ label }}</div> | ||
<div class="button" style="background-color: var(--background-primary)"> | ||
<img alt="dice" width="32" height="32" src="@/assets/dice-text.svg" /> | ||
</div> | ||
</div> | ||
<div class="tag" v-for="(tag, idx) in model" :key="idx"> | ||
<div class="name"> | ||
<input v-model="tag.name" placeholder="Tag Name"/> | ||
<button class="exp" @click="tag.exp++" @contextmenu.prevent="tag.exp--">{{ tag.exp }}</button> | ||
<div class="button"> | ||
<img alt="dice" width="32" height="32" src="@/assets/dice-accent.svg" /> | ||
</div> | ||
</div> | ||
<textarea v-model="tag.description" placeholder="Description"></textarea> | ||
</div> | ||
<button @click="model.push({ name: '', description: '', exp: 1 })">+</button> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import type { CharacterTag } from "@/stores/character"; | ||
const props = defineProps<{ | ||
label: string; | ||
}>() | ||
const model = defineModel<{ | ||
name: string; | ||
description: string; | ||
exp: number; | ||
}[]>({ required: true }) | ||
const model = defineModel<CharacterTag[]>({ required: true }) | ||
</script> | ||
|
||
<style scoped> | ||
.container { | ||
display: grid; | ||
grid-template-columns: 100px 1fr 75px; | ||
--stat-color: var(--theme-primary); | ||
display: flex; | ||
flex-direction: column; | ||
align-items: stretch; | ||
justify-content: start; | ||
gap: 1px; | ||
} | ||
.container > * { | ||
background: var(--theme-primary); | ||
.title { | ||
display: flex; | ||
} | ||
.label { | ||
background: var(--stat-color); | ||
padding: 0 16px; | ||
margin-left: auto; | ||
width: fit-content; | ||
height: 100%; | ||
display: flex; | ||
justify-content: end; | ||
align-items: center; | ||
font-size: 18px; | ||
font-weight: 500; | ||
text-transform: uppercase; | ||
} | ||
.tag { | ||
width: 100%; | ||
background-color: var(--stat-color); | ||
} | ||
.tag .name { | ||
width: 100%; | ||
height: 36px; | ||
background-color: var(--text-color); | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
.tag textarea { | ||
display: block; | ||
width: 100%; | ||
padding: 4px; | ||
box-sizing: border-box; | ||
min-height: 80px; | ||
height: fit-content; | ||
} | ||
.tag > div > * { | ||
height: 100%; | ||
padding: 0; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
color: var(--stat-color); | ||
font-size: 16px; | ||
font-weight: 400; | ||
} | ||
.tag input { | ||
flex: 1; | ||
padding: 0 16px; | ||
} | ||
label { | ||
font-size: 20px; | ||
font-weight: bold; | ||
text-align: center; | ||
.tag input:focus { | ||
outline: none; | ||
background: var(--accent-color); | ||
} | ||
.tag .exp { | ||
width: 36px; | ||
height: 36px; | ||
background-color: var(--accent-color); | ||
font-size: 18px; | ||
border-left: 1px var(--text-color) solid; | ||
} | ||
.container button { | ||
height: 36px; | ||
border: none; | ||
outline: none; | ||
background: var(--text-color); | ||
color: var(--stat-color); | ||
font-size: 32px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.button { | ||
width: 36px; | ||
height: 36px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
cursor: pointer; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,27 @@ | ||
<template> | ||
<div>{{sheet}}</div> | ||
<div id="tags"> | ||
<StatSet label="Brawn" v-model="sheet.brawn"/> | ||
<StatSet label="Keen" v-model="sheet.keen" style="--stat-color: var(--theme-secondary)"/> | ||
<StatSet label="Heart" v-model="sheet.heart"/> | ||
<StatSet label="Weird" v-model="sheet.weird" style="--stat-color: var(--theme-secondary)"/> | ||
<StatSet label="Fell" v-model="sheet.fell"/> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import type { CharacterSheet } from "@/stores/character"; | ||
import StatSet from "@/components/StatSet.vue"; | ||
const sheet = defineModel<CharacterSheet>() | ||
const sheet = defineModel<CharacterSheet>({ | ||
required: true | ||
}) | ||
</script> | ||
|
||
<style scoped> | ||
#tags { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); | ||
grid-template-rows: auto; | ||
gap: 16px; | ||
} | ||
</style> |