diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-10-15 14:16:33 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-10-15 14:16:33 +0200 |
| commit | b2c6a37430438c72a0fee45bc2d538875f2f803e (patch) | |
| tree | 6830db03f1e7907c5537c74528190d6b3b7a4a5c /src | |
| parent | 467c9335c16c701d0d7e04af39b858bbfe54db96 (diff) | |
update db
Diffstat (limited to 'src')
| -rw-r--r-- | src/utils/index.js | 11 | ||||
| -rw-r--r-- | src/views/Intro.js | 8 | ||||
| -rw-r--r-- | src/views/LandscapeWarning.js | 5 |
3 files changed, 20 insertions, 4 deletions
diff --git a/src/utils/index.js b/src/utils/index.js index 7c4ca54..48c90af 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -21,10 +21,19 @@ export const capitalize = (text = "") => /* Mobile check */ +function isIpadOS() { + return ( + navigator.userAgent.match(/iPad/i) || + (navigator.maxTouchPoints && + navigator.maxTouchPoints > 2 && + /MacIntel/.test(navigator.platform)) + ); +} + export const isiPhone = !!( navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) ); -export const isiPad = !!navigator.userAgent.match(/iPad/i); +export const isiPad = isIpadOS(); export const isAndroid = !!navigator.userAgent.match(/Android/i); export const isMobile = isiPhone || isiPad || isAndroid; export const isDesktop = !isMobile; diff --git a/src/views/Intro.js b/src/views/Intro.js index 1bb0380..2c94e21 100644 --- a/src/views/Intro.js +++ b/src/views/Intro.js @@ -7,6 +7,11 @@ import Vimeo from "@u-wave/react-vimeo"; let playing = false; +const audio = document.createElement("audio"); +audio.loop = true; +audio.volume = 0.25; +audio.src = "assets/data_store/X4LM-10m-192k.mp3"; + export default function Intro({ onComplete }) { const [done, setDone] = useState(false); const [started, setStarted] = useState(false); @@ -14,6 +19,7 @@ export default function Intro({ onComplete }) { const [videoSize] = useState(coverWindow()); const handleClose = useCallback(() => { + audio.play(); setDone(true); setTimeout(() => { onComplete(); @@ -45,6 +51,8 @@ export default function Intro({ onComplete }) { showPortrait={false} showTitle={false} style={videoSize} + muted={false} + volume={1} onReady={handleReady} onEnd={handleClose} /> diff --git a/src/views/LandscapeWarning.js b/src/views/LandscapeWarning.js index 9031eb9..c834858 100644 --- a/src/views/LandscapeWarning.js +++ b/src/views/LandscapeWarning.js @@ -60,7 +60,7 @@ export default class LandscapeWarning extends Component { <div className="landscape-warning"> {RotateIcon} {PhoneIcon} - {isiPhone && ( + {isiPhone ? ( <div className="landscape-message"> {"Please tap "} <small>A</small> @@ -68,8 +68,7 @@ export default class LandscapeWarning extends Component { <br /> {"then rotate your device."} </div> - )} - {!isiPhone && ( + ) : ( <div className="landscape-message">{"Please rotate your device"}</div> )} </div> |
