mirror of
https://github.com/lemon695/obsidian-note-image-gallery.git
synced 2026-07-22 06:41:53 +00:00
430 lines
7.6 KiB
CSS
430 lines
7.6 KiB
CSS
/* Plugin: note-image-gallery — all classes prefixed with nig- */
|
|
|
|
.modal:has(.nig-gallery) {
|
|
--dialog-width: 90vw;
|
|
--dialog-max-width: 90vw;
|
|
--dialog-max-height: 90vh;
|
|
width: 90vw;
|
|
height: 90vh;
|
|
max-width: 90vw;
|
|
max-height: 90vh;
|
|
overflow: hidden;
|
|
padding: 0;
|
|
}
|
|
|
|
.modal:has(.nig-gallery) > .modal-close-button {
|
|
top: 12px;
|
|
right: 12px;
|
|
z-index: 10;
|
|
}
|
|
|
|
.modal-content.nig-gallery {
|
|
width: 100%;
|
|
height: 100%;
|
|
display: flex;
|
|
flex-direction: column;
|
|
padding: 0;
|
|
}
|
|
|
|
.nig-gallery {
|
|
width: 90vw;
|
|
height: 90vh;
|
|
max-width: 90vw;
|
|
max-height: 90vh;
|
|
border-radius: 12px;
|
|
overflow: hidden;
|
|
display: flex;
|
|
flex-direction: column;
|
|
padding: 0;
|
|
}
|
|
|
|
.nig-toolbar {
|
|
display: flex;
|
|
justify-content: flex-start;
|
|
align-items: center;
|
|
padding: 10px 20px;
|
|
background: var(--background-secondary);
|
|
border-bottom: 1px solid var(--background-modifier-border);
|
|
position: relative;
|
|
}
|
|
|
|
.nig-title {
|
|
font-size: 16px;
|
|
font-weight: 500;
|
|
margin-right: 15px;
|
|
}
|
|
|
|
.nig-image-wall-container {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
width: 100%;
|
|
padding: 0;
|
|
}
|
|
|
|
/* 优化瀑布流列数 */
|
|
.nig-image-wall.nig-waterfall {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
|
grid-auto-rows: 20px;
|
|
gap: 16px;
|
|
padding: 16px;
|
|
}
|
|
|
|
/* 图片项样式 */
|
|
.nig-image-item {
|
|
position: relative;
|
|
width: 100%;
|
|
cursor: pointer;
|
|
transition: all 0.3s ease;
|
|
background: var(--background-secondary);
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
|
|
.nig-image-item:hover {
|
|
transform: translateY(-4px);
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
z-index: 1;
|
|
}
|
|
|
|
.nig-image-item img {
|
|
width: 100%;
|
|
height: auto;
|
|
object-fit: cover;
|
|
border-radius: 8px;
|
|
display: block;
|
|
opacity: 0;
|
|
transition: opacity 0.3s ease;
|
|
}
|
|
|
|
/* 大图查看遮罩 */
|
|
.nig-lightbox-overlay {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: rgba(0, 0, 0, 0.85);
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
z-index: 1000;
|
|
}
|
|
|
|
.nig-lightbox-overlay img {
|
|
max-width: 90%;
|
|
max-height: 90vh;
|
|
object-fit: contain;
|
|
}
|
|
|
|
.nig-lightbox-close {
|
|
position: fixed;
|
|
top: 20px;
|
|
right: 20px;
|
|
color: white;
|
|
font-size: 32px;
|
|
cursor: pointer;
|
|
width: 40px;
|
|
height: 40px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
border-radius: 50%;
|
|
z-index: 1001;
|
|
}
|
|
|
|
/* 加载状态 */
|
|
.nig-loading-text {
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
color: var(--text-muted);
|
|
background: var(--background-secondary);
|
|
padding: 8px 16px;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
/* 错误状态 */
|
|
.nig-image-item.nig-error {
|
|
padding: 20px;
|
|
text-align: center;
|
|
color: var(--text-error);
|
|
background: var(--background-modifier-error);
|
|
min-height: 100px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
/* 响应式布局 */
|
|
@media (max-width: 768px) {
|
|
.nig-image-wall.nig-waterfall {
|
|
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
|
grid-auto-rows: 15px;
|
|
gap: 8px;
|
|
}
|
|
|
|
.nig-gallery {
|
|
width: 95vw;
|
|
height: 95vh;
|
|
}
|
|
|
|
.nig-filter-toolbar {
|
|
padding-right: 40px;
|
|
}
|
|
|
|
.nig-filter-container, .nig-sort-container {
|
|
gap: 4px;
|
|
}
|
|
|
|
.nig-filter-btn, .nig-sort-select {
|
|
padding: 2px 6px;
|
|
font-size: 11px;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 600px) {
|
|
.nig-toolbar {
|
|
flex-wrap: wrap;
|
|
padding: 8px 12px;
|
|
}
|
|
|
|
.nig-filter-toolbar {
|
|
margin-left: 0;
|
|
margin-top: 8px;
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
.nig-context-menu {
|
|
background: var(--background-primary);
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 4px;
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
z-index: 1000;
|
|
padding: 4px 0;
|
|
}
|
|
|
|
.nig-context-menu .nig-menu-item {
|
|
padding: 6px 12px;
|
|
cursor: pointer;
|
|
color: var(--text-normal);
|
|
}
|
|
|
|
.nig-context-menu .nig-menu-item:hover {
|
|
background-color: var(--background-modifier-hover);
|
|
}
|
|
|
|
/* 图片容器样式 */
|
|
.nig-lightbox-image-container {
|
|
position: relative;
|
|
max-width: 90%;
|
|
max-height: 90vh;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
|
|
.nig-lightbox-image-container img {
|
|
max-width: 100%;
|
|
max-height: 90vh;
|
|
object-fit: contain;
|
|
}
|
|
|
|
/* 导航按钮样式 */
|
|
.nig-lightbox-nav {
|
|
position: fixed;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
background: rgba(0, 0, 0, 0.5);
|
|
color: white;
|
|
padding: 16px 12px;
|
|
cursor: pointer;
|
|
font-size: 24px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
transition: all 0.3s ease;
|
|
border-radius: 4px;
|
|
z-index: 1001;
|
|
}
|
|
|
|
.nig-lightbox-nav:hover {
|
|
background: rgba(0, 0, 0, 0.8);
|
|
}
|
|
|
|
.nig-lightbox-nav.prev {
|
|
left: 20px;
|
|
}
|
|
|
|
.nig-lightbox-nav.next {
|
|
right: 20px;
|
|
}
|
|
|
|
/* 图片计数器样式 */
|
|
.nig-lightbox-counter {
|
|
position: fixed;
|
|
bottom: 20px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
background: rgba(0, 0, 0, 0.5);
|
|
color: white;
|
|
padding: 8px 16px;
|
|
border-radius: 4px;
|
|
font-size: 14px;
|
|
z-index: 1001;
|
|
}
|
|
|
|
/* 进度条样式 */
|
|
.nig-progress-container {
|
|
flex: 0 1 300px;
|
|
margin: 0 20px 0 0;
|
|
display: flex;
|
|
align-items: center;
|
|
overflow: hidden;
|
|
transition: opacity 0.5s ease, height 0.4s ease, margin 0.4s ease;
|
|
height: 20px;
|
|
}
|
|
|
|
.nig-progress-container.nig-complete {
|
|
opacity: 0;
|
|
height: 0;
|
|
margin: 0;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.nig-progress-container progress {
|
|
width: 100%;
|
|
height: 4px;
|
|
border-radius: 2px;
|
|
overflow: hidden;
|
|
appearance: none;
|
|
border: none;
|
|
background-color: rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
/* 进度条填充样式 */
|
|
.nig-progress-container progress::-webkit-progress-value {
|
|
background-color: var(--interactive-accent, #1a73e8);
|
|
transition: width 0.3s ease;
|
|
}
|
|
|
|
.nig-progress-container progress::-moz-progress-bar {
|
|
background-color: var(--interactive-accent, #1a73e8);
|
|
transition: width 0.3s ease;
|
|
}
|
|
|
|
/* 进度指示器文本 */
|
|
.nig-progress-text {
|
|
font-size: 12px;
|
|
color: var(--text-muted);
|
|
margin-left: 8px;
|
|
min-width: 50px;
|
|
text-align: right;
|
|
}
|
|
|
|
/* 在暗色主题中适应 */
|
|
.theme-dark .nig-progress-container progress {
|
|
background-color: rgba(255, 255, 255, 0.1);
|
|
}
|
|
|
|
/* 图片占位符样式 */
|
|
.nig-image-placeholder {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: var(--background-secondary);
|
|
z-index: 1;
|
|
}
|
|
|
|
/* 确保加载完成的图片显示在最上层 */
|
|
.nig-image-item img.nig-loaded {
|
|
opacity: 1;
|
|
z-index: 2;
|
|
position: relative;
|
|
}
|
|
|
|
/* 缩放控制样式 */
|
|
.nig-lightbox-controls {
|
|
position: fixed;
|
|
bottom: 60px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
background: rgba(0, 0, 0, 0.5);
|
|
padding: 8px;
|
|
border-radius: 20px;
|
|
display: flex;
|
|
gap: 12px;
|
|
}
|
|
|
|
.nig-zoom-button {
|
|
width: 32px;
|
|
height: 32px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: rgba(255, 255, 255, 0.2);
|
|
color: white;
|
|
border-radius: 50%;
|
|
cursor: pointer;
|
|
font-size: 18px;
|
|
}
|
|
|
|
.nig-zoom-button:hover {
|
|
background: rgba(255, 255, 255, 0.3);
|
|
}
|
|
|
|
/* 筛选和排序工具栏 */
|
|
.nig-filter-toolbar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 16px;
|
|
margin-left: auto;
|
|
padding-right: 50px;
|
|
}
|
|
|
|
.nig-filter-container, .nig-sort-container {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.nig-filter-btn {
|
|
background: var(--background-primary);
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 4px;
|
|
padding: 4px 8px;
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.nig-filter-btn:hover {
|
|
background: var(--background-secondary);
|
|
}
|
|
|
|
.nig-filter-btn.nig-active {
|
|
background: var(--interactive-accent);
|
|
color: var(--text-on-accent);
|
|
border-color: var(--interactive-accent);
|
|
}
|
|
|
|
.nig-sort-select {
|
|
background: var(--background-primary);
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 4px;
|
|
padding: 4px 8px;
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
}
|