mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-26 22:51:03 +03:00
fix(web-test): showImage scaling and full preset improvements
- Use min-width/min-height 50% to upscale small images (was showing tiny 225px images at native size instead of scaling up) - Keep max-width/max-height 92% for large images (no regression) - Change full preset from cover to contain — no content cropping, black bars instead of cutting off edges Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
18ad662378
commit
9d6ceae4f1
@@ -4253,7 +4253,7 @@ export async function showImage(imagePath, opts = {}) {
|
|||||||
blur: { bg: '#222', fit: 'contain', shadow: true, blur: true },
|
blur: { bg: '#222', fit: 'contain', shadow: true, blur: true },
|
||||||
dark: { bg: '#2a2a2a', fit: 'contain', shadow: true, blur: false },
|
dark: { bg: '#2a2a2a', fit: 'contain', shadow: true, blur: false },
|
||||||
light: { bg: '#ffffff', fit: 'contain', shadow: true, blur: false },
|
light: { bg: '#ffffff', fit: 'contain', shadow: true, blur: false },
|
||||||
full: { bg: '#000', fit: 'cover', shadow: false, blur: false },
|
full: { bg: '#000', fit: 'contain', shadow: false, blur: false },
|
||||||
};
|
};
|
||||||
const preset = presets[style] || presets.blur;
|
const preset = presets[style] || presets.blur;
|
||||||
|
|
||||||
@@ -4316,7 +4316,7 @@ export async function showImage(imagePath, opts = {}) {
|
|||||||
const shadowCss = shadow ? 'box-shadow:0 4px 40px rgba(0,0,0,0.5);' : '';
|
const shadowCss = shadow ? 'box-shadow:0 4px 40px rgba(0,0,0,0.5);' : '';
|
||||||
const sizeCss = isFull
|
const sizeCss = isFull
|
||||||
? `width:100%;height:100%;object-fit:${fit};`
|
? `width:100%;height:100%;object-fit:${fit};`
|
||||||
: `max-width:${maxSize};max-height:${maxSize};object-fit:${fit};`;
|
: `max-width:${maxSize};max-height:${maxSize};min-width:50%;min-height:50%;object-fit:${fit};`;
|
||||||
html += `<img src="${dataUrl}" style="position:relative;${sizeCss}${shadowCss}" />`;
|
html += `<img src="${dataUrl}" style="position:relative;${sizeCss}${shadowCss}" />`;
|
||||||
|
|
||||||
div.innerHTML = html;
|
div.innerHTML = html;
|
||||||
|
|||||||
Reference in New Issue
Block a user