Dark mode

Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
This commit is contained in:
Yukai Huang 2020-04-19 23:38:31 +08:00
parent ec01735424
commit c22ce8da60
2 changed files with 21 additions and 1 deletions

View File

@ -40,7 +40,7 @@ function findOrCreateLightboxContainer () {
switchImage(1)
})
lightBoxContainer.querySelector('.lightbox-control-close').addEventListener('click', hideContainer)
// lightBoxContainer.addEventListener('click', hideContainer)
lightBoxContainer.addEventListener('click', hideContainer)
document.body.appendChild(lightBoxContainer)
}
@ -153,6 +153,10 @@ function addImageDragListener (image) {
image.addEventListener('mouseout', () => {
moved = false
})
image.addEventListener('click', (e) => {
e.stopPropagation()
})
}
const init = () => {

View File

@ -18,6 +18,10 @@
padding: 0px 40px;
}
.night .lightbox-container {
background-color: rgba(47, 47, 47, 0.8);;
}
.lightbox-container .lightbox-control-previous,
.lightbox-container .lightbox-control-next,
.lightbox-container .lightbox-control-close {
@ -32,12 +36,24 @@
z-index: 1;
}
.night .lightbox-container .lightbox-control-previous,
.night .lightbox-container .lightbox-control-next,
.night .lightbox-container .lightbox-control-close {
color: rgba(255, 255, 255, 0.5);
}
.lightbox-container .lightbox-control-previous:hover,
.lightbox-container .lightbox-control-next:hover,
.lightbox-container .lightbox-control-close:hover {
color: rgba(130, 130, 130, 0.78);
}
.night .lightbox-container .lightbox-control-previous:hover,
.night .lightbox-container .lightbox-control-next:hover,
.night .lightbox-container .lightbox-control-close:hover {
color: rgba(255, 255, 255, 0.8);
}
.lightbox-container .lightbox-control-next,
.lightbox-container .lightbox-control-previous {
top: calc(50% - 10px);