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

SOEOPSFY24-301 | scaffold timeline #7

Merged
merged 26 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
73c6125
SOEOPSFY24-301 | scaffold timeline
rebeccahongsf Oct 23, 2024
b780de4
add timeline data, tweak layout
rebeccahongsf Oct 25, 2024
e5de5b1
randomize image shapes
rebeccahongsf Oct 25, 2024
5f2f246
add timeline json
rebeccahongsf Oct 25, 2024
b6dc83a
add timeline data jsob blob
rebeccahongsf Oct 29, 2024
fdda493
switch subtitle to dek
rebeccahongsf Oct 29, 2024
1f72f9e
add timeline banner on click
rebeccahongsf Oct 29, 2024
aded702
add year to debug dupes
rebeccahongsf Oct 29, 2024
5ee1c0a
tweak timeline
rebeccahongsf Oct 29, 2024
8f2be0b
fix timeline banner bug
rebeccahongsf Oct 29, 2024
11d55ec
shift components to examples page; tweak page title; scaffold home pa…
rebeccahongsf Oct 29, 2024
77f96f3
timeline code clean up; add additional fake data
rebeccahongsf Oct 29, 2024
e91458a
add font
rebeccahongsf Oct 30, 2024
26730f6
create timeline details
rebeccahongsf Oct 30, 2024
f7bfc32
fixup 5 item, 4 item rows
rebeccahongsf Oct 30, 2024
1a7e65d
add close button to timeline details
rebeccahongsf Oct 30, 2024
4bb1965
Merge branch 'main' into feature/SOEOPSFY24-301--timeline
rebeccahongsf Oct 30, 2024
7f81539
resolve gh actions
rebeccahongsf Oct 30, 2024
478dffb
test linter
rebeccahongsf Oct 30, 2024
032a39b
add prettier package
rebeccahongsf Oct 30, 2024
8984cab
run lint fix
rebeccahongsf Oct 30, 2024
c249c04
fixup lint
rebeccahongsf Oct 30, 2024
561975a
fix lint
rebeccahongsf Oct 30, 2024
b25f48c
update package json
rebeccahongsf Oct 30, 2024
d49a18d
resolve quotes err
rebeccahongsf Oct 30, 2024
a597c12
test lint fix
rebeccahongsf Oct 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,6 @@ on:
push:
# pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set the correct Node version using nvm
shell: bash -l {0}
run: nvm install
- uses: bahmutov/npm-install@v1
with:
useLockFile: false
- name: Lint
run: npm run lint
- name: Typecheck
run: npm run tsc

jobs:
lint:
name: Lint & TS Check
Expand All @@ -35,6 +19,15 @@ jobs:
restore-keys: |
lint-${{ hashFiles('package.json') }}-${{ hashFiles('yarn.lock') }}
lint-${{ hashFiles('package.json') }}-

- name: Enable Corepack
shell: bash
run: corepack enable

- name: Prepare Yarn Version
shell: bash
run: corepack prepare [email protected] --activate

- name: Lint
run: |
yarn
Expand Down
14 changes: 7 additions & 7 deletions app/components/Container/Container.styles.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export const widths = {
full: 'w-full', // width: 100%; default
site: 'cc', // Use Decanter custom screen margins and sets max content width of 1500px
screen: 'w-screen', // width: 100vw
full: "w-full", // width: 100%; default
site: "cc", // Use Decanter custom screen margins and sets max content width of 1500px
screen: "w-screen", // width: 100vw
};

export const bgColors = {
black: 'bg-black text-white',
white: 'bg-white text-black',
'fog-light': 'bg-fog-light text-black',
'red-gradient': 'bg-soe-red-gradient text-white',
black: "bg-black text-white",
white: "bg-white text-black",
"fog-light": "bg-fog-light text-black",
"red-gradient": "bg-soe-red-gradient text-white",
};
30 changes: 15 additions & 15 deletions app/components/Container/Container.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HTMLAttributes } from 'react';
import { cnb } from 'cnbuilder';
import { HTMLAttributes } from "react";
import { cnb } from "cnbuilder";
import {
paddingTops,
paddingBottoms,
Expand All @@ -9,9 +9,9 @@ import {
marginVerticals,
type MarginType,
type PaddingType,
} from '@/utilities/datasource';
import * as styles from './Container.styles';
import * as types from './Container.types';
} from "@/utilities/datasource";
import * as styles from "./Container.styles";
import * as types from "./Container.types";

export type ContainerProps = HTMLAttributes<HTMLElement> & {
as?: types.ContainerElementType;
Expand All @@ -27,8 +27,8 @@ export type ContainerProps = HTMLAttributes<HTMLElement> & {
};

export const Container = ({
as: AsComponent = 'div',
width = 'site',
as: AsComponent = "div",
width = "site",
py,
pt,
pb,
Expand All @@ -45,14 +45,14 @@ export const Container = ({
{...props}
style={style}
className={cnb(
bgColor ? styles.bgColors[bgColor] : '',
py ? paddingVerticals[py] : '',
pt ? paddingTops[pt] : '',
pb ? paddingBottoms[pb] : '',
my ? marginVerticals[my] : '',
mt ? marginTops[mt] : '',
mb ? marginBottoms[mb] : '',
width ? styles.widths[width] : '',
bgColor ? styles.bgColors[bgColor] : "",
py ? paddingVerticals[py] : "",
pt ? paddingTops[pt] : "",
pb ? paddingBottoms[pb] : "",
my ? marginVerticals[my] : "",
mt ? marginTops[mt] : "",
mb ? marginBottoms[mb] : "",
width ? styles.widths[width] : "",
className,
)}
>
Expand Down
17 changes: 14 additions & 3 deletions app/components/Container/Container.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
import * as styles from './Container.styles';
import * as styles from "./Container.styles";

export type ContainerElementType = 'div' | 'section' | 'article' | 'main' | 'footer' | 'aside' | 'header' | 'nav' | 'form' | 'fieldset' | 'figcaption';
export type ContainerElementType =
| "div"
| "section"
| "article"
| "main"
| "footer"
| "aside"
| "header"
| "nav"
| "form"
| "fieldset"
| "figcaption";

export type WidthType = keyof typeof styles.widths;

export type BgColorType = keyof typeof styles.bgColors | '';
export type BgColorType = keyof typeof styles.bgColors | "";
6 changes: 3 additions & 3 deletions app/components/Container/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './Container';
export * from './Container.styles';
export * from './Container.types';
export * from "./Container";
export * from "./Container.styles";
export * from "./Container.types";
9 changes: 5 additions & 4 deletions app/components/FeatureHero/FeatureHero.styles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const root = 'h-full max-h-[1200px] relative overflow-hidden';
export const wrapper = 'mr-0 au-ml-auto flex-col lg:flex-row';
export const gradient = 'absolute top-0 left-0 bg-feature-gradient-rl bg-feature-gradient-bt w-full h-full z-30';
export const contentWrapper = 'lg:rs-pr-9 ml-0 *:text-white z-50';
export const root = "h-full max-h-[1200px] relative overflow-hidden";
export const wrapper = "mr-0 au-ml-auto flex-col lg:flex-row";
export const gradient =
"absolute top-0 left-0 bg-feature-gradient-rl bg-feature-gradient-bt w-full h-full z-30";
export const contentWrapper = "lg:rs-pr-9 ml-0 *:text-white z-50";
64 changes: 40 additions & 24 deletions app/components/FeatureHero/FeatureHero.tsx
Original file line number Diff line number Diff line change
@@ -1,51 +1,67 @@
'use client';
"use client";

import { HTMLAttributes } from 'react';
import { Container } from '../Container';
import { FlexBox } from '../FlexBox';
import { HTMLAttributes } from "react";
import { Container } from "../Container";
import { FlexBox } from "../FlexBox";
// import * as styles from './FeatureHero.styles';
import Image from 'next/image';
import ShapeA from '../images/shape-a';
import { motion, useScroll, useTransform } from 'framer-motion';
import Image from "next/image";
import ShapeA from "../images/shape-a";
import { motion, useScroll, useTransform } from "framer-motion";

type FeatureHeroProps = HTMLAttributes<HTMLDivElement> & {
children: React.ReactNode;
imageSrc?: string;
};

export const FeatureHero = ({
children,
...props
}: FeatureHeroProps) => {
export const FeatureHero = ({ children, ...props }: FeatureHeroProps) => {
const { scrollYProgress } = useScroll();
const opacity = useTransform(scrollYProgress, [0, 0.05], [1, 0]);

return (
<FlexBox {...props} as="section" alignItems="start" justifyContent="between" className="relative flex-col bg-soe-black h-auto w-full z-10">
<Container width="full" className='order-last flex flex-col rs-p-9 *:text-white z-50 lg:max-w-[50%] *:font-dm-sans bg-soe-black lg:bg-transparent'>
<FlexBox
{...props}
as="section"
alignItems="start"
justifyContent="between"
className="relative flex-col bg-soe-black h-auto w-full z-10"
>
<Container
width="full"
className="order-last flex flex-col rs-p-9 *:text-white z-50 lg:max-w-[50%] *:font-dm-sans bg-soe-black lg:bg-transparent"
>
{children}
</Container>
<div className="relative w-full aspect-[16/9] bg-cool-grey lg:absolute lg:top-0 lg:left-0 h-auto z-10 overflow-hidden">
<Image className="absolute top-0 left-0 lg:left-[300px] z-0 w-full h-auto"
<Image
className="absolute top-0 left-0 lg:left-[300px] z-0 w-full h-auto"
alt=""
src={`soe-centennial-nextjs/assets/images/Hawa-Racine-Thiam.jpg`}
src={"soe-centennial-nextjs/assets/images/Hawa-Racine-Thiam.jpg"}
width={0}
height={0}
sizes="100vw" />
<motion.div style={{ opacity }} >
sizes="100vw"
/>
<motion.div style={{ opacity }}>
<div className="absolute w-full h-full top-0 left-0 z-10">
<div className="w-full h-full bg-plum-dark absolute top-0 left-0 z-10" />
<ShapeA className="absolute bottom-10 left-10 lg:left-[300px] z-20 *:stroke-plum" height={1200} />
<ShapeA
className="absolute bottom-10 left-10 lg:left-[300px] z-20 *:stroke-plum"
height={1200}
/>
</div>
</motion.div>
<div className='absolute top-0 left-0 bg-transparent lg:bg-feature-gradient-rl bg-feature-gradient-bt w-full h-full z-50' />
<Image className="absolute top-0 left-0 lg:left-[300px] z-20 w-full h-auto"
<div className="absolute top-0 left-0 bg-transparent lg:bg-feature-gradient-rl bg-feature-gradient-bt w-full h-full z-50" />
<Image
className="absolute top-0 left-0 lg:left-[300px] z-20 w-full h-auto"
alt=""
src={`soe-centennial-nextjs/assets/images/Hawa-Racine-Thiam_silhouette.png`}
src={
"soe-centennial-nextjs/assets/images/Hawa-Racine-Thiam_silhouette.png"
}
width={0}
height={0}
sizes="100vw" />
<div className='absolute top-0 left-0 bg-feature-gradient-bt w-full h-full z-50' />
sizes="100vw"
/>
<div className="absolute top-0 left-0 bg-feature-gradient-bt w-full h-full z-50" />
</div>
</FlexBox>
);};
);
};
4 changes: 2 additions & 2 deletions app/components/FeatureHero/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './FeatureHero';
export * from './FeatureHero.styles';
export * from "./FeatureHero";
export * from "./FeatureHero.styles";
48 changes: 24 additions & 24 deletions app/components/FlexBox/FlexBox.styles.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
export const flexDirection = {
row: 'flex-row',
'row-reverse': 'flex-row-reverse',
col: 'flex-col',
'col-reverse': 'flex-col-reverse',
row: "flex-row",
"row-reverse": "flex-row-reverse",
col: "flex-col",
"col-reverse": "flex-col-reverse",
};

export const flexWrap = {
wrap: 'flex-wrap',
'wrap-reverse': 'flex-wrap-reverse',
nowrap: 'flex-nowrap',
wrap: "flex-wrap",
"wrap-reverse": "flex-wrap-reverse",
nowrap: "flex-nowrap",
};

export const flexJustifyContent = {
start: 'justify-start',
end: 'justify-end',
center: 'justify-center',
between: 'justify-between',
around: 'justify-around',
evenly: 'justify-evenly',
start: "justify-start",
end: "justify-end",
center: "justify-center",
between: "justify-between",
around: "justify-around",
evenly: "justify-evenly",
};

export const flexAlignContent = {
start: 'content-start',
end: 'content-end',
center: 'content-center',
between: 'content-between',
around: 'content-around',
evenly: 'content-evenly',
start: "content-start",
end: "content-end",
center: "content-center",
between: "content-between",
around: "content-around",
evenly: "content-evenly",
};

export const flexAlignItems = {
start: 'items-start',
end: 'items-end',
center: 'items-center',
baseline: 'items-baseline',
stretch: 'items-stretch',
start: "items-start",
end: "items-end",
center: "items-center",
baseline: "items-baseline",
stretch: "items-stretch",
};
24 changes: 12 additions & 12 deletions app/components/FlexBox/FlexBox.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ReactNode, HTMLAttributes } from 'react';
import { cnb } from 'cnbuilder';
import * as styles from './FlexBox.styles';
import * as types from './FlexBox.types';
import React, { ReactNode, HTMLAttributes } from "react";
import { cnb } from "cnbuilder";
import * as styles from "./FlexBox.styles";
import * as types from "./FlexBox.types";

type FlexBoxProps = HTMLAttributes<HTMLElement> & {
as?: types.FlexElementType;
Expand All @@ -15,7 +15,7 @@ type FlexBoxProps = HTMLAttributes<HTMLElement> & {
};

export const FlexBox = ({
as: AsComponent = 'div',
as: AsComponent = "div",
direction,
gap,
wrap,
Expand All @@ -29,13 +29,13 @@ export const FlexBox = ({
<AsComponent
{...props}
className={cnb(
'flex',
direction ? styles.flexDirection[direction] : '',
wrap ? styles.flexWrap[wrap] : '',
justifyContent ? styles.flexJustifyContent[justifyContent] : '',
alignContent ? styles.flexAlignContent[alignContent] : '',
alignItems ? styles.flexAlignItems[alignItems] : '',
gap ? 'grid-gap' : '',
"flex",
direction ? styles.flexDirection[direction] : "",
wrap ? styles.flexWrap[wrap] : "",
justifyContent ? styles.flexJustifyContent[justifyContent] : "",
alignContent ? styles.flexAlignContent[alignContent] : "",
alignItems ? styles.flexAlignItems[alignItems] : "",
gap ? "grid-gap" : "",
className,
)}
>
Expand Down
19 changes: 17 additions & 2 deletions app/components/FlexBox/FlexBox.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
import * as styles from './FlexBox.styles';
import * as styles from "./FlexBox.styles";

export type FlexElementType = 'div' | 'section' | 'article' | 'main' | 'footer' | 'aside' | 'header' | 'nav' | 'form' | 'button' | 'fieldset' | 'ul' | 'ol' | 'li' | 'span';
export type FlexElementType =
| "div"
| "section"
| "article"
| "main"
| "footer"
| "aside"
| "header"
| "nav"
| "form"
| "button"
| "fieldset"
| "ul"
| "ol"
| "li"
| "span";

export type FlexDirectionType = keyof typeof styles.flexDirection;

Expand Down
6 changes: 3 additions & 3 deletions app/components/FlexBox/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './FlexBox';
export * from './FlexBox.styles';
export * from './FlexBox.types';
export * from "./FlexBox";
export * from "./FlexBox.styles";
export * from "./FlexBox.types";
Loading