index.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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{ margin: 0; padding: 0; }
  14. div.qrcode > div { height: 10px; }
  15. div.qrcode > div > span { display: inline-block; width: 10px; height: 10px; }
  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>Finder dot</div>
  59. <label for="m_finder_dot_light">
  60. <input disabled="disabled" type="text" id="m_finder_dot_light" name="m_finder_dot_light" class="options" autocomplete="off" spellcheck="false"/>
  61. </label>
  62. <label for="m_finder_dot_dark">
  63. <input type="text" id="m_finder_dot_dark" name="m_finder_dot_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/>
  64. </label>
  65. <div>Alignment</div>
  66. <label for="m_alignment_light">
  67. <input type="text" id="m_alignment_light" name="m_alignment_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/>
  68. </label>
  69. <label for="m_alignment_dark">
  70. <input type="text" id="m_alignment_dark" name="m_alignment_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/>
  71. </label>
  72. <div>Timing</div>
  73. <label for="m_timing_light">
  74. <input type="text" id="m_timing_light" name="m_timing_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/>
  75. </label>
  76. <label for="m_timing_dark">
  77. <input type="text" id="m_timing_dark" name="m_timing_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/>
  78. </label>
  79. <div>Format</div>
  80. <label for="m_format_light">
  81. <input type="text" id="m_format_light" name="m_format_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/>
  82. </label>
  83. <label for="m_format_dark">
  84. <input type="text" id="m_format_dark" name="m_format_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/>
  85. </label>
  86. <div>Version</div>
  87. <label for="m_version_light">
  88. <input type="text" id="m_version_light" name="m_version_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/>
  89. </label>
  90. <label for="m_version_dark">
  91. <input type="text" id="m_version_dark" name="m_version_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/>
  92. </label>
  93. <div>Data</div>
  94. <label for="m_data_light">
  95. <input type="text" id="m_data_light" name="m_data_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/>
  96. </label>
  97. <label for="m_data_dark">
  98. <input type="text" id="m_data_dark" name="m_data_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/>
  99. </label>
  100. <div>Dark Module</div>
  101. <label for="m_darkmodule_light">
  102. <input disabled="disabled" type="text" id="m_darkmodule_light" class="options" value="" autocomplete="off" spellcheck="false"/>
  103. </label>
  104. <label for="m_darkmodule_dark">
  105. <input type="text" id="m_darkmodule_dark" name="m_darkmodule_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/>
  106. </label>
  107. <div>Separator</div>
  108. <label for="m_separator_light">
  109. <input type="text" id="m_separator_light" name="m_separator_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/>
  110. </label>
  111. <label for="m_separator_dark">
  112. <input disabled="disabled" type="text" id="m_separator_dark" class="options" value="" autocomplete="off" spellcheck="false"/>
  113. </label>
  114. <div>Quiet Zone</div>
  115. <label for="m_quietzone_light">
  116. <input type="text" id="m_quietzone_light" name="m_quietzone_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/>
  117. </label>
  118. <label for="m_quietzone_dark">
  119. <input disabled="disabled" type="text" id="m_quietzone_dark" class="options" value="" autocomplete="off" spellcheck="false"/>
  120. </label>
  121. <div>logo space</div>
  122. <label for="m_logo_light">
  123. <input type="text" id="m_logo_light" name="m_logo_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/>
  124. </label>
  125. <label for="m_logo_dark">
  126. <input disabled="disabled" type="text" id="m_logo_dark" class="options" value="" autocomplete="off" spellcheck="false"/>
  127. </label>
  128. <br/>
  129. <button type="submit">generate</button>
  130. </form>
  131. <div id="qrcode-output"></div>
  132. <div><a href="https://play.google.com/store/apps/details?id=com.google.zxing.client.android">ZXing Barcode Scanner</a></div>
  133. <script src="https://cdnjs.cloudflare.com/ajax/libs/prototype/1.7.3/prototype.js"></script>
  134. <script src="https://cdnjs.cloudflare.com/ajax/libs/jscolor/2.1.1/jscolor.js"></script>
  135. <script>
  136. ((form, output, url) => {
  137. $(form).observe('submit', ev => {
  138. Event.stop(ev);
  139. new Ajax.Request(url, {
  140. method : 'post',
  141. parameters : ev.target.serialize(true),
  142. onUninitialized: $(output).update(),
  143. onLoading : $(output).update('[portlandia_screaming.gif]'),
  144. onFailure : response => $(output).update(response.responseJSON.error),
  145. onSuccess : response => $(output).update(response.responseJSON.qrcode),
  146. });
  147. });
  148. })('qrcode-settings', 'qrcode-output', './qrcode-interactive.php');
  149. </script>
  150. </body>
  151. </html>