mirror of
https://github.com/ivanhanloth/Obsidian-Article-Navigator.git
synced 2026-07-22 07:24:45 +00:00
312 lines
6.6 KiB
CSS
312 lines
6.6 KiB
CSS
/* ===== Floating buttons (scoped to each markdown view) ===== */
|
|
|
|
.article-nav-host {
|
|
position: relative;
|
|
}
|
|
|
|
.article-nav-floating-inview {
|
|
position: absolute;
|
|
pointer-events: none;
|
|
z-index: 10;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
/* Circular style — vertically centered */
|
|
.article-nav-floating-inview-circle {
|
|
top: 50%;
|
|
left: 0;
|
|
right: 0;
|
|
transform: translateY(-50%);
|
|
padding: 0 12px;
|
|
}
|
|
|
|
/* Tall rectangular style — flush with edges, full height */
|
|
.article-nav-floating-inview-tall {
|
|
top: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
}
|
|
|
|
/* Shared button base */
|
|
.article-nav-floating-btn {
|
|
pointer-events: auto;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 0;
|
|
color: var(--text-muted);
|
|
background: var(--background-secondary);
|
|
border: 1px solid var(--background-modifier-border);
|
|
transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, opacity 0.5s ease;
|
|
}
|
|
|
|
.article-nav-floating-btn.is-hidden {
|
|
opacity: 0;
|
|
pointer-events: none;
|
|
}
|
|
|
|
/* Prevent the click strip from receiving events when the button is hidden.
|
|
pointer-events: none on a parent does NOT block children in CSS, so we
|
|
must target the strip child directly. */
|
|
.article-nav-floating-btn.is-hidden .article-nav-tall-click-strip {
|
|
pointer-events: none;
|
|
}
|
|
|
|
/* Circular variant */
|
|
.article-nav-floating-btn-circle {
|
|
width: 44px;
|
|
height: 44px;
|
|
border-radius: 50%;
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
}
|
|
|
|
.article-nav-floating-btn-circle:hover {
|
|
background: var(--interactive-accent);
|
|
color: var(--text-on-accent);
|
|
transform: scale(1.08);
|
|
}
|
|
|
|
/* Tall variant */
|
|
.article-nav-floating-btn.article-nav-floating-btn-tall {
|
|
position: relative;
|
|
width: 70px;
|
|
padding: 0;
|
|
height: 100%;
|
|
border-radius: 0;
|
|
background: transparent;
|
|
outline: 1px solid transparent;
|
|
border: 1px solid transparent;
|
|
box-shadow: none;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.article-nav-floating-btn-tall.is-hovered {
|
|
color: var(--text-normal);
|
|
}
|
|
|
|
/* 30px click strip — the only interactive zone */
|
|
.article-nav-tall-click-strip {
|
|
position: absolute;
|
|
top: 0;
|
|
bottom: 0;
|
|
width: 30px;
|
|
pointer-events: auto;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
z-index: 1;
|
|
}
|
|
|
|
.article-nav-floating-prev .article-nav-tall-click-strip {
|
|
left: 0;
|
|
}
|
|
|
|
.article-nav-floating-next .article-nav-tall-click-strip {
|
|
right: 0;
|
|
}
|
|
|
|
/* Independent background div for smooth gradient opacity transition */
|
|
.article-nav-floating-btn-tall-bg {
|
|
position: absolute;
|
|
inset: 0;
|
|
opacity: 0;
|
|
pointer-events: none;
|
|
transition: opacity 0.2s ease;
|
|
}
|
|
|
|
.article-nav-floating-prev > .article-nav-floating-btn-tall-bg {
|
|
background: linear-gradient(90deg, var(--background-modifier-hover), transparent);
|
|
}
|
|
|
|
.article-nav-floating-next > .article-nav-floating-btn-tall-bg {
|
|
background: linear-gradient(270deg, var(--background-modifier-hover), transparent);
|
|
}
|
|
|
|
.article-nav-floating-btn-tall.is-hovered .article-nav-floating-btn-tall-bg {
|
|
opacity: 1;
|
|
}
|
|
|
|
/* Idle fade — apply to children, hover still wins via :hover */
|
|
.article-nav-floating-inview.is-idle .article-nav-floating-btn {
|
|
opacity: 0.12;
|
|
}
|
|
|
|
.article-nav-floating-inview.is-idle .article-nav-floating-btn-tall {
|
|
opacity: 0.18;
|
|
}
|
|
|
|
.article-nav-floating-inview .article-nav-floating-btn:hover,
|
|
.article-nav-floating-inview .article-nav-floating-btn-tall.is-hovered {
|
|
opacity: 1;
|
|
}
|
|
|
|
/* ===== Inline (VitePress style) navigation ===== */
|
|
|
|
.article-nav-inline {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 16px;
|
|
margin: 16px 0 8px 0;
|
|
padding-top: 16px;
|
|
border-top: 1px solid var(--background-modifier-border);
|
|
}
|
|
|
|
.article-nav-inline-slot {
|
|
min-width: 0;
|
|
}
|
|
|
|
/* Explicit column placement — slots always occupy their correct column
|
|
even when the other slot is absent from the DOM. */
|
|
.article-nav-inline-slot.article-nav-inline-prev {
|
|
grid-column: 1;
|
|
}
|
|
|
|
.article-nav-inline-slot.article-nav-inline-next {
|
|
grid-column: 2;
|
|
}
|
|
|
|
.article-nav-inline a.article-nav-inline-link,
|
|
.article-nav-inline .article-nav-inline-link{
|
|
display: block;
|
|
width: 100%;
|
|
padding: 12px 16px;
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 8px;
|
|
text-decoration: none;
|
|
color: var(--text-normal);
|
|
background: var(--background-primary);
|
|
transition: border-color 0.15s ease, transform 0.15s ease, color 0.15s ease, background 0.15s ease;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
/* Right-align the "Next" card content */
|
|
.article-nav-inline-next .article-nav-inline-link {
|
|
text-align: right;
|
|
}
|
|
|
|
.article-nav-inline-link:hover {
|
|
border-color: var(--interactive-accent);
|
|
color: var(--interactive-accent);
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.article-nav-inline-label {
|
|
font-size: 0.78em;
|
|
color: var(--text-muted);
|
|
margin-bottom: 4px;
|
|
letter-spacing: 0.02em;
|
|
}
|
|
|
|
.article-nav-inline-link:hover .article-nav-inline-label {
|
|
color: var(--interactive-accent);
|
|
}
|
|
|
|
.article-nav-inline-title {
|
|
font-size: 1em;
|
|
font-weight: 600;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* Keep inline + seealso aligned with editor file margins */
|
|
.markdown-source-view .article-nav-inline,
|
|
.markdown-source-view .article-nav-seealso {
|
|
margin-left: var(--file-margins, 0);
|
|
margin-right: var(--file-margins, 0);
|
|
}
|
|
|
|
/* ===== See Also section ===== */
|
|
|
|
.article-nav-seealso {
|
|
margin: 16px 0;
|
|
padding: 14px 18px;
|
|
border-radius: 8px;
|
|
background: var(--background-secondary);
|
|
border-left: 4px solid var(--interactive-accent);
|
|
}
|
|
|
|
.article-nav-seealso-top {
|
|
margin-top: 4px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.article-nav-seealso-bottom {
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.article-nav-seealso-title {
|
|
font-weight: 600;
|
|
font-size: 0.95em;
|
|
color: var(--text-normal);
|
|
margin-bottom: 6px;
|
|
letter-spacing: 0.02em;
|
|
}
|
|
|
|
.article-nav-seealso-list {
|
|
margin: 0;
|
|
padding-left: 18px;
|
|
list-style: disc;
|
|
}
|
|
|
|
.article-nav-seealso-list li {
|
|
margin: 4px 0;
|
|
}
|
|
|
|
.article-nav-seealso-link {
|
|
color: var(--link-color);
|
|
text-decoration: none;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.article-nav-seealso-link:hover {
|
|
color: var(--link-color-hover);
|
|
text-decoration: underline;
|
|
}
|
|
|
|
/* ===== Confirm modal ===== */
|
|
|
|
.article-nav-confirm-message {
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
.article-nav-confirm-buttons {
|
|
display: flex;
|
|
gap: 8px;
|
|
justify-content: flex-end;
|
|
margin-top: 16px;
|
|
}
|
|
|
|
/* Mobile tweaks */
|
|
@media (max-width: 600px) {
|
|
.article-nav-floating-inview-circle {
|
|
padding: 0 6px;
|
|
}
|
|
|
|
.article-nav-floating-btn-circle {
|
|
width: 38px;
|
|
height: 38px;
|
|
}
|
|
|
|
.article-nav-floating-btn-tall {
|
|
width: 28px;
|
|
}
|
|
|
|
.article-nav-inline {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
/* Reset explicit column placement for single-column layout */
|
|
.article-nav-inline-slot.article-nav-inline-prev,
|
|
.article-nav-inline-slot.article-nav-inline-next {
|
|
grid-column: 1;
|
|
}
|
|
|
|
.article-nav-inline-next .article-nav-inline-link {
|
|
text-align: left;
|
|
}
|
|
}
|