@asd20/ui 3.2.966 → 3.2.968

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "*.scss",
6
6
  "*.vue"
7
7
  ],
8
- "version": "3.2.966",
8
+ "version": "3.2.968",
9
9
  "private": false,
10
10
  "license": "MIT",
11
11
  "repository": {
@@ -14,7 +14,7 @@
14
14
  class="asd20-school-homepage-video-header__image"
15
15
  >
16
16
  <video
17
- v-if="showVideo"
17
+ v-if="loadVideo"
18
18
  ref="backgroundVideo"
19
19
  class="background-video"
20
20
  role="presentation"
@@ -26,8 +26,14 @@
26
26
  playsinline
27
27
  :poster="imageUrl"
28
28
  >
29
- <source :src="videoUrl" type="video/mp4" />
29
+ <source :src="loadVideo" type="video/mp4" />
30
30
  </video>
31
+ <img
32
+ v-else
33
+ class="background-image"
34
+ :src="imageUrl"
35
+ :alt="imageCaption"
36
+ />
31
37
  <button
32
38
  v-if="videoUrl"
33
39
  class="video-toggle-btn"
@@ -39,11 +45,6 @@
39
45
  <!-- Pause icon (⏸) -->
40
46
  <span v-else>&#10073;&#10073;</span>
41
47
  </button>
42
- <img
43
- :class="videoUrl ? 'hide-background-image' : 'background-image'"
44
- :src="imageUrl"
45
- :alt="imageCaption"
46
- />
47
48
  <div id="main" class="asd20-school-homepage-video-header__content">
48
49
  <h1 v-if="heading" v-html="heading" />
49
50
  <div v-if="lead" class="asd20-school-homepage-video-header__lead">
@@ -107,8 +108,12 @@ export default {
107
108
  data() {
108
109
  return {
109
110
  isPaused: false,
111
+ isMobile: false,
110
112
  }
111
113
  },
114
+ mounted() {
115
+ this.isMobile = this.$mq === 'xs' || this.$mq === 'sm'
116
+ },
112
117
  computed: {
113
118
  mq() {
114
119
  return this.$mq || 'sm'
@@ -128,9 +133,11 @@ export default {
128
133
  this.detailLink.split('/').pop()
129
134
  )
130
135
  },
131
- showVideo() {
132
- const isMobile = this.mq === 'xs' || this.mq === 'sm'
133
- return !isMobile && this.videoUrl
136
+ loadVideo() {
137
+ if (this.isMobile) {
138
+ return null
139
+ }
140
+ return this.videoUrl
134
141
  },
135
142
  },
136
143
  methods: {
@@ -10,8 +10,6 @@
10
10
  </div>
11
11
 
12
12
  <video
13
- v-if="showVideo"
14
- preload="none"
15
13
  ref="backgroundVideo"
16
14
  class="background-video"
17
15
  role="presentation"
@@ -23,7 +21,7 @@
23
21
  playsinline
24
22
  :poster="imageUrl"
25
23
  >
26
- <source :src="videoUrl" type="video/mp4" />
24
+ <source :src="loadVideo" type="video/mp4" />
27
25
  </video>
28
26
  <button
29
27
  v-if="videoUrl"
@@ -71,8 +69,12 @@ export default {
71
69
  data() {
72
70
  return {
73
71
  isPaused: false,
72
+ isMobile: false,
74
73
  }
75
74
  },
75
+ mounted() {
76
+ this.isMobile = this.$mq === 'xs' || this.$mq === 'sm'
77
+ },
76
78
  computed: {
77
79
  mq() {
78
80
  return this.$mq || 'sm'
@@ -90,9 +92,11 @@ export default {
90
92
  this.detailLink.split('/').pop()
91
93
  )
92
94
  },
93
- showVideo() {
94
- const isMobile = this.mq === 'xs' || this.mq === 'sm'
95
- return !isMobile && this.videoUrl
95
+ loadVideo() {
96
+ if (this.isMobile) {
97
+ return null
98
+ }
99
+ return this.videoUrl
96
100
  },
97
101
  },
98
102
  methods: {