diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.css b/apps/client/src/widgets/collections/legacy/ListOrGridView.css index ef609c1d0d..d393c2496b 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.css +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.css @@ -100,50 +100,111 @@ overflow: auto; } -.note-expander { - font-size: x-large; - cursor: pointer; - opacity: .65; -} - .note-list-pager { text-align: center; } -.note-list.list-view .note-path { - margin-left: 0.5em; - vertical-align: middle; - opacity: 0.5; +@keyframes note-preview-show { + from { + opacity: 0; + } to { + opacity: 1; + } } -:root .list-view-card { +.nested-note-list { --card-nested-section-indent: 40px; -} -.note-list h5 { - display: flex; - align-items: center; - font-size: 1em; - margin: 0; + h5 { + display: flex; + align-items: center; + font-size: 1em; + font-weight: normal; + margin: 0; - .tn-icon { - color: var(--left-pane-icon-color); - margin-inline-end: 8px; - font-size: 1.2em; + .note-expander { + font-size: x-large; + cursor: pointer; + opacity: .65; + margin-inline-end: 4px; + } + + .tn-icon { + color: var(--left-pane-icon-color); + margin-inline-end: 8px; + font-size: 1.2em; + } + + .note-book-title { + color: inherit; + font-weight: normal; + } + + .note-path { + margin-left: 0.5em; + vertical-align: middle; + opacity: 0.5; + order: -1; + } + + .note-list-attributes { + flex-grow: 1; + text-align: right; + font-size: .75em; + opacity: .75; + } } - .note-book-title { - color: inherit; - } + .note-book-content { + --background: rgba(0, 0, 0, .2); + outline: 1px solid var(--background); + border-radius: 8px; + background-color: var(--background); + overflow: hidden; + user-select: text; + animation: note-preview-show .25s ease-out; + will-change: opacity; - .note-list-attributes { - flex-grow: 1; - text-align: right; - font-size: .75em; - opacity: .75; + > .rendered-content > *:last-child { + margin-bottom: 0; + } + + &.type-text { + padding: 8px 24px; + + .ck-content > *:last-child { + margin-bottom: 0; + } + } + + &.type-protectedSession { + padding: 20px; + } + + &.type-image { + padding: 0; + } + + &.type-pdf { + iframe { + height: 50vh; + } + + .file-footer { + padding: 8px; + } + } + + &.type-webView { + display: flex; + flex-direction: column; + justify-content: center; + min-height: 50vh; + } } } + .note-content-preview:has(.note-book-content:empty) { display: none; } diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx index 6bf77c644f..a1bbd6916d 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx @@ -15,6 +15,7 @@ import NoteLink from "../../react/NoteLink"; import { ViewModeProps } from "../interface"; import { Pager, usePagination } from "../Pagination"; import { filterChildNotes, useFilteredNoteIds } from "./utils"; +import { JSX } from "preact/jsx-runtime"; export function ListView({ note, noteIds: unfilteredNoteIds, highlightedTokens }: ViewModeProps<{}>) { const expandDepth = useExpansionDepth(note); @@ -34,7 +35,7 @@ export function ListView({ note, noteIds: unfilteredNoteIds, highlightedTokens } { noteIds.length > 0 &&