-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
117 lines (116 loc) · 6.54 KB
/
index.html
File metadata and controls
117 lines (116 loc) · 6.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>QR Code Generator — Free Online QR Creator</title>
<meta name="description" content="Generate QR codes instantly from any text or URL. Customize size, colors, download as PNG or SVG. 100% free, no signup required.">
<meta name="keywords" content="qr code generator, qr creator, free qr code, qr code maker, url to qr">
<meta property="og:title" content="QR Code Generator — Free Online QR Creator">
<meta property="og:description" content="Generate QR codes instantly. Custom colors, sizes, PNG/SVG download.">
<meta property="og:type" content="website">
<link rel="canonical" href="https://maxmini0214.github.io/qr-code-generator/">
<script src="https://cdn.jsdelivr.net/npm/qrcode@1.5.4/build/qrcode.min.js"></script>
<style>
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#0f172a;color:#e2e8f0;min-height:100vh;display:flex;flex-direction:column;align-items:center}
header{text-align:center;padding:2.5rem 1rem 1rem}
h1{font-size:2rem;background:linear-gradient(135deg,#38bdf8,#818cf8);-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.subtitle{color:#94a3b8;margin-top:.4rem;font-size:.95rem}
.container{width:100%;max-width:600px;padding:1.5rem}
.card{background:#1e293b;border-radius:12px;padding:1.5rem;margin-bottom:1rem;border:1px solid #334155}
label{display:block;font-size:.85rem;color:#94a3b8;margin-bottom:.4rem;font-weight:500}
input[type=text],textarea{width:100%;padding:.7rem;border-radius:8px;border:1px solid #334155;background:#0f172a;color:#e2e8f0;font-size:.95rem;outline:none;transition:border .2s}
input[type=text]:focus,textarea:focus{border-color:#818cf8}
textarea{resize:vertical;min-height:80px;font-family:inherit}
.row{display:flex;gap:1rem;margin-top:.8rem;flex-wrap:wrap}
.row>div{flex:1;min-width:120px}
input[type=color]{width:100%;height:38px;border:1px solid #334155;border-radius:8px;background:#0f172a;cursor:pointer;padding:2px}
input[type=range]{width:100%;accent-color:#818cf8}
.size-val{text-align:center;color:#94a3b8;font-size:.8rem;margin-top:.2rem}
.preview{display:flex;justify-content:center;padding:1.5rem;background:#fff;border-radius:8px;margin-top:1rem;min-height:200px;align-items:center}
.preview canvas,.preview img,.preview svg{max-width:100%}
#qr-svg-container{display:none}
.btn-row{display:flex;gap:.8rem;margin-top:1rem;flex-wrap:wrap}
.btn{flex:1;padding:.7rem;border:none;border-radius:8px;font-size:.9rem;font-weight:600;cursor:pointer;transition:transform .1s,opacity .2s}
.btn:active{transform:scale(.97)}
.btn-primary{background:linear-gradient(135deg,#38bdf8,#818cf8);color:#fff}
.btn-secondary{background:#334155;color:#e2e8f0}
.btn:disabled{opacity:.4;cursor:not-allowed}
footer{text-align:center;padding:2rem 1rem;color:#475569;font-size:.8rem}
footer a{color:#818cf8;text-decoration:none}
@media(max-width:480px){h1{font-size:1.5rem}.container{padding:1rem}.row>div{min-width:100%}}
</style>
</head>
<body>
<header>
<h1>⬜ QR Code Generator</h1>
<p class="subtitle">Generate QR codes instantly — free, private, no signup</p>
</header>
<div class="container">
<div class="card">
<label for="qr-input">Text or URL</label>
<textarea id="qr-input" placeholder="https://example.com or any text…">https://example.com</textarea>
<div class="row">
<div>
<label for="qr-size">Size: <span id="size-label">256</span>px</label>
<input type="range" id="qr-size" min="128" max="1024" step="32" value="256">
</div>
</div>
<div class="row">
<div>
<label for="fg-color">Foreground</label>
<input type="color" id="fg-color" value="#000000">
</div>
<div>
<label for="bg-color">Background</label>
<input type="color" id="bg-color" value="#ffffff">
</div>
</div>
<div class="preview" id="preview">
<canvas id="qr-canvas"></canvas>
</div>
<div id="qr-svg-container"></div>
<div class="btn-row">
<button class="btn btn-primary" id="dl-png">⬇ Download PNG</button>
<button class="btn btn-secondary" id="dl-svg">⬇ Download SVG</button>
</div>
</div>
</div>
<footer>
<p>100% client-side — your data never leaves your browser</p>
<p style="margin-top:.4rem">Built by <a href="https://github.com/maxmini0214" target="_blank">maxmini0214</a></p>
</footer>
<script>
const input=document.getElementById('qr-input'),canvas=document.getElementById('qr-canvas'),sizeSlider=document.getElementById('qr-size'),sizeLabel=document.getElementById('size-label'),fgColor=document.getElementById('fg-color'),bgColor=document.getElementById('bg-color'),svgContainer=document.getElementById('qr-svg-container');
let debounceTimer;
function generate(){
const text=input.value.trim();if(!text)return;
const size=parseInt(sizeSlider.value),fg=fgColor.value,bg=bgColor.value;
QRCode.toCanvas(canvas,text,{width:size,color:{dark:fg,light:bg},margin:2},()=>{});
QRCode.toString(text,{type:'svg',width:size,color:{dark:fg,light:bg},margin:2},(e,svg)=>{if(!e)svgContainer.innerHTML=svg;});
}
function onInput(){clearTimeout(debounceTimer);debounceTimer=setTimeout(generate,200)}
input.addEventListener('input',onInput);
sizeSlider.addEventListener('input',()=>{sizeLabel.textContent=sizeSlider.value;onInput()});
fgColor.addEventListener('input',onInput);
bgColor.addEventListener('input',onInput);
document.getElementById('dl-png').onclick=()=>{
const a=document.createElement('a');a.download='qrcode.png';a.href=canvas.toDataURL('image/png');a.click();
};
document.getElementById('dl-svg').onclick=()=>{
const svg=svgContainer.innerHTML;if(!svg)return;
const blob=new Blob([svg],{type:'image/svg+xml'});
const a=document.createElement('a');a.download='qrcode.svg';a.href=URL.createObjectURL(blob);a.click();
};
generate();
</script>
<script data-goatcounter="https://maxdevtools.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
<!-- Support CTA -->
<div style="max-width:480px;margin:1rem auto 2rem;padding:1.2rem;background:linear-gradient(135deg,#fff7ed,#fef3c7);border:1px solid #fbbf24;border-radius:12px;text-align:center;font-family:system-ui,sans-serif">
<p style="margin:0 0 0.5rem;font-size:1rem;font-weight:600;color:#92400e">☕ Like this tool? Support the project!</p>
<p style="margin:0 0 0.8rem;color:#78716c;font-size:0.85rem">Every coffee keeps free tools alive. No account needed.</p>
<a href="https://paypal.me/maxseats" target="_blank" rel="noopener" style="display:inline-block;padding:0.5rem 1.5rem;background:#0070ba;color:white;border-radius:8px;text-decoration:none;font-size:0.9rem;font-weight:600">☕ Buy Me a Coffee via PayPal</a>
</div>
</body>
</html>