devon22_obsidian-mediaviewer/styles.css
2025-02-18 15:41:40 +08:00

622 lines
12 KiB
CSS

/* FullScreenModal */
.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;
}
.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;
}
/* 自定義滾動條樣式 */
.gallery-content::-webkit-scrollbar {
width: 8px;
}
.gallery-content::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.1);
border-radius: 4px;
}
.gallery-content::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.3);
border-radius: 4px;
}
.gallery-content::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.5);
}
.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;
}
.gallery-close-button:hover {
background: #edf5ff;
}
.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;
}
.media-thumbnail-container:hover {
transform: scale(1.05);
}
.media-thumbnail-container img,
.media-thumbnail-container video {
width: 100%;
height: 100%;
object-fit: cover;
}
.media-thumbnail {
position: relative;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.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);
}
.video-indicator svg {
width: 20px;
height: 20px;
}
.delete-button {
position: absolute;
top: 8px;
right: 8px;
width: 24px;
height: 24px;
background: rgba(255, 0, 0, 0.7);
border: none;
border-radius: 50%;
color: white;
font-size: 16px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
opacity: 0;
transition: opacity 0.2s;
}
.media-thumbnail-container:hover .delete-button {
opacity: 1;
}
.delete-button:hover {
background: rgba(255, 0, 0, 0.9);
}
.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;
}
.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;
}
.media-nav-area:hover {
opacity: 0.3;
background: rgba(255, 255, 255, 0.0);
}
.prev-area {
left: 0;
}
.next-area {
right: 0;
}
.full-image,
.full-video {
width: 100%;
height: 100%;
object-fit: contain;
}
.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;
}
.media-close-button:hover {
background: #edf5ff;
}
.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;
}
.image-info-panel.fade {
opacity: 0;
}
.image-info-panel:hover {
opacity: 1;
}
.image-info-panel a {
color: var(text-warning);
padding: 0 4px;
}
.image-info-panel a:hover {
color: white;
background: rgba(255, 0, 0, 0.5);
border-radius: 2px;
}
/* Gallery Block */
.media-container {
border-radius: 8px;
overflow: hidden;
margin: 1em 0;
}
.media-gallery-grid {
position: relative;
display: grid;
gap: 15px;
padding: 15px;
background-color: var(--background-primary);
border-radius: 8px;
}
.gallery-controls {
display: flex;
justify-content: center;
align-items: center;
margin-top: 5px;
}
.pagination {
display: flex;
align-items: center;
gap: 10px;
}
.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;
}
.gallery-control-button:hover:not(:disabled) {
background-color: var(--interactive-accent-hover);
}
.gallery-control-button:disabled {
background-color: var(--background-modifier-border);
cursor: not-allowed;
opacity: 0.7;
}
.page-info {
font-size: 14px;
color: var(--text-muted);
margin: 0 5px;
}
.add-image-button {
background-color: var(--interactive-success);
margin-left: 15px;
}
.add-image-button:hover {
background-color: var(--interactive-success-hover);
}
.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;
}
.add-media-button:hover {
border-color: var(--text-accent);
background: var(--background-modifier-hover);
}
.add-media-icon {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
color: var(--text-muted);
}
.add-media-button:hover .add-media-icon {
color: var(--text-accent);
}
.add-media-icon svg {
width: 32px;
height: 32px;
}
.add-media-text {
font-size: 14px;
text-align: center;
}
.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;
}
.container-link-area a {
color: var(--text-normal);
text-decoration: none;
}
.container-link-area a:hover {
color: var(--text-accent);
text-decoration: underline;
}
.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 */
.media-gallery-grid.size-small {
gap: 15px;
padding: 15px;
}
/* Gallery Block - Medium (Default) */
.media-gallery-grid.size-medium {
gap: 15px;
padding: 15px;
}
/* Gallery Block - Large */
.media-gallery-grid.size-large {
gap: 15px;
padding: 15px;
}
.media-gallery-grid .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;
}
.media-gallery-grid .media-thumbnail-container:hover {
transform: scale(1.05);
}
.media-gallery-grid .media-thumbnail-container img,
.media-gallery-grid .media-thumbnail-container video {
width: 100%;
height: 100%;
object-fit: cover;
}
.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;
}
.media-thumbnail-container:hover .media-link-area {
opacity: 1;
}
.media-link-area a {
color: white;
text-decoration: none;
}
.media-link-area a:hover {
text-decoration: underline;
}
.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);
}
.video-indicator svg {
width: 20px;
height: 20px;
fill: currentColor;
}
.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%;
}
.note-preview {
text-align: center;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
gap: 10px;
}
.note-thumbnail-image {
max-width: 100%;
max-height: calc(100% - 50px); /* 預留標題空間 */
object-fit: contain;
}
.note-icon {
margin: auto 0;
transition: transform 0.2s;
flex-grow: 1;
display: flex;
align-items: center;
}
.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;
}
.note-icon {
margin-bottom: 10px;
transition: transform 0.2s;
}
.note-icon svg {
width: 40px;
height: 40px;
color: var(--text-muted);
}
.note-icon.external-link svg {
color: var(--text-accent);
}
.note-thumbnail:hover .note-title {
color: var(--text-accent);
}
.note-thumbnail:hover {
background: var(--background-modifier-hover);
}
/* 外部連結的特殊樣式 */
.note-thumbnail.external-link {
background: var(--background-primary-alt);
}
.note-thumbnail.external-link:hover {
background: var(--background-modifier-hover);
}
.pagination {
display: flex;
align-items: center;
gap: 10px;
margin: 10px 0;
float: right;
}
.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;
}
.pagination button:hover {
background-color: var(--interactive-accent);
color: var(--text-on-accent);
}
.pagination button:disabled {
border-color: var(--text-muted);
color: var(--text-muted);
cursor: not-allowed;
}
.pagination button:disabled:hover {
background-color: var(--background-primary);
color: var(--text-muted);
}
.page-info {
color: var(--text-muted);
font-size: 0.9em;
}
.upload-modal {
padding: 20px;
}
.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;
}
.upload-dropzone.drag-over {
border-color: var(--text-accent);
background: var(--background-modifier-hover);
}
.upload-instructions {
color: var(--text-muted);
margin-bottom: 10px;
}
.upload-icon svg {
width: 48px;
height: 48px;
color: var(--text-muted);
margin-bottom: 10px;
}
.media-gallery-grid.drag-over {
border: 2px dashed var(--interactive-accent);
background-color: var(--background-modifier-hover);
}