diff options
Diffstat (limited to 'index.html')
| -rw-r--r-- | index.html | 26 |
1 files changed, 22 insertions, 4 deletions
@@ -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> |
