feat: support custom emojis from other servers
This commit is contained in:
parent
f3a0a5af3f
commit
6d66bbbc5d
10 changed files with 40 additions and 16 deletions
|
@ -1,3 +1,5 @@
|
|||
import type { Emoji } from 'masto'
|
||||
|
||||
export function getDataUrlFromArr(arr: Uint8ClampedArray, w: number, h: number) {
|
||||
if (typeof w === 'undefined' || typeof h === 'undefined')
|
||||
w = h = Math.sqrt(arr.length / 4)
|
||||
|
@ -14,3 +16,7 @@ export function getDataUrlFromArr(arr: Uint8ClampedArray, w: number, h: number)
|
|||
|
||||
return canvas.toDataURL()
|
||||
}
|
||||
|
||||
export function emojisArrayToObject(emojis: Emoji[]) {
|
||||
return Object.fromEntries(emojis.map(i => [i.shortcode, i]))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue