Merge branch 'develop' into release/1.0
Showing
2 changed files
with
57 additions
and
13 deletions
@@ -21,10 +21,10 @@ | @@ -21,10 +21,10 @@ | ||
21 | 21 | ||
22 | module.exports = { | 22 | module.exports = { |
23 | props: { | 23 | props: { |
24 | - 'title': String, | ||
25 | - 'class': [String, Object, Array], | ||
26 | - 'fixed': Boolean, | ||
27 | - 'scrollFix': Boolean | 24 | + title: String, |
25 | + class: [String, Object, Array], | ||
26 | + fixed: Boolean, | ||
27 | + scrollFix: Boolean | ||
28 | }, | 28 | }, |
29 | methods: { | 29 | methods: { |
30 | goBack() { | 30 | goBack() { |
@@ -36,15 +36,40 @@ | @@ -36,15 +36,40 @@ | ||
36 | <style> | 36 | <style> |
37 | .blk-header-wrap.ghost { | 37 | .blk-header-wrap.ghost { |
38 | .blk-header { | 38 | .blk-header { |
39 | - background-color: transparent; | 39 | + background-color: rgba(255, 255, 255, 0); |
40 | transition: 0.3s all; | 40 | transition: 0.3s all; |
41 | border-bottom: 0; | 41 | border-bottom: 0; |
42 | } | 42 | } |
43 | 43 | ||
44 | .blk-header-title { | 44 | .blk-header-title { |
45 | - visibility: hidden; | 45 | + opacity: 0; |
46 | } | 46 | } |
47 | } | 47 | } |
48 | + | ||
49 | + .blk-header-wrap.ghost-2 { | ||
50 | + .blk-header { | ||
51 | + background-color: rgba(255, 255, 255, 0.4); | ||
52 | + transition: 0.3s all; | ||
53 | + border-bottom: 0; | ||
54 | + } | ||
55 | + | ||
56 | + .blk-header-title { | ||
57 | + opacity: 0.3; | ||
58 | + } | ||
59 | + } | ||
60 | + | ||
61 | + .blk-header-wrap.ghost-3 { | ||
62 | + .blk-header { | ||
63 | + background-color: rgba(255, 255, 255, 0.7); | ||
64 | + transition: 0.3s all; | ||
65 | + border-bottom: 0; | ||
66 | + } | ||
67 | + | ||
68 | + .blk-header-title { | ||
69 | + opacity: 0.7; | ||
70 | + } | ||
71 | + } | ||
72 | + | ||
48 | .blk-header { | 73 | .blk-header { |
49 | box-sizing: content-box; | 74 | box-sizing: content-box; |
50 | position: fixed; | 75 | position: fixed; |
@@ -134,6 +134,27 @@ | @@ -134,6 +134,27 @@ | ||
134 | }, 200); | 134 | }, 200); |
135 | }); | 135 | }); |
136 | return false; | 136 | return false; |
137 | + }, | ||
138 | + toggle() { | ||
139 | + let ghost = true; | ||
140 | + let ghost2 = false; | ||
141 | + let ghost3 = false; | ||
142 | + | ||
143 | + if (window.scrollY > 40) { | ||
144 | + ghost = false; | ||
145 | + ghost2 = false; | ||
146 | + ghost3 = false; | ||
147 | + } else if (window.scrollY > 25) { | ||
148 | + ghost = false; | ||
149 | + ghost3 = true; | ||
150 | + } else if (window.scrollY > 10) { | ||
151 | + ghost = false; | ||
152 | + ghost2 = true; | ||
153 | + } | ||
154 | + | ||
155 | + this.$refs.header.$el.classList.toggle('ghost', ghost); | ||
156 | + this.$refs.header.$el.classList.toggle('ghost-2', ghost2); | ||
157 | + this.$refs.header.$el.classList.toggle('ghost-3', ghost3); | ||
137 | } | 158 | } |
138 | }, | 159 | }, |
139 | ready() { | 160 | ready() { |
@@ -144,14 +165,12 @@ | @@ -144,14 +165,12 @@ | ||
144 | return false; | 165 | return false; |
145 | }); | 166 | }); |
146 | 167 | ||
147 | - window.addEventListener('scroll', () => { | ||
148 | - let transparent = true; | ||
149 | - | ||
150 | - if (window.scrollY > 20) { | ||
151 | - transparent = false; | ||
152 | - } | 168 | + window.addEventListener('touchmove', () => { |
169 | + this.toggle(); | ||
170 | + }); | ||
153 | 171 | ||
154 | - this.$refs.header.$el.classList.toggle('ghost', transparent); | 172 | + window.addEventListener('scroll', () => { |
173 | + this.toggle(); | ||
155 | }); | 174 | }); |
156 | 175 | ||
157 | document.addEventListener('visibilitychange', () => { | 176 | document.addEventListener('visibilitychange', () => { |
-
Please register or login to post a comment