diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index d358fdf..a66a139 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -93,7 +93,28 @@ module.exports = { '@vuepress/pwa', { serviceWorker: true, - updatePopup: true + updatePopup: true, + generateSWConfig: { + cacheId: 'hddrs', + globIgnores: ['**/*.js', '**/*.css', '**/*.html'] + } + } + ], + [ + 'seo', + { + siteTitle: (_, $site) => $site.title, + title: ($page, $site) => $page.title + ' | ' + $site.title, + description: $page => $page.frontmatter.description, + // author: (_, $site) => $site.themeConfig.author, + // tags: $page => $page.frontmatter.tags, + twitterCard: _ => 'summary_large_image', + type: $page => 'website', + url: (_, $site, path) => ($site.themeConfig.domain || '') + path, + // image: ($page, $site) => $page.frontmatter.image && (($site.themeConfig.domain || '') + $page.frontmatter.image), + image: ($page, $site) => $site.themeConfig.domain + '/social-logo.png', + // publishedAt: $page => $page.frontmatter.date && new Date($page.frontmatter.date), + // modifiedAt: $page => $page.lastUpdated && new Date($page.lastUpdated), } ], ], @@ -115,6 +136,7 @@ module.exports = { } }, themeConfig: { + domain: 'https://staging.heros-et-dragons.fr', repository: 'https://github.com/em-squared/heros-et-dragons-drs', kofi: 'https://ko-fi.com/S6S410PB8', primaryColor: '#563f5a', // Hero diff --git a/docs/.vuepress/public/manifest.json b/docs/.vuepress/public/manifest.json index 4c4dcef..62b9ef3 100644 --- a/docs/.vuepress/public/manifest.json +++ b/docs/.vuepress/public/manifest.json @@ -4,7 +4,7 @@ "name" : "Héros & Dragons DRS", "scope" : "/", "display" : "standalone", - "start_url" : "https://staging.heros-et-dragons.fr/", + "start_url" : "/index.html", "short_name" : "H&D DRS", "theme_color" : "#563f5a", "description" : "Document de référence système pour le jeu de rôle Héros & Dragons", @@ -12,12 +12,12 @@ "background_color" : "#ffffff", "icons" : [ { - "src": "https://staging.heros-et-dragons.fr/android-chrome-192x192.png", + "src": "/android-chrome-192x192.png", "type": "image/png", "sizes": "192x192" }, { - "src": "https://staging.heros-et-dragons.fr/android-chrome-512x512.png", + "src": "/android-chrome-512x512.png", "type": "image/png", "sizes": "512x512" } diff --git a/docs/.vuepress/public/social-logo.png b/docs/.vuepress/public/social-logo.png new file mode 100644 index 0000000..fc3563f Binary files /dev/null and b/docs/.vuepress/public/social-logo.png differ diff --git a/docs/.vuepress/store/index.js b/docs/.vuepress/store/index.js index 6c7b2e0..40cd900 100644 --- a/docs/.vuepress/store/index.js +++ b/docs/.vuepress/store/index.js @@ -21,6 +21,7 @@ export default new Vuex.Store({ hasRightDrawer: false, inRightDrawer: null, isThemeDark: false, + isOpenAboutDialog: false, }, getters: { @@ -30,6 +31,7 @@ export default new Vuex.Store({ hasRightDrawer: state => state.hasRightDrawer, inRightDrawer: state => state.inRightDrawer, isThemeDark: state => state.isThemeDark, + isOpenAboutDialog: state => state.isOpenAboutDialog, }, actions: { @@ -51,6 +53,9 @@ export default new Vuex.Store({ isThemeDark: ({ commit }, payload) => { commit('setIsThemeDark', payload) }, + isOpenAboutDialog: ({ commit }, payload) => { + commit('setIsOpenAboutDialog', payload) + }, }, mutations: { @@ -72,5 +77,8 @@ export default new Vuex.Store({ setIsThemeDark: (state, payload) => { state.isThemeDark = payload }, + setIsOpenAboutDialog: (state, payload) => { + state.isOpenAboutDialog = payload + }, }, }) diff --git a/docs/.vuepress/store/modules/monsterFilters.js b/docs/.vuepress/store/modules/monsterFilters.js index 2a5ca8b..897713a 100644 --- a/docs/.vuepress/store/modules/monsterFilters.js +++ b/docs/.vuepress/store/modules/monsterFilters.js @@ -29,7 +29,7 @@ export default { { label: "Très grand", abbr:"TG", value: false }, { label: "Gigantesque", abbr:"Gig", value: false }, ], - environements: [ + environments: [ { label: "Arctique / Subarctique", value: false }, { label: "Bois / Forêt", value: false }, { label: "Collines / Vallées", value: false }, diff --git a/docs/.vuepress/theme/components/Monster.vue b/docs/.vuepress/theme/components/Monster.vue index 1725c17..35570e2 100644 --- a/docs/.vuepress/theme/components/Monster.vue +++ b/docs/.vuepress/theme/components/Monster.vue @@ -139,7 +139,8 @@ import { getModifier, displayAbilityScore, getProficiencyBonus, - displayChallenge + displayChallenge, + displayMonsterTypeSizeAlignment } from '@theme/util/monsterHelpers' import {stats} from '../../data/stats.js' @@ -184,22 +185,7 @@ export default { getProficiencyBonus () { return getProficiencyBonus(this.monster.challenge) }, displayMonsterTypeSizeAlignment () { - let result = '' - if (this.monster.isSwarm) { - result = 'Nuée de taille '+ this.monster.size + ' composée ' + stats.monsterTypes[this.monster.type].swarm - if (this.monster.subtype) { - result += ' (' + this.monster.subtype + ')' - } - result += ' de taille ' + this.monster.swarmSize - } else { - result = this.monster.type - if (this.monster.subtype) { - result += ' (' + this.monster.subtype + ')' - } - result += ' de taille ' + this.monster.size - } - result += ', ' + this.monster.alignment - return result + return displayMonsterTypeSizeAlignment(this.monster) }, displaySavingThrowBonus (ability) { diff --git a/docs/.vuepress/theme/components/MonsterFilters.vue b/docs/.vuepress/theme/components/MonsterFilters.vue index 77742a1..45d5aa3 100644 --- a/docs/.vuepress/theme/components/MonsterFilters.vue +++ b/docs/.vuepress/theme/components/MonsterFilters.vue @@ -28,7 +28,21 @@ + + Environnements + + Réinitialiser + + + + + Types de donjons + + Réinitialiser + + + @@ -75,6 +89,24 @@ export default { this.$store.commit('monsterFilters/setSizes', newValue) } }, + + environments: { + get () { + return this.$store.state.monsterFilters.environments + }, + set (newValue) { + this.$store.commit('monsterFilters/setEnvironments', newValue) + } + }, + + dungeonTypes: { + get () { + return this.$store.state.monsterFilters.dungeonTypes + }, + set (newValue) { + this.$store.commit('monsterFilters/setDungeonTypes', newValue) + } + }, }, methods: { @@ -96,7 +128,27 @@ export default { list.push(this.sizes[i].label) } } - setUrlParams('raretes', list) + setUrlParams('tailles', list) + }, + + switchEnvironment () { + let list = [] + for (var i = 0; i < this.environments.length; i++) { + if (this.environments[i].value) { + list.push(this.environments[i].label) + } + } + setUrlParams('environnements', list) + }, + + switchDungeonType () { + let list = [] + for (var i = 0; i < this.dungeonTypes.length; i++) { + if (this.dungeonTypes[i].value) { + list.push(this.dungeonTypes[i].label) + } + } + setUrlParams('donjons', list) }, setColor (value, compare, color) { @@ -115,16 +167,30 @@ export default { this.$store.commit('monsterFilters/resetSizes') this.switchSize() }, + + resetEnvironments () { + this.$store.commit('monsterFilters/resetEnvironments') + this.switchEnvironment() + }, + + resetDungeonTypes () { + this.$store.commit('monsterFilters/resetDungeonTypes') + this.switchDungeonType() + }, }, mounted () { this.$store.dispatch('monsterFilters/reset') - let selectedSizes = getUrlParameter(window.location.href, "raretes").split(",") + let selectedSizes = getUrlParameter(window.location.href, "tailles").split(",") let selectedTypes = getUrlParameter(window.location.href, "types").split(",") + let selectedEnvironments = getUrlParameter(window.location.href, "environnements").split(",") + let selectedDungeonTypes = getUrlParameter(window.location.href, "donjons").split(",") setListMutation(selectedTypes, this.$store, 'monsterFilters/setTypesFromList') setListMutation(selectedSizes, this.$store, 'monsterFilters/setSizesFromList') + setListMutation(selectedEnvironments, this.$store, 'monsterFilters/setEnvironmentsFromList') + setListMutation(selectedDungeonTypes, this.$store, 'monsterFilters/setDungeonTypesFromList') } } diff --git a/docs/.vuepress/theme/components/NavDrawer.vue b/docs/.vuepress/theme/components/NavDrawer.vue index 1583737..07044e6 100644 --- a/docs/.vuepress/theme/components/NavDrawer.vue +++ b/docs/.vuepress/theme/components/NavDrawer.vue @@ -71,6 +71,16 @@ + + + mdi-information + + + + À propos + + + diff --git a/docs/.vuepress/theme/components/Navbar.vue b/docs/.vuepress/theme/components/Navbar.vue index f87d565..7481b3e 100644 --- a/docs/.vuepress/theme/components/Navbar.vue +++ b/docs/.vuepress/theme/components/Navbar.vue @@ -7,12 +7,12 @@ - mdi-information + mdi-information {{ rightDrawerIcon }} - + À propos de H&D DRS @@ -30,7 +30,6 @@