index.html 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <!DOCTYPE html>
  2. <html lang="en" >
  3. <head >
  4. <meta charset="UTF-8" >
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title >QR Code Generator</title >
  7. <style >
  8. body{ font-size: 20px; line-height: 1.4em; font-family: "Trebuchet MS", sans-serif; color: #000;}
  9. input, textarea, select{font-family: Consolas, "Liberation Mono", Courier, monospace; font-size: 75%; line-height: 1.25em; border: 1px solid #aaa; }
  10. input:focus, textarea:focus, select:focus{ border: 1px solid #ccc; }
  11. label{ cursor: pointer; }
  12. #qrcode-settings, div#qrcode-output{ text-align: center; }
  13. div#qrcode-output > div {margin: 0;padding: 0;height: 3px;}
  14. div#qrcode-output > div > span {display: inline-block;width: 3px;height: 3px;}
  15. div#qrcode-output > div > span {background-color: lightgrey;}
  16. </style >
  17. </head >
  18. <body >
  19. <form id="qrcode-settings" >
  20. <label for="inputstring" >Input String</label ><br /><textarea name="inputstring" id="inputstring" cols="80" rows="3" autocomplete="off" spellcheck="false"></textarea ><br />
  21. <label for="version" >Version</label >
  22. <input id="version" name="version" class="options" type="number" min="1" max="40" value="5" placeholder="version" />
  23. <label for="maskpattern" >Mask Pattern</label >
  24. <input id="maskpattern" name="maskpattern" class="options" type="number" min="-1" max="7" value="-1" placeholder="mask pattern" />
  25. <label for="ecc" >ECC</label >
  26. <select class="options" id="ecc" name="ecc" >
  27. <option value="L" selected="selected" >L - 7%</option >
  28. <option value="M" >M - 15%</option >
  29. <option value="Q" >Q - 25%</option >
  30. <option value="H" >H - 30%</option >
  31. </select >
  32. <br />
  33. <label for="quietzone" >Quiet Zone
  34. <input id="quietzone" name="quietzone" class="options" type="checkbox" value="true" />
  35. </label >
  36. <label for="quietzonesize" >size</label >
  37. <input id="quietzonesize" name="quietzonesize" class="options" type="number" min="0" max="100" value="4" placeholder="quiet zone" />
  38. <br />
  39. <label for="output_type" >Output</label >
  40. <select class="options" id="output_type" name="output_type" >
  41. <option value="html" >Markup - HTML</option >
  42. <option value="svg" selected="selected" >Markup - SVG</option >
  43. <option value="png">Image - png</option >
  44. <option value="jpg" >Image - jpg</option >
  45. <option value="gif" >Image - gif</option >
  46. <option value="text" >String - text</option >
  47. <option value="json" >String - json</option >
  48. </select >
  49. <label for="scale" >scale</label >
  50. <input id="scale" name="scale" class="options" type="number" min="1" max="10" value="5" placeholder="scale" />
  51. <div>Finder</div>
  52. <label for="m_finder_light" >
  53. <input type="text" id="m_finder_light" name="m_finder_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
  54. </label >
  55. <label for="m_finder_dark" >
  56. <input type="text" id="m_finder_dark" name="m_finder_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
  57. </label >
  58. <div>Alignment</div>
  59. <label for="m_alignment_light" >
  60. <input type="text" id="m_alignment_light" name="m_alignment_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
  61. </label >
  62. <label for="m_alignment_dark" >
  63. <input type="text" id="m_alignment_dark" name="m_alignment_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
  64. </label >
  65. <div>Timing</div>
  66. <label for="m_timing_light" >
  67. <input type="text" id="m_timing_light" name="m_timing_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
  68. </label >
  69. <label for="m_timing_dark" >
  70. <input type="text" id="m_timing_dark" name="m_timing_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
  71. </label >
  72. <div>Format</div>
  73. <label for="m_format_light" >
  74. <input type="text" id="m_format_light" name="m_format_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
  75. </label >
  76. <label for="m_format_dark" >
  77. <input type="text" id="m_format_dark" name="m_format_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
  78. </label >
  79. <div>Version</div>
  80. <label for="m_version_light" >
  81. <input type="text" id="m_version_light" name="m_version_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
  82. </label >
  83. <label for="m_version_dark" >
  84. <input type="text" id="m_version_dark" name="m_version_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
  85. </label >
  86. <div>Data</div>
  87. <label for="m_data_light" >
  88. <input type="text" id="m_data_light" name="m_data_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
  89. </label >
  90. <label for="m_data_dark" >
  91. <input type="text" id="m_data_dark" name="m_data_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
  92. </label >
  93. <div>Dark Module</div>
  94. <label for="m_darkmodule_light" >
  95. <input disabled="disabled" type="text" id="m_darkmodule_light" class="options" value="" autocomplete="off" spellcheck="false" />
  96. </label >
  97. <label for="m_darkmodule_dark" >
  98. <input type="text" id="m_darkmodule_dark" name="m_darkmodule_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
  99. </label >
  100. <div>Separator</div>
  101. <label for="m_separator_light" >
  102. <input type="text" id="m_separator_light" name="m_separator_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
  103. </label >
  104. <label for="m_separator_dark" >
  105. <input disabled="disabled" type="text" id="m_separator_dark" class="options" value="" autocomplete="off" spellcheck="false" />
  106. </label >
  107. <div>Quiet Zone</div>
  108. <label for="m_quietzone_light" >
  109. <input type="text" id="m_quietzone_light" name="m_quietzone_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6" />
  110. </label >
  111. <label for="m_quietzone_dark" >
  112. <input disabled="disabled" type="text" id="m_quietzone_dark" class="options" value="" autocomplete="off" spellcheck="false" />
  113. </label >
  114. <br />
  115. <button type="submit" >generate</button >
  116. </form >
  117. <div id="qrcode-output" ></div >
  118. <div><a href="https://play.google.com/store/apps/details?id=com.google.zxing.client.android" >ZXing Barcode Scanner</a ></div>
  119. <script src="https://cdnjs.cloudflare.com/ajax/libs/prototype/1.7.3/prototype.js" ></script >
  120. <script src="https://cdnjs.cloudflare.com/ajax/libs/jscolor/2.0.4/jscolor.js" ></script >
  121. <script >
  122. ((form, output, url) => {
  123. $(form).observe('submit', ev => {
  124. Event.stop(ev);
  125. new Ajax.Request(url, {
  126. method: 'post',
  127. parameters: ev.target.serialize(true),
  128. onUninitialized: $(output).update(),
  129. onLoading: $(output).update('[portlandia_screaming.gif]'),
  130. onFailure: response => $(output).update(response.responseJSON.error),
  131. onSuccess: response => $(output).update(response.responseJSON.qrcode),
  132. });
  133. });
  134. })('qrcode-settings', 'qrcode-output', './qrcode-interactive.php');
  135. </script >
  136. </body >
  137. </html >