<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <title>MaterialX Web Viewer</title>
    <link rel="icon" type="image/x-icon" href="public/favicon.ico" />
    <style>
      body {
        margin: 0;
        font-family: "Segoe UI", Roboto, Arial, sans-serif;
        font-size: 12px;
      }

      /* Responsive select menus */
      select {
        max-width: 40vw;
        width: 100%;
        box-sizing: border-box;
        white-space: normal;
        overflow-wrap: break-word;
        word-break: break-word;
        background: #000;
        color: #fff;
        border: 1px solid #444;
        font-family: inherit;
        font-size: inherit;
      }

      select option {
        background: #000;
        color: #fff;
        font-family: inherit;
        font-size: inherit;
      }

      .select-row {
        color: rgb(255, 255, 255);
        background: rgba(0,0,0,0.4);
        position: absolute;
        margin: 1em;
        display: flex;
        align-items: center;
        gap: 0.5em;
      }


      /* Property editor item color */
      .peditoritem {
        background-color: #334444;
      }
      /* Property editor folder color */
      .peditorfolder {
        background-color: #333333;
      }

      /* Move property editor down to align with Material row */
      .lil-gui {
        top: 1.0em !important;
      }

     .peditor_material_assigned {
        background-color: #006cb8;
      }
      .peditor_material_assigned:hover {
        background-color: #32adff;
      }

      .fps-overlay {
        position: fixed;
        left: 10px;
        bottom: 10px;
        padding: 4px 10px;
        background: rgba(0,0,0,0.4);
        color: rgb(255, 255, 255);
        font-family: inherit;
        font-size: inherit;
        z-index: 1000;
        pointer-events: none;
      }

    </style>
  </head>
  <body style="margin: 0px; overflow: hidden;">
    <div id="container">
      <div class="select-row" style="top: 0em;">
        <label for="materials" style="margin: 0; padding: 0 0.2em; font-family: inherit; font-size: inherit;">Material:</label>
        <select name="materials" id="materials" style="flex: 1 1 0; min-width: 0;">
          <% materials.forEach(function(m){ %>
            <option value="<%-m.value%>">
              <%- m.name.replace(/_/g, ' ').replace(/\.(mtlx|glb)$/, '').replace(/\w\S*/g, function(txt){return ' ' + txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}) %>
            </option>
            <% }); %>
        </select>
      </div>
      <div class="select-row" style="top: 1.5em;">
        <label for="geometry" style="margin: 0; padding: 0 0.2em; font-family: inherit; font-size: inherit;">Geometry:</label>
        <select name="geometry" id="geometry" style="flex: 1 1 0; min-width: 0;">
          <% geometry.forEach(function(m){ %>
            <option value="<%-m.value%>">
              <%- m.name.replace(/_/g, ' ').replace(/\.(mtlx|glb)$/, '').replace(/\w\S*/g, function(txt){return ' ' + txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}) %>
            </option>
            <% }); %>
        </select>
      </div>
      <canvas id="webglcanvas" tabindex="1" style="outline: none;"></canvas>
    </div>
  </body>
</html>
