fix: 🎨 use image ratio for imagefeed

This commit is contained in:
melMass
2023-07-28 22:14:22 +02:00
parent cbcacbe3c9
commit f5cd56ce86
+10 -4
View File
@@ -227,7 +227,7 @@ app.registerExtension({
Object.assign(img.style, {
width: '100%',
height: '100%',
objectFit: 'scale-down',
objectFit: 'cover',
})
img.src = `/view?filename=${encodeURIComponent(src.filename)}&type=${
@@ -238,6 +238,10 @@ app.registerExtension({
console.debug(img.src)
img.onload = () => {
but.style.width = `${120 * (img.naturalWidth / img.naturalHeight)}px`
}
but.onclick = () => {
lightboxContainer.style.display = 'flex'
// add the same image to the lightbox
@@ -284,9 +288,11 @@ app.registerExtension({
if (history.outputs) {
for (const key of Object.keys(history.outputs)) {
console.debug(key)
for (const im of history.outputs[key].images) {
console.debug(im)
createImageBtn(im)
if (history.outputs[key].images) {
for (const im of history.outputs[key].images) {
console.debug(im)
createImageBtn(im)
}
}
}
// for (const src of outputs.outputs.images) {