Vanessa 2025-06-11 15:02:00 +08:00
parent 543355f657
commit 0bbd9699b0
4 changed files with 23 additions and 8 deletions

View file

@ -317,6 +317,7 @@
border-radius: var(--b3-border-radius) var(--b3-border-radius) 0 0;
overflow: hidden;
transition: background 100ms ease-out;
position: relative;
}
&-img {
@ -330,11 +331,21 @@
}
&-content {
white-space: break-spaces;
word-break: break-word;
margin: 8px 8px 0;
font-size: 12px;
color: var(--b3-theme-on-surface);
transform: scale(0.85);
left: 0;
right: 0;
transform-origin: 0 0;
& ~ div {
position: absolute;
content: "";
left: 0;
height: 100%;
width: 100%;
top: 0;
}
}
&-fields {

View file

@ -2283,7 +2283,7 @@ export class Gutter {
let hideParent = false;
while (nodeElement) {
let parentElement = hasClosestBlock(nodeElement.parentElement);
if (!isInEmbedBlock(nodeElement) && !isInAVBlock(nodeElement)) {
if (!isInEmbedBlock(nodeElement)) {
let type;
if (!hideParent) {
type = nodeElement.getAttribute("data-type");

View file

@ -71,11 +71,15 @@ export const renderGallery = (options: {
galleryHTML += `<div class="av__gallery-item${selectItemIds.includes(item.id) ? " av__gallery-item--select" : ""}">`;
if (view.coverFrom !== 0) {
if (item.coverURL) {
galleryHTML += `<div class="av__gallery-cover"><div class="av__gallery-img${view.fitImage ? " av__gallery-img--fit" : ""}" style="background-image:url('${item.coverURL}')"></div></div>`;
if (item.coverURL.startsWith("background")) {
galleryHTML += `<div class="av__gallery-cover"><div class="av__gallery-img${view.fitImage ? " av__gallery-img--fit" : ""}" style="${item.coverURL}"></div></div>`;
} else {
galleryHTML += `<div class="av__gallery-cover"><div class="av__gallery-img${view.fitImage ? " av__gallery-img--fit" : ""}" style="background-image:url('${item.coverURL}')"></div></div>`;
}
} else if (item.coverContent) {
galleryHTML += `<div class="av__gallery-cover"><div class="av__gallery-content">${item.coverContent}</div></div>`;
galleryHTML += `<div class="av__gallery-cover"><div class="av__gallery-content">${item.coverContent}</div><div></div></div>`;
} else {
galleryHTML += `<div class="av__gallery-cover"></div>`;
galleryHTML += '<div class="av__gallery-cover"></div>';
}
}

View file

@ -124,7 +124,7 @@ export const isInEmbedBlock = (element: Element) => {
};
export const isInAVBlock = (element: Element) => {
if (hasClosestByClassName(element, 'av__gallery-cover')) {
if (hasClosestByClassName(element, "av__gallery-cover")) {
return hasClosestByClassName(element, "av");
}
return false;