-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.html
96 lines (79 loc) · 3.87 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
---
---
<!doctype html>
<html lang=en>
<head>
{% comment %} Only include GA snippet in production and if values in _config.yml match the actual site. {% endcomment %}
{% if jekyll.environment != 'development' and site.github.repository_nwo == site.ga.nwo %}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.ga.tid }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ site.ga.tid }}');
</script>
{% endif %}
<meta charset=utf-8>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>WhatsApp Spoilers</title>
<meta name="description" content="Hide content behind a "Read more" button in a WhatsApp message.">
<meta property="og:title" content="WhatsApp Spoilers" />
<meta property="og:description" content="Hide content behind a "Read more" button in a WhatsApp message.">
<meta property="og:image" content="https://yi-jiayu.github.io/whatsapp-spoilers/spoiler.png">
<link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<script>
function createSpoilerMessage() {
var warning = document.getElementById('warning').value;
var content = document.getElementById('content').value;
var separator = document.getElementById('separator').value;
var padding = document.getElementById('iosCompatibilityCheck').checked ? ' '.repeat(2575) : '\u200B'.repeat(4000);
var message = warning + separator + padding + content;
document.getElementById('message').value = message;
}
function copySpoilerMessage() {
document.getElementById('message').select();
document.execCommand('copy');
}
</script>
</head>
<body>
<div class="container">
<h1 class="mt-3">WhatsApp Spoilers</h1>
<h3><small class="text-muted">Hide content behind a "Read more" button in a WhatsApp message.</small></h3>
<img src="spoiler.png" class="img-fluid my-3">
<div class="form-group">
<label for="warning">Warning: </label>
<input type="text" class="form-control" id="warning" value="[SPOILER]">
</div>
<div class="form-group">
<label for="separator">Separator: </label>
<select class="form-control" id="separator">
<option value=" ">Single space (content will still be visible in quoted messages)</option>
<option value="
">3 lines (ensures content is hidden in quoted messages)</option>
</select>
</div>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="iosCompatibilityCheck">
<label class="custom-control-label" for="iosCompatibilityCheck">iOS compatibility mode</label>
<small id="iosCompatibilityCheckHelp" class="form-text text-muted">When iOS compatibility mode is enabled, normal spaces will be used instead of zero-width spaces.</small>
</div>
<div class="form-group">
<label for="content">Content: </label>
<textarea id="content" class="form-control mb-2"></textarea>
<button class="btn btn-primary" onclick="createSpoilerMessage()">Submit</button>
</div>
<div class="form-group">
<label for="message">Message (copy this): </label>
<textarea id="message" class="form-control mb-2" rows="4" readonly></textarea>
<button class="btn btn-primary" onclick=copySpoilerMessage()>Copy to clipboard</button>
</div>
<div class="text-right"><a href="https://github.com/yi-jiayu/whatsapp-spoilers">GitHub</a></div>
</div>
</body>
</html>