mirror of
https://github.com/em-squared/5e-drs.git
synced 2025-10-30 13:14:20 +00:00
spell tooltip
This commit is contained in:
parent
38931015db
commit
f3643e6eaf
6 changed files with 99 additions and 3 deletions
64
docs/.vuepress/theme/global-components/SpellTooltip.vue
Normal file
64
docs/.vuepress/theme/global-components/SpellTooltip.vue
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<template>
|
||||
<span>
|
||||
<router-link :to="{ path: spellPath }" v-if="spell">
|
||||
<v-tooltip content-class="spell-tooltip-container" top>
|
||||
<template v-slot:activator="{ on }">
|
||||
<em v-on="on">{{ label }}</em>
|
||||
</template>
|
||||
<div class="spell-tooltip">
|
||||
<p class="spell-tooltip-title"><strong>{{ spell.title }}</strong></p>
|
||||
<div class="spell-details">
|
||||
<div class="spell-school-level" v-html="displaySchoolLevel()"></div>
|
||||
<div class="spell-casting-time"><strong>Temps d'incantation</strong> : {{ spell.frontmatter.casting_time }}</div>
|
||||
<div class="spell-range"><strong>Portée</strong> : {{ spell.frontmatter.range }}</div>
|
||||
<div class="spell-components"><strong>Composantes</strong> :
|
||||
<template v-if="spell.frontmatter.components.verbal">V</template><template v-if="spell.frontmatter.components.somatic || spell.frontmatter.components.material">,</template>
|
||||
<template v-if="spell.frontmatter.components.somatic">S</template><template v-if="spell.frontmatter.components.material">,</template>
|
||||
<template v-if="spell.frontmatter.components.material">M</template>
|
||||
<template v-if="spell.frontmatter.components.materials">({{spell.frontmatter.components.materials}})</template>
|
||||
</div>
|
||||
<div class="spell-duration"><strong>Durée</strong> : <span v-if="spell.frontmatter.concentration">concentration, </span>{{ spell.frontmatter.duration }}</div>
|
||||
</div>
|
||||
<div class="spell-description">{{ spell.frontmatter.description }}</div>
|
||||
</div>
|
||||
</v-tooltip>
|
||||
</router-link>
|
||||
<router-link :to="{ path: spellPath }" v-else>{{ label }}</router-link>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {displaySchoolLevel} from '@theme/util/spellHelpers'
|
||||
|
||||
export default {
|
||||
name: 'SpellTooltip',
|
||||
|
||||
props: [
|
||||
'label',
|
||||
'path'
|
||||
],
|
||||
|
||||
data () {
|
||||
return {
|
||||
spellPath: '',
|
||||
spell: ''
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
displaySchoolLevel () {
|
||||
return displaySchoolLevel(this.spell.frontmatter)
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
console.log(this.path)
|
||||
this.spellPath = '/grimoire/' + this.path + '/'
|
||||
this.spell = this.$site.pages.find((el) => el.path === this.spellPath || el.path === this.spellPath + "/")
|
||||
console.log(this.spell)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
</style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue