summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2017-07-15 12:10:12 +0300
committerYuval Adam <_@yuv.al>2017-07-15 12:10:40 +0300
commiteb7ed78bc5f076d7eb717b74081127066c2a5b10 (patch)
tree04cf5ee0983368c4c449f63823c4ff09eafc00a5 /index.html
parent74d792cb9ead3705b72968356a6c4d834d01e540 (diff)
parent8291c910c63bdbc77ca80950377bbb468ed326bf (diff)
Merge branch 'master' into gh-pages
Diffstat (limited to 'index.html')
-rw-r--r--index.html26
1 files changed, 22 insertions, 4 deletions
diff --git a/index.html b/index.html
index 96577cc..469d5df 100644
--- a/index.html
+++ b/index.html
@@ -2,15 +2,20 @@
<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="vue.min.js"></script>
</head>
<body>
<div id="app">
<h1>Direct link to your WhatsApp contacts</h1>
- <input v-model="number" type="tel">
- <br>
- <a v-bind:href="href">+{{ number }}</a>
+ <div id="input">
+ <input v-model="tel" pattern="\d*">
+ </div>
+ <div id="link">
+ <a v-bind:href="href">+{{ number }}</a>
+ </div>
</div>
<script>
@@ -23,8 +28,21 @@
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) {
+ console.log(res);
+ }
</script>
</body>
</html>