@asd20/ui 3.2.554 → 3.2.556

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.554",
8
+ "version": "3.2.556",
9
9
  "private": false,
10
10
  "license": "MIT",
11
11
  "repository": {
@@ -24,9 +24,14 @@
24
24
  }"
25
25
  ></span>
26
26
  </div>
27
+ <div class="asd20-swipe__download">
28
+ <button @click.stop.prevent="download" name="Download">
29
+ <span><b>↓ Download</b></span>
30
+ </button>
31
+ </div>
27
32
  </slot>
28
33
  </div>
29
- <div v-if="showArrows" class="asd20-swipe__arrows">
34
+ <div v-if="showArrows && childLen > 1" class="asd20-swipe__arrows">
30
35
  <button
31
36
  v-if="cur > 0"
32
37
  class="asd20-swipe__arrows__button-prev"
@@ -77,6 +82,10 @@ export default {
77
82
  type: Number,
78
83
  default: 0,
79
84
  },
85
+ imageThumbnails: {
86
+ type: Array,
87
+ default: () => [],
88
+ },
80
89
  },
81
90
  data() {
82
91
  return {
@@ -324,6 +333,9 @@ export default {
324
333
  this.diff = -this.wrapWidth * this.cur
325
334
  }
326
335
  },
336
+ download() {
337
+ window.open(this.imageThumbnails[this.index].url, '_blank')
338
+ },
327
339
  },
328
340
  }
329
341
  </script>
@@ -341,17 +353,23 @@ export default {
341
353
  }
342
354
  &__indicator {
343
355
  position: absolute;
356
+ display: flex;
357
+ flex-direction: column;
358
+ justify-content: center;
359
+ flex-shrink: 1;
344
360
  bottom: 0;
345
361
  left: 0;
346
362
  right: 0;
347
- display: flex;
348
- justify-content: center;
363
+ align-items: center;
349
364
  &__list {
350
365
  display: flex;
351
366
  justify-content: center;
352
367
  padding: 0.5rem;
353
368
  width: auto;
354
- background: rgba(255, 255, 255, 1);
369
+ background: rgba(255, 255, 255, 0.6);
370
+ border-radius: 1rem;
371
+ width: min-content;
372
+ margin-bottom: 0.25rem;
355
373
  }
356
374
  &__item {
357
375
  display: inline-block;
@@ -361,6 +379,24 @@ export default {
361
379
  border-radius: 50%;
362
380
  }
363
381
  }
382
+ &__download {
383
+ z-index: 20000;
384
+ margin-bottom: 0.25rem;
385
+ :hover {
386
+ background: rgba(255, 255, 255, 0.8);
387
+ }
388
+ button {
389
+ border-radius: 0.75rem;
390
+ background: rgba(255, 255, 255, 0.6);
391
+ height: 1.5rem;
392
+ width: 6rem;
393
+ border: none;
394
+ padding: 0.25rem;
395
+ :hover {
396
+ background: rgba(255, 255, 255, 0);
397
+ }
398
+ }
399
+ }
364
400
  &__arrows {
365
401
  position: absolute;
366
402
  left: 0;
@@ -376,13 +412,14 @@ export default {
376
412
  position: relative;
377
413
  background: none;
378
414
  border: 0;
379
- width: 4rem;
380
- height: 4rem;
381
- background: white;
415
+ width: 3rem;
416
+ height: 3rem;
417
+ background: rgba(255, 255, 255, 0.6);
382
418
  display: flex;
383
419
  justify-content: center;
384
420
  align-items: center;
385
421
  cursor: pointer;
422
+ border-radius: 50%;
386
423
  transition: background 0.1s ease-in;
387
424
  &:hover {
388
425
  background: rgba(255, 255, 255, 0.8);
@@ -35,6 +35,7 @@
35
35
  @click.native="showSlideshow = false"
36
36
  @keyup.esc.native="showSlideshow = false"
37
37
  :change-index="selectedIndex"
38
+ :imageThumbnails="imageThumbnails"
38
39
  >
39
40
  <asd20-swipe-item
40
41
  v-for="(image, index) in imageThumbnails"
@@ -79,25 +80,23 @@ export default {
79
80
  computed: {
80
81
  imageThumbnails() {
81
82
  let images = this.images || []
82
- return (
83
- images
84
- // .filter(i => !i.isCover)
85
- .map(i => ({
86
- thumbnailUrl: (
87
- i.files.find(f => f.name === 'thumbnail-md') || i.files[0]
88
- ).url,
89
- url: (i.files.find(f => f.name === 'full') || i.files[0]).url,
90
- alt: i.metadata.alt,
91
- credits: i.metadata.credits,
92
- // isCover: i.isCover,
93
- }))
94
- )
83
+ return images
84
+ .filter(i => !i.isCover)
85
+ .map(i => ({
86
+ thumbnailUrl: (
87
+ i.files.find(f => f.name === 'thumbnail-md') || i.files[0]
88
+ ).url,
89
+ url: (i.files.find(f => f.name === 'full') || i.files[0]).url,
90
+ alt: i.metadata.alt,
91
+ credits: i.metadata.credits,
92
+ // isCover: i.isCover,
93
+ }))
95
94
  },
96
95
  },
97
96
 
98
97
  methods: {
99
98
  openImage(index) {
100
- this.selectedIndex = index + 1
99
+ this.imageThumbnails.length > 1 ? this.selectedIndex = index + 1 : this.selectedIndex = index
101
100
  this.showSlideshow = true
102
101
  },
103
102
  truncatedDescription(description) {
@@ -204,12 +203,13 @@ export default {
204
203
  .text-overlay {
205
204
  position: absolute;
206
205
  display: block;
207
- bottom: space(2);
206
+ bottom: space(2.5);
208
207
  color: #fff;
209
208
  background: rgba(50, 50, 50, 0.7);
210
209
  padding: space(0.5);
211
210
  max-width: 80vw;
212
211
  text-align: center;
212
+ border-radius: space(2);
213
213
  }
214
214
  }
215
215
 
@@ -219,7 +219,12 @@ export default {
219
219
  methods: {
220
220
  goBack() {
221
221
  if (typeof window === 'undefined') return
222
- this.returnURL = document.referrer
222
+ if (document.referrer === undefined) {
223
+ const currentURL = new URL(window.location.href)
224
+ this.returnURL = currentURL.origin
225
+ } else {
226
+ this.returnURL = document.referrer
227
+ }
223
228
  // window.history.back()
224
229
  // const url = window.location.href
225
230
  // return url.slice(0, url.lastIndexOf('/'))
@@ -77,7 +77,7 @@
77
77
  "files": [
78
78
  {
79
79
  "name": "thumbnail-md",
80
- "url": "https://asd20websitestorage.blob.core.windows.net/website-files/message-images//thumbnail-md/dcc_swimming_250x250.jpg"
80
+ "url": "https://asd20websitestorage.blob.core.windows.net/website-files/message-images/all-students-learn-at-high-levels./thumbnail-md/PIES-choice-photo_250x250.jpg"
81
81
  },
82
82
  {
83
83
  "name": "full",
@@ -85,7 +85,8 @@
85
85
  }
86
86
  ],
87
87
  "metadata": {
88
- "alt": "This is ALT text."
88
+ "alt": "This is ALT text.",
89
+ "credits": "A teacher teaches."
89
90
  }
90
91
  }
91
92
  ],