{{/*
  Copyright 2014 Team 254. All Rights Reserved.
  Author: pat@patfairbank.com (Patrick Fairbank)

  Display shown on the audience screen overlayed over the video.
*/}}
<!DOCTYPE html>
<html>
  <head>
    <title>Audience Display - {{.EventSettings.Name}} - Cheesy Arena </title>
    <link rel="shortcut icon" href="/static/img/favicon.ico">
    <link rel="stylesheet" href="/static/css/lib/bootstrap.min.css" />
    <link rel="stylesheet" href="/static/css/cheesy-arena.css" />
    <link rel="stylesheet" href="/static/css/audience_display.css" />
  </head>
  <body>
    <div id="centering">
      <div id="matchOverlay">
        <div class="teams" id="leftTeams">
          <span class="valign-cell">
            <span id="leftTeam1"></span><br />
            <span id="leftTeam2"></span><br />
            <span id="leftTeam3"></span>
          </span>
        </div>
        <div class="score reversible-left" id="leftScore">
          <div class="avatars">
            <img class="avatar" id="leftTeam1Avatar" src="" /><br />
            <img class="avatar" id="leftTeam2Avatar" src="" /><br />
            <img class="avatar" id="leftTeam3Avatar" src="" />
          </div>
          <div class="score-fields score-fields-icons">
            <span class="valign-cell">
              <span class="power-up" id="leftForceCubesIcon">F</span><br />
              <span class="power-up" id="leftLevitateCubesIcon">L</span><br />
              <span class="power-up" id="leftBoostCubesIcon">B</span>
            </span>
          </div>
          <div class="score-fields score-fields-text">
            <span class="valign-cell">
              <span class="power-up" id="leftForceCubes"></span><br />
              <span class="power-up" id="leftLevitateCubes"></span><br />
              <span class="power-up" id="leftBoostCubes"></span>
            </span>
          </div>
          <div class="powerup-progress">
            <div id="leftProgress"></div>
          </div>
          <div class="score-number" id="leftScoreNumber">&nbsp;</div>
        </div>
        <div class="score reversible-right" id="rightScore">
          <div class="avatars pull-right">
            <img class="avatar" id="rightTeam1Avatar" src="" /><br />
            <img class="avatar" id="rightTeam2Avatar" src="" /><br />
            <img class="avatar" id="rightTeam3Avatar" src="" />
          </div>
          <div class="score-fields score-fields-icons pull-right">
            <span class="valign-cell">
              <span class="power-up" id="rightForceCubesIcon">F</span><br />
              <span class="power-up" id="rightLevitateCubesIcon">L</span><br />
              <span class="power-up" id="rightBoostCubesIcon">B</span>
            </span>
          </div>
          <div class="score-fields score-fields-text pull-right" style="direction: rtl;">
            <span class="valign-cell" style="text-align: right;">
              <span class="power-up" id="rightForceCubes"></span><br />
              <span class="power-up" id="rightLevitateCubes"></span><br />
              <span class="power-up" id="rightBoostCubes"></span>
            </span>
          </div>
          <div class="powerup-progress pull-right">
            <div id="rightProgress"></div>
          </div>
          <div class="score-number pull-right" id="rightScoreNumber">&nbsp;</div>
        </div>
        <div class="teams" id="rightTeams">
          <span class="valign-cell">
            <span id="rightTeam1"></span><br />
            <span id="rightTeam2"></span><br />
            <span id="rightTeam3"></span>
          </span>
        </div>
        <div id="eventMatchInfo">
          <span>{{.EventSettings.Name}}{{if lt (len .EventSettings.Name) 16}} 2018{{end}}</span>
          <span class="pull-right" id="matchName"></span>
        </div>
      </div>
      <div class="text-center" id="matchCircle">
        <img id="logo" src="/static/img/game-logo.png" alt="logo" />
        <div id="matchTime"></div>
        <div class="seesaw-indicator" id="leftSwitchIndicator"></div>
        <div class="seesaw-indicator" id="scaleIndicator"></div>
        <div class="seesaw-indicator" id="rightSwitchIndicator"></div>
      </div>
    </div>
    <div id="blindsContainer">
      <div class="blinds right background">
        <div class="blindsCenter blank"></div>
      </div>
      <div class="blinds left background">
        <div class="blindsCenter blank"></div>
      </div>
      <div class="blindsCenter full">
        <img id="blindsLogo" src="/static/img/game-logo.png" alt="logo" />
      </div>
      <div id="finalScore">
        <div class="final-score reversible-left" id="leftFinalScore"></div>
        <div class="final-score reversible-right" id="rightFinalScore"></div>
        <div class="final-teams" id="leftFinalTeams">
          <span id="leftFinalTeam1"></span><img class="final-avatar" id="leftFinalTeam1Avatar" src="" />
          <span id="leftFinalTeam2"></span><img class="final-avatar" id="leftFinalTeam2Avatar" src="" />
          <span id="leftFinalTeam3"></span><img class="final-avatar" id="leftFinalTeam3Avatar" src="" />
        </div>
        <div class="final-teams" id="rightFinalTeams">
          <img class="final-avatar" id="rightFinalTeam1Avatar" src="" /><span id="rightFinalTeam1"></span>
          <img class="final-avatar" id="rightFinalTeam2Avatar" src="" /><span id="rightFinalTeam2"></span>
          <img class="final-avatar" id="rightFinalTeam3Avatar" src="" /><span id="rightFinalTeam3"></span>
        </div>
        <div class="final-breakdown" id="leftFinalBreakdown">
          <span class="valign-cell">
            <span id="leftFinalAutoRunPoints"></span><br />
            <span id="leftFinalOwnershipPoints"></span><br />
            <span id="leftFinalVaultPoints"></span><br />
            <span id="leftFinalParkClimbPoints"></span><br />
            <span id="leftFinalFoulPoints"></span><br />
            <span id="leftFinalAutoQuest"></span><br />
            <span id="leftFinalFaceTheBoss"></span><br />
          </span>
        </div>
        <div class="final-breakdown" id="centerFinalBreakdown">
          <span class="valign-cell">Auto Run<br />Ownership<br />Vault<br />Endgame<br />Foul<br />Auto Quest<br />Face The Boss</span>
        </div>
        <div class="final-breakdown" id="rightFinalBreakdown">
          <span class="valign-cell">
            <span id="rightFinalAutoRunPoints"></span><br />
            <span id="rightFinalOwnershipPoints"></span><br />
            <span id="rightFinalVaultPoints"></span><br />
            <span id="rightFinalParkClimbPoints"></span><br />
            <span id="rightFinalFoulPoints"></span><br />
            <span id="rightFinalAutoQuest"></span><br />
            <span id="rightFinalFaceTheBoss"></span><br />
          </span>
        </div>
        <div id="finalEventMatchInfo">
          <div class="final-footer">{{.EventSettings.Name}}{{if lt (len .EventSettings.Name) 22}} 2018{{end}}</div>
          <div class="final-footer" id="finalSeriesStatus">&nbsp;</div>
          <div class="final-footer" id="finalMatchName">&nbsp;</div>
        </div>
      </div>
      <div id="sponsor" class="carousel slide">
        <div class="carousel-inner" id="sponsorContainer">
        </div>
      </div>
    </div>
    <div id="allianceSelectionCentering" style="display: none;">
      <div id="allianceSelection"></div>
    </div>
    <div id="lowerThird">
      <img id="lowerThirdLogo" src="/static/img/lower-third-logo.png" alt="logo" />
      <div id="lowerThirdTop"></div>
      <div id="lowerThirdBottom"></div>
      <div id="lowerThirdSingle"></div>
    </div>
    <script id="allianceSelectionTemplate" type="text/x-handlebars-template">
      <table id="allianceSelectionTable">
        <tr>
          <td colspan="{{"{{numColumns}}"}}">
            <img src="/static/img/alliance-selection-logo.png" alt="logo" />
          </td>
        </tr>
        {{"{{#each alliances}}"}}
          <tr>
            <td class="alliance-cell">{{"{{Index}}"}}</td>
            {{"{{#each this}}"}}
              <td class="selection-cell">{{"{{#if TeamId}}"}}{{"{{TeamId}}"}}{{"{{/if}}"}}</td>
            {{"{{/each}}"}}
          </tr>
        {{"{{/each}}"}}
      </table>
    </script>
    <script id="sponsorImageTemplate" type="text/x-handlebars-template">
      <div class="item{{"{{#if First}}"}} active{{"{{/if}}"}}" data-interval="{{"{{DisplayTimeMs}}"}}">
        <div class="sponsor-image-container">
          <img src="/static/img/sponsors/{{"{{Image}}"}}" />
        </div>
        <h1>{{"{{Subtitle}}"}}</h1>
      </div>
    </script>
    <script id="sponsorTextTemplate" type="text/x-handlebars-template">
      <div class="item{{"{{#if First}}"}} active{{"{{/if}}"}}" data-interval="{{"{{DisplayTimeMs}}"}}">
        <h2>{{"{{Line1}}"}}<br />{{"{{Line2}}"}}</h2>
        <h1>{{"{{Subtitle}}"}}</h1>
      </div>
    </script>
    {{range $sound := .MatchSounds}}
      <audio id="sound-{{$sound.Name}}" src="/static/audio/{{$sound.Name}}.{{$sound.FileExtension}}" preload="auto">
      </audio>
    {{end}}
    <script src="/static/js/lib/jquery.min.js"></script>
    <script src="/static/js/lib/jquery.json-2.4.min.js"></script>
    <script src="/static/js/lib/jquery.websocket-0.0.1.js"></script>
    <script src="/static/js/lib/jquery.transit.min.js"></script>
    <script src="/static/js/lib/handlebars-1.3.0.js"></script>
    <script src="/static/js/lib/bootstrap.min.js"></script>
    <script src="/static/js/cheesy-websocket.js"></script>
    <script src="/static/js/match_timing.js"></script>
    <script src="/static/js/audience_display.js"></script>
  </body>
</html>
