Flask-Files/app/static/css/browser.css
2025-03-24 20:34:42 +01:00

878 lines
No EOL
15 KiB
CSS

.browser-container {
background: var(--card-bg);
border-radius: var(--border-radius);
padding: 1.5rem;
margin-bottom: 2rem;
box-shadow: var(--shadow-sm);
}
.browser-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
flex-wrap: wrap;
gap: 1rem;
}
.browser-title {
display: flex;
align-items: center;
gap: 0.5rem;
}
.browser-actions {
display: flex;
gap: 0.5rem;
align-items: center;
}
.breadcrumbs {
display: flex;
flex-wrap: wrap;
margin-bottom: 1.5rem;
background: var(--bg-light);
padding: 0.5rem 1rem;
border-radius: var(--border-radius-sm);
}
.breadcrumb-item {
display: flex;
align-items: center;
}
.breadcrumb-separator {
margin: 0 0.5rem;
color: var(--text-muted);
}
.view-toggle {
display: flex;
border: 1px solid var(--border-color);
border-radius: var(--border-radius-sm);
overflow: hidden;
margin-left: 0.5rem;
}
.view-btn {
border: none;
background: var(--card-bg);
padding: 0.5rem;
cursor: pointer;
color: var(--text-muted);
}
.view-btn.active {
background: var(--primary-color);
color: white;
}
.filter-bar {
display: flex;
margin-bottom: 1rem;
gap: 0.5rem;
flex-wrap: wrap;
}
.search-bar {
flex-grow: 1;
position: relative;
}
.search-bar input {
width: 100%;
padding: 0.5rem 1rem 0.5rem 2.5rem;
border: 1px solid var(--border-color);
border-radius: var(--border-radius-sm);
background: var(--bg-light);
}
.search-icon {
position: absolute;
left: 0.75rem;
top: 0.75rem;
color: var(--text-muted);
pointer-events: none;
}
.sort-dropdown {
position: relative;
}
.sort-dropdown-btn {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
border: 1px solid var(--border-color);
border-radius: var(--border-radius-sm);
background: var(--bg-light);
cursor: pointer;
}
.sort-dropdown-menu {
position: absolute;
top: 100%;
right: 0;
background: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: var(--border-radius-sm);
min-width: 200px;
z-index: 10;
box-shadow: var(--shadow-md);
display: none;
margin-top: 0.25rem;
}
.sort-dropdown-menu.show {
display: block;
}
.sort-option {
padding: 0.5rem 1rem;
cursor: pointer;
}
.sort-option:hover {
background: var(--bg-hover);
}
.sort-option.active {
color: var(--primary-color);
font-weight: 500;
}
.files-container {
min-height: 200px;
position: relative;
}
.loading-indicator {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(var(--card-bg-rgb), 0.7);
display: flex;
align-items: center;
justify-content: center;
z-index: 5;
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease;
}
.loading-indicator.show {
opacity: 1;
pointer-events: auto;
}
.spinner {
width: 40px;
height: 40px;
border: 4px solid rgba(var(--primary-color-rgb), 0.3);
border-radius: 50%;
border-top-color: var(--primary-color);
animation: spin 1s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
/* Grid view */
.files-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
gap: 1rem;
}
.folder-item,
.file-item {
display: flex;
flex-direction: column;
padding: 1rem;
border-radius: var(--border-radius-sm);
border: 1px solid var(--border-color);
transition: all 0.2s ease;
position: relative;
text-decoration: none;
color: var(--text-color);
}
.folder-item:hover,
.file-item:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-sm);
background: var(--bg-hover);
}
.item-icon {
font-size: 3rem;
margin-bottom: 0.75rem;
text-align: center;
color: var(--primary-color);
}
.folder-item .item-icon {
color: #ffc107;
}
.item-info {
flex: 1;
display: flex;
flex-direction: column;
}
.item-name {
font-weight: 500;
margin-bottom: 0.25rem;
word-break: break-word;
text-align: center;
}
.item-details {
display: flex;
justify-content: space-between;
font-size: 0.85rem;
color: var(--text-muted);
text-align: center;
}
/* List view */
.files-list {
display: flex;
flex-direction: column;
}
.list-view .folder-item,
.list-view .file-item {
flex-direction: row;
align-items: center;
padding: 0.75rem 1rem;
margin-bottom: 0.5rem;
}
.list-view .item-icon {
font-size: 1.5rem;
margin-bottom: 0;
margin-right: 1rem;
width: 1.5rem;
text-align: center;
}
.list-view .item-info {
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.list-view .item-name {
margin-bottom: 0;
text-align: left;
}
.list-view .item-details {
margin-left: auto;
min-width: 200px;
justify-content: flex-end;
}
.list-view .item-date {
margin-left: 1rem;
}
/* Empty folder state */
.empty-folder {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 3rem 1rem;
text-align: center;
}
.empty-icon {
font-size: 3rem;
color: var(--text-muted);
margin-bottom: 1rem;
}
.empty-message h3 {
margin-bottom: 0.5rem;
font-weight: 500;
}
.empty-message p {
color: var(--text-muted);
margin-bottom: 1.5rem;
}
.empty-actions {
display: flex;
gap: 0.5rem;
}
/* Context menu */
.context-menu {
position: fixed;
background: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: var(--border-radius-sm);
box-shadow: var(--shadow-md);
z-index: 100;
min-width: 180px;
padding: 0.5rem 0;
}
.context-menu-item {
padding: 0.5rem 1rem;
cursor: pointer;
display: flex;
align-items: center;
gap: 0.5rem;
}
.context-menu-item:hover {
background: var(--bg-hover);
}
.context-menu-item.danger {
color: var(--danger-color);
}
/* Responsive */
@media (max-width: 768px) {
.browser-header {
flex-direction: column;
align-items: flex-start;
}
.browser-actions {
width: 100%;
justify-content: space-between;
}
.filter-bar {
flex-direction: column;
}
.files-grid {
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.list-view .item-info {
flex-direction: column;
align-items: flex-start;
}
.list-view .item-details {
margin-left: 0;
margin-top: 0.25rem;
}
}
/* Modal fixes - ensure they're hidden by default */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 1000;
overflow: auto;
justify-content: center;
align-items: center;
}
.modal.visible {
display: flex;
}
.modal-content {
background: var(--card-bg);
border-radius: var(--border-radius);
width: 100%;
max-width: 500px;
box-shadow: var(--shadow-lg);
margin: 2rem;
}
/* File Browser Styles */
.browser-container {
background: var(--card-bg);
border-radius: var(--border-radius-md);
box-shadow: var(--shadow-md);
padding: 1.5rem;
margin-bottom: 2rem;
}
.browser-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
}
.browser-actions {
display: flex;
gap: 0.5rem;
align-items: center;
}
.view-toggle {
display: flex;
border: 1px solid var(--border-color);
border-radius: var(--border-radius-sm);
overflow: hidden;
margin-left: 0.5rem;
}
.view-btn {
background: var(--card-bg);
border: none;
padding: 0.5rem 0.75rem;
cursor: pointer;
transition: all 0.2s ease;
}
.view-btn:hover {
background: var(--bg-hover);
}
.view-btn.active {
background: var(--primary-color);
color: white;
}
.breadcrumbs {
display: flex;
flex-wrap: wrap;
align-items: center;
margin-bottom: 1.5rem;
padding: 0.75rem;
background: var(--bg-alt);
border-radius: var(--border-radius-sm);
}
.breadcrumb-item {
color: var(--text-color);
text-decoration: none;
padding: 0.25rem 0.5rem;
border-radius: var(--border-radius-sm);
transition: background 0.2s ease;
}
.breadcrumb-item:hover {
background: var(--bg-hover);
}
.breadcrumb-separator {
margin: 0 0.25rem;
color: var(--text-muted);
}
.loading-spinner {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 3rem;
color: var(--text-muted);
}
.loading-spinner i {
font-size: 2rem;
margin-bottom: 1rem;
}
.files-grid {
display: grid;
gap: 1rem;
}
.grid-view {
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.list-view {
grid-template-columns: 1fr;
}
.folder-item,
.file-item {
display: flex;
flex-direction: column;
text-decoration: none;
color: var(--text-color);
background: var(--bg-alt);
border-radius: var(--border-radius-sm);
transition: all 0.2s ease;
overflow: hidden;
position: relative;
}
.list-view .folder-item,
.list-view .file-item {
flex-direction: row;
align-items: center;
padding: 0.75rem;
}
.folder-item:hover,
.file-item:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-md);
}
.item-icon {
display: flex;
align-items: center;
justify-content: center;
font-size: 2.5rem;
padding: 1.5rem 0;
background: var(--card-bg);
}
.list-view .item-icon {
font-size: 1.5rem;
padding: 0.5rem;
margin-right: 1rem;
background: none;
}
.folder-item .item-icon {
color: var(--folder-color, #f8d775);
}
.item-info {
padding: 0.75rem;
flex: 1;
}
.item-name {
font-weight: 500;
margin-bottom: 0.25rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.item-details {
display: flex;
justify-content: space-between;
font-size: 0.8rem;
color: var(--text-muted);
}
.empty-folder {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 4rem 1rem;
text-align: center;
color: var(--text-muted);
}
.empty-icon {
font-size: 4rem;
margin-bottom: 1.5rem;
opacity: 0.5;
}
.empty-message h3 {
margin-bottom: 0.5rem;
}
/* Modal Styles */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 1000;
overflow-y: auto;
animation: fadeIn 0.3s ease;
}
.modal.active {
display: flex;
align-items: center;
justify-content: center;
}
.modal-content {
background: var(--card-bg);
border-radius: var(--border-radius-md);
box-shadow: var(--shadow-lg);
width: 90%;
max-width: 500px;
max-height: 90vh;
overflow-y: auto;
position: relative;
animation: modalIn 0.3s ease;
}
.modal-lg {
max-width: 800px;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1.25rem 1.5rem;
border-bottom: 1px solid var(--border-color);
}
.modal-close {
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
color: var(--text-muted);
transition: color 0.2s ease;
}
.modal-close:hover {
color: var(--text-color);
}
.modal-body {
padding: 1.5rem;
}
.modal-footer {
padding: 1.25rem 1.5rem;
border-top: 1px solid var(--border-color);
display: flex;
justify-content: space-between;
align-items: center;
}
/* File Preview Styles */
.image-preview,
.pdf-preview,
.video-preview {
display: flex;
justify-content: center;
align-items: center;
max-height: 60vh;
overflow: hidden;
border-radius: var(--border-radius-sm);
}
.image-preview img {
max-width: 100%;
max-height: 60vh;
object-fit: contain;
}
.pdf-preview iframe,
.video-preview video {
width: 100%;
height: 60vh;
border: none;
}
.audio-preview {
display: flex;
justify-content: center;
padding: 2rem 0;
}
.text-preview {
max-height: 60vh;
overflow: auto;
background: var(--code-bg);
border-radius: var(--border-radius-sm);
}
.text-preview pre {
margin: 0;
padding: 1rem;
white-space: pre-wrap;
word-wrap: break-word;
font-family: monospace;
}
.file-details {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.detail-item {
display: flex;
align-items: baseline;
}
.detail-label {
font-weight: 500;
min-width: 70px;
}
.no-preview {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 4rem 2rem;
text-align: center;
color: var(--text-muted);
}
.no-preview i {
font-size: 4rem;
margin-bottom: 1.5rem;
opacity: 0.5;
}
.error-message {
color: var(--error-color);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 3rem 2rem;
text-align: center;
}
.error-message i {
font-size: 3rem;
margin-bottom: 1rem;
}
/* Animations */
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes modalIn {
from {
opacity: 0;
transform: translateY(-20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.fade-out {
animation: fadeOut 0.3s forwards;
}
@keyframes fadeOut {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
/* Responsive Adjustments */
@media (max-width: 768px) {
.grid-view {
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.browser-header {
flex-direction: column;
align-items: flex-start;
}
.browser-actions {
margin-top: 1rem;
}
}
/* Selection box */
.selection-box {
position: fixed;
background-color: rgba(var(--primary-rgb), 0.2);
border: 1px solid var(--primary-color);
z-index: 100;
pointer-events: none;
}
/* Selected item styling */
.file-item.selected,
.folder-item.selected {
background-color: rgba(var(--primary-rgb), 0.1);
border: 1px solid var(--primary-color);
}
/* Dragging item styling */
.file-item.dragging,
.folder-item.dragging {
opacity: 0.6;
}
/* Drag target styling */
.folder-item.drag-over {
background-color: rgba(var(--primary-rgb), 0.2);
border: 2px dashed var(--primary-color);
}
/* Selection action bar */
.selection-actions {
display: none;
position: fixed;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
background-color: var(--card-bg);
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
padding: 10px 15px;
z-index: 1000;
animation: slide-up 0.3s ease;
}
.selection-actions.active {
display: flex;
align-items: center;
}
.selection-count {
margin-right: 15px;
color: var(--text-color);
font-weight: 500;
}
.selection-actions .action-btn {
margin-left: 5px;
padding: 8px 12px;
font-size: 14px;
}
@keyframes slide-up {
from {
transform: translate(-50%, 20px);
opacity: 0;
}
to {
transform: translate(-50%, 0);
opacity: 1;
}
}