summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2017-07-15 11:05:35 +0300
committerYuval Adam <_@yuv.al>2017-07-15 11:05:35 +0300
commit8291c910c63bdbc77ca80950377bbb468ed326bf (patch)
tree58a26d25ab32aca5d865b7aa40f448450bfb88b6 /index.html
parent2693dc35c26f9c44aa12ab502c8fe5289378a8e0 (diff)
Looks better
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 d1b5958..6fb82c0 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="number">
- <br>
- <a v-bind:href="href">+{{ number }}</a>
+ <div id="input">
+ <input v-model="number" 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>