Skip to content

Commit

Permalink
SOEOPSFY24-309 SOEOPSFY24-350 | adjust impact story banner and contri…
Browse files Browse the repository at this point in the history
…bute story banner
  • Loading branch information
rebeccahongsf committed Dec 10, 2024
1 parent 3fe869f commit 13444e0
Show file tree
Hide file tree
Showing 31 changed files with 312 additions and 78 deletions.
4 changes: 2 additions & 2 deletions app/example/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Container } from "@/components/Container";
import { ContributeStoryBanner } from "@/components/ContributeStoryBanner";
import { HorizontalLineart } from "@/components/images/horizontal-lineart";
import { Quote } from "@/components/Quote";
import { ImpactStoryBanner } from "@/components/ImpactStoryBanner";
import { ImpactBanner } from "@/components/StoryBanners";
import Metadata from "@/components/Layout/Metadata";

const ExamplePage = async () => {
Expand Down Expand Up @@ -57,7 +57,7 @@ const ExamplePage = async () => {
</Text>
</FeatureHero>
<ShapeAnimation />
<ImpactStoryBanner
<ImpactBanner
heading="Exploring the reengineering of immune cells"
superhead="Change Makers"
body="The Sarafan ChEM-H Institute scholar is building a multidisciplinary lab to explore the reengineering of immune cells. Before coming to Stanford, she says, “I was thinking in terms of understanding. Now I feel that I can start thinking in terms of creating."
Expand Down
22 changes: 11 additions & 11 deletions app/example/story/hero/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Masthead } from "@/components/Masthead";
import { ImpactStoryBanner } from "@/components/ImpactStoryBanner";
import { ImpactBanner } from "@/components/StoryBanners";

const ExampleStoryPage = async () => {
return (
<div>
<Masthead isOverlap />
<ImpactStoryBanner
<ImpactBanner
bgColor="stone-dark"
heading="Exploring the reengineering of immune cells"
superhead="Change Makers"
Expand All @@ -14,7 +14,7 @@ const ExampleStoryPage = async () => {
src="/soe-centennial-nextjs/assets/images/lt-flynn-1994.jpeg"
caption="Caption/credit lorem ipsum dolar sit amet vestibulum perimentium"
/>
<ImpactStoryBanner
<ImpactBanner
hasBgImage
bgColor="stone-dark"
heading="Exploring the reengineering of immune cells"
Expand All @@ -24,7 +24,7 @@ const ExampleStoryPage = async () => {
src="/soe-centennial-nextjs/assets/images/lt-flynn-1994.jpeg"
caption="Caption/credit lorem ipsum dolar sit amet vestibulum perimentium"
/>
<ImpactStoryBanner
<ImpactBanner
bgColor="red"
heading="Exploring the reengineering of immune cells"
superhead="Change Makers"
Expand All @@ -33,7 +33,7 @@ const ExampleStoryPage = async () => {
src="/soe-centennial-nextjs/assets/images/lt-flynn-1994.jpeg"
caption="Caption/credit lorem ipsum dolar sit amet vestibulum perimentium"
/>
<ImpactStoryBanner
<ImpactBanner
hasBgImage
bgColor="red"
heading="Exploring the reengineering of immune cells"
Expand All @@ -43,15 +43,15 @@ const ExampleStoryPage = async () => {
src="/soe-centennial-nextjs/assets/images/lt-flynn-1994.jpeg"
caption="Caption/credit lorem ipsum dolar sit amet vestibulum perimentium"
/>
<ImpactStoryBanner
<ImpactBanner
heading="Exploring the reengineering of immune cells"
superhead="Change Makers"
body="The Sarafan ChEM-H Institute scholar is building a multidisciplinary lab to explore the reengineering of immune cells. Before coming to Stanford, she says, “I was thinking in terms of understanding. Now I feel that I can start thinking in terms of creating."
byline="by Jess Alvarenga"
src="/soe-centennial-nextjs/assets/images/lt-flynn-1994.jpeg"
caption="Caption/credit lorem ipsum dolar sit amet vestibulum perimentium"
/>
<ImpactStoryBanner
<ImpactBanner
isHorizontal
bgColor="stone-dark"
heading="Exploring the reengineering of immune cells"
Expand All @@ -61,7 +61,7 @@ const ExampleStoryPage = async () => {
src="/soe-centennial-nextjs/assets/images/lt-flynn-1994.jpeg"
caption="Caption/credit lorem ipsum dolar sit amet vestibulum perimentium"
/>
<ImpactStoryBanner
<ImpactBanner
isHorizontal
hasBgImage
bgColor="stone-dark"
Expand All @@ -72,7 +72,7 @@ const ExampleStoryPage = async () => {
src="/soe-centennial-nextjs/assets/images/lt-flynn-1994.jpeg"
caption="Caption/credit lorem ipsum dolar sit amet vestibulum perimentium"
/>
<ImpactStoryBanner
<ImpactBanner
isHorizontal
bgColor="red"
heading="Exploring the reengineering of immune cells"
Expand All @@ -82,7 +82,7 @@ const ExampleStoryPage = async () => {
src="/soe-centennial-nextjs/assets/images/lt-flynn-1994.jpeg"
caption="Caption/credit lorem ipsum dolar sit amet vestibulum perimentium"
/>
<ImpactStoryBanner
<ImpactBanner
isHorizontal
hasBgImage
bgColor="red"
Expand All @@ -93,7 +93,7 @@ const ExampleStoryPage = async () => {
src="/soe-centennial-nextjs/assets/images/lt-flynn-1994.jpeg"
caption="Caption/credit lorem ipsum dolar sit amet vestibulum perimentium"
/>
<ImpactStoryBanner
<ImpactBanner
isHorizontal
heading="Exploring the reengineering of immune cells"
superhead="Change Makers"
Expand Down
4 changes: 2 additions & 2 deletions app/example/story/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { Masthead } from "@/components/Masthead";
import { Container } from "@/components/Container";
import { ContributeStoryBanner } from "@/components/ContributeStoryBanner";
import { TimelineSidebar } from "@/components/Timeline";
import { ImpactStoryBanner } from "@/components/ImpactStoryBanner";
import { ImpactBanner } from "@/components/StoryBanners";
import { TwoCol } from "@/components/Layout";

const ExampleStoryPage = async () => {
return (
<div>
<Masthead isOverlap />
<ImpactStoryBanner
<ImpactBanner
bgColor="stone-dark"
heading="Exploring the reengineering of immune cells"
superhead="Change Makers"
Expand Down
4 changes: 3 additions & 1 deletion components/ContributeStoryBanner/ContributeStoryBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export const ContributeStoryBanner = ({
size={2}
mb="none"
font="dm-mono"
className="order-first font-dm-mono mb-1 mt-70"
className={cnb("order-first font-dm-mono mb-1", {
"mt-70": hasLineArt,
})}
>
Get involved
</Text>
Expand Down
1 change: 0 additions & 1 deletion components/ImpactStoryBanner/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Image from "next/image";
import { Heading, Text } from "../Typography";
import { cnb } from "cnbuilder";

type ImpactStoryBannerProps = HTMLAttributes<HTMLDivElement> & {
type ImpactBannerProps = HTMLAttributes<HTMLDivElement> & {
heading: string;
superhead: string;
body: string;
Expand All @@ -18,7 +18,7 @@ type ImpactStoryBannerProps = HTMLAttributes<HTMLDivElement> & {
alt?: string;
};

export const ImpactStoryBanner = ({
export const ImpactBanner = ({
heading,
superhead,
body,
Expand All @@ -30,7 +30,7 @@ export const ImpactStoryBanner = ({
src,
alt,
...props
}: ImpactStoryBannerProps) => {
}: ImpactBannerProps) => {
const pb = bgColor === "white" ? 10 : 8;
return (
<Container {...props} width="full" mb={7} className="relative">
Expand All @@ -55,10 +55,10 @@ export const ImpactStoryBanner = ({
)}
<FlexBox
alignItems="center"
className={cnb("flex flex-col z-50 relative", {
className={cnb("flex flex-col z-50 relative md:grid-gap", {
"lg:flex-row": !isHorizontal,
"w-full max-w-[1100px] mx-auto": isHorizontal,
})}
gap
>
<div
className={cnb("flex flex-col text-center rs-mb-8 rs-mt-7", {
Expand Down Expand Up @@ -89,8 +89,9 @@ export const ImpactStoryBanner = ({
>
<div
className={cnb(
"aspect-[3/2] w-full xl:max-h-[960px] overflow-hidden relative rounded-[30px] mb-10",
{ "md:aspect-[2/3]": !isHorizontal },
"w-full xl:max-h-[860px] overflow-hidden relative rounded-[30px] mb-10",
{ "aspect-[3/2]": isHorizontal },
{ "aspect-[1/1] md:aspect-[2/3]": !isHorizontal },
)}
>
<Image src={src} alt={alt || ""} fill className="object-cover" />
Expand Down
85 changes: 85 additions & 0 deletions components/StoryBanners/LineBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import { HTMLAttributes } from "react";
import { BgColorType, Container } from "@/components/Container";
import { Heading, Text } from "@/components/Typography";
import BannerLineart from "@/components/images/banner-lineart";
import { cnb } from "cnbuilder";
import { Button } from "../Cta";
import { FlexBox } from "@/components/FlexBox";

type LineBannerProps = HTMLAttributes<HTMLDivElement> & {
hasLineArt?: boolean;
heading: string;
superhead: string;
body: string;
byline?: string;
bgColor?: BgColorType;
caption?: string;
src: string;
alt?: string;
};

export const LineBanner = ({
bgColor = "red-gradient",
hasLineArt = false,
...props
}: LineBannerProps) => (
<Container
{...props}
as="section"
bgColor={bgColor}
width="full"
className="cc lg:w-full lg:rs-px-7 mb-20 flex items-center justify-center"
pt={2}
pb={6}
>
<Container
className={cnb(
"relative 2xl:max-w-[1700px] flex items-center justify-center w-full",
{
"*:text-white": bgColor === "red-gradient",
"*:text-stone-dark": bgColor !== "red-gradient",
"p-30 sm:p-50 md:p-68 lg:p-100 xl:rs-py-10 xl:rs-px-8": hasLineArt,
"rs-py-5 rs-px-2": !hasLineArt,
},
)}
width="full"
>
{hasLineArt && (
<BannerLineart className="absolute top-0 left-0 flex justify-center items-center z-10" />
)}
<div className="w-full 2xl:max-w-[1050px] flex flex-col xl:flex-row items-center sm:items-start xl:items-center justify-center h-full justify-between xl:gap-50">
<FlexBox direction="col" className="z-50 max-w-full lg:max-w-[670px]">
<Heading mb={5} className="font-normal">
Contribute{" "}
<span
className={cnb("underline decoration-4 underline-offset-8", {
"text-digital-red-xlight": bgColor === "red-gradient",
"text-stone-dark": bgColor !== "red-gradient",
})}
>
your stories
</span>
</Heading>
<Text
size={2}
mb="none"
font="dm-mono"
className="order-first font-dm-mono mb-1 mt-70"
>
Get involved
</Text>
<Text size={1} mb="none">
Cras felis tortor, bibendum quis porttitor at, ullamcorper eu diam.
Aenean iaculis efficitur quam, quis dignissim lacus. Cras nec dui id
mi blandit lobortis eget in enim.
</Text>
</FlexBox>
<div className="shrink-0 z-50 my-48 md:mb-0">
<Button isLight={bgColor !== "red-gradient" ? true : false} href="/">
Submit your story
</Button>
</div>
</div>
</Container>
</Container>
);
2 changes: 2 additions & 0 deletions components/StoryBanners/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./ImpactBanner";
export * from "./LineBanner";
4 changes: 2 additions & 2 deletions components/Typography/typography.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ export const textVariants = {
subheading: "subheading",
/**
* Centennial typography styles
* (-soe ones are Decanter styles with Centennial modifications)
* (cen- ones are Decanter styles with Centennial modifications)
*/
caption: "caption",
caption: "cen-caption",
card: "card",
changemaker: "text-18 sm:text-15 3xl:text-16 leading-snug 3xl:leading-cozy",
changemakerHorizontal:
Expand Down
Loading

0 comments on commit 13444e0

Please sign in to comment.