99 lines
2.3 KiB
HTML
99 lines
2.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>Start a new WhatsApp Chat</title>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<script>
|
|
function submit() {
|
|
var phone = document.getElementById("phone").value.replace(/\D/g, "");
|
|
var message = document.getElementById("message-wrapper").open
|
|
? document.getElementById("message").value
|
|
: "";
|
|
|
|
location.href = "whatsapp://send/?phone=" + phone + "&text=" + message + "&type=phone_number";
|
|
}
|
|
</script>
|
|
<style>
|
|
body {
|
|
background-color: #EFE9DD;
|
|
text-align: center;
|
|
font-family: sans-serif;
|
|
}
|
|
h1 {
|
|
margin-bottom: 0;
|
|
opacity: 0.7;
|
|
}
|
|
p {
|
|
opacity: 0.5;
|
|
font-size: 0.85rem;
|
|
max-width: 400px;
|
|
margin: 1rem auto;
|
|
}
|
|
summary {
|
|
opacity: 0.5;
|
|
font-size: 0.85rem;
|
|
margin: 0.5rem auto;
|
|
cursor: pointer;
|
|
}
|
|
#desc {
|
|
margin-top: 2rem;
|
|
font-size: 0.75rem;
|
|
}
|
|
|
|
input, textarea {
|
|
padding: 0.5rem 1rem;
|
|
border-radius: 4px;
|
|
border: 1px solid rgba(0, 0, 0, 0.5);
|
|
transition: all 150ms;
|
|
font-size: 1rem;
|
|
}
|
|
textarea {
|
|
resize: vertical;
|
|
font-family: sans-serif;
|
|
font-size: 0.75rem;
|
|
width: 100%;
|
|
max-width: 400px;
|
|
}
|
|
input:focus, textarea:focus {
|
|
outline: none;
|
|
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
|
|
}
|
|
|
|
button {
|
|
background-color: #1DAA61;
|
|
color: white;
|
|
border: none;
|
|
padding: 0.5rem 2rem;
|
|
margin: 1rem 0;
|
|
border-radius: 4px;
|
|
transition: all 150ms;
|
|
}
|
|
button:active {
|
|
background-color: #18864D;
|
|
}
|
|
button:focus {
|
|
outline: none;
|
|
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Start a new WhatsApp chat</h1>
|
|
<p>Type a phone number, including country code</p>
|
|
<input id="phone" type="tel" placeholder="+1 (123) 456-7890" />
|
|
<details id="message-wrapper">
|
|
<summary>Write a message</summary>
|
|
<textarea id="message" placeholder="(Optional) Message to send"></textarea>
|
|
</details>
|
|
<button id="send" onclick="submit()">Submit</button>
|
|
<br>
|
|
<p id="desc">
|
|
By default, WhatsApp does not allow you to message
|
|
users who are not in your contacts list. This website
|
|
allows you to message any phone number through WhatsApp.
|
|
</small>
|
|
</body>
|
|
</html>
|
|
|