-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhatsapp-link-generator.html
More file actions
156 lines (142 loc) · 8.61 KB
/
whatsapp-link-generator.html
File metadata and controls
156 lines (142 loc) · 8.61 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WhatsApp Link Generator | WhatsApp Direct Message Link Generator</title>
<meta name="twitter:title" content="WhatsApp Link Generator | WhatsApp Direct Message Link Generator">
<meta property="twitter:title" content="WhatsApp Link Generator | WhatsApp Direct Message Link Generator">
<meta property="og:title" content="WhatsApp Link Generator | WhatsApp Direct Message Link Generator">
<meta property="twitter:description" content="Generate sharable WhatsApp link for your WhatsApp number with our free link generator. Make it easy for your customer to reach you."><meta property="og:description" content="Generate sharable WhatsApp link for your WhatsApp number with our free link generator. Make it easy for your customer to reach you.">
<meta property="og:image" content="">
<meta name="twitter:image" content="">
<meta name="twitter:card" content="summary_large_image">
<meta name="description" content="Generate sharable WhatsApp link for your WhatsApp number with our free link generator. Make it easy for your customer to reach you.">
<meta property="og:url" content="https://webdev-murali.github.io/whatsapp-link-generator/" />
<meta property="og:site_name" content="webdev-murali.github.io" />
<!--Bootstrap V5-->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<!--Angular JS-->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<!-- Toastr JS-CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/angularjs-toaster/2.1.0/toaster.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/angularjs-toaster/2.1.0/toaster.min.js"></script>
<!--Fonts-->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<!--External JS-->
<script src="assets/js/app.js"></script>
<script src="assets/js/main.js"></script>
<!--Fontawesome 5 CDN-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<!--Externall CSS-->
<link rel="stylesheet" href="assets/css/mai n.css">
<!--Internall CSS-->
<style>
</style>
</head>
<body ng-app="whatsapp">
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'time-out': 4000}"></toaster-container>
<!-- header -->
<header>
<nav class="navbar navbar-expand-sm bg-light navbar-light ">
<div class="container-fluid">
<!-- <a class="navbar-brand" href="#">Logo</a> -->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link text-dark" href="index.html" target="_blank">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" href="resume-builder.html" target="_blank">Free Resume Builder</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" href="weather-reports.html" target="_blank">Weather App</a>
</li>
</ul>
</div>
<a href="https://api.whatsapp.com/send?phone=9514773633&text=Hi..😀" target="_blank" class="btn btn-primary text-light btn-md">Feedback here !</a>
</div>
</nav>
</header>
<div class="container mt-5" ng-controller="whatsappCtrl">
<div class="row">
<div class="col">
<form action="" class="form" class="">
<div class="row d-flex flex-column gap-4">
<div class="form-group col">
<label for="" class="form-label">
Enter Whatsapp Number
</label>
<input type="number" placeholder="Enter Phone Number" id="mobileNumber" ng-model="mobileNumber" class="form-control" maxlength="20" minlength="5" inputmode="numeric">
</div>
<div class="form-group col">
<label for="" class="form-label">
Add your custom Message
</label>
<textarea name="customMessage" ng-model="customMessage" id="customMessage" class="form-control" placeholder="Hi" inputmode="">Hi </textarea>
</div>
<div class="form-group col">
<label for="" class="form-label">Generated link will be shown here</label>
<div class="input-group">
<input type="text" class="form-control" id="whatsappLink" placeholder="Generated link will be shown here..." value="https://api.whatsapp.com/send?phone={{mobileNumber}}&text={{customMessage}}" >
<span class="input-group-addon btn btn-sm btn-primary" ng-click="copyToClipboard();">
<b>{{copyStatus}} <i class="fa fa-copy"></i></b>
</span>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- JS -->
<script>
var app = angular.module('whatsapp',['toaster']);
app.controller('whatsappCtrl',function($scope,$timeout,toaster){
$scope.mobileNumber = "";
$scope.customMessage = "Hi";
$scope.copyStatus = "Clink here to copy";
$scope.$watchGroup(['mobileNumber', 'customMessage'], function() {
console.warn("watchgroup.")
$scope.whatsappLink = "https://api.whatsapp.com/send?phone=" + $scope.mobileNumber + "&text=" + encodeURIComponent($scope.customMessage);
});
$scope.copyToClipboard = function() {
var copyText = document.getElementById("whatsappLink");
var mobileNumber = document.getElementById("mobileNumber");
var customMessage = document.getElementById("customMessage");
//mobile number
console.log(mobileNumber.value);
console.log(customMessage);
if($scope.mobileNumber == null || $scope.mobileNumber == undefined || !$scope.mobileNumber){
mobileNumber.focus();
toaster.pop('error', "Error!", "Please Enter Valid Mobile Number");
}else if($scope.customMessage == '' || $scope.customMessage == null){
customMessage.focus();
toaster.pop('error', "Error!", "Please Enter Custom Message");
}else{
copyText.select();
navigator.clipboard.writeText(copyText.value).then(function() {
toaster.pop('success', "Success!", "Link Copied Successfully.");
$scope.copyStatus = "Copied..";
$timeout(function(){
$scope.copyStatus = "Clink here to copy";
},100);
}).catch(function(err) {
console.error("Failed to copy: ", err);
alert("Copy link failed.");
});
}
};
});
</script>
<!---Bootstrap V5 js-->
<script async src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<script async src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
</body>
</html>