adjust font size

This commit is contained in:
Pete Matsyburka
2025-07-14 12:53:15 +03:00
committed by GitHub
parent 0310c26edd
commit 1f338dfd2b
21 changed files with 173 additions and 54 deletions
+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')
}
}