mirror of
https://github.com/devon22/obsidian-mediaviewer.git
synced 2026-07-22 11:50:28 +00:00
580 lines
No EOL
11 KiB
CSS
580 lines
No EOL
11 KiB
CSS
.mv-media-viewer-modal {
|
|
padding: 0;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
width: 100vw !important;
|
|
height: 100vh !important;
|
|
max-width: 100vw !important;
|
|
max-height: 100vh !important;
|
|
position: fixed !important;
|
|
top: 0 !important;
|
|
left: 0 !important;
|
|
margin: 0 !important;
|
|
border-radius: 0 !important;
|
|
display: flex !important;
|
|
align-items: center !important;
|
|
justify-content: center !important;
|
|
overflow: auto !important;
|
|
}
|
|
|
|
.mv-gallery-content {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
|
gap: 15px;
|
|
padding: 20px;
|
|
justify-content: center;
|
|
width: 100%;
|
|
margin: auto;
|
|
border-radius: 8px;
|
|
}
|
|
|
|
/* 自定義滾動條樣式 */
|
|
.mv-gallery-content::-webkit-scrollbar {
|
|
width: 8px;
|
|
}
|
|
|
|
.mv-gallery-content::-webkit-scrollbar-track {
|
|
background: rgba(255, 255, 255, 0.1);
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.mv-gallery-content::-webkit-scrollbar-thumb {
|
|
background: rgba(255, 255, 255, 0.3);
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.mv-gallery-content::-webkit-scrollbar-thumb:hover {
|
|
background: rgba(255, 255, 255, 0.5);
|
|
}
|
|
|
|
.mv-gallery-close-button {
|
|
position: fixed;
|
|
top: 15px;
|
|
right: 15px;
|
|
width: 40px;
|
|
height: 40px;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
border: none;
|
|
border-radius: 50%;
|
|
color: white;
|
|
font-size: 24px;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
z-index: 1001;
|
|
transition: background-color 0.3s;
|
|
}
|
|
|
|
.mv-gallery-close-button:hover {
|
|
background: #edf5ff;
|
|
}
|
|
|
|
.mv-media-thumbnail-container {
|
|
aspect-ratio: 1;
|
|
overflow: hidden;
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
transition: transform 0.2s;
|
|
background: var(--background-primary);
|
|
position: relative;
|
|
margin: 0;
|
|
}
|
|
|
|
.mv-media-thumbnail-container:hover {
|
|
transform: scale(1.05);
|
|
}
|
|
|
|
.mv-media-thumbnail-container img,
|
|
.mv-media-thumbnail-container video {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: cover;
|
|
}
|
|
|
|
.mv-media-thumbnail {
|
|
position: relative;
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.mv-video-indicator {
|
|
position: absolute;
|
|
top: 8px;
|
|
left: 8px;
|
|
width: 32px;
|
|
height: 32px;
|
|
background: rgba(0, 0, 0, 0.6);
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: white;
|
|
z-index: 1;
|
|
backdrop-filter: blur(2px);
|
|
}
|
|
|
|
.mv-video-indicator svg {
|
|
width: 20px;
|
|
height: 20px;
|
|
fill: currentColor;
|
|
}
|
|
|
|
.mv-full-media-view {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
z-index: 1000;
|
|
overflow-x: hidden;
|
|
}
|
|
|
|
.mv-media-nav-area {
|
|
position: absolute;
|
|
top: 20%;
|
|
height: 70%;
|
|
width: 10%;
|
|
z-index: 1001;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
opacity: 0.1;
|
|
transition: opacity 0.3s;
|
|
}
|
|
|
|
.mv-media-nav-area:hover {
|
|
opacity: 0.3;
|
|
background: rgba(255, 255, 255, 0.0);
|
|
}
|
|
|
|
.mv-prev-area {
|
|
left: 0;
|
|
}
|
|
|
|
.mv-next-area {
|
|
right: 0;
|
|
}
|
|
|
|
.mv-full-image,
|
|
.mv-full-video {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: contain;
|
|
}
|
|
|
|
.mv-media-close-button {
|
|
position: fixed;
|
|
top: 15px;
|
|
right: 15px;
|
|
width: 40px;
|
|
height: 40px;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
border: none;
|
|
border-radius: 50%;
|
|
color: white;
|
|
font-size: 24px;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
z-index: 1002;
|
|
transition: background-color 0.3s;
|
|
}
|
|
|
|
.mv-media-close-button:hover {
|
|
background: #edf5ff;
|
|
}
|
|
|
|
.mv-image-info-panel {
|
|
position: fixed;
|
|
top: 15px;
|
|
left: 15px;
|
|
background: rgba(0, 0, 0, 0.7);
|
|
padding: 7px 14px;
|
|
border-radius: 5px;
|
|
color: white;
|
|
font-size: 14px;
|
|
z-index: 1001;
|
|
opacity: 1;
|
|
transition: opacity 0.3s ease;
|
|
}
|
|
|
|
.mv-info-item {
|
|
display: inline-block;
|
|
margin-right: 10px;
|
|
}
|
|
|
|
.mv-info-item:last-child {
|
|
margin-right: 0;
|
|
}
|
|
|
|
.mv-info-filename {
|
|
cursor: text;
|
|
}
|
|
|
|
.mv-info-dimensions {
|
|
margin-left: 10px;
|
|
}
|
|
|
|
.mv-image-info-panel.fade {
|
|
opacity: 0;
|
|
}
|
|
|
|
.mv-image-info-panel:hover {
|
|
opacity: 1;
|
|
}
|
|
|
|
.mv-image-info-panel a {
|
|
color: var(text-warning);
|
|
padding: 0 4px;
|
|
}
|
|
|
|
.mv-image-info-panel a:hover {
|
|
color: white;
|
|
background: rgba(255, 0, 0, 0.5);
|
|
border-radius: 2px;
|
|
}
|
|
|
|
/* Gallery Block */
|
|
|
|
.mvgb-media-container {
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
margin: 1em 0;
|
|
}
|
|
|
|
.mvgb-media-gallery-grid {
|
|
position: relative;
|
|
display: grid;
|
|
gap: 15px;
|
|
padding: 15px;
|
|
background-color: var(--background-primary);
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.mvgb-gallery-controls {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
margin-top: 5px;
|
|
}
|
|
|
|
.mvgb-pagination {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
|
|
.mvgb-gallery-control-button {
|
|
background-color: var(--interactive-accent);
|
|
color: var(--text-on-accent);
|
|
border: none;
|
|
padding: 6px 12px;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
font-size: 14px;
|
|
transition: background-color 0.2s ease;
|
|
}
|
|
|
|
.mvgb-gallery-control-button:hover:not(:disabled) {
|
|
background-color: var(--interactive-accent-hover);
|
|
}
|
|
|
|
.mvgb-gallery-control-button:disabled {
|
|
background-color: var(--background-modifier-border);
|
|
cursor: not-allowed;
|
|
opacity: 0.7;
|
|
}
|
|
|
|
.mvgb-page-info {
|
|
color: var(--text-muted);
|
|
margin: 0 5px;
|
|
font-size: 0.9em;
|
|
}
|
|
|
|
.mvgb-add-image-button {
|
|
background-color: var(--interactive-success);
|
|
margin-left: 15px;
|
|
}
|
|
|
|
.mvgb-add-image-button:hover {
|
|
background-color: var(--interactive-success-hover);
|
|
}
|
|
|
|
.mvgb-add-media-button {
|
|
border: 2px dashed var(--text-faint);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: var(--background-primary-alt);
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.mvgb-add-media-button:hover {
|
|
border-color: var(--text-accent);
|
|
background: var(--background-modifier-hover);
|
|
}
|
|
|
|
.mvgb-add-media-icon {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 10px;
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.mvgb-add-media-button:hover .mvgb-add-media-icon {
|
|
color: var(--text-accent);
|
|
}
|
|
|
|
.mvgb-add-media-icon svg {
|
|
width: 32px;
|
|
height: 32px;
|
|
}
|
|
|
|
.mvgb-add-media-text {
|
|
font-size: 14px;
|
|
text-align: center;
|
|
}
|
|
|
|
.mvgb-container-link-area {
|
|
display: inline-block;
|
|
position: relative;
|
|
color: var(--text-normal);
|
|
background: var(--background-secondary);
|
|
padding: 10px 15px 2px 15px;
|
|
white-space: nowrap;
|
|
border-radius: 8px 8px 0 0;
|
|
}
|
|
|
|
.mvgb-container-link-area a {
|
|
color: var(--text-normal);
|
|
text-decoration: none;
|
|
}
|
|
|
|
.mvgb-container-link-area a:hover {
|
|
color: var(--text-accent);
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.mvgb-media-gallery-grid {
|
|
position: relative;
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
|
gap: 15px;
|
|
padding: 15px;
|
|
background: var(--background-secondary);
|
|
}
|
|
|
|
/* Gallery Block - Small */
|
|
.mvgb-media-gallery-grid.size-small {
|
|
gap: 15px;
|
|
padding: 15px;
|
|
}
|
|
|
|
/* Gallery Block - Medium (Default) */
|
|
.mvgb-media-gallery-grid.size-medium {
|
|
gap: 15px;
|
|
padding: 15px;
|
|
}
|
|
|
|
/* Gallery Block - Large */
|
|
.mvgb-media-gallery-grid.size-large {
|
|
gap: 15px;
|
|
padding: 15px;
|
|
}
|
|
|
|
.mvgb-media-gallery-grid .mv-media-thumbnail-container {
|
|
aspect-ratio: 1;
|
|
overflow: hidden;
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
transition: transform 0.2s;
|
|
background: var(--background-primary);
|
|
position: relative;
|
|
margin: 0;
|
|
}
|
|
|
|
.mvgb-media-gallery-grid .mv-media-thumbnail-container:hover {
|
|
transform: scale(1.05);
|
|
}
|
|
|
|
.mvgb-media-gallery-grid .mv-media-thumbnail-container img,
|
|
.mvgb-media-gallery-grid .mv-media-thumbnail-container video {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: cover;
|
|
}
|
|
|
|
.mvgb-media-gallery-grid.drag-over {
|
|
border: 2px dashed var(--interactive-accent);
|
|
background-color: var(--background-modifier-hover);
|
|
}
|
|
|
|
.mvgb-media-link-area {
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
padding: 8px;
|
|
background: rgba(0, 0, 0, 0.7);
|
|
color: white;
|
|
font-size: 12px;
|
|
opacity: 0;
|
|
transition: opacity 0.2s ease;
|
|
}
|
|
|
|
.mv-media-thumbnail-container:hover .mvgb-media-link-area {
|
|
opacity: 1;
|
|
}
|
|
|
|
.mvgb-media-link-area a {
|
|
color: white;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.mvgb-media-link-area a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.mvgb-note-thumbnail {
|
|
background: var(--background-primary-alt);
|
|
border: 1px solid var(--background-modifier-border);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 15px;
|
|
height: 100%;
|
|
}
|
|
|
|
.mvgb-note-preview {
|
|
text-align: center;
|
|
width: 100%;
|
|
height: 100%;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 10px;
|
|
}
|
|
|
|
.mvgb-note-thumbnail-image {
|
|
max-width: 100%;
|
|
max-height: calc(100% - 50px); /* 預留標題空間 */
|
|
object-fit: contain;
|
|
}
|
|
|
|
.mvgb-note-icon {
|
|
margin: auto 0;
|
|
transition: transform 0.2s;
|
|
flex-grow: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
margin-bottom: 10px;
|
|
transition: transform 0.2s;
|
|
}
|
|
|
|
.mvgb-note-title {
|
|
font-size: 14px;
|
|
color: var(--text-normal);
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
display: -webkit-box;
|
|
-webkit-line-clamp: 2;
|
|
-webkit-box-orient: vertical;
|
|
width: 100%;
|
|
margin-top: auto;
|
|
}
|
|
|
|
.mvgb-note-icon svg {
|
|
width: 40px;
|
|
height: 40px;
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.mvgb-note-icon.external-link svg {
|
|
color: var(--text-accent);
|
|
}
|
|
|
|
.mvgb-note-thumbnail:hover .mvgb-note-title {
|
|
color: var(--text-accent);
|
|
}
|
|
|
|
.mvgb-note-thumbnail:hover {
|
|
background: var(--background-modifier-hover);
|
|
}
|
|
|
|
/* 外部連結的特殊樣式 */
|
|
.mvgb-note-thumbnail.external-link {
|
|
background: var(--background-primary-alt);
|
|
}
|
|
|
|
.mvgb-note-thumbnail.external-link:hover {
|
|
background: var(--background-modifier-hover);
|
|
}
|
|
|
|
.mvgb-pagination {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
margin: 10px 0;
|
|
float: right;
|
|
}
|
|
|
|
.mvgb-pagination button {
|
|
padding: 4px 8px;
|
|
border: 1px solid var(--interactive-accent);
|
|
border-radius: 4px;
|
|
background-color: var(--background-primary);
|
|
color: var(--text-normal);
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.mvgb-pagination button:hover {
|
|
background-color: var(--interactive-accent);
|
|
color: var(--text-on-accent);
|
|
}
|
|
|
|
.mvgb-pagination button:disabled {
|
|
border-color: var(--text-muted);
|
|
color: var(--text-muted);
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.mvgb-pagination button:disabled:hover {
|
|
background-color: var(--background-primary);
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.mvgb-upload-modal {
|
|
padding: 20px;
|
|
}
|
|
|
|
.mvgb-upload-dropzone {
|
|
border: 3px dashed var(--text-muted);
|
|
border-radius: 10px;
|
|
padding: 40px;
|
|
text-align: center;
|
|
background: var(--background-primary-alt);
|
|
margin-bottom: 20px;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.mvgb-upload-dropzone.drag-over {
|
|
border-color: var(--text-accent);
|
|
background: var(--background-modifier-hover);
|
|
}
|
|
|
|
.mvgb-upload-instructions {
|
|
color: var(--text-muted);
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.mvgb-upload-icon svg {
|
|
width: 48px;
|
|
height: 48px;
|
|
color: var(--text-muted);
|
|
margin-bottom: 10px;
|
|
} |