mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 01:50:12 +01:00
💄 bazaar
This commit is contained in:
parent
9e9fa6fd2e
commit
37abb9628d
2 changed files with 18 additions and 25 deletions
|
|
@ -34,37 +34,32 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&__img {
|
&__img {
|
||||||
width: 100px;
|
margin: 16px 0 16px 16px;
|
||||||
height: 100px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
img {
|
img {
|
||||||
height: 100%;
|
height: 54px;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
|
border-radius: 4px;
|
||||||
|
width: 54px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__info {
|
&__info {
|
||||||
padding: 8px 16px;
|
padding: 16px 16px 4px;
|
||||||
white-space: nowrap;
|
}
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
|
|
||||||
a {
|
&__desc {
|
||||||
color: var(--b3-theme-on-background);
|
color: var(--b3-theme-on-surface);
|
||||||
|
font-size: 12px;
|
||||||
&:hover {
|
margin-top: 4px;
|
||||||
color: var(--b3-theme-on-surface);
|
height: 36px;
|
||||||
}
|
@include text-clamp(2);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&__actions {
|
&__actions {
|
||||||
padding: 0 16px 8px 16px;
|
padding: 0 16px 14px 16px;
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 36px;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -183,8 +183,7 @@ export const bazaar = {
|
||||||
<div class="fn__flex-1 fn__flex-column">
|
<div class="fn__flex-1 fn__flex-column">
|
||||||
<div class="b3-card__info fn__flex-1">
|
<div class="b3-card__info fn__flex-1">
|
||||||
${item.preferredName} <span class="ft__on-surface ft__smaller">${item.name}</span>
|
${item.preferredName} <span class="ft__on-surface ft__smaller">${item.name}</span>
|
||||||
<div class="fn__hr"></div>
|
<div class="b3-card__desc">
|
||||||
<div class="ft__smaller ft__on-surface fn__ellipsis">
|
|
||||||
${item.preferredDesc || ""}
|
${item.preferredDesc || ""}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -254,8 +253,7 @@ export const bazaar = {
|
||||||
<div class="fn__flex-1 fn__flex-column">
|
<div class="fn__flex-1 fn__flex-column">
|
||||||
<div class="b3-card__info fn__flex-1">
|
<div class="b3-card__info fn__flex-1">
|
||||||
${item.preferredName} <span class="ft__on-surface ft__smaller">${item.name}</span>
|
${item.preferredName} <span class="ft__on-surface ft__smaller">${item.name}</span>
|
||||||
<div class="fn__hr"></div>
|
<div class="b3-card__desc">${item.preferredDesc || ""}</div>
|
||||||
<div class="ft__smaller ft__on-surface fn__ellipsis">${item.preferredDesc || ""}</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="b3-card__actions">
|
<div class="b3-card__actions">
|
||||||
${item.preferredFunding ? `<a target="_blank" href="${item.preferredFunding}" data-type="a" class="block__icon block__icon--show" aria-label="${window.siyuan.languages.sponsor} ${item.preferredFunding}"><svg class="ft__pink"><use xlink:href="#iconHeart"></use></svg></a>` : ""}
|
${item.preferredFunding ? `<a target="_blank" href="${item.preferredFunding}" data-type="a" class="block__icon block__icon--show" aria-label="${window.siyuan.languages.sponsor} ${item.preferredFunding}"><svg class="ft__pink"><use xlink:href="#iconHeart"></use></svg></a>` : ""}
|
||||||
|
|
@ -780,14 +778,14 @@ export const bazaar = {
|
||||||
} else if (localSort[bazaarType.replace("s", "")] === "2") { // 下载次数降序
|
} else if (localSort[bazaarType.replace("s", "")] === "2") { // 下载次数降序
|
||||||
html = "";
|
html = "";
|
||||||
Array.from(element.querySelectorAll(".b3-card")).sort((a, b) => {
|
Array.from(element.querySelectorAll(".b3-card")).sort((a, b) => {
|
||||||
return parseInt(b.querySelector(".b3-card__info").lastElementChild.textContent) < parseInt(a.querySelector(".b3-card__info").lastElementChild.textContent) ? -1 : 1;
|
return JSON.parse(b.getAttribute("data-obj")).downloads < JSON.parse(a.getAttribute("data-obj")).downloads ? -1 : 1;
|
||||||
}).forEach((item) => {
|
}).forEach((item) => {
|
||||||
html += item.outerHTML;
|
html += item.outerHTML;
|
||||||
});
|
});
|
||||||
} else if (localSort[bazaarType.replace("s", "")] === "3") { // 下载次数升序
|
} else if (localSort[bazaarType.replace("s", "")] === "3") { // 下载次数升序
|
||||||
html = "";
|
html = "";
|
||||||
Array.from(element.querySelectorAll(".b3-card")).sort((a, b) => {
|
Array.from(element.querySelectorAll(".b3-card")).sort((a, b) => {
|
||||||
return parseInt(b.querySelector(".b3-card__info").lastElementChild.textContent) < parseInt(a.querySelector(".b3-card__info").lastElementChild.textContent) ? 1 : -1;
|
return JSON.parse(b.getAttribute("data-obj")).downloads < JSON.parse(a.getAttribute("data-obj")).downloads ? 1 : -1;
|
||||||
}).forEach((item) => {
|
}).forEach((item) => {
|
||||||
html += item.outerHTML;
|
html += item.outerHTML;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue