Merge branch 'main' of git.satori.love:LaniakeaSupercluster/webrtc
This commit is contained in:
commit
06479610f9
19
src/music.js
19
src/music.js
@ -47,11 +47,28 @@ export default class MusicList {
|
|||||||
maxWidth: '20rem', maxHeight: '70vh',
|
maxWidth: '20rem', maxHeight: '70vh',
|
||||||
overflow: 'hidden', boxShadow: '0 0 1rem #eee',
|
overflow: 'hidden', boxShadow: '0 0 1rem #eee',
|
||||||
display: 'flex', flexDirection: 'column',
|
display: 'flex', flexDirection: 'column',
|
||||||
fontSize: '12px'
|
fontSize: '12px', userSelect: 'none',
|
||||||
},
|
},
|
||||||
onclick: event => {
|
onclick: event => {
|
||||||
this.ul.classList.toggle('disable')
|
this.ul.classList.toggle('disable')
|
||||||
},
|
},
|
||||||
|
onmousedown({ srcElement: dom, clientX, clientY }) {
|
||||||
|
if (dom !== element) return
|
||||||
|
const [w, h] = [innerWidth - dom.offsetWidth, innerWidth - dom.offsetHeight]
|
||||||
|
document.onmouseup = () => {
|
||||||
|
if (dom.offsetLeft < 0) dom.style.left = '0px'
|
||||||
|
if (dom.offsetTop < 0) dom.style.top = '0px'
|
||||||
|
if (dom.offsetLeft > w) dom.style.left = w + 'px'
|
||||||
|
if (dom.offsetTop > h) dom.style.top = h + 'px'
|
||||||
|
document.onmouseup = document.onmousemove = null
|
||||||
|
localStorage.setItem('playerXY', dom.style.left + ',' + dom.style.top)
|
||||||
|
}
|
||||||
|
document.onmousemove = ({ clientX: x, clientY: y }) => {
|
||||||
|
dom.style.left = dom.offsetLeft - clientX + x + 'px'
|
||||||
|
dom.style.top = dom.offsetTop - clientY + y + 'px';
|
||||||
|
[clientX, clientY] = [x, y]
|
||||||
|
}
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
this.audio,
|
this.audio,
|
||||||
this.ul,
|
this.ul,
|
||||||
|
@ -127,7 +127,7 @@ export function UploadMusic(options) {
|
|||||||
options.onchange(files)
|
options.onchange(files)
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
// 绘制一个云朵上传图标(别放弃...还有我呢!)
|
// 绘制一个云朵上传图标
|
||||||
createElement({
|
createElement({
|
||||||
style: {
|
style: {
|
||||||
width: '82px',
|
width: '82px',
|
||||||
@ -183,7 +183,7 @@ export function UploadMusic(options) {
|
|||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
top: '-2.25rem',
|
top: '-2.25rem',
|
||||||
color: '#e7f4fd',
|
color: '#e7f8fd',
|
||||||
textShadow: '0 1px 1px #fff',
|
textShadow: '0 1px 1px #fff',
|
||||||
//textShadow: '0 0 5px #000, 0 0 10px #000, 0 0 15px #000, 0 0 20px #000, 0 0 25px #000, 0 0 30px #000, 0 0 35px #000, 0 0 40px #000, 0 0 45px #000, 0 0 50px #000, 0 0 55px #000, 0 0 60px #000, 0 0 65px #000, 0 0 70px #000, 0 0 75px #000'
|
//textShadow: '0 0 5px #000, 0 0 10px #000, 0 0 15px #000, 0 0 20px #000, 0 0 25px #000, 0 0 30px #000, 0 0 35px #000, 0 0 40px #000, 0 0 45px #000, 0 0 50px #000, 0 0 55px #000, 0 0 60px #000, 0 0 65px #000, 0 0 70px #000, 0 0 75px #000'
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user