templates/partials/setup/select-characters.html.twig line 1

Open in your IDE?
  1. <button type="button" class="button button--full-height" id="select-characters" data-dialog="#character-select" disabled>{{ 'setup.buttons.select_characters'|trans }}</button>
  2. {% embed 'includes/dialog.html.twig' with {
  3.     id: 'character-select',
  4.     background: 'blur',
  5.     title: 'setup.character_select.title'|trans
  6. } %}
  7.     {% import 'macros/forms.html.twig' as forms %}
  8.     {% block body %}
  9.     <form id="player-select">
  10.         {{ forms.range({
  11.             classes: 'mb-4',
  12.             label: 'setup.character_select.number_players'|trans,
  13.             name: 'player-count',
  14.             id: 'player-count',
  15.             output: 'player-count-output',
  16.             min: 5,
  17.             max: 15,
  18.             step: 1,
  19.             value: 7
  20.         }) }}
  21.         {{ forms.switch({
  22.             node: 'div',
  23.             classes: 'mb-4',
  24.             label: 'setup.character_select.toggle_abilities'|trans,
  25.             name: 'toggle-abilities',
  26.             id: 'toggle-abilities',
  27.             checked: true
  28.         }) }}
  29.         {{ forms.switch({
  30.             node: 'div',
  31.             classes: 'mb-4',
  32.             label: 'setup.character_select.toggle_duplicates'|trans,
  33.             name: 'toggle-duplicates',
  34.             id: 'toggle-duplicates',
  35.             checked: false
  36.         }) }}
  37.         <p><button type="button" class="button" id="player-select-random">{{ 'setup.character_select.highlight_random'|trans }}</button></p>
  38.         {% set teams = {
  39.             townsfolk: 'groups.townsfolk'|trans,
  40.             outsider: 'groups.outsider'|trans,
  41.             minion: 'groups.minion'|trans,
  42.             demon: 'groups.demon'|trans,
  43.             traveller: 'groups.traveller'|trans
  44.         } %}
  45.         {% for team, name in teams %}
  46.         <fieldset class="sidebar character-select__group is-hide-duplicates" data-team="{{ team }}">
  47.             <legend class="sr-only">{{ name }}</legend>
  48.             <div class="sidebar__side character-select__score">
  49.                 <div class="sidebar__side-content character-select__heading">
  50.                     <div class="character-select__title" aria-hidden="true">{{ name }}</div>
  51.                     <div class="character-select__score-box">
  52.                         <span class="js--character-select--count">0</span>
  53.                         <span class="character-select__score-seperator" data-vertical="-" data-horizontal="|"></span>
  54.                         <span class="js--character-select--total">X</span>
  55.                     </div>
  56.                 </div>
  57.             </div>
  58.             <div class="sidebar__body">
  59.                 <div class="character-select__characters js--character-select--list"></div>
  60.             </div>
  61.         </fieldset>
  62.         {% endfor %}
  63.         
  64.         <p style="text-align: center;">
  65.             {% set teamsummary = {
  66.                 townsfolk: 'groups.short.townsfolk'|trans,
  67.                 outsider: 'groups.short.outsider'|trans,
  68.                 minion: 'groups.short.minion'|trans,
  69.                 demon: 'groups.short.demon'|trans,
  70.                 traveller: 'groups.short.traveller'|trans
  71.             } %}
  72.             {% for team, name in teamsummary %}
  73.             <span data-team-summary="{{ team }}">
  74.                 {{ name }}:<span class="js--character-select--count">0</span>/<span class="js--character-select--total">X</span>
  75.             </span>
  76.             {% endfor %}
  77.             {{ 'groups.short.all'|trans }}:<span class="js--tokens--count">0</span>/<span class="js--players--total">X</span>
  78.         </p>
  79.         <p>
  80.             <label for="token-layout">{{ 'setup.character_select.layout'|trans }}</label>
  81.             <select name="token-layout" id="token-layout" class="input">
  82.                 <option value="ellipse">{{ 'setup.character_select.ellipse'|trans }}</option>
  83.                 <option value="rectangular_ellipse">{{ 'setup.character_select.rectangular_ellipse'|trans }}</option>
  84.                 <option value="rectangle">{{ 'setup.character_select.rectangle'|trans }}</option>
  85.                 <option value="diagonal">{{ 'setup.character_select.diagonal'|trans }}</option>
  86.                 <option value="horizontal">{{ 'setup.character_select.horizontal'|trans }}</option>
  87.                 <option value="vertical">{{ 'setup.character_select.vertical'|trans }}</option>
  88.             </select>
  89.         </p>
  90.         <input type="text" name="validation" id="player-select-validation" class="sr-only" aria-label="Validation" aria-description="This field exists just to aid with validation">
  91.         <ul class="button-list">
  92.             <li><button type="submit" class="button button--full-height">{{ 'setup.character_select.draw_characters'|trans }}</button></li>
  93.             <li><button type="submit" class="button button--full-height" id="player-select-all">{{ 'setup.character_select.add_all'|trans }}</button></li>
  94.         </ul>
  95.     </form>
  96.     {% endblock %}
  97. {% endembed %}
  98. {% embed 'includes/dialog.html.twig' with {
  99.     id: 'character-choice',
  100.     background: 'hide',
  101.     title: 'setup.character_choice.title'|trans,
  102.     hideClickBackground: false,
  103.     confirmXButton: 'setup.character_choice.return_confirm'|trans
  104. } %}
  105.     {% block body %}
  106.     <p>{{ 'setup.character_choice.description'|trans }}</p>
  107.     <div id="character-choice-wrapper" class="slot slot--3">
  108.     </div>
  109.     {% endblock %}
  110. {% endembed %}
  111. <template id="character-choice-template">
  112.     <div>
  113.         <button type="button" data-id="" class="character-choice">
  114.             <span class="character">
  115.                 <span class="character__unknown js--character-choice--number"></span>
  116.             </span>
  117.         </button>
  118.     </div>
  119. </template>
  120. {% embed 'includes/dialog.html.twig' with {
  121.     id: 'character-decision',
  122.     background: 'hide',
  123.     hideClickBackground: false,
  124.     title: 'setup.character_decision.title'|trans
  125. } %}
  126.     {% block body %}
  127.     <div id="character-decision-wrapper" class="mb-4"></div>
  128.     <p id="character-decision-ability"></p>
  129.     <p>
  130.         <label for="player-name" class="d-block text-small">{{ 'setup.character_decision.name'|trans }}</label>
  131.         <input type="text" class="input" name="player-name" id="player-name" list="player-name-options">
  132.     </p>
  133.     <datalist id="player-name-options"></datalist>
  134.     <p><button type="button" class="button" data-dialog-hide>{{ 'setup.character_decision.return'|trans }}</button></p>
  135.     {% endblock %}
  136. {% endembed %}
  137. <template id="character-select-template">
  138.     <div class="character-select__character js--character-select">
  139.         <div class="character-select__duplicate js--character-select--duplicate-wrapper">
  140.             <button type="button" class="character-select__button character-select__button--prev" data-quantity-amount="-1">
  141.                 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="character-select__icon"><!--! Font Awesome Pro 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path fill="currentColor" d="M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM168 232C154.7 232 144 242.7 144 256C144 269.3 154.7 280 168 280H344C357.3 280 368 269.3 368 256C368 242.7 357.3 232 344 232H168z"/></svg>
  142.             </button>
  143.             <input type="number" step="1" min="0" value="0" name="count-" tabindex="-1" class="character-select__count js--character-select--count" readonly>
  144.             <button type="button" class="character-select__button character-select__button--next" data-quantity-amount="1">
  145.                 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="character-select__icon"><!--! Font Awesome Pro 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path fill="currentColor" d="M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256 368C269.3 368 280 357.3 280 344V280H344C357.3 280 368 269.3 368 256C368 242.7 357.3 232 344 232H280V168C280 154.7 269.3 144 256 144C242.7 144 232 154.7 232 168V232H168C154.7 232 144 242.7 144 256C144 269.3 154.7 280 168 280H232V344C232 357.3 242.7 368 256 368z"/></svg>
  146.             </button>
  147.         </div>
  148.         <label class="js--character-select--label" for="">
  149.             <input type="checkbox" name="character" value="" class="sr-only tick-select__checkbox character-select__input js--character-select--input">
  150.             <span class="tick-select__highlight character-select__image-wrapper">
  151.                 <img src="" alt="" width="177" height="124" aria-hidden="true" class="tick-select__icon character-select__image js--character-select--image" loading="lazy">
  152.             </span>
  153.             <span class="character-select__name js--character-select--name"></span>
  154.             <span class="character-select__ability js--character-select--ability"></span>
  155.         </label>
  156.     </div>
  157. </template>
  158. <template id="player-name-template">
  159.     <option class="js--player-name--option">
  160. </template>