Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(case-study-carousel): Case study carousel block. #323

Merged
merged 7 commits into from
Sep 6, 2023
273 changes: 230 additions & 43 deletions blocks/carousel/carousel.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ main .section div.carousel-wrapper {
transition: height 0.2s linear
}

.carousel.case-study .carousel-slide-container {
background-color: var(--neutral-carbon);
border-radius: var(--spacer-element-09);
color: var(--neutral-white);
min-height: 528px;
}

.carousel .carousel-slide {
width: 100%;
height: 100%;
Expand Down Expand Up @@ -170,18 +177,34 @@ main .section div.carousel-wrapper {
padding-inline-start: 0;
}

.carousel.case-study ul.carousel-dots {
gap: var(--spacer-element-04);
}

.carousel .carousel-dots li {
width: 12px;
height: 12px;
width: var(--spacer-element-04);
height: var(--spacer-element-04);
box-shadow: inset 0 0 100px 100px var(--neutral-sand);
cursor: pointer;
border-radius: 50%;
}

.carousel.case-study .carousel-dots li {
width: var(--spacer-layout-05);
height: var(--spacer-element-02);
border-radius: unset;
}

.carousel .carousel-dots li.carousel-dots-active {
box-shadow: inset 0 0 100px 100px var(--primary-purple);
}

.carousel.case-study .carousel-dots li.carousel-dots-active {
box-shadow: inherit;
background-image: var(--gradient-left-right);
background-position: 0 100%;
}

.carousel .carousel-dots button {
display: none;
}
Expand All @@ -192,52 +215,140 @@ main .section div.carousel-wrapper {
margin: var(--spacer-layout-05) 0 0;
}

/* Media queries */
@media screen and (min-width: 1200px) {
.carousel-container {
background: var(--neutral-bone);
padding: var(--spacer-layout-06) 0 var(--spacer-layout-06);
.carousel.case-study .carousel-slide-container .carousel-slide {
text-align: left;
}

main .section div.carousel-wrapper {
padding-top: var(--spacer-layout-07);
padding-bottom: var(--spacer-layout-04);

.carousel.case-study .carousel-slide-container .carousel-slide .case-study__container-wrapper {
padding: var(--sticky-nav-height) var(--spacer-element-08) var(--spacer-element-10) var(--spacer-element-08);
}

.section.carousel-container .default-content-wrapper {
padding-top: 0;
padding-bottom: var(--spacer-layout-07);

.carousel.case-study .carousel-slide-container .carousel-slide .case-study__container-wrapper .case-study__title-wrapper > p:first-child {
text-transform: uppercase;
font-family: var(--sans-serif-font-medium);
font-size: var(--font-size-11);
font-weight: var(--font-weight-medium);
line-height: var(--line-height-120);
letter-spacing: 0.1375rem;
margin: 0;
}

.carousel .carousel-slide-container {
width: 100%;
max-width: 740px;
position: relative;
overflow: hidden;
margin: 0 auto;
transition: height 0.2s linear
.carousel.case-study .carousel-slide-container .carousel-slide .case-study__container-wrapper .case-study__content-wrapper > h2 {
font-size: var(--font-size-32);
font-family: var(--serif-font);
font-weight: var(--font-weight-light);
line-height: var(--line-height-120);
letter-spacing: 0.035rem;
margin: var(--spacer-element-07) 0 0 0;
}

.carousel ul.carousel-dots {
margin-top: var(--spacer-layout-02);

.carousel.case-study .carousel-slide-container .carousel-slide .case-study__container-wrapper .case-study__content-wrapper > p:nth-child(2) {
font-size: var(--font-size-16);
font-family: var(--sans-serif-font-light);
font-weight: var(--font-weight-light);
line-height: var(--line-height-160);
letter-spacing: 0.01rem;
margin: var(--spacer-element-08) 0 0 0;
}

.carousel.case-study .carousel-slide-container .carousel-slide .case-study__container-wrapper .case-study__content-wrapper .button-container {
margin: var(--spacer-element-08) 0 0 0;
}

.carousel.case-study .carousel-slide-container .carousel-slide .case-study__container-wrapper .case-study__content-wrapper .button-container a {
color: var(--neutral-white);
border: 2px solid var(--neutral-white);
background-image: none;
white-space: nowrap;
}

.carousel .carousel-slide {
width: 100%;
height: 100%;
.carousel.case-study .carousel-slide-container .carousel-slide .case-study__container-wrapper .case-study__content-wrapper .button-container a:hover {
background-image: var(--gradient-to-right);
transition: all .4s ease-in-out;
}

.carousel.case-study .carousel-slide-container .carousel-slide > div.only-picture > picture {
display: flex;
position: absolute;
transition: all 0.5s;
bottom: 0;
}

.carousel .carousel-slide div {
display: flex;
flex-direction: column;
font-family: var(--serif-font);
font-weight: var(--font-weight-light);
line-height: 124%;
font-size: 31px;
Copy link
Collaborator

@helms-charity helms-charity Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function "calculateSlideHeight" seems to need a font size as a number, not a variable in order to render the .carousel-slide-container. So you can put this back but specify the .carousel.testimonial type?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I remember I tried using 32px as the font-size here, but there's something funky with your custome font, and I had to tell the JS to use 31px instead of 32px so that nothing would get cut off.

/* Media queries */

/* Tablet */
@media screen and (min-width: 768px) {
.carousel.case-study ul.carousel-dots {
margin-top: var(--spacer-layout-04);
gap: var(--gap-10);
}

.carousel.case-study .carousel-slide-container {
min-height: 588px;
}

.carousel.case-study .carousel-slide-container .carousel-slide .case-study__container-wrapper {
padding: var(--spacer-layout-06) var(--spacer-layout-05) var(--spacer-layout-04) var(--spacer-layout-05);
}

}

/* Desktop */
@media screen and (min-width: 1200px) {
.carousel-container {
background: var(--neutral-bone);
padding: var(--spacer-layout-06) 0 var(--spacer-layout-06);
}

main .section div.carousel-wrapper {
padding-top: var(--spacer-layout-07);
padding-bottom: var(--spacer-layout-04);
}

.section.carousel-container .default-content-wrapper {
padding-top: 0;
padding-bottom: var(--spacer-layout-07);
}

.carousel .carousel-slide-container {
width: 100%;
position: relative;
overflow: hidden;
margin: 0 auto;
transition: height 0.2s linear
}

.carousel.case-study .carousel-slide-container {
min-height: 774px;
min-width: var(--secton-max-container);
}

.carousel ul.carousel-dots {
margin-top: var(--spacer-layout-02);
}

.carousel.case-study ul.carousel-dots {
margin-top: var(--spacer-layout-05);
}

.carousel.case-study .carousel-dots li {
width: var(--spacer-layout-07);
}

.carousel .carousel-slide {
width: 100%;
height: 100%;
position: absolute;
transition: all 0.5s;
}

.carousel .carousel-slide div {
display: flex;
flex-direction: column;
font-family: var(--serif-font);
font-weight: var(--font-weight-light);
line-height: 124%;
font-size: var(--font-size-32);
}

/* Testimonial */
.carousel .carousel-slide .figure {
Expand All @@ -255,12 +366,12 @@ main .section div.carousel-wrapper {
padding-top: var(--spacer-layout-02);
}

.carousel.testimonial p {
margin-left: 1em;
font-size: var(--font-size-16);
font-family: var(--sans-serif-font-regular);
letter-spacing: var(--letter-spacing-1);
}
.carousel.testimonial p {
margin-left: var(--spacer-element-05);
font-size: var(--font-size-16);
font-family: var(--sans-serif-font-regular);
letter-spacing: var(--letter-spacing-1);
}

.carousel:hover .carousel-nav {
opacity: 1;
Expand All @@ -270,4 +381,80 @@ main .section div.carousel-wrapper {
text-align: left;
margin: 0;
}

.carousel.case-study .carousel-nav {
opacity: 1;
top: 36%;
background: unset;
}

.carousel.case-study .carousel-nav.carousel-nav-prev {
transform: unset;
background: url('./../../icons/carousel-arrow-left.svg') no-repeat;
background-size: contain;
width: 100px;
height: 100px;
left: -50px;
}

.carousel.case-study .carousel-nav.carousel-nav-prev:hover {
transform: unset;
background: url('./../../icons/carousel-arrow-left-hover.svg') no-repeat;
background-size: contain;
width: 100px;
height: 100px;
left: -50px;
}

.carousel.case-study .carousel-nav.carousel-nav-next {
transform: unset;
background: url('./../../icons/carousel-arrow-right.svg') no-repeat;
background-size: contain;
width: 101px;
height: 101px;
right: -50px;
}

.carousel.case-study .carousel-nav.carousel-nav-next:hover {
transform: unset;
background: url('./../../icons/carousel-arrow-right-hover.svg') no-repeat;
background-size: contain;
width: 101px;
height: 101px;
right: -50px;
}

.carousel.case-study .carousel-slide-container .carousel-slide .case-study__container-wrapper {
padding: var(--spacer-layout-06) var(--spacer-layout-06) 0 var(--spacer-layout-06);
}

.carousel.case-study .carousel-slide-container .carousel-slide .case-study__container-wrapper .case-study__title-wrapper > p:first-child {
font-size: var(--font-size-14);
letter-spacing: 0.175rem;
}

.carousel.case-study .carousel-slide-container .carousel-slide .case-study__container-wrapper .case-study__content-wrapper {
display: flex;
flex-direction: row;
margin-top: var(--spacer-element-07);
gap: var(--gap-24);
}

.carousel.case-study .carousel-slide-container .carousel-slide .case-study__container-wrapper .case-study__content-wrapper .button-container {
margin: 0;
}

.carousel.case-study .carousel-slide-container .carousel-slide .case-study__container-wrapper .case-study__content-wrapper > h2 {
font-size: var(--font-size-45);
max-width: 268px;
letter-spacing: 0.0493rem;
margin: 0;
}

.carousel.case-study .carousel-slide-container .carousel-slide .case-study__container-wrapper .case-study__content-wrapper > p:nth-child(2) {
font-size: var(--font-size-21);
max-width: 446px;
letter-spacing: 0.013rem;
margin: 0;
}
}
Loading