mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-07-17 01:56:09 +00:00
Merge pull request #593 from immortal521/fix/mobile-theme-toggle-position
fix: incorrect animation start position on mobile theme toggle
This commit is contained in:
@@ -71,8 +71,19 @@ export function setTheme(mode) {
|
|||||||
|
|
||||||
function getCircle(event) {
|
function getCircle(event) {
|
||||||
if (!import.meta.client) return undefined
|
if (!import.meta.client) return undefined
|
||||||
const x = event.clientX
|
|
||||||
const y = event.clientY
|
let x, y
|
||||||
|
if (event.touches?.length) {
|
||||||
|
x = event.touches[0].clientX
|
||||||
|
y = event.touches[0].clientY
|
||||||
|
} else if (event.changedTouches?.length) {
|
||||||
|
x = event.changedTouches[0].clientX
|
||||||
|
y = event.changedTouches[0].clientY
|
||||||
|
} else {
|
||||||
|
x = event.clientX
|
||||||
|
y = event.clientY
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
x,
|
x,
|
||||||
y,
|
y,
|
||||||
|
|||||||
Reference in New Issue
Block a user