diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index a1e8dd3..662051c 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -185,6 +185,12 @@ module.exports = { frontmatter: { layout: 'AbilityCalculatorLayout' } + }, + { + path: '/homebrew/', + frontmatter: { + layout: 'HomebrewLayout' + } } ], themeConfig: { diff --git a/docs/.vuepress/store/index.js b/docs/.vuepress/store/index.js index 21db792..29028cc 100644 --- a/docs/.vuepress/store/index.js +++ b/docs/.vuepress/store/index.js @@ -32,6 +32,8 @@ export default new Vuex.Store({ isThemeDark: false, isOpenAboutDialog: false, isOpenSupportDialog: false, + isOpenShareHomebrewDialog: false, + shareURI: '', isOpenSnackbar: false, snackbarText: '', l5r: false @@ -46,6 +48,8 @@ export default new Vuex.Store({ isThemeDark: state => state.isThemeDark, isOpenAboutDialog: state => state.isOpenAboutDialog, isOpenSupportDialog: state => state.isOpenSupportDialog, + isOpenShareHomebrewDialog: state => state.isOpenShareHomebrewDialog, + shareURI: state => state.shareURI, isOpenSnackbar: state => state.isOpenSnackbar, l5r: state => state.l5r, }, @@ -113,6 +117,12 @@ export default new Vuex.Store({ setIsOpenSupportDialog: (state, payload) => { state.isOpenSupportDialog = payload }, + setIsOpenShareHomebrewDialog: (state, payload) => { + state.isOpenShareHomebrewDialog = payload + }, + setShareURI: (state, payload) => { + state.shareURI = payload + }, setIsOpenSnackbar: (state, payload) => { state.isOpenSnackbar = payload if (payload === true) { diff --git a/docs/.vuepress/theme/components/MagicItem.vue b/docs/.vuepress/theme/components/MagicItem.vue index f650b46..fb9708a 100644 --- a/docs/.vuepress/theme/components/MagicItem.vue +++ b/docs/.vuepress/theme/components/MagicItem.vue @@ -15,6 +15,7 @@

Source : {{ $page.frontmatter.source }}

+

Auteur : {{ magicItem.author }}

diff --git a/docs/.vuepress/theme/components/Monster.vue b/docs/.vuepress/theme/components/Monster.vue index 4d9037a..fcced43 100644 --- a/docs/.vuepress/theme/components/Monster.vue +++ b/docs/.vuepress/theme/components/Monster.vue @@ -153,6 +153,7 @@

Source : {{ monsterStats.source }}

+

Auteur : {{ monster.author }}

diff --git a/docs/.vuepress/theme/components/Spell.vue b/docs/.vuepress/theme/components/Spell.vue index b91a2f7..ad13535 100644 --- a/docs/.vuepress/theme/components/Spell.vue +++ b/docs/.vuepress/theme/components/Spell.vue @@ -33,6 +33,7 @@

Source : {{ spell.frontmatter.source }}

+

Auteur : {{ spell.author }}

diff --git a/docs/.vuepress/theme/layouts/CreateMagicItemLayout.vue b/docs/.vuepress/theme/layouts/CreateMagicItemLayout.vue index 434c356..b959e39 100644 --- a/docs/.vuepress/theme/layouts/CreateMagicItemLayout.vue +++ b/docs/.vuepress/theme/layouts/CreateMagicItemLayout.vue @@ -19,7 +19,8 @@ mdi-book {{ displayToggleMagicItemButton }} mdi-update MàJ dans le grimoire - mdi-eraser Réinitialiser + mdi-eraser Réinitialiser + mdi-share-variant Partager @@ -55,6 +56,12 @@ + + + + + + @@ -70,6 +77,7 @@ import MagicItem from '@theme/components/MagicItem' import { saveAs } from 'file-saver' import { MAGICITEMTYPES, RARITIES } from '../../data/magicItems' import { getUrlParameter } from '@theme/util/filterHelpers' +import { encode } from '@theme/util/homebrew' import slugify from 'slugify' slugify.extend({"'": '-'}) @@ -118,6 +126,7 @@ export default { custom: true, pid: 'magicitem', key: null, + author: '', title: '', content: '', hasAttunement: false, @@ -223,6 +232,11 @@ export default { attunement: '', } } + }, + + share () { + this.$store.commit('setShareURI', encode(this.magicItem)) + this.$store.commit('setIsOpenShareHomebrewDialog', true) } }, diff --git a/docs/.vuepress/theme/layouts/CreateMonsterLayout.vue b/docs/.vuepress/theme/layouts/CreateMonsterLayout.vue index fe578a8..7293022 100644 --- a/docs/.vuepress/theme/layouts/CreateMonsterLayout.vue +++ b/docs/.vuepress/theme/layouts/CreateMonsterLayout.vue @@ -20,7 +20,8 @@ mdi-book {{ displayToggleMonsterButton }} mdi-update MàJ dans le bestiaire - mdi-eraser Réinitialiser + mdi-eraser Réinitialiser + mdi-share-variant Partager @@ -203,6 +204,12 @@ + + + + + + @@ -224,6 +231,7 @@ import { DAMAGETYPES } from '../../data/damageTypes' import { LANGUAGES } from '../../data/languages' import { getUrlParameter } from '@theme/util/filterHelpers' import { isResourceInLibrary } from '@theme/util' +import { encode } from '@theme/util/homebrew' import { getProficiencyBonus, displayBonus } from '@theme/util/monsterHelpers' import slugify from 'slugify' slugify.extend({"'": '-'}) @@ -276,6 +284,7 @@ export default { custom: true, pid: 'monster', key: null, + author: '', title: '', content: `## Capacités\n_**Capacité**_. Description de la capacité.\n\n## Actions\n_**Action**_. Description de l'action.`, frontmatter: { @@ -495,6 +504,11 @@ export default { this.monster.frontmatter.skills[idx].isExpert = this.selectedSkillsExpert.indexOf(mskill.name) >= 0 }) }, + + share () { + this.$store.commit('setShareURI', encode(this.monster)) + this.$store.commit('setIsOpenShareHomebrewDialog', true) + } }, mounted () { diff --git a/docs/.vuepress/theme/layouts/CreateSpellLayout.vue b/docs/.vuepress/theme/layouts/CreateSpellLayout.vue index 79ea4c0..dd73ea0 100644 --- a/docs/.vuepress/theme/layouts/CreateSpellLayout.vue +++ b/docs/.vuepress/theme/layouts/CreateSpellLayout.vue @@ -11,15 +11,16 @@

Création de sort

- mdi-printer Imprimer - mdi-file-download Sauvegarder + mdi-printer Imprimer + mdi-file-download Sauvegarder mdi-file-upload Charger - mdi-book {{ displayToggleSpellButton }} - mdi-update MàJ dans le grimoire - mdi-eraser Réinitialiser + mdi-book {{ displayToggleSpellButton }} + mdi-update MàJ dans le grimoire + mdi-eraser Réinitialiser + mdi-share-variant Partager
@@ -94,6 +95,12 @@
+ + + + + + @@ -111,6 +118,7 @@ import { CLASSES } from '../../data/classes' import { SPELLSCHOOLS, SPELLLEVELS } from '../../data/spells' import { getUrlParameter } from '@theme/util/filterHelpers' import { isResourceInLibrary } from '@theme/util' +import { encode } from '@theme/util/homebrew' import slugify from 'slugify' slugify.extend({"'": '-'}) @@ -132,7 +140,7 @@ export default { return 'Supprimer de mon grimoire' } return 'Ajouter à mon grimoire' - } + }, }, data () { @@ -145,6 +153,7 @@ export default { custom: true, pid: 'spell', key: null, + author: '', title: '', content: '', frontmatter: { @@ -263,6 +272,11 @@ export default { } } } + }, + + share () { + this.$store.commit('setShareURI', encode(this.spell)) + this.$store.commit('setIsOpenShareHomebrewDialog', true) } }, diff --git a/docs/.vuepress/theme/layouts/GlobalLayout.vue b/docs/.vuepress/theme/layouts/GlobalLayout.vue index 3649153..c8acecd 100644 --- a/docs/.vuepress/theme/layouts/GlobalLayout.vue +++ b/docs/.vuepress/theme/layouts/GlobalLayout.vue @@ -46,6 +46,22 @@ + + + + Partage + mdi-close + + + + +
+ Voir la page +
+
+
+
+ @@ -74,7 +90,8 @@ export default { data () { return { cookieConsentDialog: true, - toTopButton: false + toTopButton: false, + hintCopied: '' } }, @@ -158,6 +175,17 @@ export default { setRightDrawer () { this.$store.commit('setRightDrawer', !this.$store.state.rightDrawer) }, + + copyURI(id) { + let toCopy = document.getElementById(id) + toCopy.select() + document.execCommand( 'copy' ) + this.hintCopied = "L'adresse a été copiée dans le presse-papier" + let self = this + setTimeout(function () { + self.hintCopied = '' + }, 2000) + } } } diff --git a/docs/.vuepress/theme/layouts/HomebrewLayout.vue b/docs/.vuepress/theme/layouts/HomebrewLayout.vue new file mode 100644 index 0000000..f29c8d2 --- /dev/null +++ b/docs/.vuepress/theme/layouts/HomebrewLayout.vue @@ -0,0 +1,164 @@ + + + + + diff --git a/docs/.vuepress/theme/layouts/MonsterLayout.vue b/docs/.vuepress/theme/layouts/MonsterLayout.vue index 82c0e23..5cd7f3b 100644 --- a/docs/.vuepress/theme/layouts/MonsterLayout.vue +++ b/docs/.vuepress/theme/layouts/MonsterLayout.vue @@ -4,7 +4,7 @@
8 Règles cinq royaumes - mdi-plus Créer un monstre + mdi-plus Créer un monstre/PNJ mdi-book {{ displayToggleMonsterButton }}
diff --git a/docs/.vuepress/theme/layouts/MonstersLayout.vue b/docs/.vuepress/theme/layouts/MonstersLayout.vue index 1f86940..314241a 100644 --- a/docs/.vuepress/theme/layouts/MonstersLayout.vue +++ b/docs/.vuepress/theme/layouts/MonstersLayout.vue @@ -5,7 +5,7 @@
8 Règles cinq royaumes - mdi-plus Créer un monstre + mdi-plus Créer un monstre/PNJ
diff --git a/docs/.vuepress/theme/styles/_blocks.scss b/docs/.vuepress/theme/styles/_blocks.scss index 8324087..801431f 100644 --- a/docs/.vuepress/theme/styles/_blocks.scss +++ b/docs/.vuepress/theme/styles/_blocks.scss @@ -21,3 +21,17 @@ color: #fff; } } + +blockquote { + background-color: #eee; + padding: 0.5rem 0.5rem 0.5rem 1rem; + margin-bottom: 16px; + border-left: 3px solid #ccc; + font-style: italic; + + p { + &:last-child { + margin-bottom: 0; + } + } +} diff --git a/docs/.vuepress/theme/styles/_typography.scss b/docs/.vuepress/theme/styles/_typography.scss index be6018c..68debca 100644 --- a/docs/.vuepress/theme/styles/_typography.scss +++ b/docs/.vuepress/theme/styles/_typography.scss @@ -58,7 +58,7 @@ } } -ul { +ul, ol { margin-bottom: 16px; } diff --git a/docs/.vuepress/theme/util/homebrew.js b/docs/.vuepress/theme/util/homebrew.js new file mode 100644 index 0000000..51bc2ad --- /dev/null +++ b/docs/.vuepress/theme/util/homebrew.js @@ -0,0 +1,7 @@ +export function encode (o) { + return btoa(unescape(encodeURIComponent(JSON.stringify(o)))) +} + +export function decode (s) { + return JSON.parse(decodeURIComponent(escape(atob(s)))) +} diff --git a/docs/grimoire/lenteur/README.md b/docs/grimoire/lenteur/README.md index 5ae686d..22fcfaa 100644 --- a/docs/grimoire/lenteur/README.md +++ b/docs/grimoire/lenteur/README.md @@ -23,6 +23,6 @@ Vous modifiez le cours du temps autour d'un maximum de six créatures de votre c Une cible affectée voit sa vitesse réduite de moitié. De plus, elle subit un malus de -2 à la CA et aux jets de sauvegarde de Dextérité et ne peut plus utiliser de réaction. À son tour, elle peut utiliser une action ou une action bonus, mais pas les deux. Elle ne peut pas faire plus d'une attaque au corps-à-corps ou à distance à son tour, quels que soient ses aptitudes et ses objets magiques. -Si la créature affectée tente de lancer un sort doté d'un temps d'incantation de 1 action, lancez 1d20. Sur un résultat de 11 ou plus, le sort agit seulement au prochain tour de la créature, qui doit utiliser son action de ce tour pour terminer l'incantation. Si elle en est incapable, le sort est n'a aucun effet. +Si la créature affectée tente de lancer un sort doté d'un temps d'incantation de 1 action, lancez 1d20. Sur un résultat de 11 ou plus, le sort agit seulement au prochain tour de la créature, qui doit utiliser son action de ce tour pour terminer l'incantation. Si elle en est incapable, le sort n'a aucun effet. Une créature affectée par ce sort fait un nouveau [jet de sauvegarde](/utiliser-les-caracteristiques/#jets-de-sauvegarde) de Sagesse à la fin de chacun de ses tours. Si elle le réussit, le sort se termine pour elle.