diff --git a/css/grid-n-view.css b/css/grid-n-view.css index 065259e..f7923d9 100644 --- a/css/grid-n-view.css +++ b/css/grid-n-view.css @@ -290,8 +290,19 @@ body { padding-right: calc(var(--padding) / 5); } .gallery .toolbar:not(.shown):not(:hover) { - background: transparent; box-shadow: none; + + z-index: var(--base-layer); + animation: 0.5s steps(1) tuck-to-backgroud; +} + +@keyframes tuck-to-backgroud { + 0% { + z-index: calc(var(--base-layer) + 2); + } + 100% { + z-index: var(--base-layer); + } } @@ -357,6 +368,7 @@ body { /* button: collapse... */ .gallery .toolbar button.collapse { + float: right; opacity: 0.3; transition: rotate 0.2s; } @@ -376,10 +388,10 @@ body { cursor: pointer; - opacity: 0.3; + color: var(--gallery-secondary-color); } .gallery .toolbar .drag-handle:hover { - opacity: 1; + color: var(--gallery-text-color); } diff --git a/grid-n-view.html b/grid-n-view.html index b72750c..2557425 100644 --- a/grid-n-view.html +++ b/grid-n-view.html @@ -84,6 +84,10 @@ For more info see: README.md +
+ + +
diff --git a/grid-n-view.js b/grid-n-view.js index 7c2d572..fb1aeeb 100644 --- a/grid-n-view.js +++ b/grid-n-view.js @@ -878,20 +878,23 @@ var Gallery = { evt.stopPropagation() }) // toolbar: collapse: click, hold to make sticky... var hold_timeout + var handleInterationStart = function(evt){ + hold_timeout = setTimeout( + function(){ + hold_timeout = undefined + toolbar.classList.toggle('sticky') }, + that.toolbar_hold ?? 300) } + var handleInterationEnd = function(evt){ + evt.preventDefault() + hold_timeout + && clearTimeout(hold_timeout) + hold_timeout = undefined + that.toggleToolbar() } var collapse_button = toolbar.querySelector('.collapse') - collapse_button - .addEventListener('mousedown', function(evt){ - hold_timeout = setTimeout( - function(){ - hold_timeout = undefined - toolbar.classList.toggle('sticky') }, - that.toolbar_hold ?? 300) }) - collapse_button - .addEventListener('mouseup', function(evt){ - hold_timeout - && clearTimeout(hold_timeout) - hold_timeout = undefined - that.toggleToolbar() }) + collapse_button.addEventListener('touchstart', handleInterationStart) + collapse_button.addEventListener('mousedown', handleInterationStart) + collapse_button.addEventListener('touchend', handleInterationEnd) + collapse_button.addEventListener('mouseup', handleInterationEnd) // toolbar: autohide... var hide_timeout toolbar