-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feature/GIVCAMP-282_react-player-light
* dev: (34 commits) GIVCAMP-292 GIVCAMP-305 | Horizontal Initiative card and image aspect ratio options (#256) 1.3.3 Update robots to use different URL for sitemap path (#254) 1.3.2 GIVCAMP-307 | Stacked story hero variant (#251) 1.3.1 GIVCAMP-297 GIVCAMP-312 | Section background options + add light overlay options (#248) Bump follow-redirects from 1.15.4 to 1.15.6 (#249) 1.3.0 GIVCAMP-289: Inline External Script Loading. (#246) GIVCAMP-88 | data card (#245) 1.2.2 GIVCAMP-294 | Basic Hero overlay options and image optimization (#243) HSTS set max-age to 31536000 (#242) 1.2.1 Icon animation (#240) GIVCAMP-304 | Add CTA region to Section and Homepage Theme/Story Section (#239) 1.2.0 GIVCAMP-293 | Moment poster (#236) NoJira: Remove Editor Token (#237) ...
- Loading branch information
Showing
84 changed files
with
1,928 additions
and
506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { MetadataRoute } from 'next'; | ||
|
||
export default function robots(): MetadataRoute.Robots { | ||
const CurrentURL = process.env.DEPLOY_PRIME_URL || 'http://localhost:3000'; | ||
const CurrentURL = process.env.URL || process.env.DEPLOY_PRIME_URL || 'https://momentum.stanford.edu'; | ||
return { | ||
rules: { | ||
userAgent: '*', | ||
allow: '/', | ||
}, | ||
sitemap: CurrentURL + '/sitemap.xml', | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
export const root = 'relative w-full max-w-[29rem] sm:max-w-300 lg:max-w-[35rem] mx-auto break-words'; | ||
export const cardInner = 'relative w-full h-full aspect-w-1 aspect-h-2'; | ||
export const cardInner = 'relative size-full aspect-w-1 aspect-h-2'; | ||
|
||
export const cardFront = 'absolute w-full h-full top-0 left-0'; | ||
export const cardFront = 'absolute size-full top-0 left-0'; | ||
export const imageWrapper = 'overflow-hidden aspect-w-1 aspect-h-2'; | ||
export const info = 'rs-px-1 pb-150 absolute w-full h-full bottom-0 left-0 mb-0'; | ||
export const info = 'rs-px-1 pb-150 absolute size-full bottom-0 left-0 mb-0'; | ||
export const heading = 'mb-02em mt-auto'; | ||
|
||
export const cardContent = 'absolute w-full h-full top-0 left-0 px-20 py-30 3xl:py-48 3xl:px-36 aria-hidden:opacity-0 opacity-100 backdrop-blur-sm transition-opacity duration-500 bg-gradient-to-b from-gc-black/60 to-gc-black/90 gc-changemaker *:*:*:!mb-1em'; | ||
export const cardContent = 'absolute size-full top-0 left-0 px-20 py-30 3xl:py-48 3xl:px-36 aria-hidden:opacity-0 opacity-100 backdrop-blur-sm transition-opacity duration-500 bg-gradient-to-b from-gc-black/60 to-gc-black/90 gc-changemaker *:*:*:!mb-1em'; | ||
|
||
export const button = 'group absolute w-full h-full top-0 left-0'; | ||
export const button = 'group absolute size-full top-0 left-0'; | ||
export const icon = 'absolute bottom-40 right-36 text-white w-65 h-65 border-2 border-white rounded-full p-16 group-hocus-visible:border-dashed group-aria-expanded:rotate-45 transition-transform'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { cnb } from 'cnbuilder'; | ||
|
||
export const animateWrapper = 'h-full'; | ||
// Use border-black-50/50 which works well on both light and dark backgrounds | ||
export const root = 'relative overflow-hidden size-full break-words border-l-2 border-black-50/50'; | ||
|
||
export const flex = 'h-full'; | ||
export const content = ( | ||
hasBarColor?: boolean, | ||
) => cnb('rs-pl-2', { | ||
'border-l-[1.4rem] md:border-l-[2rem]': hasBarColor, | ||
}); | ||
|
||
export const heading = 'rs-mb-3 ml-22 whitespace-pre-line mt-auto'; | ||
export const body = '*:*:leading-snug'; | ||
export const cta = 'rs-mt-2'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import { cnb } from 'cnbuilder'; | ||
import { AnimateInView, type AnimationType } from '@/components/Animate'; | ||
import { NumberCounter } from '@/components/NumberCounter'; | ||
import { Container } from '@/components/Container'; | ||
import { FlexBox } from '@/components/FlexBox'; | ||
import { Heading, type HeadingType } from '../Typography'; | ||
import { accentBorderColors, type AccentBorderColorType, type PaddingType } from '@/utilities/datasource'; | ||
import { splitNumberString } from '@/utilities/splitNumberString'; | ||
import * as styles from './DataCard.styles'; | ||
|
||
export type DataCardProps = React.HTMLAttributes<HTMLDivElement> & { | ||
heading?: string; | ||
headingLevel?: HeadingType; | ||
isDarkTheme?: boolean; | ||
barColor?: AccentBorderColorType; | ||
body?: React.ReactNode; | ||
paddingTop?: PaddingType; | ||
cta?: React.ReactNode; | ||
isCounter?: boolean; | ||
// In number of seconds | ||
counterDuration?: number; | ||
animation?: AnimationType; | ||
delay?: number; | ||
}; | ||
|
||
export const DataCard = ({ | ||
heading, | ||
headingLevel = 'h3', | ||
barColor, | ||
body, | ||
cta, | ||
paddingTop, | ||
isDarkTheme, | ||
isCounter, | ||
counterDuration, | ||
animation = 'slideUp', | ||
delay, | ||
children, | ||
className, | ||
...props | ||
}: DataCardProps) => { | ||
const headingProcessed = isCounter ? splitNumberString(heading) : undefined; | ||
|
||
return ( | ||
<AnimateInView animation={animation} delay={delay} className={styles.animateWrapper}> | ||
<Container | ||
as="article" | ||
width="full" | ||
pt={paddingTop} | ||
className={styles.root} | ||
{...props} | ||
> | ||
<FlexBox direction="col" className={styles.flex}> | ||
{/* If number counter is enabled, aria-hidden the animated heading and add a SR only heading */} | ||
{isCounter && heading && ( | ||
<Heading as={headingLevel} srOnly>{heading}</Heading> | ||
)} | ||
{heading && ( | ||
<Heading | ||
as={headingLevel} | ||
font="druk" | ||
leading="druk" | ||
color={isDarkTheme ? 'white' : 'black'} | ||
size="f5" | ||
aria-hidden={isCounter} | ||
className={styles.heading} | ||
> | ||
{isCounter ? ( | ||
<> | ||
{headingProcessed?.beforeNumber} | ||
<NumberCounter number={headingProcessed?.number} duration={counterDuration} /> | ||
{headingProcessed?.afterNumber} | ||
</> | ||
) : ( | ||
heading | ||
)} | ||
</Heading> | ||
)} | ||
<div className={cnb(styles.content(!!barColor), accentBorderColors[barColor])}> | ||
<div className={styles.body}> | ||
{body} | ||
</div> | ||
{!!cta && ( | ||
<div className={styles.cta}> | ||
{cta} | ||
</div> | ||
)} | ||
</div> | ||
</FlexBox> | ||
</Container> | ||
</AnimateInView> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './DataCard'; |
Oops, something went wrong.