@mixd-id/web-scaffold 0.1.2301231338 → 0.1.2301231339
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 +1 -1
- package/src/components/Image.vue +16 -6
package/package.json
CHANGED
package/src/components/Image.vue
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<img :class="computedClass" :src="actualSrc" ref="img" :style="imageStyle"/>
|
|
6
6
|
<input v-if="Boolean(editable)" class="hidden" type="file" accept="image/*" ref="file" @change="onChange"/>
|
|
7
7
|
<slot></slot>
|
|
8
|
-
<div :class="$style.loading" v-if="loading">
|
|
8
|
+
<div :class="$style.loading" v-if="loading && spinnerType === 'spinner'">
|
|
9
9
|
<svg class="animate-spin aspect-square w-[15%] text-primary" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>
|
|
10
10
|
</div>
|
|
11
11
|
</div>
|
|
@@ -48,7 +48,12 @@ export default{
|
|
|
48
48
|
defaultSrc: {
|
|
49
49
|
type: String,
|
|
50
50
|
default: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMS4xNTkyIDIxLjA4MjhDMjEuNjc5OCAyMC41NDMyIDIyIDE5LjgwOSAyMiAxOVY1QzIyIDMuMzQzMTUgMjAuNjU2OSAyIDE5IDJINUMzLjM0Mz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aXJjbGUgY3g9IjE3IiBjeT0iNyIgcj0iMS4yNSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLW9wYWNpdHk9Ii4wOCIgc3Ryb2tlLXdpZHRoPSIxLjUiLz4KPC9zdmc+Cg=="
|
|
51
|
-
}
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
spinnerType: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "shimmer" // spinner | shimmer
|
|
56
|
+
}
|
|
52
57
|
|
|
53
58
|
},
|
|
54
59
|
|
|
@@ -57,7 +62,8 @@ export default{
|
|
|
57
62
|
computedOuterClass(){
|
|
58
63
|
return [
|
|
59
64
|
this.$style.img,
|
|
60
|
-
this.outerClass
|
|
65
|
+
this.outerClass,
|
|
66
|
+
this.loading && this.spinnerType === 'shimmer' ? this.$style.shimmer : ''
|
|
61
67
|
]
|
|
62
68
|
.join(' ')
|
|
63
69
|
},
|
|
@@ -135,13 +141,13 @@ export default{
|
|
|
135
141
|
var img = new Image()
|
|
136
142
|
img.addEventListener('load', () => {
|
|
137
143
|
this.loaded = true
|
|
138
|
-
this.actualSrc = img.src
|
|
139
|
-
this.loading = false
|
|
144
|
+
//this.actualSrc = img.src
|
|
145
|
+
//this.loading = false
|
|
140
146
|
})
|
|
141
147
|
img.addEventListener('error', () => {
|
|
142
148
|
this.loaded = true
|
|
143
149
|
this.actualSrc = this.defaultSrc
|
|
144
|
-
this.loading = false
|
|
150
|
+
//this.loading = false
|
|
145
151
|
})
|
|
146
152
|
img.src = src[screens[b]]
|
|
147
153
|
this.loading = true
|
|
@@ -202,5 +208,9 @@ export default{
|
|
|
202
208
|
@apply flex items-center justify-center;
|
|
203
209
|
}
|
|
204
210
|
|
|
211
|
+
.shimmer{
|
|
212
|
+
@apply bg-text-100 animate-pulse;
|
|
213
|
+
}
|
|
214
|
+
|
|
205
215
|
|
|
206
216
|
</style>
|