mirror of
https://github.com/devon22/obsidian-mediaviewer.git
synced 2026-07-22 11:50:28 +00:00
512 lines
No EOL
9.6 KiB
CSS
512 lines
No EOL
9.6 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;
|
|
}
|
|
|
|
.media-delete-button {
|
|
position: fixed;
|
|
top: 20px;
|
|
left: 20px;
|
|
padding: 4px 8px;
|
|
background: rgba(255, 0, 0, 0.5);
|
|
border: none;
|
|
border-radius: 4px;
|
|
color: white;
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
z-index: 1002;
|
|
transition: background-color 0.3s;
|
|
}
|
|
|
|
.media-delete-button:hover {
|
|
background: rgba(255, 0, 0, 0.7);
|
|
}
|
|
|
|
/* Gallery Block */
|
|
|
|
.media-gallery-grid {
|
|
position: relative;
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
|
gap: 15px;
|
|
padding: 15px;
|
|
background: var(--background-secondary);
|
|
border-radius: 8px;
|
|
margin: 1em 0;
|
|
}
|
|
|
|
.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;
|
|
}
|
|
|
|
.cm-editor .media-gallery-grid {
|
|
pointer-events: all;
|
|
}
|
|
|
|
.container-link-area {
|
|
position: absolute;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
padding: 4px 8px;
|
|
border-radius: 4px;
|
|
z-index: 3;
|
|
white-space: nowrap;
|
|
max-width: calc(100% - 40px); /* 預留左右邊距 */
|
|
}
|
|
|
|
.container-link-area.top-left {
|
|
top: 20px;
|
|
left: 20px;
|
|
}
|
|
|
|
.container-link-area.top-right {
|
|
top: 20px;
|
|
right: 20px;
|
|
}
|
|
|
|
.container-link-area.bottom-left {
|
|
bottom: 20px;
|
|
left: 20px;
|
|
}
|
|
|
|
.container-link-area.bottom-right {
|
|
bottom: 20px;
|
|
right: 20px;
|
|
}
|
|
|
|
.container-link-area a {
|
|
color: white;
|
|
text-decoration: none;
|
|
font-size: 14px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
display: block;
|
|
}
|
|
|
|
.container-link-area a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.media-link-area {
|
|
position: absolute;
|
|
bottom: 0;
|
|
right: 0;
|
|
background: rgba(0, 0, 0, 0.7);
|
|
padding: 4px 8px;
|
|
border-top-left-radius: 4px;
|
|
z-index: 2;
|
|
max-width: 100%;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.media-link-area a {
|
|
color: white;
|
|
text-decoration: none;
|
|
font-size: 12px;
|
|
word-break: break-all;
|
|
display: block;
|
|
}
|
|
|
|
.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);
|
|
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;
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.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);
|
|
}
|
|
|
|
.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-text {
|
|
font-size: 14px;
|
|
text-align: center;
|
|
}
|
|
|
|
.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);
|
|
} |