-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathIdle.vue
76 lines (69 loc) · 1.33 KB
/
Idle.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<template>
<div class="idle-view" :class="{isIdle: isAppIdle}">
<div class="overlay"></div>
<sprite spriteId="touch"
:spriteSrc="require('../assets/touch.png')"
:spriteW='180'
:spriteH='215'
ref='sprite'
></sprite>
</div>
</template>
<script>
'use strict'
import Sprite from './Sprite'
export default {
components: {
Sprite
},
onIdle () {
this.$refs.sprite.play()
},
onActive () {
this.$refs.sprite.stop()
}
}
</script>
<style>
.idle-view {
position: fixed;
top: 0;
width: 100vw;
height: 100vh;
z-index: 8888;
pointer-events: none;
display: none;
}
.idle-view.isIdle {
pointer-events: all;
display: block;
}
.idle-view .sprite {
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
height: 10px;
width: 180px;
z-index: 9999;
-webkit-transform: scale(0.7);
}
.idle-view .overlay {
width: 100%;
height: 100%;
position: absolute;
z-index: 8888;
background: #000;
opacity: 0;
/*-webkit-animation: SlowMo 5s cubic-bezier(0.77, 0, 0.175, 1) infinite;*/
-webkit-transition: opacity 800ms cubic-bezier(0.77, 0, 0.175, 1);
}
.idle-view.isIdle .overlay {
opacity: 0.6;
}
@-webkit-keyframes SlowMo {
0%{background-position:0% 50%}
50%{background-position:100% 50%}
100%{background-position:0% 50%}
}
</style>