forked from hakimel/reveal.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
always use css transforms for presentation scaling (zoom has too many…
… quirks even if it is slightly sharper on ldpi displays)
- Loading branch information
Showing
6 changed files
with
13 additions
and
37 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,8 @@ | ||
const UA = navigator.userAgent; | ||
const testElement = document.createElement( 'div' ); | ||
|
||
export const isMobile = /(iphone|ipod|ipad|android)/gi.test( UA ) || | ||
( navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1 ); // iPadOS | ||
|
||
export const isChrome = /chrome/i.test( UA ) && !/edge/i.test( UA ); | ||
|
||
export const isAndroid = /android/gi.test( UA ); | ||
|
||
// Flags if we should use zoom instead of transform to scale | ||
// up slides. Zoom produces crisper results but has a lot of | ||
// xbrowser quirks so we only use it in whitelisted browsers. | ||
export const supportsZoom = 'zoom' in testElement.style && !isMobile && | ||
( isChrome || /Version\/[\d\.]+.*Safari/.test( UA ) ); | ||
export const isAndroid = /android/gi.test( UA ); |