barbican-reset 1.4.0 → 1.4.1

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.
@@ -1,7 +1,10 @@
1
1
  <template>
2
2
  <div :class="styleComponent">
3
- <div v-if="type === 'live'" :class="$style.icon">
4
- <div class="btn btn-secondary">live</div>
3
+ <div v-if="type === 'concert'" :class="$style.icon">
4
+ <div :class="[`btn btn-secondary`, { hero }]">
5
+ <template v-if="hero">Live event</template>
6
+ <live-icon :class="$style.svg" />
7
+ </div>
5
8
  </div>
6
9
  <img :class="$style.image" :src="image">
7
10
  <div v-if="expired" :class="$style.title">
@@ -11,8 +14,10 @@
11
14
  </template>
12
15
 
13
16
  <script>
17
+ import { LiveIcon } from 'barbican-reset/icons/stream'
14
18
  export default {
15
19
  name: "CardDisplay",
20
+ components: { LiveIcon },
16
21
  props: {
17
22
  image: {
18
23
  type: String,
@@ -28,7 +33,7 @@ export default {
28
33
  },
29
34
  type: {
30
35
  type: String,
31
- default: 'live',
36
+ default: 'concert',
32
37
  },
33
38
  },
34
39
  computed: {
@@ -38,12 +43,40 @@ export default {
38
43
  if (this.hero) { output.push(style.hero); }
39
44
  return output;
40
45
  },
46
+ styleButton() {
47
+ const style = this.$style;
48
+ let output = [style.button];
49
+ if (this.hero) { output.push(style.hero); }
50
+ return output;
51
+ }
41
52
  }
42
53
  }
43
54
  </script>
44
55
 
56
+ <style lang="scss" scoped>
57
+
58
+ .btn.btn-secondary {
59
+ &:not(.hero) {
60
+ border-radius: 50%;
61
+ padding: 0.5rem;
62
+ }
63
+
64
+ &.hero {
65
+ align-items: center;
66
+ padding: 0.75rem;
67
+ display: flex;
68
+ gap: 0.5rem;
69
+ }
70
+ }
71
+
72
+ </style>
73
+
45
74
  <style lang="scss" module>
46
75
 
76
+ .svg {
77
+ fill: white;
78
+ }
79
+
47
80
  .component {
48
81
  padding-top: 56.25%;
49
82
  position: relative;
@@ -2,27 +2,63 @@
2
2
 
3
3
  <div>
4
4
 
5
- <fluid-iframe v-if="type === 'jwplayer'" :src="url" />
5
+ <fluid-iframe v-if="data.type === 'jwplayer'" :src="data.url" />
6
6
 
7
- <div v-if="type === 'brightcove'" v-html="markup" :class="$style.brightcove"></div>
7
+ <template v-if="data.type === 'brightcove'">
8
8
 
9
- <h2 v-html="title" class="margin-bottom-1"></h2>
9
+ <div v-html="data.markup" :class="$style.brightcove"></div>
10
10
 
11
- <p v-html="lead_description"></p>
11
+ <alert v-if="data.isExpired" error center inline>Event has passed.</alert>
12
12
 
13
- <p v-html="long_description"></p>
13
+ </template>
14
14
 
15
- <p>Until {{ formatDateTime(expires) }}</p>
15
+ <h2 v-html="data.title" class="margin-bottom-1"></h2>
16
+
17
+ <p v-html="data.lead_description"></p>
18
+
19
+ <template v-if="data.long_description">
20
+
21
+ <p v-html="data.long_description"></p>
22
+
23
+ </template>
24
+
25
+ <template v-if="data.expires">
26
+
27
+ <p>Until {{ formatDateTime(data.expires) }}</p>
28
+
29
+ </template>
30
+
31
+ <template v-if="data.programme">
32
+
33
+ <p>Read tonight's <a :href="data.programme" target="_blank">Digital Programme</a></p>
34
+
35
+ </template>
16
36
 
17
37
  </div>
18
38
 
19
39
  </template>
20
40
 
21
41
  <script>
22
- import { FluidIframe } from 'barbican-reset'
42
+ import { FluidIframe, Alert } from 'barbican-reset'
23
43
  export default {
24
- props: ['type','url','markup','title','lead_description','long_description','expires'],
25
- components: { FluidIframe },
44
+ props: {
45
+ data: {
46
+ type: Object
47
+ },
48
+ concert: {
49
+ type: Boolean,
50
+ default: false,
51
+ }
52
+ },
53
+ created() {
54
+ if (this.concert) {
55
+ this.data.expires = this.data.brightcove.expires;
56
+ this.data.markup = this.data.brightcove.markup;
57
+ this.data.script = this.data.brightcove.script;
58
+ this.data.isExpired = this.data.brightcove.isExpired;
59
+ }
60
+ },
61
+ components: { FluidIframe, Alert },
26
62
  methods: {
27
63
  formatDateTime(date) {
28
64
  return this.$moment(date).format("LT ddd D MMM YYYY");
@@ -1,106 +1,11 @@
1
1
  <template>
2
- <div class="live-icon__container">
3
- <div class="live-icon__title">Live event</div>
4
- <svg
5
- class="live-icon__svg"
6
- :class="{ animate: animate }"
7
- xmlns="http://www.w3.org/2000/svg"
8
- viewBox="0 0 14 15"
9
- >
10
- <path
11
- class="big-echo"
12
- d="M14,7.5c0-2.8-1.1-5.3-2.9-7.1l-1,1.1c1.5,1.5,2.5,3.7,2.5,6s-1,4.5-2.5,6l1.1,1.1 C12.9,12.8,14,10.3,14,7.5z"
13
- />
14
- <path
15
- class="small-echo"
16
- d="M8.6,7.5C8.6,9,8,10.4,7,11.4l1,1.1c1.3-1.3,2-3,2-5S9.2,3.8,8,2.6l-1.1,1C7.9,4.6,8.6,6,8.6,7.5z"
17
- />
18
- <path
19
- class="echo-ball"
20
- d="M6,7.5c0,1.7-1.3,3-3,3s-3-1.3-3-3s1.3-3,3-3S6,5.8,6,7.5z"
21
- />
22
- </svg>
23
- </div>
2
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
3
+ <path d="M7.76,16.24C6.67,15.16,6,13.66,6,12s0.67-3.16,1.76-4.24l1.42,1.42C8.45,9.9,8,10.9,8,12c0,1.1,0.45,2.1,1.17,2.83 L7.76,16.24z M16.24,16.24C17.33,15.16,18,13.66,18,12s-0.67-3.16-1.76-4.24l-1.42,1.42C15.55,9.9,16,10.9,16,12 c0,1.1-0.45,2.1-1.17,2.83L16.24,16.24z M12,10c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S13.1,10,12,10z M20,12 c0,2.21-0.9,4.21-2.35,5.65l1.42,1.42C20.88,17.26,22,14.76,22,12s-1.12-5.26-2.93-7.07l-1.42,1.42C19.1,7.79,20,9.79,20,12z M6.35,6.35L4.93,4.93C3.12,6.74,2,9.24,2,12s1.12,5.26,2.93,7.07l1.42-1.42C4.9,16.21,4,14.21,4,12S4.9,7.79,6.35,6.35z"/>
4
+ </svg>
24
5
  </template>
25
6
 
26
7
  <script>
27
- import { gsap } from "gsap";
28
8
  export default {
29
- name: "LiveIcon",
30
- props: {
31
- animate: {
32
- type: Boolean,
33
- },
34
- },
35
- methods: {
36
- doAnimate(input) {
37
- if (input) {
38
- let tl = gsap.timeline({ repeat: -1, repeatDelay: 0.5 });
39
- let parent = ".live-icon__svg.animate";
40
- let all = [
41
- `${parent} .echo-ball`,
42
- `${parent} .small-echo`,
43
- `${parent} .big-echo`,
44
- ];
45
- tl.set(all, {
46
- opacity: 0.1,
47
- }).to(all, {
48
- opacity: 1,
49
- stagger: 0.3,
50
- duration: 1,
51
- });
52
- }
53
- },
54
- },
55
- mounted() {
56
- this.doAnimate(this.animate);
57
- },
9
+ name: "LiveIcon"
58
10
  };
59
11
  </script>
60
-
61
- <style lang="scss" scoped>
62
-
63
- .live-icon {
64
- &__container {
65
- background-color: $c-grey-midnight;
66
- border-radius: $border-radius;
67
- font-size: $font-size-sm;
68
- padding: 0.6rem 0.8rem;
69
- border-color: white;
70
- position: absolute;
71
- font-weight: bold;
72
- border: 1px solid;
73
- color: white;
74
- right: 1rem;
75
- top: 1rem;
76
-
77
- @include media-breakpoint-up(sm) {
78
- font-size: $font-size-base;
79
- padding: 0.8rem 1rem;
80
- }
81
-
82
- @include media-breakpoint-up(md) {
83
- right: 2rem;
84
- top: 2rem;
85
- }
86
- }
87
-
88
- &__title {
89
- vertical-align: middle;
90
- display: inline-block;
91
- margin-right: 0.5rem;
92
- }
93
-
94
- &__svg {
95
- vertical-align: middle;
96
- display: inline-block;
97
- height: 1.5rem;
98
- fill: white;
99
-
100
- @include media-breakpoint-up(sm) {
101
- height: 1.75rem;
102
- }
103
- }
104
- }
105
-
106
- </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "barbican-reset",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "A collection of useful scss imports and js scripts, that provide consistent styling and functionality across barbican projects.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/scss/_atomic.scss CHANGED
@@ -1,11 +1,11 @@
1
1
 
2
- $margins: "margin-top", "margin-bottom", "min-height";
2
+ $gaps: "margin-top", "margin-bottom", "min-height", "padding-left", "padding-right";
3
3
  $aligns: "left", "center", "right";
4
4
 
5
- @each $margin in $margins {
5
+ @each $gap in $gaps {
6
6
  @for $i from 1 to 5 {
7
- .#{$margin}-#{$i} {
8
- #{$margin}: 1rem * $i;
7
+ .#{$gap}-#{$i} {
8
+ #{$gap}: 1rem * $i;
9
9
  }
10
10
  }
11
11
  }