Last active
June 12, 2020 05:23
-
-
Save nemesisqp/f2aef4dd75b114dc909e636fd58d72d6 to your computer and use it in GitHub Desktop.
maplife app slashscreen patch
This file contains hidden or 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
Index: src/pages/splash-screen.vue | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
--- src/pages/splash-screen.vue (date 1591939356733) | |
+++ src/pages/splash-screen.vue (date 1591939356733) | |
@@ -0,0 +1,54 @@ | |
+<template> | |
+ <video | |
+ id="video" | |
+ ref="videoRef" | |
+ autoplay | |
+ preload | |
+ :muted="muted" | |
+ > | |
+ <source | |
+ :src="videoSrc" | |
+ type="video/mp4" | |
+ > | |
+ </video> | |
+</template> | |
+ | |
+<style scoped> | |
+ video { | |
+ pointer-events: none; | |
+ object-fit: cover; | |
+ object-position: 50% 95%; | |
+ height: 100%; | |
+ width: 100%; | |
+ } | |
+</style> | |
+ | |
+<script> | |
+ export default { | |
+ data: function () { | |
+ return { | |
+ videoSrc: 'static/splash-screen.mp4', | |
+ muted: this.$f7.device.desktop, | |
+ }; | |
+ }, | |
+ mounted() { | |
+ const router = this.$f7.views.main.router; | |
+ // // redirect to home if dev mode | |
+ // if (process.env.NODE_ENV === 'development') { | |
+ // router.navigate('/home/'); | |
+ // } else { | |
+ const video = this.$refs.videoRef; | |
+ | |
+ // redirect to home trong trường hợp lỗi bất kỳ, set thoi gian = thoi gian video | |
+ const failSafeTimer = setTimeout(function () { | |
+ router.navigate('/home/'); | |
+ }, 6000); | |
+ | |
+ video.onended = function () { | |
+ clearTimeout(failSafeTimer); | |
+ router.navigate('/home/'); | |
+ }; | |
+ // } | |
+ }, | |
+ }; | |
+</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment