mirror of
https://github.com/thejusticeman/obsidian-mobile-plugin.git
synced 2026-07-22 06:40:12 +00:00
308 lines
6.4 KiB
CSS
308 lines
6.4 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-top: 1px solid var(--background-modifier-border);
|
|
padding-right: 76px;
|
|
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;
|
|
}
|
|
|
|
.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 {
|
|
padding-right: 12px;
|
|
}
|
|
|
|
/* Expanded toolbar state - allows wrapping to show more rows */
|
|
.mobile-plugin-toolbar.is-expanded {
|
|
flex-wrap: wrap;
|
|
flex: none;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.mobile-plugin-toolbar::-webkit-scrollbar {
|
|
display: none; /* Chrome, Safari, Opera */
|
|
}
|
|
|
|
.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;
|
|
}
|
|
|
|
.workspace-leaf-content .mobile-search-view {
|
|
padding: 0;
|
|
}
|
|
|
|
.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-container.hide {
|
|
display: none;
|
|
}
|
|
|
|
.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;
|
|
}
|
|
|
|
.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 {
|
|
display: none;
|
|
position: sticky;
|
|
top: 0;
|
|
padding: 12px;
|
|
background-color: var(--background-secondary);
|
|
border-bottom: 1px solid var(--background-modifier-border);
|
|
z-index: 10;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
gap: 8px;
|
|
flex-wrap: wrap;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.mobile-search-selection-bar > button.hide {
|
|
display: none;
|
|
}
|
|
|
|
.mobile-search-selection-bar.show {
|
|
display: flex;
|
|
}
|
|
|
|
/* Style for ExtraButtonComponent (more actions menu) */
|
|
.mobile-search-selection-bar > .clickable-icon:last-of-type {
|
|
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,
|
|
.mobile-search-result-card.selected {
|
|
border: 2px solid var(--interactive-accent);
|
|
background-color: var(--background-modifier-hover);
|
|
}
|
|
|
|
.mobile-search-result-card.is-selected::before,
|
|
.mobile-search-result-card.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;
|
|
}
|