浏览代码

Center map

master
Roderic Day 5 年前
父节点
当前提交
3020680e4c
共有 2 个文件被更改,包括 7 次插入6 次删除
  1. +1
    -3
      apps/volume.js
  2. +6
    -3
      pico.js

+ 1
- 3
apps/volume.js 查看文件

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

正在加载...
取消
保存