2022-08-12 14:36:19 +01:00
|
|
|
const names = {
|
|
|
|
"🎶": "musical_notes",
|
|
|
|
"🎬": "clapper_board",
|
|
|
|
"🎉": "party_popper",
|
2023-01-29 18:17:33 +00:00
|
|
|
"❓": "question_mark",
|
2022-08-12 14:36:19 +01:00
|
|
|
"✨": "sparkles",
|
|
|
|
"🪅": "pinata",
|
|
|
|
"🪄": "magic_wand",
|
2022-09-11 16:04:06 +01:00
|
|
|
"🐲": "dragon_face",
|
2022-10-27 17:27:20 +01:00
|
|
|
"🀄": "dragon_face_wukko",
|
2022-08-12 14:36:19 +01:00
|
|
|
"💸": "money_with_wings",
|
2022-08-19 18:54:20 +01:00
|
|
|
"⚙️": "gear",
|
2022-10-27 17:27:20 +01:00
|
|
|
"📋": "clipboard",
|
|
|
|
"🎃": "pumpkin",
|
|
|
|
"🎄": "christmas_tree",
|
|
|
|
"🕯️": "candle",
|
|
|
|
"😺": "cat",
|
2022-11-20 13:46:08 +00:00
|
|
|
"🐶": "dog",
|
2023-01-29 18:17:33 +00:00
|
|
|
"🎂": "cake",
|
|
|
|
"🐘": "elephant",
|
|
|
|
"🐦": "bird",
|
|
|
|
"🐙": "octopus",
|
2023-03-08 07:17:33 +00:00
|
|
|
"🔮": "crystal_ball",
|
2023-05-17 17:50:11 +01:00
|
|
|
"💪": "biceps",
|
2023-05-23 17:52:17 +01:00
|
|
|
"💖": "sparkling_heart",
|
2023-07-18 20:50:51 +01:00
|
|
|
"👾": "alien_monster",
|
|
|
|
"😿": "cat_crying",
|
|
|
|
"🙀": "cat_flabbergasted",
|
2023-08-11 16:53:30 +01:00
|
|
|
"🐱": "cat_smile",
|
|
|
|
"❤️🩹": "mending_heart",
|
|
|
|
"🔒": "locked",
|
|
|
|
"🔍": "magnifying_glass",
|
|
|
|
"🔗": "link",
|
2023-08-13 19:09:50 +01:00
|
|
|
"⌨": "keyboard",
|
2023-08-13 20:36:19 +01:00
|
|
|
"📑": "boring_document",
|
2023-09-08 22:10:43 +01:00
|
|
|
"🧮": "abacus",
|
2023-09-16 18:38:07 +01:00
|
|
|
"😸": "cat_grin",
|
2023-10-14 17:51:53 +01:00
|
|
|
"📰": "newspaper",
|
|
|
|
"🎞️": "film_frames",
|
|
|
|
"🎧": "headphone",
|
2023-12-02 06:54:27 +00:00
|
|
|
"📧": "email",
|
2023-12-25 11:46:33 +00:00
|
|
|
"📬": "mailbox",
|
|
|
|
"📢": "loudspeaker",
|
2023-12-25 18:08:58 +00:00
|
|
|
"🔧": "wrench",
|
|
|
|
"🫧": "bubbles"
|
2022-08-12 14:36:19 +01:00
|
|
|
}
|
|
|
|
let sizing = {
|
2023-06-07 16:41:06 +01:00
|
|
|
18: 0.8,
|
2022-08-12 14:36:19 +01:00
|
|
|
22: 0.4,
|
2022-08-19 18:54:20 +01:00
|
|
|
30: 0.7,
|
2023-10-14 17:51:53 +01:00
|
|
|
32: 0.8,
|
2023-01-29 18:17:33 +00:00
|
|
|
48: 0.9,
|
2023-07-18 20:50:51 +01:00
|
|
|
64: 0.9,
|
|
|
|
78: 0.9
|
2022-08-12 14:36:19 +01:00
|
|
|
}
|
2023-07-18 20:50:51 +01:00
|
|
|
export default function(emoji, size, disablePadding, fluent) {
|
2022-08-12 14:36:19 +01:00
|
|
|
if (!size) size = 22;
|
2023-03-09 18:41:17 +00:00
|
|
|
let padding = size !== 22 ? `margin-right:${sizing[size] ? sizing[size] : "0.4"}rem;` : false;
|
2022-08-12 14:36:19 +01:00
|
|
|
if (disablePadding) padding = 'margin-right:0!important;';
|
2023-07-18 20:50:51 +01:00
|
|
|
|
2022-08-12 14:36:19 +01:00
|
|
|
if (!names[emoji]) emoji = "❓";
|
2023-07-18 20:50:51 +01:00
|
|
|
|
|
|
|
let filePath = `emoji/${names[emoji]}.svg`;
|
|
|
|
if (fluent) filePath = `emoji/3d/${names[emoji]}.svg`;
|
2024-01-12 23:51:15 +00:00
|
|
|
return `<img class="emoji" draggable=false height="${size}" width="${size}" ${padding ? `style="${padding}" ` : ''}alt="${emoji}" src="${filePath}" loading="lazy">`
|
2022-08-12 14:36:19 +01:00
|
|
|
}
|