const VolumeMap = { | const VolumeMap = { | ||||
isOn: false, | isOn: false, | ||||
size: 200, | |||||
size: 320, | |||||
positions: new Map(), | positions: new Map(), | ||||
toggle() { | toggle() { | ||||
VolumeMap.isOn = !VolumeMap.isOn | VolumeMap.isOn = !VolumeMap.isOn | ||||
'position': 'fixed', | 'position': 'fixed', | ||||
'height': VolumeMap.size + 'px', | 'height': VolumeMap.size + 'px', | ||||
'width': VolumeMap.size + 'px', | 'width': VolumeMap.size + 'px', | ||||
'right': '0', | |||||
'top': '0', | |||||
} | } | ||||
return m('svg', {onclick: VolumeMap.moveNotify, style}, | return m('svg', {onclick: VolumeMap.moveNotify, style}, | ||||
m('style', 'text { pointer-events: none }'), | m('style', 'text { pointer-events: none }'), |
view({attrs}) { | view({attrs}) { | ||||
const style = { | const style = { | ||||
zIndex: 999, | zIndex: 999, | ||||
backgroundColor: 'rgba(0, 0, 0, 0.8)', | |||||
backgroundColor: 'rgba(0, 0, 0, 0.2)', | |||||
visibility: attrs.app.isOn ? 'unset' : 'hidden', | visibility: attrs.app.isOn ? 'unset' : 'hidden', | ||||
position: 'fixed', | position: 'fixed', | ||||
height: '100vh', | |||||
width: '100vw', | |||||
right: 0, | right: 0, | ||||
top: 0, | top: 0, | ||||
height: '100vh', | |||||
width: '100vw', | |||||
display: 'flex', | |||||
alignItems: 'center', | |||||
justifyContent: 'center', | |||||
} | } | ||||
const onclick = ({target: {classList}}) => { | const onclick = ({target: {classList}}) => { | ||||
classList.contains('shadow') && signal({kind: attrs.key}) | classList.contains('shadow') && signal({kind: attrs.key}) |