mirror of
https://github.com/microsoft/playwright.git
synced 2025-01-07 11:46:42 +03:00
30 lines
674 B
HTML
30 lines
674 B
HTML
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
|
||
|
<head>
|
||
|
<title>Device orientation test</title>
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<script>
|
||
|
window.result = 'Was not oriented';
|
||
|
window.alpha = undefined;
|
||
|
window.beta = undefined;
|
||
|
window.gamma = undefined;
|
||
|
window.absolute = undefined;
|
||
|
|
||
|
document.addEventListener('deviceorientation', onOrientation, false);
|
||
|
document.addEventListener('deviceorientationabsolute', onOrientation, false);
|
||
|
|
||
|
function onOrientation(event) {
|
||
|
window.result = 'Oriented';
|
||
|
window.alpha = event.alpha;
|
||
|
window.beta = event.beta;
|
||
|
window.gamma = event.gamma;
|
||
|
window.absolute = event.absolute;
|
||
|
}
|
||
|
</script>
|
||
|
</body>
|
||
|
|
||
|
</html>
|