|
9 | 9 | // object-fit and instead copy the image src to a the background-image of the
|
10 | 10 | // wrapper div and add the compat-object-fit class.
|
11 | 11 | //
|
12 |
| -// 2. Visually overrides the top margin for '.body' defined in _body.scss. |
13 |
| -// The '.body' top margin creates space between the header and page content. |
14 |
| -// However, on the homepage, we want the carousel to be flush with the header. |
15 |
| -// |
16 | 12 | // 3. Allows image to scale on large screens while preventing the top and bottom
|
17 | 13 | // from becoming cut off.
|
18 | 14 | // -----------------------------------------------------------------------------
|
|
22 | 18 | min-width: 100%;
|
23 | 19 | margin-bottom: (spacing("double") + spacing("single"));
|
24 | 20 | margin-top: -(spacing("single")); // 3
|
| 21 | + overflow: hidden; |
| 22 | + visibility: hidden; |
| 23 | + |
| 24 | + &.is-visible { |
| 25 | + visibility: visible; |
| 26 | + } |
25 | 27 |
|
26 | 28 | @include breakpoint("medium") {
|
27 | 29 | margin-top: -(spacing("single") + spacing("base")); // 3
|
28 | 30 | }
|
29 | 31 |
|
30 |
| - &.slick-initialized { // 2 |
31 |
| - max-height: remCalc(1000); |
| 32 | + &.slick-initialized { |
32 | 33 | opacity: 1;
|
| 34 | + max-height: 100vh; |
| 35 | + |
| 36 | + @include breakpoint("small") { |
| 37 | + max-height: remCalc(400px); |
| 38 | + } |
| 39 | + |
| 40 | + @include breakpoint("medium") { |
| 41 | + max-height: remCalc(600px); |
| 42 | + } |
33 | 43 | }
|
34 | 44 |
|
35 | 45 | &:not(.slick-initialized) :not(.heroCarousel-slide--first).heroCarousel-slide {
|
|
43 | 53 | .slick-next,
|
44 | 54 | .slick-prev {
|
45 | 55 | top: 50%;
|
| 56 | + transform: translateY(-50%); |
| 57 | + margin: 0; |
46 | 58 | }
|
47 | 59 |
|
48 | 60 | .slick-next {
|
|
82 | 94 | }
|
83 | 95 |
|
84 | 96 | .heroCarousel-image {
|
85 |
| - @include breakpoint("medium") { |
86 |
| - object-fit: cover; // 1 |
87 |
| - max-height: remCalc(600px); |
88 |
| - width: 100%; |
| 97 | + object-fit: contain; |
| 98 | + width: 100%; |
| 99 | + height: 100%; |
| 100 | + object-position: 50% 0%; |
| 101 | + |
| 102 | + @include breakpoint("small") { |
| 103 | + object-position: 50% 50%; |
| 104 | + } |
| 105 | + } |
| 106 | + |
| 107 | + &.stretch { |
| 108 | + .heroCarousel-image { |
| 109 | + object-fit: cover; |
| 110 | + object-position: 50% 50%; |
| 111 | + } |
| 112 | + |
| 113 | + &.compat-object-fit { // 1 |
| 114 | + .heroCarousel-image { |
| 115 | + width: 100%; |
| 116 | + height: 100%; |
| 117 | + } |
| 118 | + } |
| 119 | + } |
| 120 | + |
| 121 | + &.compat-object-fit { // 1 |
| 122 | + overflow: hidden; |
| 123 | + |
| 124 | + .heroCarousel-image { |
| 125 | + width: auto; |
89 | 126 | }
|
90 | 127 | }
|
91 | 128 |
|
92 | 129 | .heroCarousel-image-wrapper {
|
| 130 | + height: remCalc(250px); |
| 131 | + display: flex; |
| 132 | + justify-content: center; |
| 133 | + align-items: flex-start; |
| 134 | + height: 56.25vw; |
| 135 | + |
| 136 | + @include breakpoint("small") { |
| 137 | + max-height: remCalc(400px); |
| 138 | + } |
| 139 | + |
93 | 140 | @include breakpoint("medium") {
|
94 | 141 | max-height: remCalc(600px);
|
95 | 142 | }
|
96 | 143 | }
|
97 | 144 |
|
98 |
| - &.compat-object-fit { // 1 |
99 |
| - background-size: cover; |
100 |
| - background-position: 50%; |
101 |
| - background-repeat: no-repeat; |
102 |
| - |
103 |
| - &.stretch { |
104 |
| - @include breakpoint("large") { // 4 |
105 |
| - background-size: 100% 100%; |
106 |
| - } |
| 145 | + &.is-square-image-type { |
| 146 | + |
| 147 | + .heroCarousel-image-wrapper { |
| 148 | + height: 100vw; |
| 149 | + |
| 150 | + @include breakpoint("small") { |
| 151 | + height: 56.25vw; |
| 152 | + } |
107 | 153 | }
|
| 154 | + } |
108 | 155 |
|
109 |
| - .heroCarousel-image { |
110 |
| - opacity: 0; |
| 156 | + &.is-vertical-image-type { |
| 157 | + |
| 158 | + .heroCarousel-image-wrapper { |
| 159 | + height: 110vw; |
| 160 | + |
| 161 | + @include breakpoint("small") { |
| 162 | + height: 56.25vw; |
| 163 | + } |
111 | 164 | }
|
112 | 165 | }
|
113 | 166 | }
|
|
117 | 170 | padding: spacing("half") spacing("single") (spacing("double"));
|
118 | 171 | text-align: center;
|
119 | 172 |
|
120 |
| - @include breakpoint("medium") { |
| 173 | + @include breakpoint("small") { |
121 | 174 | @include carouselOpaqueBackgrounds;
|
| 175 | + width: remCalc(700px); |
| 176 | + padding: spacing("single") * 1.5; |
| 177 | + width: 70%; |
122 | 178 | background-color: rgba($carousel-bgColor, 0.9);
|
123 | 179 | left: 0;
|
| 180 | + padding: spacing("single"); |
124 | 181 | margin: 0 auto;
|
125 |
| - padding: spacing("single") * 1.5; |
126 | 182 | position: absolute;
|
127 | 183 | right: 0;
|
128 | 184 | top: 50%;
|
129 | 185 | transform: translateY(-50%);
|
130 |
| - width: remCalc(700px); |
131 | 186 |
|
132 | 187 | &.heroCarousel-content--empty {
|
133 | 188 | background-color: transparent;
|
|
0 commit comments