mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 13:45:36 +03:00
29 lines
680 B
HTML
29 lines
680 B
HTML
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
|
||
|
<head>
|
||
|
<title>Device motion test</title>
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<script>
|
||
|
window.result = 'Was not moved';
|
||
|
window.acceleration = undefined;
|
||
|
window.accelerationIncludingGravity = undefined;
|
||
|
window.rotationRate = undefined;
|
||
|
window.interval = undefined;
|
||
|
|
||
|
document.addEventListener('devicemotion', onMotion, false);
|
||
|
|
||
|
function onMotion(event) {
|
||
|
window.result = 'Moved';
|
||
|
window.acceleration = event.acceleration;
|
||
|
window.accelerationIncludingGravity = event.accelerationIncludingGravity;
|
||
|
window.rotationRate = event.rotationRate;
|
||
|
window.interval = event.interval;
|
||
|
}
|
||
|
</script>
|
||
|
</body>
|
||
|
|
||
|
</html>
|