-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVT.html
More file actions
193 lines (190 loc) · 6.52 KB
/
VT.html
File metadata and controls
193 lines (190 loc) · 6.52 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!DOCTYPE html><html lang="en">
<head>
<meta charset="UTF-8" />
<title>QR Tool - Bharat</title>
<script src="https://unpkg.com/html5-qrcode"></script>
<script src="https://cdn.jsdelivr.net/npm/qrcodejs@1.0.0/qrcode.min.js"></script>
<style>
body {
font-family: 'Segoe UI', sans-serif;
background: linear-gradient(to bottom right, #f0f8ff, #e0f7fa);
color: #333;
text-align: center;
padding: 20px;
}
.container {
max-width: 500px;
margin: auto;
background: #fff;
padding: 20px;
border-radius: 12px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
h2 {
margin-bottom: 10px;
}
textarea, input[type="file"] {
width: 100%;
padding: 10px;
font-size: 16px;
margin: 10px 0;
border-radius: 8px;
border: 1px solid #ccc;
}
button {
padding: 10px 20px;
margin: 10px 5px;
border: none;
border-radius: 8px;
background: #007bff;
color: white;
cursor: pointer;
}
button:hover {
background: #0056b3;
}
#qrcode, #reader {
margin-top: 20px;
}
#result {
margin-top: 15px;
font-weight: bold;
color: green;
}
#langSelect {
margin-bottom: 10px;
}
.ad-bottom, .ad-top, .ad-native {
width: 100%;
text-align: center;
margin: 10px auto;
z-index: 999;
}
.ad-bottom {
position: fixed;
bottom: 0;
left: 0;
background: #f8f8f8;
}
.ad-social {
position: fixed;
bottom: 80px;
right: 10px;
width: 300px;
max-width: 90vw;
z-index: 9999;
background: #fff;
border-radius: 12px;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
padding: 5px;
}
</style>
</head>
<body> <!-- 🔝 Top Banner Ad --> <div class="ad-top">
<script>
atOptions = {
'key' : '2839a3c1ca8fc9e07589a1b83ea67a15',
'format' : 'iframe',
'height' : 50,
'width' : 320,
'params' : {}
};
</script>
<script src="//www.highperformanceformat.com/2839a3c1ca8fc9e07589a1b83ea67a15/invoke.js"></script>
</div> <div class="container">
<h2 id="title">🔍 QR Tool - Bharat 🇮🇳</h2>
<select id="langSelect" onchange="changeLanguage()">
<option value="en">English</option>
<option value="hi">हिन्दी</option>
<option value="bn">বাংলা</option>
</select><textarea id="qrText" placeholder="Enter URL, text or payment link..."></textarea>
<button onclick="generateQR()">Generate QR</button>
<div id="qrcode"></div>
<button onclick="shareQR()">Share QR</button>
<hr />
<div id="reader" style="width: 100%; max-width: 400px;"></div>
<p id="result">Result will appear here...</p>
<input type="file" id="imageUpload" accept="image/*" onchange="scanImage(event)" />
<!-- 🔁 Native Ad -->
<div class="ad-native">
<script async="async" data-cfasync="false" src="//pl26993212.profitableratecpm.com/f411671ee1d0146704d13266d9687f63/invoke.js"></script>
<div id="container-f411671ee1d0146704d13266d9687f63"></div>
</div>
</div> <!-- 🔲 Social Ad --> <div class="ad-social">
<script src="//pl27011960.profitableratecpm.com/ef/1a/43/ef1a432319118bcb45467ce0fd7f2ff4.js"></script>
</div> <!-- 🔻 Bottom Banner Ad --> <div class="ad-bottom">
<script>
atOptions = {
'key' : '2839a3c1ca8fc9e07589a1b83ea67a15',
'format' : 'iframe',
'height' : 50,
'width' : 320,
'params' : {}
};
</script>
<script src="//www.highperformanceformat.com/2839a3c1ca8fc9e07589a1b83ea67a15/invoke.js"></script>
</div> <script>
let qr;
function generateQR() {
const text = document.getElementById("qrText").value.trim();
if (!text) return alert("Please enter text or URL");
document.getElementById("qrcode").innerHTML = "";
qr = new QRCode("qrcode", { text: text, width: 256, height: 256 });
}
function shareQR() {
const img = document.querySelector("#qrcode img");
if (!img) return alert("Generate QR first");
if (navigator.share) {
fetch(img.src).then(res => res.blob()).then(blob => {
const file = new File([blob], "qr.png", { type: blob.type });
navigator.share({ files: [file], title: "QR Code", text: "Scan this QR code" });
});
} else {
alert("Sharing not supported in this browser");
}
}
function scanImage(event) {
const file = event.target.files[0];
if (!file) return;
const reader = new FileReader();
reader.onload = () => {
const img = new Image();
img.src = reader.result;
img.onload = () => {
const canvas = document.createElement("canvas");
canvas.width = img.width;
canvas.height = img.height;
const ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0);
const scanner = new Html5Qrcode("reader");
scanner.scanFile(file, true).then(decoded => {
document.getElementById("result").innerText = decoded;
scanner.clear();
}).catch(err => alert("Failed to scan: " + err));
};
};
reader.readAsDataURL(file);
}
function changeLanguage() {
const lang = document.getElementById("langSelect").value;
const textMap = {
en: { title: "🔍 QR Tool - Bharat 🇮🇳", placeholder: "Enter URL, text or payment link...", result: "Result will appear here..." },
hi: { title: "🔍 QR टूल - भारत 🇮🇳", placeholder: "यूआरएल, टेक्स्ट या भुगतान लिंक दर्ज करें...", result: "परिणाम यहाँ दिखेगा..." },
bn: { title: "🔍 QR টুল - ভারত 🇮🇳", placeholder: "ইউআরএল, টেক্সট বা পেমেন্ট লিঙ্ক দিন...", result: "ফলাফল এখানে দেখাবে..." }
};
const t = textMap[lang];
document.getElementById("title").innerText = t.title;
document.getElementById("qrText").placeholder = t.placeholder;
document.getElementById("result").innerText = t.result;
}
Html5Qrcode.getCameras().then(devices => {
if (devices && devices.length) {
const cameraId = devices[0].id;
const scanner = new Html5Qrcode("reader");
scanner.start(cameraId, { fps: 10, qrbox: 250 }, (decodedText) => {
document.getElementById("result").innerText = decodedText;
});
}
});
</script></body>
</html>