adjust font size

This commit is contained in:
Pete Matsyburka authored and GitHub committed 2025-07-14 12:53:15 +03:00
1 parent 0310c26edd
commit 1f338dfd2b
21 files changed
+173 -54

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
export default class extends HTMLElement {
connectedCallback () {
this.image.addEventListener('load', (e) => {
this.image.setAttribute('width', e.target.naturalWidth)
this.image.setAttribute('height', e.target.naturalHeight)
this.style.aspectRatio = `${e.target.naturalWidth} / ${e.target.naturalHeight}`
})
}
get image () {
return this.querySelector('img')
}
}