mirror of
https://github.com/em-squared/5e-drs.git
synced 2025-12-17 07:30:47 +00:00
classes
This commit is contained in:
parent
1050fbb531
commit
38931015db
71 changed files with 5819 additions and 184 deletions
56
docs/.vuepress/theme/components/Breadcrumb.vue
Normal file
56
docs/.vuepress/theme/components/Breadcrumb.vue
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<template>
|
||||
<v-breadcrumbs :items="bread">
|
||||
<template v-slot:item="{ item }">
|
||||
<v-breadcrumbs-item :to="item.to" :exact="true" :disabled="item.disabled">
|
||||
{{ item.text }}
|
||||
</v-breadcrumbs-item>
|
||||
</template>
|
||||
</v-breadcrumbs>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Breadcrumb",
|
||||
|
||||
computed: {
|
||||
bread() {
|
||||
const parts = this.$page.path.split("/");
|
||||
if (!parts[parts.length - 1].length) { parts.pop() }
|
||||
let link = ""
|
||||
const crumbs = []
|
||||
for (let i = 0; i < parts.length; i++) {
|
||||
let disabled = false
|
||||
if (i == parts.length - 1) {
|
||||
console.log(parts[i])
|
||||
disabled = true
|
||||
}
|
||||
link += parts[i]
|
||||
const page = this.$site.pages.find((el) => el.path === link || el.path === link + "/")
|
||||
link += "/"
|
||||
if (page != null) {
|
||||
if (page.path == '/grimoire/') {
|
||||
crumbs.push({to: page.path, disabled: disabled, text: 'Grimoire'})
|
||||
} else if (page.path == '/classes/') {
|
||||
crumbs.push({to: page.path, disabled: disabled, text: 'Classes'})
|
||||
} else {
|
||||
crumbs.push({to: page.path, disabled: disabled, text: page.frontmatter.breadcrumb || page.title})
|
||||
}
|
||||
}
|
||||
}
|
||||
return crumbs;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import '../styles/colors';
|
||||
|
||||
.v-breadcrumbs {
|
||||
// background-color: lighten($color-gray, 50);
|
||||
}
|
||||
|
||||
.theme--light.v-breadcrumbs .v-breadcrumbs__item--disabled {
|
||||
// color: rgba(0,0,0,.87);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
<v-navigation-drawer class="main-drawer" v-model="drawer" :clipped="$vuetify.breakpoint.lgAndUp" width="300" app>
|
||||
<v-list dense nav>
|
||||
<template v-for="item in items">
|
||||
<v-list-group v-if="item.children" :key="item.title" v-model="item.expanded" :color="$site.themeConfig.accentColor">
|
||||
<v-list-group v-if="item.children" :key="item.title" v-model="item.expanded" color="accent">
|
||||
<template v-slot:activator>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title>
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
</template>
|
||||
|
||||
<template v-for="child in item.children">
|
||||
<v-list-group v-if="child.children" :key="child.title" sub-group v-model="child.expanded" :color="$site.themeConfig.accentColor">
|
||||
<v-list-group v-if="child.children" :key="child.title" sub-group v-model="child.expanded" color="accent">
|
||||
<template v-slot:activator>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title>
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</template>
|
||||
<v-list-item v-for="subchild in child.children" link :to="{path: subchild.path}">
|
||||
<v-list-item v-for="subchild in child.children" link :to="{path: subchild.path}" exact>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title>
|
||||
{{ subchild.title }}
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
</v-list-group>
|
||||
<v-list-item v-else :key="child.title" link :to="{path: child.path}">
|
||||
<v-list-item v-else :key="child.title" link :to="{path: child.path}" exact>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title>
|
||||
{{ child.title }}
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
</v-list-item>
|
||||
</template>
|
||||
</v-list-group>
|
||||
<v-list-item v-else :key="item.title" link :to="{path: item.path}" :color="$site.themeConfig.accentColor">
|
||||
<v-list-item v-else :key="item.title" link :to="{path: item.path}" color="accent" exact>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title>
|
||||
{{ item.title }}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<v-app-bar :clipped-left="$vuetify.breakpoint.lgAndUp" :clipped-right="$vuetify.breakpoint.lgAndUp" app :color="$site.themeConfig.primaryColor" dark>
|
||||
<v-app-bar :clipped-left="$vuetify.breakpoint.lgAndUp" :clipped-right="$vuetify.breakpoint.lgAndUp" app color="navbar" dark>
|
||||
<v-app-bar-nav-icon @click.stop="setDrawer" />
|
||||
<v-toolbar-title class="ml-0 mr-4 pl-4">
|
||||
<v-btn class="hidden-sm-and-down site-title" text link :to="{ path: '/' }">{{ $site.title }}</v-btn>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
export default {
|
||||
name: 'Page',
|
||||
components: { }
|
||||
components: { }
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
<template>
|
||||
<main class="page">
|
||||
<main class="page content">
|
||||
|
||||
<div class="theme-default-content">
|
||||
<h1>{{ $page.title }}</h1>
|
||||
<div class="spell-details">
|
||||
<div class="spell-school-level">
|
||||
<template v-if="$page.frontmatter.level != 0">{{ $page.frontmatter.school }} de niveau {{ $page.frontmatter.level }}</template>
|
||||
<template v-else>{{ $page.frontmatter.school }}, Tour de magie</template>
|
||||
<template v-if="$page.frontmatter.ritual"> (rituel)</template>
|
||||
</div>
|
||||
<div class="spell-school-level" v-html="displaySchoolLevel()"></div>
|
||||
<div class="spell-casting-time"><strong>Temps d'incantation</strong> : {{ $page.frontmatter.casting_time }}</div>
|
||||
<div class="spell-range"><strong>Portée</strong> : {{ $page.frontmatter.range }}</div>
|
||||
<div class="spell-components"><strong>Composantes</strong> :
|
||||
|
|
@ -29,7 +26,14 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { displaySchoolLevel } from '@theme/util/spellHelpers'
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
displaySchoolLevel () {
|
||||
return displaySchoolLevel(this.$page.frontmatter)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
label="Filtrer"
|
||||
single-line
|
||||
hide-details
|
||||
:color="$site.themeConfig.accentColor"
|
||||
color="accent"
|
||||
></v-text-field>
|
||||
|
||||
<v-expansion-panels multiple flat hover v-model="panels">
|
||||
|
|
@ -15,16 +15,16 @@
|
|||
<v-expansion-panel>
|
||||
<v-expansion-panel-header>Classes</v-expansion-panel-header>
|
||||
<v-expansion-panel-content>
|
||||
<v-btn class="mb-2 mt-2" small :color="$site.themeConfig.primaryColor" @click="resetClasses" dark>Réinitialiser</v-btn>
|
||||
<v-switch v-for="(c, idx) in classes" v-model="c.value" :label="c.label" dense class="ma-0" @change="switchClass" :color="$site.themeConfig.accentColor"></v-switch>
|
||||
<v-btn class="mb-2 mt-2" small color="primary" @click="resetClasses" dark>Réinitialiser</v-btn>
|
||||
<v-switch v-for="(c, idx) in classes" v-model="c.value" :label="c.label" dense class="ma-0" @change="switchClass" color="accent"></v-switch>
|
||||
</v-expansion-panel-content>
|
||||
</v-expansion-panel>
|
||||
|
||||
<v-expansion-panel>
|
||||
<v-expansion-panel-header>Niveaux de sorts</v-expansion-panel-header>
|
||||
<v-expansion-panel-content>
|
||||
<v-btn class="mb-2 mt-2" small :color="$site.themeConfig.primaryColor" @click="resetLevels" dark>Réinitialiser</v-btn>
|
||||
<v-switch v-for="level in levels" v-model="level.value" dense class="ma-0" @change="switchLevel" :color="$site.themeConfig.accentColor">
|
||||
<v-btn class="mb-2 mt-2" small color="primary" @click="resetLevels" dark>Réinitialiser</v-btn>
|
||||
<v-switch v-for="level in levels" v-model="level.value" dense class="ma-0" @change="switchLevel" color="accent">
|
||||
<template v-slot:label>
|
||||
<span v-html="levelDisplay(level)"></span>
|
||||
</template>
|
||||
|
|
@ -35,8 +35,8 @@
|
|||
<v-expansion-panel>
|
||||
<v-expansion-panel-header>Écoles de magie</v-expansion-panel-header>
|
||||
<v-expansion-panel-content>
|
||||
<v-btn class="mb-2 mt-2" small :color="$site.themeConfig.primaryColor" @click="resetSchools" dark>Réinitialiser</v-btn>
|
||||
<v-switch v-for="school in schools" v-model="school.value" :label="school.label" dense class="ma-0" @change="switchSchool" :color="$site.themeConfig.accentColor"></v-switch>
|
||||
<v-btn class="mb-2 mt-2" small color="primary" @click="resetSchools" dark>Réinitialiser</v-btn>
|
||||
<v-switch v-for="school in schools" v-model="school.value" :label="school.label" dense class="ma-0" @change="switchSchool" color="accent"></v-switch>
|
||||
</v-expansion-panel-content>
|
||||
</v-expansion-panel>
|
||||
|
||||
|
|
@ -325,7 +325,6 @@ export default {
|
|||
},
|
||||
|
||||
mounted () {
|
||||
console.log('filter mounted')
|
||||
this.$store.dispatch('spellFilters/reset')
|
||||
|
||||
let selectedSchools = getUrlParameter(window.location.href, "ecoles").split(",")
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
<script>
|
||||
import matchQuery from './match-query'
|
||||
import { displaySchoolLevel } from '@theme/util/spellHelpers'
|
||||
|
||||
/* global SEARCH_MAX_SUGGESTIONS, SEARCH_PATHS, SEARCH_HOTKEYS */
|
||||
export default {
|
||||
|
|
@ -104,7 +105,15 @@ export default {
|
|||
}
|
||||
|
||||
if (matchQuery(query, p)) {
|
||||
res.push(p)
|
||||
if (p.pid && p.pid == 'spell') {
|
||||
res.push(Object.assign({}, p, {
|
||||
subtitle: displaySchoolLevel(p.frontmatter),
|
||||
title: p.title,
|
||||
path: p.path
|
||||
}))
|
||||
} else {
|
||||
res.push(p)
|
||||
}
|
||||
} else if (p.headers) {
|
||||
for (let j = 0; j < p.headers.length; j++) {
|
||||
if (res.length >= max) break
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue