|
| 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 | + |
| 20 | +<form id="qrcode-settings"> |
| 21 | + |
| 22 | + <label for="inputstring">Input String</label><br/><textarea name="inputstring" id="inputstring" cols="80" rows="3" autocomplete="off" spellcheck="false"></textarea><br/> |
| 23 | + |
| 24 | + <label for="version">Version</label> |
| 25 | + <input id="version" name="version" class="options" type="number" min="1" max="40" value="5" placeholder="version"/> |
| 26 | + |
| 27 | + <label for="maskpattern">Mask Pattern</label> |
| 28 | + <input id="maskpattern" name="maskpattern" class="options" type="number" min="-1" max="7" value="-1" placeholder="mask pattern"/> |
| 29 | + |
| 30 | + <label for="ecc">ECC</label> |
| 31 | + <select class="options" id="ecc" name="ecc"> |
| 32 | + <option value="L" selected="selected">L - 7%</option> |
| 33 | + <option value="M">M - 15%</option> |
| 34 | + <option value="Q">Q - 25%</option> |
| 35 | + <option value="H">H - 30%</option> |
| 36 | + </select> |
| 37 | + |
| 38 | + <br/> |
| 39 | + |
| 40 | + <label for="quietzone">Quiet Zone |
| 41 | + <input id="quietzone" name="quietzone" class="options" type="checkbox" value="true"/> |
| 42 | + </label> |
| 43 | + |
| 44 | + <label for="quietzonesize">size</label> |
| 45 | + <input id="quietzonesize" name="quietzonesize" class="options" type="number" min="0" max="100" value="4" placeholder="quiet zone"/> |
| 46 | + |
| 47 | + <br/> |
| 48 | + |
| 49 | + <label for="output_type">Output</label> |
| 50 | + <select class="options" id="output_type" name="output_type"> |
| 51 | + <option value="html">Markup - HTML</option> |
| 52 | + <option value="svg" selected="selected">Markup - SVG</option> |
| 53 | + <option value="png">Image - png</option> |
| 54 | + <option value="jpg">Image - jpg</option> |
| 55 | + <option value="gif">Image - gif</option> |
| 56 | + <option value="text">String - text</option> |
| 57 | + <option value="json">String - json</option> |
| 58 | + </select> |
| 59 | + |
| 60 | + <label for="scale">scale</label> |
| 61 | + <input id="scale" name="scale" class="options" type="number" min="1" max="10" value="5" placeholder="scale"/> |
| 62 | + |
| 63 | + <div>Finder</div> |
| 64 | + <label for="m_finder_light"> |
| 65 | + <input type="text" id="m_finder_light" name="m_finder_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/> |
| 66 | + </label> |
| 67 | + <label for="m_finder_dark"> |
| 68 | + <input type="text" id="m_finder_dark" name="m_finder_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/> |
| 69 | + </label> |
| 70 | + |
| 71 | + <div>Finder dot</div> |
| 72 | + <label for="m_finder_dot_light"> |
| 73 | + <input disabled="disabled" type="text" id="m_finder_dot_light" name="m_finder_dot_light" class="options" autocomplete="off" spellcheck="false"/> |
| 74 | + </label> |
| 75 | + <label for="m_finder_dot_dark"> |
| 76 | + <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"/> |
| 77 | + </label> |
| 78 | + |
| 79 | + <div>Alignment</div> |
| 80 | + <label for="m_alignment_light"> |
| 81 | + <input type="text" id="m_alignment_light" name="m_alignment_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/> |
| 82 | + </label> |
| 83 | + <label for="m_alignment_dark"> |
| 84 | + <input type="text" id="m_alignment_dark" name="m_alignment_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/> |
| 85 | + </label> |
| 86 | + |
| 87 | + <div>Timing</div> |
| 88 | + <label for="m_timing_light"> |
| 89 | + <input type="text" id="m_timing_light" name="m_timing_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/> |
| 90 | + </label> |
| 91 | + <label for="m_timing_dark"> |
| 92 | + <input type="text" id="m_timing_dark" name="m_timing_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/> |
| 93 | + </label> |
| 94 | + |
| 95 | + <div>Format</div> |
| 96 | + <label for="m_format_light"> |
| 97 | + <input type="text" id="m_format_light" name="m_format_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/> |
| 98 | + </label> |
| 99 | + <label for="m_format_dark"> |
| 100 | + <input type="text" id="m_format_dark" name="m_format_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/> |
| 101 | + </label> |
| 102 | + |
| 103 | + <div>Version</div> |
| 104 | + <label for="m_version_light"> |
| 105 | + <input type="text" id="m_version_light" name="m_version_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/> |
| 106 | + </label> |
| 107 | + <label for="m_version_dark"> |
| 108 | + <input type="text" id="m_version_dark" name="m_version_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/> |
| 109 | + </label> |
| 110 | + |
| 111 | + <div>Data</div> |
| 112 | + <label for="m_data_light"> |
| 113 | + <input type="text" id="m_data_light" name="m_data_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/> |
| 114 | + </label> |
| 115 | + <label for="m_data_dark"> |
| 116 | + <input type="text" id="m_data_dark" name="m_data_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/> |
| 117 | + </label> |
| 118 | + |
| 119 | + <div>Dark Module</div> |
| 120 | + <label for="m_darkmodule_light"> |
| 121 | + <input disabled="disabled" type="text" id="m_darkmodule_light" class="options" value="" autocomplete="off" spellcheck="false"/> |
| 122 | + </label> |
| 123 | + <label for="m_darkmodule_dark"> |
| 124 | + <input type="text" id="m_darkmodule_dark" name="m_darkmodule_dark" class="jscolor options" value="000000" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/> |
| 125 | + </label> |
| 126 | + |
| 127 | + <div>Separator</div> |
| 128 | + <label for="m_separator_light"> |
| 129 | + <input type="text" id="m_separator_light" name="m_separator_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/> |
| 130 | + </label> |
| 131 | + <label for="m_separator_dark"> |
| 132 | + <input disabled="disabled" type="text" id="m_separator_dark" class="options" value="" autocomplete="off" spellcheck="false"/> |
| 133 | + </label> |
| 134 | + |
| 135 | + <div>Quiet Zone</div> |
| 136 | + <label for="m_quietzone_light"> |
| 137 | + <input type="text" id="m_quietzone_light" name="m_quietzone_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/> |
| 138 | + </label> |
| 139 | + <label for="m_quietzone_dark"> |
| 140 | + <input disabled="disabled" type="text" id="m_quietzone_dark" class="options" value="" autocomplete="off" spellcheck="false"/> |
| 141 | + </label> |
| 142 | + |
| 143 | + <div>logo space</div> |
| 144 | + <label for="m_logo_light"> |
| 145 | + <input type="text" id="m_logo_light" name="m_logo_light" class="jscolor options" value="ffffff" autocomplete="off" spellcheck="false" minlength="6" maxlength="6"/> |
| 146 | + </label> |
| 147 | + <label for="m_logo_dark"> |
| 148 | + <input disabled="disabled" type="text" id="m_logo_dark" class="options" value="" autocomplete="off" spellcheck="false"/> |
| 149 | + </label> |
| 150 | + |
| 151 | + <br/> |
| 152 | + <button type="submit">generate</button> |
| 153 | +</form> |
| 154 | +<div id="qrcode-output"></div> |
| 155 | + |
| 156 | +<div><a href="https://play.google.com/store/apps/details?id=com.google.zxing.client.android">ZXing Barcode Scanner</a></div> |
| 157 | +<script src="https://cdnjs.cloudflare.com/ajax/libs/prototype/1.7.3/prototype.js"></script> |
| 158 | +<script src="https://cdnjs.cloudflare.com/ajax/libs/jscolor/2.1.1/jscolor.js"></script> |
| 159 | +<script> |
| 160 | + ((form, output, url) => { |
| 161 | + |
| 162 | + $(form).observe('submit', ev => { |
| 163 | + Event.stop(ev); |
| 164 | + |
| 165 | + new Ajax.Request(url, { |
| 166 | + method : 'post', |
| 167 | + parameters : ev.target.serialize(true), |
| 168 | + onUninitialized: $(output).update(), |
| 169 | + onLoading : $(output).update('[portlandia_screaming.gif]'), |
| 170 | + onFailure : response => $(output).update(response.responseJSON.error), |
| 171 | + onSuccess : response => $(output).update(response.responseJSON.qrcode), |
| 172 | + }); |
| 173 | + |
| 174 | + }); |
| 175 | + })('qrcode-settings', 'qrcode-output', './qrcode-interactive.php'); |
| 176 | +</script> |
| 177 | + |
| 178 | +</body> |
| 179 | +</html> |
0 commit comments