mirror of
https://github.com/Dreamer-Paul/Pio.git
synced 2024-12-25 20:10:11 +08:00
Fix Draggable Mode
修复在右对齐的情况下使用拖动模式,导致看板娘下方有“空气墙”影响操作的问题
This commit is contained in:
parent
d7cdd6b358
commit
90e4531b22
@ -6,7 +6,7 @@
|
||||
|
||||
## 使用方法
|
||||
|
||||
> 奇趣保罗自己搭建的 [梦象](https://mx-model.ga) 资源站上提供了较多可用于本插件的模型资源,如果你也想在这里提交自己的原创作品,不妨现在就和我 [取得联系](https://paul.ren) 吧!
|
||||
> 奇趣保罗自己搭建的 [梦象](https://mx.paul.ren) 资源站上提供了较多可用于本插件的模型资源,如果你也想在这里提交自己的原创作品,不妨现在就和我 [取得联系](https://paul.ren) 吧!
|
||||
|
||||
1. Star 本项目
|
||||
2. 从这里 [下载](https://github.com/Dreamer-Paul/Pio/archive/master.zip) 本插件
|
||||
@ -29,10 +29,9 @@
|
||||
|
||||
同时欢迎前往 [保罗的小窝](https://paul.ren/donate) 为我提供赞助,谢谢您!
|
||||
|
||||
## 使用的开源项目
|
||||
|
||||
- [Live2D-SRC](https://github.com/journey-ad/live2d_src)
|
||||
|
||||
## 感谢
|
||||
|
||||
感谢来自开源社区提供的解决方案,简化了本项目的不少工作!
|
||||
|
||||
- [Live2D](https://www.live2d.com)
|
||||
- [Live2D-SRC](https://github.com/journey-ad/live2d_src)
|
||||
|
@ -18,7 +18,6 @@
|
||||
user-select: none;
|
||||
}
|
||||
.pio-container:not(.loaded){ display: none }
|
||||
.pio-container:not(.draggable){ bottom: 0 }
|
||||
|
||||
.pio-container.left{ left: 0 }
|
||||
.pio-container.right{ right: 0 }
|
||||
|
@ -59,7 +59,7 @@ var Paul_Pio = function (prop) {
|
||||
// 移除方法
|
||||
destroy: function () {
|
||||
current.body.parentNode.removeChild(current.body);
|
||||
localStorage.setItem("posterGirl", false);
|
||||
localStorage.setItem("posterGirl", 0);
|
||||
}
|
||||
};
|
||||
|
||||
@ -216,17 +216,18 @@ var Paul_Pio = function (prop) {
|
||||
action.touch(); action.buttons();
|
||||
|
||||
var body = current.body;
|
||||
body.onmousedown = function () {
|
||||
body.onmousedown = function (downEvent) {
|
||||
var location = {
|
||||
x: event.clientX - this.offsetLeft,
|
||||
y: event.clientY - this.offsetTop
|
||||
x: downEvent.clientX - this.offsetLeft,
|
||||
y: downEvent.clientY - this.offsetTop
|
||||
};
|
||||
|
||||
function move(e) {
|
||||
function move(moveEvent) {
|
||||
body.classList.add("active");
|
||||
body.classList.remove("right");
|
||||
body.style.left = (event.clientX - location.x) + 'px';
|
||||
body.style.top = (event.clientY - location.y) + 'px';
|
||||
body.style.left = (moveEvent.clientX - location.x) + 'px';
|
||||
body.style.top = (moveEvent.clientY - location.y) + 'px';
|
||||
body.style.bottom = "auto";
|
||||
}
|
||||
|
||||
document.addEventListener("mousemove", move);
|
||||
|
Loading…
Reference in New Issue
Block a user