Public
Script
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
import { codepoints } from "https://esm.town/v/jdan/codepoints";
export const htmlOfEmoji = (
emoji: Record<string, string | number | string[]> & {
emoji: string;
},
) => {
return `<main>
<style>body { margin: 2em } h1 { font-size: 12em; margin: 0 }</style>
<h1>${emoji.emoji}</h1>
<table border=2 cellpadding=2>
<tr>
<td>codepoints
</td>
<td>${codepoints(emoji.emoji).join("-")}</td></tr>
${
Object.entries(emoji).map(([field, value]) => {
return `<tr>
<td>${field}</td> <td>${
Array.isArray(value) ? value.join(", ") : value
}</td></tr>`;
}).join("\n")
}
</table>
</main>`;
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023