Browse Source

Center map

master
Roderic Day 5 years ago
parent
commit
3020680e4c
2 changed files with 7 additions and 6 deletions
  1. +1
    -3
      apps/volume.js
  2. +6
    -3
      pico.js

+ 1
- 3
apps/volume.js View File

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 }'),

+ 6
- 3
pico.js View File

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})

Loading…
Cancel
Save