-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
link.html
260 lines (247 loc) · 9.82 KB
/
link.html
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<html>
<head>
<title>Buy me chai: Your own creator Page!</title>
<link rel="icon" type="image/png" href="https://i.ibb.co/5T5bHD3/Buy-me-chai.png"/>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="js/qrcode.js" charset="utf-8"></script>
<link rel="stylesheet" href="fonts/flaticon/font/flaticon.css">
<meta property="og:title" content="Buy me chai">
<meta property="og:description" content="My very own Buy me chai support page!">
<meta property="og:image" content="https://i.ibb.co/0K2Bx8w/BMCLogo.png" itemprop="image">
<meta property="og:url" content="https://buymechai.ml">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-D91EMY6DW5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-D91EMY6DW5');
</script>
<style>
body{
text-align:center;
background: #373B50;
height: 100%;
width:100%;
font-family: "Muli", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
.wrapper {
height: 100%;
width: 100%;
display: table;
}
.qrBoxOuter {
padding: 4mm;
margin-top: 2mm;
margin-bottom: 2mm;
}
#qrCode{
display: block;
margin-left: auto;
margin-right: auto;
border-radius: 6%;
}
.container{
padding:70px;
display: table-cell;
height: 100%;
width: 100%;
vertical-align: middle;
}
.bmcLogo{
border: 2px solid #3e2e21;
border-radius: 20px;
min-width: 315px;
}
.supportTag{
padding: 10px;
background: #3E2E21;
border-radius: 25px;
color: white;
font-size: 15px;
}
.qrDiv {
border: 1px solid #3e2e21;
padding: 35px 70px 35px 70px;
background: #F8F9FA;
border-radius: 20px;
}
.qrM{
margin-bottom: 40px;
}
.payLogo{
padding: 0px 20px 20px 20px;
}
.foot{
color: white;
padding: 50px;
font-size: 17;
}
.ty{
font-size: 28px;
}
@media (min-width: 991.98px) {
.container{
padding:30px;
}
.bmcLogo{
border: 2px solid #3e2e21;
border-radius: 20px;
min-width: 0px;
}
.ws{
width:10%;
cursor: pointer;
}
.payLogoAnchor {
pointer-events: none;
}
.tagline{
margin-bottom: 40px;
text-decoration: none !important;
font-size: 18px;
font-weight: 600;
}
}
@media (max-width: 991.98px) {
.payLogo{
min-width:120px;
padding: 0px 20px 20px 20px;
}
.foot{
font-size: 28px;
}
.ty{
font-size: 33px;
}
.ws{
width:25%;
cursor: pointer;
}
.tagline{
margin-bottom: 40px;
text-decoration: none !important;
font-size: 24px;
font-weight: 600;
}
}
</style>
</head>
<body>
<div class="wrapper">
<div class="container">
<div class="row qrDiv">
<div class="row">
<a href="https://getmechai.vercel.app">
<img class="bmcLogo" src="https://i.ibb.co/Xkdj83y/image-2.png" alt="buymechai" border="0">
</a>
<p class="tagline">Help creators by sponsoring a cup of tea.</p>
</div>
<div class="row qrM">
<h2 class="ty">🥳 Thank you for buying <i id="name"></i> chai<i id="amt"></i> ❤️</h2>
<p><!--<i class="supportTag">#SupportCreatorsViaBMC</i>--></p>
</div>
<div class="row qrBoxOuter">
<div id="qrCode" style="text-align: center"></div>
<p style="font-size: 23px;padding-top: 20px;">Scan via any QR code apps like PayTm, PhonePe or GPay</p>
<p id="validity" style="font-weight: 600;font-size:23px;"></p>
</div>
<div class="row" style="display:none;">
<h3>App Based Options:</h3>
</div>
<div class="row qrM" style="display:none;">
<a class="payLogoAnchor" target="_blank"><img class="payLogo" src="images/bhim.png" alt="buymechai" border="0"></a>
<a class="payLogoAnchor" target="_blank"><img class="payLogo" src="images/paytm.png" alt="buymechai" border="0"></a>
<a class="payLogoAnchor" target="_blank"><img class="payLogo" src="images/gTez.png" alt="buymechai" border="0"></a>
<a class="payLogoAnchor" target="_blank"><img class="payLogo" src="images/phonepe.png" alt="buymechai" border="0"></a>
</div>
<div class="row">
<a id="fullWS" target="_blank"><img class="ws" src="images/ws.png" alt="buymechai" border="0"/></a>
</div>
</div>
<div class="foot">
<p>
Copyright © 2020, Made with 💛 <i style="margin-left:5px;margin-right:2px;font-style: normal;">by <a href="https://vaibhavmagon.github.io" target="_blank" style="color:white;">Vaibhav Magon</a> in</i> 🇮🇳
</p>
<p>
(Not for Profit Initiative)
</p>
</div>
</div>
</div>
</body>
<script>
var urlParams;
(window.onpopstate = function () {
let country;
const http = new XMLHttpRequest()
http.open("GET", "https://ipinfo.io?token=b68c3fd62a6a01")
http.send()
http.onreadystatechange = (e) => {
if(http.readyState === XMLHttpRequest.DONE) {
var status = http.status;
if (status === 0 || (status >= 200 && status < 400)) {
ele = JSON.parse(http.responseText)
country = ele["country"];
} else {
country = null;
}
loadData(country)
}
}
})();
function loadData(country){
var match,
pl = /\+/g, // Regex for replacing addition symbol with a space
search = /([^&=]+)=?([^&]*)/g,
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
query = window.location.search.substring(1);
urlParams = {};
while (match = search.exec(query))
urlParams[decode(match[1])] = decode(match[2]);
console.log("User logged in from: ", country);
if("vpa" in urlParams && urlParams["vpa"] != "undefined" && urlParams["vpa"] != "NaN" && country == "IN"){
document.getElementById("validity").innerHTML = "Valid ✅";
}else if("vpa" in urlParams && urlParams["vpa"] != "undefined" && urlParams["vpa"] != "NaN" && (country != null && country != "IN")){
document.getElementById("validity").innerHTML = "Only Active in India! 🥺";
}else if("vpa" in urlParams && urlParams["vpa"] != "undefined" && urlParams["vpa"] != "NaN"){
document.getElementById("validity").innerHTML = "Valid ✅";
}else{
document.getElementById("validity").innerHTML = "Invalid ❌";
}
let text = "pay?pa=" + urlParams["vpa"] + "&mode=00&orgid=000000&cu=INR"
if("nm" in urlParams){
text = text + "&pn=" + (urlParams["nm"]).replace(/ /g,'') + "&tn=Buying%20chai%20for%20" + (urlParams["nm"]).replace(/ /g,'')
document.getElementById("name").innerHTML = urlParams["nm"];
if("amt" in urlParams){
document.getElementById("amt").innerHTML = " of ₹ " + urlParams["amt"]
}else{
document.getElementById("amt").innerHTML = "";
}
}else{
document.getElementById("name").innerHTML = "me";
document.getElementById("amt").innerHTML = "";
}
if("amt" in urlParams){
text = text + "&am=" + urlParams["amt"]
}
document.getElementById("fullWS").href = "https://wa.me/?text=Hey,%20you%20can%20support%20my%20work%20at%20Buy%20me%20chai:%20" + encodeURIComponent(window.location.href);
let intrmUrl = "upi://" + text;
let signedUrl = "upi://" + text + "&sign=" + btoa(intrmUrl);
document.getElementsByClassName("payLogoAnchor")[0].href = signedUrl;
document.getElementsByClassName("payLogoAnchor")[1].href = "paytmmp://" + text;
document.getElementsByClassName("payLogoAnchor")[2].href = "upi://" + text;
document.getElementsByClassName("payLogoAnchor")[3].href = "upi://" + text;
var qrcode = new QRCode("qrCode", {
text: "upi://" + text,
width: 450,
height: 450,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});
}
</script>
</html>