aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Emoji.svelte
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-02-16 00:07:13 -0600
committermat <github@matdoes.dev>2022-02-16 00:07:13 -0600
commit36bbe64db012aaed7ff0fadf083f191b122fa4ad (patch)
treed4529a64a0e2e369a642f47c9f7ef791aaf4ea8e /src/lib/Emoji.svelte
parent77679dbf69ae097cefbbcabe9c2b952d446e9677 (diff)
downloadskyblock-stats-36bbe64db012aaed7ff0fadf083f191b122fa4ad.tar.gz
skyblock-stats-36bbe64db012aaed7ff0fadf083f191b122fa4ad.tar.bz2
skyblock-stats-36bbe64db012aaed7ff0fadf083f191b122fa4ad.zip
add files
Diffstat (limited to 'src/lib/Emoji.svelte')
-rw-r--r--src/lib/Emoji.svelte25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/Emoji.svelte b/src/lib/Emoji.svelte
new file mode 100644
index 0000000..0e8f4a7
--- /dev/null
+++ b/src/lib/Emoji.svelte
@@ -0,0 +1,25 @@
+<!--
+ @component
+
+ All the emojis inside this component will be turned into Twemojis.
+-->
+<script lang="ts">
+ import { twemojiHtml } from './utils'
+
+ export let value: string
+</script>
+
+<span>
+ {@html twemojiHtml(value)}
+</span>
+
+<style>
+ :global(.emoji) {
+ position: relative;
+ /* we specify the width so it doesn't change size when the image shows up */
+ width: 1em;
+ height: 1em;
+ vertical-align: text-bottom;
+ bottom: 0.1em;
+ }
+</style>