Updates preview.
This commit is contained in:
parent
72c7b32a94
commit
797d5bbc47
2 changed files with 44 additions and 45 deletions
|
@ -34,11 +34,21 @@
|
||||||
|
|
||||||
#pv-close-area {
|
#pv-close-area {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
right: 8px;
|
||||||
top: 0;
|
top: 8px;
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
opacity: 0.5;
|
||||||
|
|
||||||
|
img {
|
||||||
|
background-color: rgba(0,0,0,0.5);
|
||||||
|
border-radius: 8px;
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#pv-prev-area, #pv-next-area {
|
#pv-prev-area, #pv-next-area {
|
||||||
|
@ -46,14 +56,14 @@
|
||||||
top: 50%;
|
top: 50%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
.transition(all 0.2s ease-in-out);
|
|
||||||
|
|
||||||
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;
|
||||||
margin: -24px 0;
|
margin: -72px 0;
|
||||||
|
padding: 48px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
@ -135,4 +145,18 @@
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background-color: rgb(27,27,27);
|
background-color: rgb(27,27,27);
|
||||||
border-top: 1px solid rgb(45,45,45);
|
border-top: 1px solid rgb(45,45,45);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#pv-overlay.fullscreen {
|
||||||
|
|
||||||
|
#pv-bottombar {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 700px) {
|
||||||
|
#pv-prev-area, #pv-next-area, #pv-close-area {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,12 +6,12 @@ modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'cor
|
||||||
}, allsettings['preview']),
|
}, allsettings['preview']),
|
||||||
|
|
||||||
template = '<div id="pv-overlay" class="noSelection">' +
|
template = '<div id="pv-overlay" class="noSelection">' +
|
||||||
'<div id="pv-close-area"/>' +
|
|
||||||
'<div id="pv-content"/>' +
|
'<div id="pv-content"/>' +
|
||||||
'<div id="pv-spinner"><img src="' + resource.image('spinner') + '"/></div>' +
|
'<div id="pv-spinner"><img src="' + resource.image('spinner') + '"/></div>' +
|
||||||
'<div id="pv-prev-area"><img src="' + resource.image('preview/prev') + '"/></div>' +
|
'<div id="pv-prev-area" class="hof"><img src="' + resource.image('preview/prev') + '"/></div>' +
|
||||||
'<div id="pv-next-area"><img src="' + resource.image('preview/next') + '"/></div>' +
|
'<div id="pv-next-area" class="hof"><img src="' + resource.image('preview/next') + '"/></div>' +
|
||||||
'<div id="pv-bottombar" class="clearfix">' +
|
'<div id="pv-close-area" class="hof"><img src="' + resource.image('preview/close') + '"/></div>' +
|
||||||
|
'<div id="pv-bottombar" class="clearfix hof">' +
|
||||||
'<ul id="pv-buttons">' +
|
'<ul id="pv-buttons">' +
|
||||||
'<li id="pv-bar-close" class="bar-right bar-button"><img src="' + resource.image('preview/close') + '"/></li>' +
|
'<li id="pv-bar-close" class="bar-right bar-button"><img src="' + resource.image('preview/close') + '"/></li>' +
|
||||||
'<li id="pv-bar-raw" class="bar-right"><a class="bar-button" target="_blank"><img src="' + resource.image('preview/raw') + '"/></a></li>' +
|
'<li id="pv-bar-raw" class="bar-right"><a class="bar-button" target="_blank"><img src="' + resource.image('preview/raw') + '"/></a></li>' +
|
||||||
|
@ -91,17 +91,17 @@ modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'cor
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
fsTimer = null,
|
userAliveTimeoutId = null,
|
||||||
onMouseMove = function () {
|
userAlive = function () {
|
||||||
|
|
||||||
clearTimeout(fsTimer);
|
clearTimeout(userAliveTimeoutId);
|
||||||
$('#pv-bottombar, #pv-prev-area, #pv-next-area').fadeIn(200);
|
$('#pv-overlay .hof').stop(true, true).fadeIn(200);
|
||||||
|
|
||||||
if (isFullscreen) {
|
if (isFullscreen) {
|
||||||
|
|
||||||
fsTimer = setTimeout(function () {
|
userAliveTimeoutId = setTimeout(function () {
|
||||||
|
|
||||||
$('#pv-bottombar, #pv-prev-area, #pv-next-area').fadeOut(400);
|
$('#pv-overlay .hof').stop(true, true).fadeOut(2000);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -111,7 +111,7 @@ modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'cor
|
||||||
isFullscreen = !isFullscreen;
|
isFullscreen = !isFullscreen;
|
||||||
store.put(storekey, isFullscreen);
|
store.put(storekey, isFullscreen);
|
||||||
|
|
||||||
onMouseMove();
|
userAlive();
|
||||||
adjustSize();
|
adjustSize();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -123,11 +123,11 @@ modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'cor
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
onExit();
|
onExit();
|
||||||
} else if (key === 8 || key === 37 || key === 40) { // backspace, left, down
|
} else if (key === 8 || key === 37) { // backspace, left
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
onPrevious();
|
onPrevious();
|
||||||
} else if (key === 13 || key === 32 || key === 38 || key === 39) { // enter, space, up, right
|
} else if (key === 13 || key === 32 || key === 39) { // enter, space, right
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
onNext();
|
onNext();
|
||||||
|
@ -217,34 +217,9 @@ modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'cor
|
||||||
$('#pv-bar-close, #pv-close-area').on('click', onExit);
|
$('#pv-bar-close, #pv-close-area').on('click', onExit);
|
||||||
$('#pv-bar-fullscreen').on('click', onFullscreen);
|
$('#pv-bar-fullscreen').on('click', onFullscreen);
|
||||||
|
|
||||||
$('#pv-prev-area')
|
|
||||||
.on('mouseenter', function () {
|
|
||||||
$('#pv-bar-prev').addClass('hover');
|
|
||||||
})
|
|
||||||
.on('mouseleave', function () {
|
|
||||||
$('#pv-bar-prev').removeClass('hover');
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#pv-next-area')
|
|
||||||
.on('mouseenter', function () {
|
|
||||||
$('#pv-bar-next').addClass('hover');
|
|
||||||
})
|
|
||||||
.on('mouseleave', function () {
|
|
||||||
$('#pv-bar-next').removeClass('hover');
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#pv-close-area')
|
|
||||||
.on('mouseenter', function () {
|
|
||||||
$('#pv-bar-close').addClass('hover');
|
|
||||||
})
|
|
||||||
.on('mouseleave', function () {
|
|
||||||
$('#pv-bar-close').removeClass('hover');
|
|
||||||
});
|
|
||||||
|
|
||||||
var fsTimer = null;
|
|
||||||
$('#pv-overlay')
|
$('#pv-overlay')
|
||||||
.on('keydown', onKeydown)
|
.on('keydown', onKeydown)
|
||||||
.on('mousemove click mousedown', onMouseMove)
|
.on('mousemove mousedown', userAlive)
|
||||||
.on('click mousedown mousemove keydown keypress', function (event) {
|
.on('click mousedown mousemove keydown keypress', function (event) {
|
||||||
|
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
|
|
Loading…
Add table
Reference in a new issue