mirror of
https://github.com/zadam/trilium.git
synced 2025-10-19 06:38:59 +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
|
||||
data-note-id={slide.noteId}
|
||||
data-background-color={slide.backgroundColor}
|
||||
data-background-gradient={slide.backgroundGradient}
|
||||
dangerouslySetInnerHTML={slide.content}
|
||||
/>
|
||||
);
|
||||
|
@ -13,6 +13,7 @@ export interface PresentationSlideBaseModel {
|
||||
noteId: string;
|
||||
content: DangerouslySetInnerHTML;
|
||||
backgroundColor?: string;
|
||||
backgroundGradient?: string;
|
||||
}
|
||||
|
||||
export interface PresentationModel {
|
||||
@ -39,10 +40,14 @@ async function buildVerticalSlides(parentSlideNote: FNote): Promise<undefined |
|
||||
}
|
||||
|
||||
async function buildSlideModel(note: FNote): Promise<PresentationSlideBaseModel> {
|
||||
const slideBackground = note.getLabelValue("slide:background") ?? undefined;
|
||||
const isGradient = slideBackground?.includes("gradient(");
|
||||
|
||||
return {
|
||||
noteId: note.noteId,
|
||||
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