thejusticeman_obsidian-mobi.../styles.css

349 lines
7.6 KiB
CSS

/*
Mobile Plugin Styles
Includes FAB and selection toolbar styles with mobile-friendly design
*/
/* Floating Action Button (FAB) */
.mobile-fab {
position: absolute;
bottom: calc(20px + env(safe-area-inset-bottom));
right: 20px;
width: 56px;
height: 56px;
border-radius: 50%;
background-color: var(--interactive-accent);
color: var(--text-on-accent);
border: none;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
transition:
transform 0.2s ease,
box-shadow 0.2s ease;
}
.mobile-fab:hover {
transform: scale(1.05);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}
.mobile-fab:active {
transform: scale(0.95);
}
.mobile-fab svg {
width: 24px;
height: 24px;
}
/* Selection Toolbar */
.mobile-plugin-toolbar {
display: flex;
flex-wrap: nowrap;
gap: 8px;
padding: 8px;
background-color: var(--background-primary);
border: 1px solid var(--background-modifier-border);
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
position: absolute;
bottom: calc(10px + env(safe-area-inset-bottom));
left: 10px;
/* Prevent overlap with FAB by adding padding on right */
right: 86px; /* 56px FAB width + 20px FAB right margin + 10px gap */
max-width: calc(100% - 96px); /* 86px right + 10px left */
overflow-x: auto;
overflow-y: hidden;
/* Hide scrollbar for cleaner look while still allowing scroll */
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE and Edge */
-webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
transition:
height 0.3s ease,
flex-wrap 0.3s ease,
right 0.3s ease,
max-width 0.3s ease;
/* z-index: 1000; */
}
.hidden-mobile-toolbar .mobile-toolbar,
.hidden-mobile-toolbar .mobile-toolbar-spacer {
display: none;
}
/* Expand toolbar when FAB is hidden */
.workspace-leaf-content:not(:has(.mobile-fab)) .mobile-plugin-toolbar {
right: 10px;
max-width: calc(100% - 20px);
}
/* Expanded toolbar state - allows wrapping to show more rows */
.mobile-plugin-toolbar.is-expanded {
flex-wrap: wrap;
max-height: 200px;
overflow-y: auto;
}
.mobile-plugin-toolbar::-webkit-scrollbar {
display: none; /* Chrome, Safari, Opera */
}
/* Prevent toolbar buttons from shrinking */
.mobile-plugin-toolbar > button,
.mobile-plugin-toolbar > .clickable-icon {
flex-shrink: 0;
}
.mobile-fab-dragline {
position: fixed;
height: 4px;
background-color: var(--interactive-accent);
top: 0;
left: 0;
transform-origin: 0 50%;
z-index: 101;
pointer-events: none;
transition: opacity 0.5s ease;
}
/* State classes for dragline animation */
.mobile-fab-dragline.is-fading {
opacity: 0;
height: 0;
}
/* Gesture feedback animation for FAB */
.mobile-fab.gesture-success {
background: var(--interactive-accent);
}
.mobile-fab.gesture-animating {
transition: background 2s;
}
.mobile-plugin-settings-header > .setting-item-control {
flex-wrap: wrap;
flex-direction: row;
gap: 0.5em;
justify-content: flex-start;
}
.mobile-plugin-settings-header > .setting-item-control > button {
flex-grow: 1;
}
.mobile-plugin-settings-header > .setting-item-control > button.mod-cta {
border-radius: var(--button-radius) var(--button-radius) 0 0;
}
/* Settings Drag and Drop */
.mobile-plugin-draggable-item {
cursor: grab;
}
.mobile-plugin-draggable-item.is-dragging {
opacity: 0.5;
cursor: grabbing;
}
.mobile-plugin-draggable-item.drag-over-top {
border-top: 2px solid var(--interactive-accent);
}
.mobile-plugin-draggable-item.drag-over-bottom {
border-bottom: 2px solid var(--interactive-accent);
}
/* Mobile Search View */
.mobile-search-view {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
}
.mobile-search-input-container {
position: sticky;
top: 0;
padding: 12px;
background-color: var(--background-secondary);
border-bottom: 1px solid var(--background-modifier-border);
z-index: 10;
}
.mobile-search-input {
width: 100%;
padding: 10px 12px;
/* 16px font-size prevents iOS zoom on focus */
font-size: 16px;
border: 1px solid var(--background-modifier-border);
border-radius: 8px;
background-color: var(--background-secondary);
color: var(--text-normal);
outline: none;
}
.mobile-search-input:focus {
border-color: var(--interactive-accent);
box-shadow: 0 0 0 2px var(--interactive-accent-hover);
}
.mobile-search-input::placeholder {
color: var(--text-muted);
}
.mobile-search-results-container {
flex: 1;
overflow-y: auto;
padding: 8px;
-webkit-overflow-scrolling: touch;
}
.mobile-search-result-card {
position: relative;
padding: 12px;
margin-bottom: 8px;
background-color: var(--background-secondary);
border: 1px solid var(--background-modifier-border);
border-radius: 8px;
cursor: pointer;
transition: background-color 0.15s ease;
}
.mobile-search-result-card:hover {
background-color: var(--background-modifier-hover);
}
.mobile-search-result-card:active {
background-color: var(--background-modifier-active-hover);
}
.mobile-search-result-filename {
font-weight: 600;
font-size: 14px;
color: var(--text-normal);
margin-bottom: 4px;
}
.mobile-search-result-path {
font-size: 12px;
color: var(--text-muted);
margin-bottom: 8px;
}
.mobile-search-result-preview {
font-size: 13px;
color: var(--text-muted);
line-height: 1.4;
max-height: 60px;
overflow: hidden;
text-overflow: ellipsis;
}
/* Hide markdown block elements in preview */
.mobile-search-result-preview p {
margin: 0;
display: inline;
}
.mobile-search-result-preview h1,
.mobile-search-result-preview h2,
.mobile-search-result-preview h3,
.mobile-search-result-preview h4,
.mobile-search-result-preview h5,
.mobile-search-result-preview h6 {
font-size: inherit;
font-weight: normal;
margin: 0;
display: inline;
}
.mobile-search-no-results,
.mobile-search-more-results {
text-align: center;
padding: 20px;
color: var(--text-muted);
font-size: 14px;
}
/* Preview wrapper for positioning date */
.mobile-search-result-preview-wrapper {
position: relative;
}
/* Date at bottom corner of preview */
.mobile-search-result-date {
position: absolute;
bottom: 0;
right: 0;
font-size: 11px;
color: var(--text-faint);
background: linear-gradient(
to right,
transparent,
var(--background-secondary) 20%
);
padding-left: 16px;
}
/* Selection Mode Styles */
.mobile-search-selection-bar {
position: sticky;
top: 0;
padding: 12px;
background-color: var(--background-secondary);
border-bottom: 1px solid var(--background-modifier-border);
z-index: 10;
display: none;
flex-direction: row;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
/* Style for ButtonComponent buttons in selection bar */
.mobile-search-selection-bar > button {
flex-shrink: 0;
}
/* Style for ExtraButtonComponent (more actions menu) */
.mobile-search-selection-bar > .clickable-icon {
flex-shrink: 0;
margin-left: auto;
}
.mobile-search-selection-count {
font-size: 14px;
color: var(--text-muted);
padding: 0 8px;
}
.mobile-search-result-card.is-active {
border: 1px solid var(--interactive-accent);
}
/* Selected card styling */
.mobile-search-result-card.is-selected {
border: 2px solid var(--interactive-accent);
background-color: var(--background-modifier-hover);
}
.mobile-search-result-card.is-selected::before {
content: '✓';
position: absolute;
top: 8px;
right: 8px;
width: 24px;
height: 24px;
background-color: var(--interactive-accent);
color: var(--text-on-accent);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
font-weight: bold;
}