mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-16 21:29:58 +00:00
25 lines
765 B
JavaScript
25 lines
765 B
JavaScript
const names = {
|
|
"🎶": "musical_notes",
|
|
"🎬": "clapper_board",
|
|
"💰": "money_bag",
|
|
"🎉": "party_popper",
|
|
"❓": "red_question_mark",
|
|
"✨": "sparkles",
|
|
"🪅": "pinata",
|
|
"🪄": "magic_wand",
|
|
"🐲": "dragon_face",
|
|
"💸": "money_with_wings",
|
|
"⚙️": "gear"
|
|
}
|
|
let sizing = {
|
|
22: 0.4,
|
|
30: 0.7
|
|
}
|
|
export default function(emoji, size, disablePadding) {
|
|
if (!size) size = 22;
|
|
let padding = size != 22 ? `margin-right:${sizing[size] ? sizing[size] : "0.4"}rem;` : ``;
|
|
if (disablePadding) padding = 'margin-right:0!important;';
|
|
if (!names[emoji]) emoji = "❓";
|
|
return `<img class="emoji" height="${size}" width="${size}" style="${padding}" alt="${emoji}" src="emoji/${names[emoji]}.svg">`
|
|
}
|