sidepanel: hide resize handle, hilight side handle on hover

This commit is contained in:
jean-emmanuel 2019-03-27 20:16:58 +01:00
parent 1fb03797cc
commit 4bd6454a16
4 changed files with 36 additions and 40 deletions

View file

@ -2,13 +2,17 @@
## next
- bug fixes
- sidepanel: resize handle overflow issue
- ui
- sidepanel: hidden resize handle; show edge resize handle on hover
- launcher
- added context menu action to display midi device list without starting the server
- widgets
- switch: add `traversing` option (`true` by default)
- knob: act as a relative encoder when traversing gestures are enabled and `snap` is `false`
- keys: `key` variable in `keydown` and `keyup` is now always lowercased when referencing a single character
- keys; expose `code` variable from the keyboard event object (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code#Code_values)
- keys; expose `code` variable from the keyboard event object (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code#Code_values)
- custom module
- expose shorthand functions `send` and `receives`
- expose a client object instead of just an id in `app` event handlers to allow retrieving the client's ip address as well

View file

@ -20,7 +20,10 @@
<body>
<div id="container"></div>
<div id="sidepanel" class="hide"></div>
<div id="sidepanel" class="hide">
<div id="sidepanel-wrapper"></div>
<div id="sidepanel-handle"></div>
</div>
<div id="notifications"></div>
</body>

View file

@ -198,7 +198,7 @@ for (let i in sidepanelData) {
}
var sidepanel = document.getElementById('sidepanel')
var sidepanel = document.getElementById('sidepanel-wrapper')
sidepanel.appendChild(html`
<div class="navigation"><ul><li><a>${PACKAGE.productName.toUpperCase()}</a></li></ul></div>
@ -228,7 +228,7 @@ function sidepanelOpen() {
sidepaneLock = true
DOM.get('#sidepanel')[0].classList.remove('hide')
setTimeout(function(){
DOM.each(document, '#open-toggle, #sidepanel', (el)=>{
el.classList.add('sidepanel-open')
@ -293,17 +293,14 @@ document.addEventListener('keydown', function(e){
// Sidepanel resize
var resizeHandle = html`<div id="sidepanel-handle">${raw(icon('bars'))}</div>`,
sidepanelWidth
var sidepanelWidth,
sidepanelContainer = document.getElementById('sidepanel')
sidepanel.appendChild(resizeHandle)
$(resizeHandle).draggable({
$('#sidepanel-handle').draggable({
cursor:'col-resize',
start: ()=>{
sidepanelWidth = parseInt(sidepanel.offsetWidth) / PXSCALE
sidepanel.classList.add('resizing')
sidepanelWidth = parseInt(sidepanelContainer.offsetWidth) / PXSCALE
sidepanelContainer.classList.add('resizing')
},
drag: (event, ui)=>{
var delta = (ui.originalPosition.left - ui.position.left) / PXSCALE,
@ -313,7 +310,7 @@ $(resizeHandle).draggable({
}
},
stop: ()=>{
sidepanel.classList.remove('resizing')
sidepanelContainer.classList.remove('resizing')
}
})

View file

@ -16,12 +16,18 @@
transition:transform .25s, opacity .25s;
transform: translate3d(0,0,0);
opacity: 0;
overflow-y: auto;
overflow-x: visible;
box-shadow: 0 0 15rem 0 var(--color-bg), 0 0 0 2rem var(--color-bg);
display: flex;
flex-direction: column;
#sidepanel-wrapper {
overflow-y: auto;
overflow-x: visible;
display: flex;
flex-direction: column;
flex:1;
}
&.sidepanel-open {
transform: translate3d(calc(-1 * var(--sidepanel-size)),0,0);
opacity: 1;
@ -134,32 +140,18 @@
}
#sidepanel-handle {
position: absolute;
top: 12rem!important;
left: 10rem!important;
height: auto;
width: auto;
background: transparent;
color: var(--color-fg);
width: 6rem;
position: fixed;
top:-1rem!important;
bottom:-1rem!important;
left:-1rem!important;
height: auto!important;
background-color: var(--color-custom);
cursor: col-resize;
&:after {
content:none;
}
&:before {
content:"";
width: 5rem;
height: 400%;
top:0;
bottom:0;
position: fixed;
left:0;
top:0;
}
i {
transform: rotate(90deg);
pointer-events: none;
font-size:13rem;
display: block
transition: opacity .25s;
opacity: 0;
&:hover {
opacity: 0.2;
}
}