forked from mataherry/WhatsAppAny
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
145 lines (126 loc) · 4.45 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Dialer for WhatsApp</title>
<meta name="description" content="">
<link rel="manifest" href="manifest.json" />
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="cleartype" content="on">
<link rel="apple-touch-icon-precomposed" sizes="180x180" href="images/apple-touch-icon-180x180-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="images/apple-touch-icon-152x152-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="images/apple-touch-icon-144x144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="images/apple-touch-icon-120x120-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="images/apple-touch-icon-114x114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="images/apple-touch-icon-76x76-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="images/apple-touch-icon-72x72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="images/apple-touch-icon-57x57-precomposed.png">
<link rel="shortcut icon" href="images/apple-touch-icon.png">
<link rel="icon" sizes="192x192" href="images/touch-icon-192x192.png">
<link rel="icon" sizes="128x128" href="images/touch-icon-128x128.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="">
<meta name="mobile-web-app-capable" content="yes">
<style>
* {
margin: 0;
padding: 0;
}
body {
background: #F0F0F0;
display: flex;
flex-direction: column;
font-family: Helvetica, Arial, sans-serif;
min-height: 100vh;
}
header {
align-items: center;
background: #009B50;
color: white;
display: flex;
flex: 0 0 56px;
justify-content: center;
}
#content {
display: flex;
flex: 1;
flex-direction: column;
justify-content: center;
margin: 0 auto;
max-width: 24rem;
width: 100%;
}
#content>div {
margin: 0 2em;
}
.form-field {
border: solid 3px #01E678;
border-radius: 5px;
display: flex;
font-size: 1.3rem;
height: 2.5rem;
line-height: 2.4rem;
margin: 1rem 0;
}
.form-field span {
background: #EEE;
border-right: solid 1px #CCC;
color: #444;
flex: 0 0 auto;
text-align: center;
width: 2.4rem;
}
.form-field input {
flex: 1;
border: 0;
font-size: inherit;
outline: none;
padding: 0 0.5rem;
}
button {
flex: 0 0 auto;
background: #01E678;
border: 0;
padding: 0.3rem;
}
footer {
flex: 0 0 1rem;
font-size: 0.5rem;
}
</style>
</head>
<body>
<header id="main-nav" tabindex="-1">
<h1>Dialer for WhatsApp</h1>
</header>
<div id="content">
<div>
<form id="form" action="https://api.whatsapp.com/send" method="GET">
<p class="form-field prefix"><span>+</span>
<input id="phone" name="phone" type="tel" required autofocus pattern="\d+" title="Phone number cannot contain any spaces or special characters - only numbers" size="1" />
<button type="submit">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24">
<path fill="#FFFFFF" d="M20,2H4A2,2 0 0,0 2,4V22L6,18H20A2,2 0 0,0 22,16V4A2,2 0 0,0 20,2M6,9H18V11H6M14,14H6V12H14M18,8H6V6H18" />
</svg>
</button>
</p>
</form>
</div>
</div>
<footer>
</footer>
<script>
const phone = document.getElementById("phone");
phone.addEventListener('input', function(event) {
phone.value = phone.value.replace(/\D/g, '');
})
// Required to add to homescreen
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js');
}
</script>
</body>
</html>