blob: 044f67c56ece1f80ddc1e8984ebcdf529478c91a (
plain)
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
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Direct link to your WhatsApp contacts | WhatZap.space</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="cc.js"></script>
<script src="vue.min.js"></script>
</head>
<body>
<div id="app">
<h1>Direct link to your WhatsApp contacts</h1>
<div id="input">
<input v-model="number" pattern="\d*">
</div>
<div id="link">
<a v-bind:href="href">+{{ number }}</a>
</div>
</div>
<script>
var app = new Vue({
el: '#app',
data: {
number: '',
},
computed: {
href: function () {
return 'whatsapp://send?phone=+' + this.number + '&text=abc'
}
},
methods: {
getLocation: function() {
var tag = document.createElement('script');
tag.src = "https://ipinfo.io/?callback=locationCallback";
document.querySelector('head').appendChild(tag);
}
},
beforeMount: function() {
this.getLocation();
}
});
function locationCallback(res) {
app.number = cc[res['country']];
}
</script>
</body>
</html>
|