-
-
Notifications
You must be signed in to change notification settings - Fork 57
/
linkpe.html
100 lines (94 loc) · 4.1 KB
/
linkpe.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
<!DOCTYPE html>
<html>
<head>
<!-- Primary Meta Tags -->
<title>LinkPe | UPI LINK Generator</title>
<meta name="title" content="LinkPe | UPI LINK Generator">
<meta name="description" content="LinkPe | UPI LINK Generator - https://github.com/PtPrashantTripathi/linkpe">
<link rel="fluid-icon" href="https://raw.githubusercontent.com/PtPrashantTripathi/linkpe/main/img/linkpe.png"
title="PtPrashantTripathi | LinkPe" />
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://ptprashanttripathi.github.io/linkpe">
<meta property="og:title" content="LinkPe | UPI LINK Generator">
<meta property="og:description"
content="LinkPe | UPI LINK Generator - https://github.com/PtPrashantTripathi/linkpe">
<meta property="og:image" content="https://raw.githubusercontent.com/PtPrashantTripathi/linkpe/main/img/linkpe.png">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://ptprashanttripathi.github.io/linkpe">
<meta property="twitter:title" content="LinkPe | UPI LINK Generator">
<meta property="twitter:description"
content="LinkPe | UPI LINK Generator - https://github.com/PtPrashantTripathi/linkpe">
<meta property="twitter:image"
content="https://raw.githubusercontent.com/PtPrashantTripathi/linkpe/main/img/linkpe.png">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/main.css">
<!--Coded by Pt. Prashant Tripathi @ptprashanttripathi on 14th Oct 2020 -->
<body>
<center>
<div class="card">
<div class="card-content">
<a href=""><img src="img/logo.png" height="50"></a>
<br>
<h4 style="color: #DAE0E2;">Create UPI Payment Request Link </h4>
<img src="img/upi.png" height="100">
<br>
<div id="linkpediv" style="display:none;">
<textarea class='text-box' rows="4" cols="30" id='linkpeURL'></textarea>
<br><br>
<a onclick='copyUpiUrl()' class='btn' id='btn-copy'>Copy Link</a>
<a id='whatsapp' class="btn">Share Link</a>
</div>
<form id="linkpeform">
<label style="color: #DAE1E2;">Enter Name:</label><br>
<input type="name" name="pn" class="text-box" placeholder="Enter your name (Optional):"><br>
<label style="color: #DAE1E2;">Enter Upi Id:</label><br>
<input type="email" name="pa" class="text-box" placeholder="Enter UPI Id" required><br>
<label style="color: #DAE1E2;">Enter Amount (Optional):</label><br>
<input type="number" name="am" class="text-box" placeholder="INR"><br>
<button type="submit" class="btn">Submit</button>
</form>
<br>
<p style="color: #555">
<b>Developed BY : </b>
<a href="https://ptprashanttripathi.github.io" style="color: #999;">Pt. Prashant Tripathi</a>
</p>
</div>
</div>
</center>
</body>
<script>
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const pn = urlParams.get('pn');
const pa = urlParams.get('pa');
const am = urlParams.get('am');
if (pa !== null) {
// check prod or dev
var linkpeURL = window.location.hostname;
if (linkpeURL.includes("localhost")) {
console.log("dev");
linkpeURL = `${window.location.protocol}//${window.location.hostname}:${window.location.port}/index.html`;
} else {
linkpeURL = `${window.location.protocol}//${window.location.hostname}/linkpe`;
}
linkpeURL = `?pa=${pa}&pn=${pn}&cu=INR`;
if (!isNaN(am) && am !== null && am !== "") {
linkpeURL = `&am=${am}`;
}
document.getElementById("linkpeURL").innerHTML = linkpeURL;
document.getElementById("whatsapp").href = "https://wa.me/?text=Hi, You can pay me by this Upi Payment Link
" encodeURIComponent(linkpeURL);
document.getElementById("linkpediv").style.display = "block";
document.getElementById("linkpeform").style.display = "none";
}
function copyUpiUrl() {
var copylinkpe = document.getElementById("linkpeURL");
copylinkpe.select();
copylinkpe.setSelectionRange(0, 99999)
document.execCommand("copy");
document.getElementById("btn-copy").innerHTML = "Copied";
}
</script>
</html>