mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-18 20:19:30 -07:00
now creation of image element can be achieved by createImgElement function in utils.ts
This commit is contained in:
@@ -79,3 +79,12 @@ export const center = (e: HTMLDivElement): void => {
|
||||
e.style.top = 'calc((100% - 31px) / 2 + 31px)'
|
||||
}
|
||||
}
|
||||
|
||||
export function createImgElement(input: ImageData): HTMLImageElement {
|
||||
const img = document.createElement('img')
|
||||
img.setAttribute('src', input.url)
|
||||
img.setAttribute('alt', input.index)
|
||||
img.setAttribute('height', input.imgH)
|
||||
img.setAttribute('width', input.imgW)
|
||||
return img
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user