-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
97 lines (74 loc) · 3.09 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
<!doctype html>
<meta charset="utf8">
<meta name="viewport" content="width=320, initial-scale=1">
<title>base-lol - binary-to-emoji encoding scheme</title>
<style>
body {
font-family: Helvetica, "Helvetica Neue", sans-serif;
color: #000;
display: flex;
flex-direction: column;
min-height: 100vh;
font-size: 18px;
}
h1 {
height: auto;
}
.uploadBlock {
flex: 1;
border: 10px dashed #888;
padding: 10px;
font-size: 2rem;
margin: 10px 0;
color: #666;
}
.uploadBlock p {
margin: 0;
}
.dragover {
border: 10px dashed #aaa;
background: #e4ffe2;
}
code {
background: rgba(255,255,255,0.1);
padding: 2px;
}
.minor {
font-size: 1rem;
}
.hidden {
display: none;
}
.status {
font-size: 1rem;
}
.bytePreview {
font-family: monospace;
}
</style>
<script src="dist/demo-page.js"
defer
></script>
<body>
<h1>base-lol - encode binary data as emojis</h1>
<noscript>
This won't work without Javascript. Time to get out of lynx
and into a browser Richard Stallman!
</noscript>
<p>Encodes binary data as a sequence of emojis in UTF-8. Ready for embedding in tweets, file-names, WiFi SSIDs etc! Read <a href="https://github.com/timruffles/base-lol/blob/gh-pages/base-lol.mjs">the code</a>, and say hi <a href="https://twitter.com/timruffles">@timruffles</a>.</p>
<p>As an example, the byte sequence <code>0xcafecafe</code> becomes 💋💿💋💿. This SVG <img style="width: 1em; height: 1em; transform: scale(2) translate(4px, 4px); margin-right: .25em" src="./targets/smiley.svg"> (gzipped) becomes:</p>
<p>🐼😲😵😦🐠😷😬😫😭😲🐽🐢😧😳😳😯🐺🐯🐯😶😶😶🐮😶🐳🐮😮😱😦🐯🐲🐰🐰🐰🐯😲😵😦🐢🐾🐼😢😨😱😢😫😤🐠😥😨😫😫🐽🐢🐣😅😅🐰🐢🐠😢😷🐽🐢🐶🐢🐠😢😸🐽🐢🐶🐢🐠😱🐽🐢🐶🐢🐯🐾🐼😢😨😱😢😫😤🐠😢😷🐽🐢🐳🐢🐠😢😸🐽🐢🐴🐢🐠😱🐽🐢🐱🐢🐯🐾🐼😢😨😱😢😫😤🐠😢😷🐽🐢🐷🐢🐠😢😸🐽🐢🐴🐢🐠😱🐽🐢🐱🐢🐯🐾🐼😯😠😳😧🐠😣🐽🐢😌🐲🐬🐶🐠😂🐲🐬🐶🐠🐳🐬🐱🐲🐠🐸🐬🐶🐢🐯🐾🐼🐯😲😵😦🐾</p>
<p>Drag and drop files to encode and decode.</p>
<div class="uploadBlock" data-action="encode">
<p>1️⃣0️⃣1️⃣1️⃣ ➡ 🐋 <input type="file" /></p>
<p class="status hidden">
First <span class="previewCount"></span> bytes (<span class="bytePreview"></span>) of your file encoded to:
<span class="preview"></span>
</p>
<p class="minor">File to emojis</p>
</div>
<div class="uploadBlock" data-action="decode">
<p>🐋 ➡ 1️⃣0️⃣1️⃣1️⃣ <input type="file" /></p>
<p class="minor">Emojis to file</p>
</div>
</body>