mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 04:24:45 -04:00
Updates preview.
This commit is contained in:
parent
797d5bbc47
commit
2251b52f86
2 changed files with 20 additions and 7 deletions
|
@ -37,25 +37,26 @@
|
||||||
right: 8px;
|
right: 8px;
|
||||||
top: 8px;
|
top: 8px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
opacity: 0.5;
|
|
||||||
|
|
||||||
img {
|
img {
|
||||||
background-color: rgba(0,0,0,0.5);
|
background-color: rgba(0,0,0,0.5);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
width: 48px;
|
width: 48px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover, &.hover {
|
||||||
|
img {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pv-prev-area, #pv-next-area {
|
#pv-prev-area, #pv-next-area {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
opacity: 0.5;
|
|
||||||
|
|
||||||
img {
|
img {
|
||||||
background-color: rgba(0,0,0,0.5);
|
background-color: rgba(0,0,0,0.5);
|
||||||
|
@ -64,12 +65,15 @@
|
||||||
height: 48px;
|
height: 48px;
|
||||||
margin: -72px 0;
|
margin: -72px 0;
|
||||||
padding: 48px 0;
|
padding: 48px 0;
|
||||||
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover, &.hover {
|
||||||
|
img {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pv-prev-area {
|
#pv-prev-area {
|
||||||
left: 8px;
|
left: 8px;
|
||||||
|
|
|
@ -117,23 +117,32 @@ modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'cor
|
||||||
|
|
||||||
onKeydown = function (event) {
|
onKeydown = function (event) {
|
||||||
|
|
||||||
var key = event.which;
|
var key = event.which,
|
||||||
|
delay = 300;
|
||||||
|
|
||||||
if (key === 27) { // esc
|
if (key === 27) { // esc
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
|
$('#pv-bar-close, #pv-close-area').addClass('hover');
|
||||||
|
setTimeout(function () { $('#pv-bar-close, #pv-close-area').removeClass('hover'); }, delay);
|
||||||
onExit();
|
onExit();
|
||||||
} else if (key === 8 || key === 37) { // backspace, left
|
} else if (key === 8 || key === 37) { // backspace, left
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
|
$('#pv-bar-prev, #pv-prev-area').addClass('hover');
|
||||||
|
setTimeout(function () { $('#pv-bar-prev, #pv-prev-area').removeClass('hover'); }, delay);
|
||||||
onPrevious();
|
onPrevious();
|
||||||
} else if (key === 13 || key === 32 || key === 39) { // enter, space, right
|
} else if (key === 13 || key === 32 || key === 39) { // enter, space, right
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
|
$('#pv-bar-next, #pv-next-area').addClass('hover');
|
||||||
|
setTimeout(function () { $('#pv-bar-next, #pv-next-area').removeClass('hover'); }, delay);
|
||||||
onNext();
|
onNext();
|
||||||
} else if (key === 70) { // f
|
} else if (key === 70) { // f
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
|
$('#pv-bar-fullscreen').addClass('hover');
|
||||||
|
setTimeout(function () { $('#pv-bar-fullscreen').removeClass('hover'); }, delay);
|
||||||
onFullscreen();
|
onFullscreen();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue