-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
87 lines (76 loc) · 4 KB
/
index.html
File metadata and controls
87 lines (76 loc) · 4 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
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>QR Code Generator</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="stylesheet" href="assets/css/style.css">
</head>
<body>
<div class="container">
<h1>QR Code Generator</h1>
<div class="try-section">
<h3><i class="fas fa-rocket"></i> Coba Sekarang</h3>
<div class="input-group">
<label for="tryText">Masukkan Teks atau URL:</label>
<input type="text" id="tryText" placeholder="Contoh: https://example.com" />
</div>
<div class="input-group">
<label for="tryScale">Ukuran (Scale):</label>
<input type="number" id="tryScale" value="5" min="1" max="10" />
</div>
<button id="tryGenerate">Generate QR Code</button>
<div id="tryResult"></div>
</div>
<div id="qrcode"></div>
<div class="documentation">
<h3><i class="fas fa-book"></i> Dokumentasi</h3>
<div class="doc-section">
<h4><i class="fas fa-info-circle"></i> Cara Pakai</h4>
<p>Tambahkan parameter <code>text</code> di URL untuk generate QR code:</p>
<div class="code-block">https://kelasphp-kafekoding.github.io/qrcode/?text=YOUR_TEXT&scale=5</div>
<p style="margin-top: 10px; font-size: 14px; color: #666;">Parameter <code>scale</code> opsional (1-10), default 5</p>
</div>
<div class="doc-section">
<h4><i class="fas fa-code"></i> Contoh Kode</h4>
<div class="tab-buttons">
<button class="tab-btn active" data-tab="php">PHP</button>
<button class="tab-btn" data-tab="html">HTML</button>
<button class="tab-btn" data-tab="js">JavaScript</button>
</div>
<div class="tab-content active" id="php">
<pre><?php
$qr = "kelas php - kafekoding";
echo "<img src='https://kelasphp-kafekoding.github.io/qrcode/?text=$qr&scale=5'>";
?></pre>
</div>
<div class="tab-content" id="html">
<pre><img src="https://kelasphp-kafekoding.github.io/qrcode/?text=Hello%20World&scale=5"></pre>
</div>
<div class="tab-content" id="js">
<pre>const qr = "kelas php - kafekoding";
document.body.innerHTML = `<img src="https://kelasphp-kafekoding.github.io/qrcode/?text=${qr}&scale=5">`;</pre>
</div>
</div>
<div class="doc-section">
<h4><i class="fas fa-link"></i> Contoh URL</h4>
<div class="examples">
<p><i class="fas fa-arrow-right"></i> <a href="?text=Hello%20World&scale=5" target="_blank">?text=Hello World&scale=5</a></p>
<p><i class="fas fa-arrow-right"></i> <a href="?text=https://github.com&scale=3" target="_blank">?text=https://github.com&scale=3</a></p>
<p><i class="fas fa-arrow-right"></i> <a href="?text=0812345678&scale=7" target="_blank">?text=0812345678&scale=7</a></p>
</div>
</div>
<div class="footer">
<p>
<i class="fab fa-github"></i> Source Code:
<a href="https://github.com/kelasphp-kafekoding/qrcode" target="_blank">github.com/kelasphp-kafekoding/qrcode</a>
<img src="https://img.shields.io/github/stars/kelasphp-kafekoding/qrcode?style=social" alt="GitHub stars" style="margin-left: 10px; vertical-align: middle;">
</p>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>
<script src="assets/js/app.js"></script>
</body>
</html>