diff --git a/src/components/common/card/card.module.scss b/src/components/common/card/card.module.scss index a7f79f6..1bb4050 100644 --- a/src/components/common/card/card.module.scss +++ b/src/components/common/card/card.module.scss @@ -7,10 +7,22 @@ padding-bottom: tovw(2px, 'default', 2px); white-space: normal; width: 100%; + max-height: tovw(1000px, 'default', 600px); &-blog { border-bottom: none; + > div { + display: flex; + flex-direction: column; + justify-content: space-between; + height: 100%; + + .content { + height: 100%; + } + } + &:hover, &:focus { .read span { @@ -297,8 +309,13 @@ } h2 { + @include respond-to('mobile') { + font-size: tovw(30px, 'default', 30px); + } + text-transform: none !important; line-height: 1.2; + font-size: tovw(40px, 'default', 25px); } p { @@ -307,6 +324,7 @@ } margin: 0; + margin-top: auto; line-height: 1.4; font-size: tovw(18px, 'default', 15px); } diff --git a/src/components/common/card/index.tsx b/src/components/common/card/index.tsx index cd6b5e2..79d30e1 100644 --- a/src/components/common/card/index.tsx +++ b/src/components/common/card/index.tsx @@ -20,7 +20,12 @@ interface CardProps { reduced?: boolean } -const Card = ({ className, data, isNews = false, reduced }: CardProps) => { +const Card = ({ + className, + data, + isNews = false, + reduced = true +}: CardProps) => { const [eventDate, setEventDate] = useState() const [eventTime, setEventTime] = useState() @@ -40,6 +45,25 @@ const Card = ({ className, data, isNews = false, reduced }: CardProps) => { ) }, [data?.eventDatetime]) + const [title, setTitle] = useState() + const [eventTitle, setEventTitle] = useState() + + useEffect(() => { + if (data?.title?.length > 60) { + setTitle(data?.title.slice(0, 60) + '...') + return + } + + setTitle(data?.title) + + if (data?.eventTitle?.length > 60) { + setEventTitle(data?.eventTitle.slice(0, 60) + '...') + return + } + + setEventTitle(data?.eventTitle) + }, [data?.eventTitle, data?.title]) + return (
@@ -76,7 +100,7 @@ const Card = ({ className, data, isNews = false, reduced }: CardProps) => {
- {isNews ? data?.title : data?.eventTitle} + {isNews ? title : eventTitle} {!reduced &&

{isNews ? getDescription(data) : data?.eventDesc}

} @@ -107,6 +131,17 @@ export const BlogCard = ({ router.push(`/blog/${data?.slug}`) }, [data?.slug, router]) + const [title, setTitle] = useState() + + useEffect(() => { + if (data?.title && data?.title?.length > 60) { + setTitle(data?.title.slice(0, 60) + '...') + return + } + + setTitle(data?.title) + }, [data?.title]) + return (
- {data?.title} + {title} {horizontal &&

{data && getDescription(data)}

} READ ARTICLE diff --git a/src/components/sections/about/related/index.tsx b/src/components/sections/about/related/index.tsx index 84c439e..8758385 100644 --- a/src/components/sections/about/related/index.tsx +++ b/src/components/sections/about/related/index.tsx @@ -15,10 +15,11 @@ import s from './related.module.scss' export interface Props { isInPost?: boolean isFeatured?: boolean + reduced?: boolean data: any } -const Related = ({ data, isInPost, isFeatured }: Props) => { +const Related = ({ data, isInPost, isFeatured, reduced }: Props) => { const [sliderRef] = useKeenSlider({ initial: 0, loop: true, @@ -54,7 +55,7 @@ const Related = ({ data, isInPost, isFeatured }: Props) => { key={i} data={item} className="keen-slider__slide" - reduced={true} + reduced={reduced} isNews /> ))} diff --git a/src/components/sections/newsroom/press/index.tsx b/src/components/sections/newsroom/press/index.tsx new file mode 100644 index 0000000..82f6908 --- /dev/null +++ b/src/components/sections/newsroom/press/index.tsx @@ -0,0 +1,79 @@ +import 'keen-slider/keen-slider.min.css' + +import { useKeenSlider } from 'keen-slider/react' +import { Key, useState } from 'react' + +import { BlogCard } from '~/components/common/card' +import { ArrowSlider } from '~/components/icons/arrow' +import { Container } from '~/components/layout/container' +import Section from '~/components/layout/section' +import Heading from '~/components/primitives/heading' + +import s from './press.module.scss' + +// TODO +export interface Props { + blogData: any +} + +const Press = ({ blogData }: Props) => { + const [loaded, setLoaded] = useState(false) + + const [sliderRef, slider] = useKeenSlider({ + initial: 0, + loop: true, + mode: 'free-snap', + slides: { perView: 3.915, spacing: 24 }, + created() { + setLoaded(true) + }, + breakpoints: { + '(max-width: 1140px)': { + slides: { perView: 2.915, spacing: 20 } + }, + '(max-width: 900px)': { + slides: { perView: 1.12, spacing: 12 } + } + } + }) + + return ( +
+ +
+ + Press Releases + + 04 +
+
+
+
+ {blogData.map((item: any, i: Key) => ( + + ))} +
+
+ + {loaded && slider.current && ( +
+ + e.stopPropagation() || slider.current?.prev() + } + className={s['arrow']} + /> + + e.stopPropagation() || slider.current?.next() + } + className={s['arrow']} + /> +
+ )} +
+
+ ) +} + +export default Press diff --git a/src/components/sections/newsroom/press/press.module.scss b/src/components/sections/newsroom/press/press.module.scss new file mode 100644 index 0000000..64905a5 --- /dev/null +++ b/src/components/sections/newsroom/press/press.module.scss @@ -0,0 +1,137 @@ +@import '~/css/helpers'; + +.section { + @include respond-to('mobile') { + margin-top: unset; + padding: tovw(30px, 'mobile', 60px) 0 tovw(40px, 'mobile', 70px) 0; + } + + display: flex; + align-items: center; + flex-direction: column; + margin-top: tovw(55px, 'default', 55px); + padding: tovw(95px, 'default', 90px) 0 tovw(185px, 'default', 90px) 0; + + .slider__container { + @include respond-to('mobile') { + width: calc(100% - tovw(16px, 'mobile')); + } + + margin-right: 0; + margin-left: auto; + width: calc(100% - tovw(205px, 'default', 16px)); + } + + .heading { + @include respond-to('mobile') { + align-items: flex-start; + flex-direction: column; + border-bottom: unset; + padding: 0 tovw(56px, 'default', 16px); + gap: tovw(16px, 'mobile'); + } + + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: tovw(86px, 'default', 54px); + + .header { + @include respond-to('mobile') { + align-items: flex-end; + } + + display: flex; + justify-content: space-between; + border-bottom: tovw(1px, 'default', 1px) solid var(--color-white); + padding-bottom: tovw(36px, 'default', 24px); + width: 100%; + + > h2 { + text-shadow: 0 0 tovw(20px, 'default', 20px) rgb(255 255 255 / 0.4); + } + + span { + padding-top: tovw(35px, 'default', 14px); + color: var(--color-grey-light); + font-family: var(--font-dm-mono), sans-serif; + font-size: tovw(18px, 'default', 12px); + } + } + } + + .events__container { + @include respond-to('mobile') { + padding-left: 0; + } + + padding-left: tovw(100px); + + &::after, + &::before { + @include respond-to('mobile') { + background: linear-gradient( + 90deg, + rgb(3 3 3 / 0) 0%, + rgb(3 3 3 / 0.55) 35%, + rgb(3 3 3 / 1) 95% + ); + width: tovw(20px, 'default', 20px); + } + + position: absolute; + right: tovw(-20px, 'default', -20px); + background: linear-gradient( + 90deg, + rgb(3 3 3 / 0) 0%, + rgb(3 3 3 / 0.95) 35%, + rgb(3 3 3 / 1) 65% + ); + width: tovw(280px, 'default', 150px); + height: 100%; + content: ''; + } + + &::before { + @include respond-to('mobile') { + content: initial; + } + + right: initial; + left: tovw(-180px); + transform: scaleX(-1); + z-index: 5; + } + } + + .navigation { + @include respond-to('mobile') { + display: none; + } + + display: flex; + padding-top: tovw(75px, 'default', 45px); + width: 100%; + gap: tovw(25px, 'default', 18px); + place-content: center; + + button { + cursor: pointer; + display: flex; + align-items: center; + border: unset; + padding: unset; + margin: unset; + background-color: unset; + height: tovw(45px, 'default', 40px); + + &:first-child { + transform: rotate(180deg); + } + + .arrow { + width: tovw(51px, 'default', 51px); + } + } + } +} diff --git a/src/css/global.scss b/src/css/global.scss index 935fee3..9067dcb 100644 --- a/src/css/global.scss +++ b/src/css/global.scss @@ -98,8 +98,9 @@ body:not(.user-is-tabbing) textarea:focus { } p { - font-family: var(--font-tt-hoves); font-size: tovw(24px, 'default', 18px); + font-family: var(--font-tt-hoves); + line-height: 1.32; } .highlight { diff --git a/src/pages/newsroom.tsx b/src/pages/press.tsx similarity index 88% rename from src/pages/newsroom.tsx rename to src/pages/press.tsx index f03eb47..a662f05 100644 --- a/src/pages/newsroom.tsx +++ b/src/pages/press.tsx @@ -9,6 +9,7 @@ import { PageLayout } from '~/components/layout/page' import Related from '~/components/sections/about/related' import Hero from '~/components/sections/newsroom/hero' import Media from '~/components/sections/newsroom/media' +import Press from '~/components/sections/newsroom/press' // import { // CareersHero, @@ -57,7 +58,12 @@ const Newsroom = ({ - + +