mirror of
https://github.com/zadam/trilium.git
synced 2025-10-21 15:49:00 +02:00
feat(collection/presentation): support gradients as well
This commit is contained in:
parent
bbda8d3357
commit
d9b4f7345b
@ -178,6 +178,7 @@ function Slide({ slide }: { slide: PresentationSlideBaseModel }) {
|
|||||||
<section
|
<section
|
||||||
data-note-id={slide.noteId}
|
data-note-id={slide.noteId}
|
||||||
data-background-color={slide.backgroundColor}
|
data-background-color={slide.backgroundColor}
|
||||||
|
data-background-gradient={slide.backgroundGradient}
|
||||||
dangerouslySetInnerHTML={slide.content}
|
dangerouslySetInnerHTML={slide.content}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -13,6 +13,7 @@ export interface PresentationSlideBaseModel {
|
|||||||
noteId: string;
|
noteId: string;
|
||||||
content: DangerouslySetInnerHTML;
|
content: DangerouslySetInnerHTML;
|
||||||
backgroundColor?: string;
|
backgroundColor?: string;
|
||||||
|
backgroundGradient?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PresentationModel {
|
export interface PresentationModel {
|
||||||
@ -39,10 +40,14 @@ async function buildVerticalSlides(parentSlideNote: FNote): Promise<undefined |
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function buildSlideModel(note: FNote): Promise<PresentationSlideBaseModel> {
|
async function buildSlideModel(note: FNote): Promise<PresentationSlideBaseModel> {
|
||||||
|
const slideBackground = note.getLabelValue("slide:background") ?? undefined;
|
||||||
|
const isGradient = slideBackground?.includes("gradient(");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
noteId: note.noteId,
|
noteId: note.noteId,
|
||||||
content: await processContent(note),
|
content: await processContent(note),
|
||||||
backgroundColor: note.getLabelValue("slide:background") ?? undefined
|
backgroundColor: !isGradient ? slideBackground : undefined,
|
||||||
|
backgroundGradient: isGradient ? slideBackground : undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user