mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
This commit is contained in:
parent
55f02dde40
commit
73544bf297
7 changed files with 19 additions and 7 deletions
|
|
@ -11,6 +11,7 @@
|
|||
--b3-theme-surface-light: rgba(243, 243, 243, .86);
|
||||
--b3-theme-surface-lighter: #e0e0e0;
|
||||
--b3-theme-error: #d23f31;
|
||||
--b3-theme-success: #65b84d;
|
||||
|
||||
/* 文字颜色 */
|
||||
--b3-theme-on-primary: #fff;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "daylight",
|
||||
"author": "Vanessa",
|
||||
"url": "https://github.com/Vanessa219",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"modes": [
|
||||
"light"
|
||||
]
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
--b3-theme-surface-light: rgba(41, 42, 45, .86);
|
||||
--b3-theme-surface-lighter: rgba(230, 230, 230, .06);
|
||||
--b3-theme-error: #d23f31;
|
||||
--b3-theme-success: #65b84d;
|
||||
|
||||
/* 文字颜色 */
|
||||
--b3-theme-on-primary: #fff;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "midnight",
|
||||
"author": "Vanessa",
|
||||
"url": "https://github.com/Vanessa219",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"modes": [
|
||||
"dark"
|
||||
]
|
||||
|
|
|
|||
|
|
@ -175,6 +175,10 @@
|
|||
color: var(--b3-theme-primary);
|
||||
}
|
||||
|
||||
&__success {
|
||||
color: var(--b3-theme-success);
|
||||
}
|
||||
|
||||
&__secondary {
|
||||
color: var(--b3-theme-secondary);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,11 @@ import {resize} from "../protyle/util/resize";
|
|||
import {setStorageVal} from "../protyle/util/compatibility";
|
||||
|
||||
const genCardCount = (unreviewedNewCardCount: number, unreviewedOldCardCount: number,) => {
|
||||
return `<span>${unreviewedNewCardCount}</span> + <span>${unreviewedOldCardCount}</span>`;
|
||||
return `<span class="ft__error">1</span>
|
||||
<span class="fn__space"></span>/<span class="fn__space"></span>
|
||||
<span class="ariaLabel ft__primary" aria-label="${window.siyuan.languages.flashcardNewCard}">${unreviewedNewCardCount}</span>
|
||||
<span class="fn__space"></span>+<span class="fn__space"></span>
|
||||
<span class="ariaLabel ft__success" aria-label="${window.siyuan.languages.flashcardReviewCard}">${unreviewedOldCardCount}</span>`;
|
||||
}
|
||||
|
||||
export const genCardHTML = (options: {
|
||||
|
|
@ -38,7 +42,7 @@ export const genCardHTML = (options: {
|
|||
iconsHTML = `<div class="toolbar toolbar--border">
|
||||
<svg class="toolbar__icon"><use xlink:href="#iconRiffCard"></use></svg>
|
||||
<span class="fn__flex-1 fn__flex-center toolbar__text">${window.siyuan.languages.riffCard}</span>
|
||||
<div data-type="count" class="${options.cardsData.unreviewedCount === 0 ? "fn__none" : ""}"><span>1</span>/${genCardCount(options.cardsData.unreviewedNewCardCount, options.cardsData.unreviewedOldCardCount)}</span></div>
|
||||
<div data-type="count" class="${options.cardsData.unreviewedCount === 0 ? "fn__none" : "fn__flex"}">${genCardCount(options.cardsData.unreviewedNewCardCount, options.cardsData.unreviewedOldCardCount)}</span></div>
|
||||
<svg class="toolbar__icon" data-id="${options.id || ""}" data-cardtype="${options.cardType}" data-type="filter"><use xlink:href="#iconFilter"></use></svg>
|
||||
<svg class="toolbar__icon" data-type="close"><use xlink:href="#iconCloseRound"></use></svg>
|
||||
</div>`;
|
||||
|
|
@ -50,7 +54,7 @@ export const genCardHTML = (options: {
|
|||
<span class="fn__space"></span>
|
||||
<span class="fn__flex-center">${window.siyuan.languages.riffCard}</span>`}
|
||||
<span class="fn__space fn__flex-1 resize__move" style="min-height: 100%"></span>
|
||||
<div data-type="count" class="ft__on-surface ft__smaller fn__flex-center${options.cardsData.unreviewedCount === 0 ? " fn__none" : ""}"><span>1</span>/${genCardCount(options.cardsData.unreviewedNewCardCount, options.cardsData.unreviewedOldCardCount)}</span></div>
|
||||
<div data-type="count" class="ft__on-surface ft__smaller fn__flex-center${options.cardsData.unreviewedCount === 0 ? " fn__none" : " fn__flex"}">${genCardCount(options.cardsData.unreviewedNewCardCount, options.cardsData.unreviewedOldCardCount)}</span></div>
|
||||
<div class="fn__space"></div>
|
||||
<div data-id="${options.id || ""}" data-cardtype="${options.cardType}" data-type="filter" class="block__icon block__icon--show">
|
||||
<svg><use xlink:href="#iconFilter"></use></svg>
|
||||
|
|
@ -507,8 +511,8 @@ const nextCard = (options: {
|
|||
options.actionElements[1].classList.add("fn__none");
|
||||
options.editor.protyle.element.classList.remove("fn__none");
|
||||
options.editor.protyle.element.nextElementSibling.classList.add("fn__none");
|
||||
options.countElement.firstElementChild.innerHTML = (options.index + 1).toString();
|
||||
options.countElement.classList.remove("fn__none");
|
||||
options.countElement.innerHTML = (options.index + 1).toString();
|
||||
options.countElement.parentElement.classList.remove("fn__none");
|
||||
if (options.index === 0) {
|
||||
options.actionElements[0].firstElementChild.setAttribute("disabled", "disabled");
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import {hasClosestByClassName} from "../protyle/util/hasClosest";
|
||||
import {Constants} from "../constants";
|
||||
import {hideAllElements} from "../protyle/ui/hideElements";
|
||||
|
||||
export const moveResize = (element: HTMLElement, afterCB?: (type: string) => void) => {
|
||||
element.addEventListener("mousedown", (event: MouseEvent & { target: HTMLElement }) => {
|
||||
|
|
@ -131,6 +132,7 @@ export const moveResize = (element: HTMLElement, afterCB?: (type: string) => voi
|
|||
documentSelf.ondragstart = null;
|
||||
documentSelf.onselectstart = null;
|
||||
documentSelf.onselect = null;
|
||||
hideAllElements(["gutter"])
|
||||
if (hasMove && afterCB) {
|
||||
afterCB(type);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue