index.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>Pokemon By Color</title>
  6. <link rel="stylesheet" href="styles.css" />
  7. <script src="https://unpkg.com/d3-color@3.0.1/dist/d3-color.min.js"></script>
  8. <script src="https://unpkg.com/d3-cam02@0.1.5/build/d3-cam02.min.js"></script>
  9. <script src="database-v3.js"></script>
  10. <!-- TODO move these files -->
  11. <script src="web/math.js"></script>
  12. <script src="web/convert.js"></script>
  13. <script src="form.js"></script>
  14. </head>
  15. <body>
  16. <noscript>Requires javascript</noscript>
  17. <template id="metric-form-template">
  18. <div>
  19. <label>
  20. <input type="checkbox" name="sortOrder" hidden />
  21. <output name="sortOrderLabel"></output>
  22. (click to toggle)
  23. </label>
  24. </div>
  25. <div>
  26. <label>
  27. <input type="radio" name="metricKind" value="whole" />
  28. Set Comparison
  29. </label>
  30. </div>
  31. <div>
  32. <label>
  33. <input type="radio" name="metricKind" value="mean" />
  34. Mean Comparison
  35. </label>
  36. </div>
  37. <div>
  38. <label>
  39. <input type="radio" name="metricKind" value="statistic" />
  40. Set Statistics
  41. </label>
  42. </div>
  43. <select name="whole" disabled>
  44. <option value="sigma">RMS Deviation (σ)</option>
  45. <option value="bigTheta">Cosine Difference (Θ)</option>
  46. <option value="alpha">Geometric Difference (α)</option>
  47. </select>
  48. <select name="mean" disabled>
  49. <option value="theta">Angular Difference (θ)</option>
  50. <option value="phi">Hue Azimuth (ϕ)</option>
  51. <option value="delta">Euclidean (δ)</option>
  52. <option value="manhattan">Manhattan (M)</option>
  53. <option value="ch">Chebyshev (Ч)</option>
  54. <option value="lightnessDiff">Lightness (ℓ)</option>
  55. </select>
  56. <select name="statistic" disabled>
  57. <option value="inertia">Inertia (I)</option>
  58. <option value="variance">Variance (V)</option>
  59. <option value="muNuAngle">Mu-Nu Angle (Φ)</option>
  60. <option value="size">Size (N)</option>
  61. <option value="lightness">Mean Lightness (L)</option>
  62. <option value="chroma">Mean Chroma (C)</option>
  63. <option value="importance">Visual Importance (β)</option>
  64. </select>
  65. <output name="sortMetric" hidden aria-hidden="true"></output>
  66. </template>
  67. <form action="javascript:void(0);" id="sortControl" autocomplete="off">
  68. <div>
  69. <label>
  70. <div>Target Color</div>
  71. <input
  72. name="colorText"
  73. type="text"
  74. maxlength="7"
  75. oninput="onColorChange(event.target.value)"
  76. />
  77. </label>
  78. <input
  79. name="colorPicker"
  80. type="color"
  81. onchange="onColorChange(event.target.value)"
  82. />
  83. </div>
  84. <div>
  85. <label>
  86. <div>Results:&nbsp;<output name="resultsToDisplayOutput">10</output></div>
  87. <input
  88. name="resultsToDisplay"
  89. type="range"
  90. min="1"
  91. max="100"
  92. value="10"
  93. oninput="
  94. event.target.form.elements.resultsToDisplayOutput.value = event.target.value
  95. "
  96. onchange="showResults(event.target.value)"
  97. />
  98. </label>
  99. </div>
  100. <fieldset onchange="updateSort()">
  101. <legend>Color Space</legend>
  102. <div>
  103. <label>
  104. <input type="radio" name="colorSpace" value="jab" checked />
  105. CIECAM
  106. </label>
  107. </div>
  108. <div>
  109. <label>
  110. <input type="radio" name="colorSpace" value="rgb" />
  111. sRGB
  112. </label>
  113. </div>
  114. </fieldset>
  115. <fieldset name="metric" onchange="onMetricChange(event.target.form.elements)">
  116. <legend>Distance Metric</legend>
  117. <!-- template mount point -->
  118. </fieldset>
  119. </form>
  120. <form action="javascript:void(0);" id="clusterControl" autocomplete="off">
  121. <fieldset
  122. onchange="
  123. const elements = event.target.form.elements;
  124. elements.metric.hidden = elements.useClusters.value === 'off';
  125. onMetricChange(elements);
  126. "
  127. >
  128. <legend>Compare With</legend>
  129. <div>
  130. <label>
  131. <input type="radio" name="useClusters" value="off" />
  132. Whole Image
  133. </label>
  134. </div>
  135. <div>
  136. <label>
  137. <input type="radio" name="useClusters" value="on" checked />
  138. Best Cluster
  139. </label>
  140. </div>
  141. <fieldset name="metric">
  142. <legend>Cluster Ranking</legend>
  143. <!-- template mount point -->
  144. </fieldset>
  145. </fieldset>
  146. </form>
  147. </body>
  148. </html>