mirror of
https://github.com/BlueSkyXN/WorkerJS_CloudFlare_ImageBed.git
synced 2024-11-16 11:42:33 +08:00
20240326-1443
This commit is contained in:
parent
032ecd5eef
commit
9e4ff3b9e9
|
@ -17,11 +17,17 @@
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
flex-grow: 1; /* 使复制按钮填充剩余空间 */
|
||||||
|
}
|
||||||
|
.preview-container {
|
||||||
|
max-width: calc(100% - 100px); /* 图片预览容器的最大宽度为外部框架宽度减去按钮的宽度 */
|
||||||
|
max-height: calc(8 * 50px); /* 最大高度不超过8个上传按钮的高度 */
|
||||||
|
overflow: hidden; /* 超出部分隐藏 */
|
||||||
}
|
}
|
||||||
.preview-img {
|
.preview-img {
|
||||||
max-height: calc(8 * 50px); /* 最大高度不超过8个上传按钮的高度 */
|
max-width: 100%; /* 图片预览的最大宽度为容器宽度 */
|
||||||
max-width: 100%; /* 横向不超过外部框架的大小 */
|
height: auto; /* 自适应高度 */
|
||||||
margin-top: 10px;
|
display: block; /* 防止图片下面产生空白 */
|
||||||
}
|
}
|
||||||
.copy-button {
|
.copy-button {
|
||||||
width: auto;
|
width: auto;
|
||||||
|
@ -96,16 +102,12 @@
|
||||||
resultItem.innerHTML = `
|
resultItem.innerHTML = `
|
||||||
<button class="btn btn-success mr-2 copy-button" onclick="copyUrl(this)">复制URL</button>
|
<button class="btn btn-success mr-2 copy-button" onclick="copyUrl(this)">复制URL</button>
|
||||||
<span class="mr-2">${file.name}</span>
|
<span class="mr-2">${file.name}</span>
|
||||||
|
<div class="preview-container">
|
||||||
|
<img src="${data}" class="preview-img">
|
||||||
|
</div>
|
||||||
<input type="text" class="form-control" value="${data}" readonly>
|
<input type="text" class="form-control" value="${data}" readonly>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
if (enablePreview) {
|
|
||||||
const preview = document.createElement('img');
|
|
||||||
preview.src = data;
|
|
||||||
preview.className = 'preview-img';
|
|
||||||
resultItem.appendChild(preview);
|
|
||||||
}
|
|
||||||
|
|
||||||
resultContainer.appendChild(resultItem);
|
resultContainer.appendChild(resultItem);
|
||||||
resultContainer.style.display = 'flex';
|
resultContainer.style.display = 'flex';
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user