mirror of
https://github.com/Cola-Echo/Cola.git
synced 2026-06-06 03:35:50 +00:00
Add files via upload
This commit is contained in:
@@ -11634,6 +11634,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
height: 180px;
|
height: 180px;
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wechat-toy-wheel-heart {
|
.wechat-toy-wheel-heart {
|
||||||
@@ -11712,6 +11713,8 @@
|
|||||||
.wechat-toy-wheel-options.open .wechat-toy-wheel-option {
|
.wechat-toy-wheel-options.open .wechat-toy-wheel-option {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1);
|
transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1);
|
||||||
|
pointer-events: auto;
|
||||||
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wechat-toy-wheel-option:hover {
|
.wechat-toy-wheel-option:hover {
|
||||||
|
|||||||
@@ -330,12 +330,27 @@ function renderToyWheelSelector() {
|
|||||||
|
|
||||||
// 绑定轮盘选项事件(支持触摸)
|
// 绑定轮盘选项事件(支持触摸)
|
||||||
wheelOptions.querySelectorAll('.wechat-toy-wheel-option').forEach(opt => {
|
wheelOptions.querySelectorAll('.wechat-toy-wheel-option').forEach(opt => {
|
||||||
opt.addEventListener('click', (e) => {
|
let touchHandled = false;
|
||||||
|
|
||||||
|
opt.addEventListener('touchstart', (e) => {
|
||||||
|
touchHandled = false;
|
||||||
|
}, { passive: true });
|
||||||
|
|
||||||
|
opt.addEventListener('touchend', (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
touchHandled = true;
|
||||||
const index = parseInt(opt.dataset.toyIndex);
|
const index = parseInt(opt.dataset.toyIndex);
|
||||||
switchToToy(index);
|
switchToToy(index);
|
||||||
});
|
});
|
||||||
opt.addEventListener('touchend', (e) => {
|
|
||||||
e.preventDefault();
|
opt.addEventListener('click', (e) => {
|
||||||
|
// 如果刚处理过触摸事件,跳过点击
|
||||||
|
if (touchHandled) {
|
||||||
|
touchHandled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
e.stopPropagation();
|
||||||
const index = parseInt(opt.dataset.toyIndex);
|
const index = parseInt(opt.dataset.toyIndex);
|
||||||
switchToToy(index);
|
switchToToy(index);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user