index.html 4.5 KB

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