Utiliser icones Fontawesome

Plutôt que les images custom
This commit is contained in:
Vincent Vandemeulebrouck 2021-05-19 00:55:00 +02:00
parent e0962506ed
commit d8d27430ed
5 changed files with 33 additions and 37 deletions

View File

@ -234,19 +234,24 @@ export class RdDRoll extends Dialog {
this.rollData[attribute] = event.currentTarget.checked; this.rollData[attribute] = event.currentTarget.checked;
this.updateRollResult(); this.updateRollResult();
}); });
html.find('.imgAppelAuMoral').click((event) => { /* l'appel au moral, qui donne un bonus de +1 */ html.find('.appel-moral').click((event) => { /* l'appel au moral, qui donne un bonus de +1 */
this.rollData.useMoral = !this.rollData.useMoral; this.rollData.useMoral = !this.rollData.useMoral;
const appelMoral = html.find('.icon-appel-moral')[0];
const tooltip = html.find('.tooltipAppelAuMoralText')[0];
appelMoral.classList.remove('fa-grin-beam');
appelMoral.classList.remove('fa-sad-tear');
appelMoral.classList.remove('fa-meh');
if (this.rollData.useMoral) { if (this.rollData.useMoral) {
if (this.rollData.moral > 0) { if (this.rollData.moral > 0) {
html.find('.imgAppelAuMoral')[0].src = "/systems/foundryvtt-reve-de-dragon/icons/moral-heureux.svg"; appelMoral.classList.add('fa-grin-beam');
html.find('.tooltipAppelAuMoralText')[0].innerHTML = "Appel au moral"; tooltip.innerHTML = "Appel au moral";
} else { } else {
html.find('.imgAppelAuMoral')[0].src = "/systems/foundryvtt-reve-de-dragon/icons/moral-malheureux.svg"; appelMoral.classList.add('fa-sad-tear');
html.find('.tooltipAppelAuMoralText')[0].innerHTML = "Appel à l'énergie du désespoir"; tooltip.innerHTML = "Appel à l'énergie du désespoir";
} }
} else { } else {
html.find('.imgAppelAuMoral')[0].src = "/systems/foundryvtt-reve-de-dragon/icons/moral-neutre.svg"; appelMoral.classList.add('fa-meh');
html.find('.tooltipAppelAuMoralText')[0].innerHTML = "Sans appel au moral"; tooltip.innerHTML = "Sans appel au moral";
} }
this.updateRollResult(); this.updateRollResult();
}); });
@ -306,7 +311,7 @@ export class RdDRoll extends Dialog {
HtmlUtility._showControlWhen($(".diffMoral"), rollData.ajustements.moralTotal.used); HtmlUtility._showControlWhen($(".diffMoral"), rollData.ajustements.moralTotal.used);
HtmlUtility._showControlWhen($(".divAppelAuMoral"), rollData.use.appelAuMoral); HtmlUtility._showControlWhen($(".divAppelAuMoral"), rollData.use.appelAuMoral);
HtmlUtility._showControlWhen($("#etat-general"), !RdDCarac.isIgnoreEtatGeneral(rollData.selectedCarac, rollData.competence)); HtmlUtility._showControlWhen($("#etat-general"), !RdDCarac.isIgnoreEtatGeneral(rollData));
HtmlUtility._showControlWhen($("#ajust-astrologique"), RdDResolutionTable.isAjustementAstrologique(rollData)); HtmlUtility._showControlWhen($("#ajust-astrologique"), RdDResolutionTable.isAjustementAstrologique(rollData));
// Mise à jour valeurs // Mise à jour valeurs

View File

@ -393,7 +393,7 @@ table {border: 1px solid #7a7971;}
border-bottom: 1px solid #BBB; border-bottom: 1px solid #BBB;
} }
.blessure-inactive{ .fas-inactive{
color:rgba(150, 150, 150, 0.4) color:rgba(150, 150, 150, 0.4)
} }
.blessure-active-legere{ .blessure-active-legere{
@ -900,14 +900,6 @@ ul, li {
display: none !important; display: none !important;
} }
.imgAppelAuMoral {
height: 20px;
width: 20px;
border:none;
outline: none;
background-size: cover;
}
/* Tooltip container */ /* Tooltip container */
.tooltipAppelAuMoral { .tooltipAppelAuMoral {
position: relative; position: relative;

View File

@ -2,11 +2,8 @@
<td class="item-control blessure-control" title="Blessure {{title}}" data-blessure-active="{{bless.active}}"> <td class="item-control blessure-control" title="Blessure {{title}}" data-blessure-active="{{bless.active}}">
{{#if bless.active}} {{#if bless.active}}
<i class="fas fa-skull-crossbones blessure-active-{{gravite}}"></i> <i class="fas fa-skull-crossbones blessure-active-{{gravite}}"></i>
{{!-- <i class="fas fa-first-aid"></i> --}}
{{!-- <i class="fas fa-plus-square"></i> --}}
{{else}} {{else}}
{{!-- <i class="fas fa-genderless"></i> --}} <i class="fas fa-skull-crossbones fas-inactive"></i>
<i class="fas fa-skull-crossbones blessure-inactive"></i>
{{/if}} {{/if}}
</td> </td>
<td> <td>

View File

@ -113,9 +113,9 @@
<div class="tab items" data-group="primary" data-tab="carac"> <div class="tab items" data-group="primary" data-tab="carac">
<div class="grid grid-2col"> <div class="grid grid-2col">
<div class="flex-group-left flexcol"> <div class="flex-group-left flexcol">
<span><a class="lock-unlock-sheet"><img class="small-button-container" <span><a class="lock-unlock-sheet"><i class="fas fa-lock{{#if options.editCaracComp}}-open{{/if}}"></i>
src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.editCaracComp}}unlocked.svg{{else}}locked.svg{{/if}}" alt="blocker/débloquer" {{#if options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}}
>{{#if options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}}</a></span> </a></span>
<ul class="carac-list alterne-list"> <ul class="carac-list alterne-list">
{{#each data.carac as |carac key|}} {{#each data.carac as |carac key|}}
{{#if carac.isLevelUp}} {{#if carac.isLevelUp}}
@ -202,9 +202,9 @@
{{else if (eq compteur.label 'Ethylisme')}} {{else if (eq compteur.label 'Ethylisme')}}
<a class="item-control ethylisme-test" id="ethylisme-test" title="Jet d'Ethylisme">Jet d'Ethylisme</a> <a class="item-control ethylisme-test" id="ethylisme-test" title="Jet d'Ethylisme">Jet d'Ethylisme</a>
{{else if (eq compteur.label 'Moral')}} {{else if (eq compteur.label 'Moral')}}
<a class="moral-malheureux" title="Jet de moral situation malheureuse"><img class="small-button-container" src="systems/foundryvtt-reve-de-dragon/icons/moral-malheureux.svg" alt="Jet de moral situation malheureuse"/></a> <a class="moral-malheureux" title="Jet de moral situation malheureuse"><i class="far fa-sad-tear"></i></a>
<a class="moral-neutre" title="Jet de moral situation neutre"><img class="small-button-container" src="systems/foundryvtt-reve-de-dragon/icons/moral-neutre.svg" alt="Jet de moral situation neutre"/></a> <a class="moral-neutre" title="Jet de moral situation neutre"><i class="far fa-meh"></i></a>
<a class="moral-heureux" title="Jet de moral situation heureuse"><img class="small-button-container" src="systems/foundryvtt-reve-de-dragon/icons/moral-heureux.svg" alt="Jet de moral situation heureuse"/></a> <a class="moral-heureux" title="Jet de moral situation heureuse"><i class="far fa-grin-beam"></i></a>
{{else}} {{else}}
<label></label> <label></label>
{{/if}} {{/if}}
@ -221,15 +221,15 @@
{{!-- Compétences Tab --}} {{!-- Compétences Tab --}}
<div class="tab competences" data-group="primary" data-tab="competences"> <div class="tab competences" data-group="primary" data-tab="competences">
<div class="flexrow"> <div class="flexrow">
<span><a class="lock-unlock-sheet"><img class="small-button-container" <span><a class="lock-unlock-sheet"><i class="fas fa-lock{{#if options.editCaracComp}}-open{{/if}}"></i>
src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.editCaracComp}}unlocked.svg{{else}}locked.svg{{/if}}" alt="blocker/débloquer" {{#if options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}}
>{{#if options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}}</a></span> </a></span>
<span><a id="show-hide-competences"><img class="small-button-container" <span><a id="show-hide-competences"><i class="fas fa-filter {{#unless options.showCompNiveauBase}}fas-inactive{{/unless}}"></i>
src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.showCompNiveauBase}}no-filter.svg{{else}}filter.svg{{/if}}" alt="filter/montrer tout" {{#if options.showCompNiveauBase}}Montrer tout{{else}}Filtrer{{/if}}
>{{#if options.showCompNiveauBase}}Montrer tout{{else}}Filtrer{{/if}}</a></span> </a></span>
<span><a id="show-hide-archetype"><img class="small-button-container" <span><a id="show-hide-archetype"><i class="fas fa-eye{{#if options.montrerArchetype}}-slash{{/if}}"></i>
src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.montrerArchetype}}no-filter.svg{{else}}filter.svg{{/if}}" alt="filter/montrer l'archétype" {{#if options.montrerArchetype}}Masquer l'archétype{{else}}Voir l'archétype{{/if}}
>{{#if options.montrerArchetype}}Masquer l'archétype{{else}}Voir l'archétype{{/if}}</a></span> </a></span>
</div> </div>
<div class="grid grid-2col"> <div class="grid grid-2col">
<div class="flex-group-left flexcol competence-column"> <div class="flex-group-left flexcol competence-column">

View File

@ -1,7 +1,9 @@
<div class="flexrow"> <div class="flexrow">
<label class="diffMoral">Moral: {{#if (gt moral 0)}}+{{/if}}{{moral}}</label> <label class="diffMoral">Moral: {{#if (gt moral 0)}}+{{/if}}{{moral}}</label>
<div class="tooltipAppelAuMoral divAppelAuMoral"> <div class="tooltipAppelAuMoral divAppelAuMoral">
<img class="imgAppelAuMoral small-button-container" src="/systems/foundryvtt-reve-de-dragon/icons/moral-neutre.svg"> <a class="appel-moral">
<i class="far fa-meh icon-appel-moral"></i>
</a>
<span class="tooltipAppelAuMoralText">Sans appel au moral</span> <span class="tooltipAppelAuMoralText">Sans appel au moral</span>
</div> </div>
</div> </div>