forked from olcxjas-softworks/LarpixClient
better vc ui
This commit is contained in:
parent
dd08cc88ae
commit
bc91533262
6 changed files with 826 additions and 270 deletions
|
|
@ -1461,8 +1461,8 @@ function showFixedContextMenu(rect, html) {
|
|||
|
||||
fixedContextMenu.style.transition = 'none';
|
||||
fixedContextMenu.style.opacity = '0';
|
||||
fixedContextMenu.style.left = '0px';
|
||||
fixedContextMenu.style.top = '0px';
|
||||
fixedContextMenu.style.left = '0rem';
|
||||
fixedContextMenu.style.top = '0rem';
|
||||
|
||||
fixedContextMenu.classList.add("show");
|
||||
|
||||
|
|
@ -3139,7 +3139,7 @@ async function generateMessagesHtml(entries, isPinnedContext = false) {
|
|||
let safeType = encodeURIComponent(att.type).replace(/'/g, "%27");
|
||||
let safeName = encodeURIComponent(att.name).replace(/'/g, "%27");
|
||||
|
||||
attachmentsHtml += `<div id="${attContainerId}" class="attachment-box" style="position: relative; min-width: 120px; max-width: 300px; min-height: 100px; max-height: 300px; background: rgba(0,0,0,0.2); border: 1px solid var(--border-color); border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden;" onclick="event.stopPropagation(); downloadAndRenderAttachment(this, '${msgId}', '${att.id}', decodeURIComponent('${safeType}'), decodeURIComponent('${safeName}'), '${msg.key || "0"}')">
|
||||
attachmentsHtml += `<div id="${attContainerId}" class="attachment-box" style="position: relative; min-width: 7.5rem; max-width: 18.75rem; min-height: 6.25rem; max-height: 18.75rem; background: rgba(0,0,0,0.2); border: 0.0625rem solid var(--border-color); border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden;" onclick="event.stopPropagation(); downloadAndRenderAttachment(this, '${msgId}', '${att.id}', decodeURIComponent('${safeType}'), decodeURIComponent('${safeName}'), '${msg.key || "0"}')">
|
||||
<div style="padding: 1rem; text-align: center; color: var(--text-color);">
|
||||
${iconSvg}
|
||||
<div style="font-size: 0.8rem; margin-top: 0.5rem; word-break: break-all;">${escapeHtml(displayName)}</div>
|
||||
|
|
@ -3653,12 +3653,12 @@ async function downloadAndRenderAttachment(container, msgId, attId, type, name,
|
|||
container.dataset.url = blobUrl;
|
||||
|
||||
if (type.startsWith("image/")) {
|
||||
container.innerHTML = `<img src="${blobUrl}" style="max-width: 100%; max-height: 300px; display: block;" onclick="window.open('${blobUrl}', '_blank')">`;
|
||||
container.innerHTML = `<img src="${blobUrl}" style="max-width: 100%; max-height: 18.75rem; display: block;" onclick="window.open('${blobUrl}', '_blank')">`;
|
||||
} else if (type.startsWith("video/")) {
|
||||
container.innerHTML = `<video src="${blobUrl}" controls style="max-width: 100%; max-height: 300px; display: block;"></video>`;
|
||||
container.innerHTML = `<video src="${blobUrl}" controls style="max-width: 100%; max-height: 18.75rem; display: block;"></video>`;
|
||||
} else {
|
||||
container.innerHTML = originalHtml;
|
||||
container.style.border = "1px solid var(--accent-color)";
|
||||
container.style.border = "0.0625rem solid var(--accent-color)";
|
||||
let a = document.createElement("a");
|
||||
a.href = blobUrl;
|
||||
a.download = name;
|
||||
|
|
@ -3716,7 +3716,7 @@ function renderAttachmentsPreview() {
|
|||
}
|
||||
|
||||
html += `
|
||||
<div style="display: flex; align-items: center; gap: 0.8rem; background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: var(--border-width) solid rgba(255, 255, 255, 0.1); padding: 0.5rem 0.5rem 0.5rem 1rem; border-radius: 0.75rem; flex-shrink: 0; max-width: 15.625rem; box-shadow: 0 0.25rem 0.375rem rgba(0,0,0,0.1); transition: transform 0.2s ease;">
|
||||
<div style="display: flex; align-items: center; gap: 0.8rem; background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(0.625rem); -webkit-backdrop-filter: blur(0.625rem); border: var(--border-width) solid rgba(255, 255, 255, 0.1); padding: 0.5rem 0.5rem 0.5rem 1rem; border-radius: 0.75rem; flex-shrink: 0; max-width: 15.625rem; box-shadow: 0 0.25rem 0.375rem rgba(0,0,0,0.1); transition: transform 0.2s ease;">
|
||||
<div style="flex-shrink: 0; color: var(--accent-color); display: flex; align-items: center;">${iconHtml}</div>
|
||||
<div style="font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-color); font-weight: 500; flex-grow: 1;">${escapeHtml(file.name)}</div>
|
||||
<button onclick="removeDraftAttachment(${index})" style="background: transparent; color: var(--text-color); border: none; width: 1.5rem; height: 1.5rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0.125rem; opacity: 0.6; transition: opacity 0.2s;" onmouseover="this.style.opacity='1'" onmouseout="this.style.opacity='0.6'">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue