Merge branch 'main' of https://git.csclub.uwaterloo.ca/www/cs-2022-class-profile
This commit is contained in:
commit
f5c9f2e447
|
@ -15,8 +15,14 @@ module.exports = {
|
||||||
"plugin:react/recommended",
|
"plugin:react/recommended",
|
||||||
"plugin:prettier/recommended",
|
"plugin:prettier/recommended",
|
||||||
],
|
],
|
||||||
plugins: ["@typescript-eslint", "react", "react-hooks", "prettier"],
|
plugins: ["@typescript-eslint", "react", "react-hooks", "prettier", "unused-imports"],
|
||||||
rules: {
|
rules: {
|
||||||
|
"no-unused-vars": "off",
|
||||||
|
"unused-imports/no-unused-imports": "error",
|
||||||
|
"unused-imports/no-unused-vars": [
|
||||||
|
"error",
|
||||||
|
{ "vars": "all", "varsIgnorePattern": "^_", "args": "after-used", "argsIgnorePattern": "^_" }
|
||||||
|
],
|
||||||
"prettier/prettier": ["error", { "endOfLine": "auto" }],
|
"prettier/prettier": ["error", { "endOfLine": "auto" }],
|
||||||
"import/first": "error",
|
"import/first": "error",
|
||||||
"import/order": [
|
"import/order": [
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
transform: rotate(180deg);
|
transform: rotate(180deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 768px) {
|
@media screen and (max-width: 1000px) {
|
||||||
.subBox {
|
.subBox {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
@ -93,6 +93,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.arrow {
|
.arrow {
|
||||||
width: calc(200rem / 16);
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.containerOnlyRightArrow {
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.containerOnlyLeftArrow {
|
||||||
|
justify-content: flex-start;
|
||||||
}
|
}
|
|
@ -4,35 +4,49 @@ import React from "react";
|
||||||
import styles from "./BottomNav.module.css";
|
import styles from "./BottomNav.module.css";
|
||||||
|
|
||||||
interface PagesInfo {
|
interface PagesInfo {
|
||||||
leftPageLink: string;
|
leftPage?: {
|
||||||
leftPageName: string;
|
url: string;
|
||||||
rightPageLink: string;
|
name: string;
|
||||||
rightPageName: string;
|
};
|
||||||
|
rightPage?: {
|
||||||
|
url: string;
|
||||||
|
name: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function BottomNav(props: PagesInfo) {
|
export function BottomNav(props: PagesInfo) {
|
||||||
|
const onlyRightArrow = props.rightPage && !props.leftPage;
|
||||||
|
const onlyLeftArrow = !props.rightPage && props.leftPage;
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div
|
||||||
<div className={styles.subBox + " " + styles.subBoxLeft}>
|
className={`${styles.container}
|
||||||
<Link href={props.leftPageLink}>
|
${onlyRightArrow ? styles.containerOnlyRightArrow : ""}
|
||||||
<a>
|
${onlyLeftArrow ? styles.containerOnlyLeftArrow : ""}`}
|
||||||
<Arrow />
|
>
|
||||||
</a>
|
{props.leftPage ? (
|
||||||
</Link>
|
<div className={styles.subBox + " " + styles.subBoxLeft}>
|
||||||
<Link href={props.leftPageLink}>
|
<Link href={props.leftPage.url}>
|
||||||
<a className={styles.item}>{props.leftPageName}</a>
|
<a>
|
||||||
</Link>
|
<Arrow />
|
||||||
</div>
|
</a>
|
||||||
<div className={styles.subBox}>
|
</Link>
|
||||||
<Link href={props.rightPageLink}>
|
<Link href={props.leftPage.url}>
|
||||||
<a className={styles.item}>{props.rightPageName}</a>
|
<a className={styles.item}>{props.leftPage.name}</a>
|
||||||
</Link>
|
</Link>
|
||||||
<Link href={props.rightPageLink}>
|
</div>
|
||||||
<a>
|
) : null}
|
||||||
<Arrow isPointingRight />
|
{props.rightPage ? (
|
||||||
</a>
|
<div className={styles.subBox}>
|
||||||
</Link>
|
<Link href={props.rightPage.url}>
|
||||||
</div>
|
<a className={styles.item}>{props.rightPage.name}</a>
|
||||||
|
</Link>
|
||||||
|
<Link href={props.rightPage.url}>
|
||||||
|
<a>
|
||||||
|
<Arrow isPointingRight />
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: calc(40rem / 16) calc(50rem / 16);
|
padding: calc(40rem / 16) calc(50rem / 16);
|
||||||
margin: calc(65rem / 16) 0;
|
margin: calc(65rem / 16) 0;
|
||||||
width: 90%;
|
width: 88%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapperRight {
|
.wrapperRight {
|
||||||
|
@ -43,7 +43,12 @@
|
||||||
padding: 0 15%;
|
padding: 0 15%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 768px) {
|
.wrapperNoBodyText {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 900px) {
|
||||||
.sideWrapperCommon {
|
.sideWrapperCommon {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
@ -52,6 +57,10 @@
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wrapperCenter {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.internalWrapper {
|
.internalWrapper {
|
||||||
|
|
|
@ -7,7 +7,7 @@ type AlignOption = "left" | "center" | "right";
|
||||||
type ComponentWrapperProps = {
|
type ComponentWrapperProps = {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
heading: string;
|
heading: string;
|
||||||
bodyText: string;
|
bodyText?: string;
|
||||||
align?: AlignOption;
|
align?: AlignOption;
|
||||||
noBackground?: boolean;
|
noBackground?: boolean;
|
||||||
};
|
};
|
||||||
|
@ -30,11 +30,12 @@ export function ComponentWrapper({
|
||||||
className={`
|
className={`
|
||||||
${alignClasses[align]}
|
${alignClasses[align]}
|
||||||
${noBackground ? styles.noBackground : ""}
|
${noBackground ? styles.noBackground : ""}
|
||||||
|
${bodyText ? "" : styles.wrapperNoBodyText}
|
||||||
`}
|
`}
|
||||||
>
|
>
|
||||||
<div className={styles.internalWrapper}>
|
<div className={styles.internalWrapper}>
|
||||||
<h3>{heading}</h3>
|
<h3>{heading}</h3>
|
||||||
<p>{bodyText}</p>
|
{bodyText ? <p>{bodyText}</p> : null}
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.internalWrapper}>{children}</div>
|
<div className={styles.internalWrapper}>{children}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,137 @@
|
||||||
|
.headerWrapper {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
background: var(--dark--primary-background);
|
||||||
|
z-index: 98;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: calc(10rem / 16) calc(100rem / 16) 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.titleHeader {
|
||||||
|
margin: calc(16rem / 16) 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sideBarCommon {
|
||||||
|
position: fixed;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
min-width: calc(400rem / 16);
|
||||||
|
height: 100vh;
|
||||||
|
background: var(--secondary-background);
|
||||||
|
padding: calc(100rem / 16);
|
||||||
|
margin: 0;
|
||||||
|
z-index: 100;
|
||||||
|
padding: 0;
|
||||||
|
padding-right: calc(20rem / 16);
|
||||||
|
transition: transform 0.8s;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sideBarShown {
|
||||||
|
composes: sideBarCommon;
|
||||||
|
/* -1% to hide slight line tip showing in some browsers */
|
||||||
|
transform: translateX(-1%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sideBarHidden {
|
||||||
|
composes: sideBarCommon;
|
||||||
|
transform: translateX(100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.backgroundTintCommon {
|
||||||
|
background-color: var(--label);
|
||||||
|
animation: fadeIn 1s;
|
||||||
|
position: fixed;
|
||||||
|
z-index: 99;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
transition: opacity 0.8s, visibility 0.8s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.backgroundTintShow {
|
||||||
|
composes: backgroundTintCommon;
|
||||||
|
visibility: visible;
|
||||||
|
opacity: 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.backgroundTintHidden {
|
||||||
|
composes: backgroundTintCommon;
|
||||||
|
visibility: hidden;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.menuHeader {
|
||||||
|
margin-bottom: 0;
|
||||||
|
padding-left: calc(30rem / 16);
|
||||||
|
padding-bottom: 0;
|
||||||
|
color: var(--dark--secondary-heading);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sectionsWrapper {
|
||||||
|
padding-left: calc(30rem / 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menuIcon {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menuIcon:hover {
|
||||||
|
opacity: 0.8;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media screen and (max-width: 768px) {
|
||||||
|
.sideBarCommon {
|
||||||
|
min-width: calc(300rem / 16);
|
||||||
|
max-width: calc(500rem / 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menuHeader {
|
||||||
|
padding-left: calc(20rem / 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sectionsWrapper {
|
||||||
|
padding-left: calc(20rem / 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
.headerWrapper {
|
||||||
|
padding: calc(10rem / 16) calc(20rem / 16) 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.closeMenuButton {
|
||||||
|
background: var(--primary-heading);
|
||||||
|
padding: 0 calc(20rem / 16);
|
||||||
|
border-radius: calc(50rem / 16);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
margin-left: calc(20rem / 16);
|
||||||
|
/* transparent border fixes weird coloring on the border in some browsers */
|
||||||
|
border: calc(1rem / 16) solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.closeMenuButton:hover {
|
||||||
|
background-color: var(--secondary-accent-light);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lineWrapper {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lineWrapper:before {
|
||||||
|
content: "";
|
||||||
|
flex: 1 1;
|
||||||
|
border-bottom: 3px solid white;
|
||||||
|
margin: auto;
|
||||||
|
}
|
|
@ -0,0 +1,69 @@
|
||||||
|
import { pageRoutes } from "data/routes";
|
||||||
|
import Link from "next/link";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
|
||||||
|
import { Sections } from "./Sections";
|
||||||
|
|
||||||
|
import styles from "./Header.module.css";
|
||||||
|
|
||||||
|
export function Header() {
|
||||||
|
const [isShowingMenu, setIsShowingMenu] = useState(false);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
isShowingMenu
|
||||||
|
? styles.backgroundTintShow
|
||||||
|
: styles.backgroundTintHidden
|
||||||
|
}
|
||||||
|
onClick={(_) => {
|
||||||
|
setIsShowingMenu(false);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<div className={styles.headerWrapper}>
|
||||||
|
<h1 className={styles.titleHeader}>
|
||||||
|
<Link href="/">CS 2022</Link>
|
||||||
|
</h1>
|
||||||
|
<button
|
||||||
|
onClick={(_) => {
|
||||||
|
setIsShowingMenu(true);
|
||||||
|
}}
|
||||||
|
className={styles.menuIcon}
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src="/images/menuIcon.svg"
|
||||||
|
width="50"
|
||||||
|
height="50"
|
||||||
|
draggable="false"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
className={isShowingMenu ? styles.sideBarShown : styles.sideBarHidden}
|
||||||
|
>
|
||||||
|
<h1 className={styles.menuHeader}>Sections</h1>
|
||||||
|
<div className={styles.lineWrapper}>
|
||||||
|
<button
|
||||||
|
className={styles.closeMenuButton}
|
||||||
|
onClick={(_) => {
|
||||||
|
setIsShowingMenu(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src="/images/rightArrow.svg"
|
||||||
|
className={styles.arrowIcon}
|
||||||
|
width="50"
|
||||||
|
height="50"
|
||||||
|
draggable="false"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className={styles.sectionsWrapper}>
|
||||||
|
<Sections data={pageRoutes} showHeader={false} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
|
@ -83,6 +83,8 @@ interface LineGraphProps {
|
||||||
const DEFAULT_LABEL_SIZE = 16;
|
const DEFAULT_LABEL_SIZE = 16;
|
||||||
const DEFAULT_LEGEND_GAP = 16;
|
const DEFAULT_LEGEND_GAP = 16;
|
||||||
|
|
||||||
|
// TODO: Address unused props in this file
|
||||||
|
/* eslint-disable unused-imports/no-unused-vars*/
|
||||||
export function LineGraph(props: LineGraphProps) {
|
export function LineGraph(props: LineGraphProps) {
|
||||||
const {
|
const {
|
||||||
width,
|
width,
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
padding: calc(40rem / 16) 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
color: var(--primary-accent-light);
|
||||||
|
font-size: calc(70rem / 16);
|
||||||
|
margin: calc(40rem / 16) auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subTitle {
|
||||||
|
color: var(--primary-accent-lighter);
|
||||||
|
font-size: calc(26rem / 16);
|
||||||
|
margin: auto;
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
import styles from "./SectionHeader.module.css";
|
||||||
|
|
||||||
|
interface SectionHeaderProps {
|
||||||
|
title: string;
|
||||||
|
subtitle?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function SectionHeader({ title, subtitle }: SectionHeaderProps) {
|
||||||
|
return (
|
||||||
|
<div className={styles.header}>
|
||||||
|
<h1 className={styles.title}>{title}</h1>
|
||||||
|
{subtitle && <h5 className={styles.subTitle}>{subtitle}</h5>}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
|
@ -1,16 +1,12 @@
|
||||||
|
import { PageRoutes } from "data/routes";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import styles from "./Sections.module.css";
|
import styles from "./Sections.module.css";
|
||||||
|
|
||||||
interface SectionsData {
|
|
||||||
name: string;
|
|
||||||
url: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SectionsProps {
|
interface SectionsProps {
|
||||||
/* Whether to display the "Sections" title and separator that appears on the left. */
|
/* Whether to display the "Sections" title and separator that appears on the left. */
|
||||||
showHeader?: boolean;
|
showHeader?: boolean;
|
||||||
data: SectionsData[];
|
data: PageRoutes;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Sections({ data, showHeader = true }: SectionsProps) {
|
export function Sections({ data, showHeader = true }: SectionsProps) {
|
||||||
|
@ -26,7 +22,7 @@ export function Sections({ data, showHeader = true }: SectionsProps) {
|
||||||
)}
|
)}
|
||||||
<nav className={styles.nav}>
|
<nav className={styles.nav}>
|
||||||
<ul>
|
<ul>
|
||||||
{data.map((datum, index) => {
|
{Object.values(data).map((datum, index) => {
|
||||||
return (
|
return (
|
||||||
<li key={`${datum.name}-${index}`}>
|
<li key={`${datum.name}-${index}`}>
|
||||||
<a href={datum.url}>
|
<a href={datum.url}>
|
||||||
|
|
|
@ -1,46 +1,65 @@
|
||||||
export const sectionsData = [
|
export interface PageRoute {
|
||||||
{
|
name: string;
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
type PageID =
|
||||||
|
| "demographics"
|
||||||
|
| "academics"
|
||||||
|
| "coop"
|
||||||
|
| "lifestyleAndInterests"
|
||||||
|
| "intimacyAndDrugs"
|
||||||
|
| "postGrad"
|
||||||
|
| "friends"
|
||||||
|
| "miscellaneous"
|
||||||
|
| "mentalHealth"
|
||||||
|
| "personal"
|
||||||
|
| "contributors";
|
||||||
|
|
||||||
|
export type PageRoutes = { [key in PageID]: PageRoute };
|
||||||
|
export const pageRoutes: PageRoutes = {
|
||||||
|
demographics: {
|
||||||
name: "Demographics",
|
name: "Demographics",
|
||||||
url: "/",
|
url: "/demographics",
|
||||||
},
|
},
|
||||||
{
|
academics: {
|
||||||
name: "Academics",
|
name: "Academics",
|
||||||
url: "/",
|
url: "/academics",
|
||||||
},
|
},
|
||||||
{
|
coop: {
|
||||||
name: "Co-op",
|
name: "Co-op",
|
||||||
url: "/",
|
url: "/coop",
|
||||||
},
|
},
|
||||||
{
|
lifestyleAndInterests: {
|
||||||
name: "Lifestyle and Interests",
|
name: "Lifestyle and Interests",
|
||||||
url: "/",
|
url: "/lifestyle-and-interests",
|
||||||
},
|
},
|
||||||
{
|
intimacyAndDrugs: {
|
||||||
name: "Intimacy and Drugs",
|
name: "Intimacy and Drugs",
|
||||||
url: "/",
|
url: "/intimacy-and-drugs",
|
||||||
},
|
},
|
||||||
{
|
postGrad: {
|
||||||
name: "Post-grad",
|
name: "Post-grad",
|
||||||
url: "/",
|
url: "/post-grad",
|
||||||
},
|
},
|
||||||
{
|
friends: {
|
||||||
name: "Friends",
|
name: "Friends",
|
||||||
url: "/",
|
url: "/friends",
|
||||||
},
|
},
|
||||||
{
|
miscellaneous: {
|
||||||
name: "Miscellaneous",
|
name: "Miscellaneous",
|
||||||
url: "/",
|
url: "/miscellaneous",
|
||||||
},
|
},
|
||||||
{
|
mentalHealth: {
|
||||||
name: "Mental Health",
|
name: "Mental Health",
|
||||||
url: "/",
|
url: "/mental-health",
|
||||||
},
|
},
|
||||||
{
|
personal: {
|
||||||
name: "Personal",
|
name: "Personal",
|
||||||
url: "/",
|
url: "/personal",
|
||||||
},
|
},
|
||||||
{
|
contributors: {
|
||||||
name: "Contributors",
|
name: "Contributors",
|
||||||
url: "/",
|
url: "/contributors",
|
||||||
},
|
},
|
||||||
];
|
};
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
trailingSlash: true,
|
trailingSlash: true,
|
||||||
|
// This image loader supports `next export`, for optimizing next <Image /> tags
|
||||||
|
images: {
|
||||||
|
loader: 'akamai',
|
||||||
|
path: '',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = nextConfig
|
module.exports = nextConfig
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -45,6 +45,7 @@
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"eslint-plugin-react": "^7.30.0",
|
"eslint-plugin-react": "^7.30.0",
|
||||||
"eslint-plugin-react-hooks": "^4.5.0",
|
"eslint-plugin-react-hooks": "^4.5.0",
|
||||||
|
"eslint-plugin-unused-imports": "^2.0.0",
|
||||||
"postcss": "^8.4.14",
|
"postcss": "^8.4.14",
|
||||||
"postcss-calc": "^8.2.4",
|
"postcss-calc": "^8.2.4",
|
||||||
"postcss-flexbugs-fixes": "^5.0.2",
|
"postcss-flexbugs-fixes": "^5.0.2",
|
||||||
|
|
|
@ -145,4 +145,4 @@ a:hover {
|
||||||
--card-background: var(--dark--card-background);
|
--card-background: var(--dark--card-background);
|
||||||
--label: var(--dark--label);
|
--label: var(--dark--label);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -13,7 +13,7 @@ import {
|
||||||
mockTimelineData,
|
mockTimelineData,
|
||||||
mockGroupedBarGraphData,
|
mockGroupedBarGraphData,
|
||||||
} from "data/mocks";
|
} from "data/mocks";
|
||||||
import { sectionsData } from "data/routes";
|
import { pageRoutes } from "data/routes";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Color } from "utils/Color";
|
import { Color } from "utils/Color";
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ export default function Home() {
|
||||||
<h2>
|
<h2>
|
||||||
<code>{"<Sections />"}</code>
|
<code>{"<Sections />"}</code>
|
||||||
</h2>
|
</h2>
|
||||||
<Sections data={sectionsData} />
|
<Sections data={pageRoutes} />
|
||||||
|
|
||||||
<h2>
|
<h2>
|
||||||
<code>{"<About />"}</code>
|
<code>{"<About />"}</code>
|
||||||
|
@ -245,10 +245,8 @@ export default function Home() {
|
||||||
<code>{"<BottomNav />"}</code>
|
<code>{"<BottomNav />"}</code>
|
||||||
</h2>
|
</h2>
|
||||||
<BottomNav
|
<BottomNav
|
||||||
leftPageLink="/"
|
leftPage={pageRoutes.demographics}
|
||||||
leftPageName="Demographics"
|
rightPage={pageRoutes.coop}
|
||||||
rightPageLink="/"
|
|
||||||
rightPageName="Co-ops"
|
|
||||||
></BottomNav>
|
></BottomNav>
|
||||||
|
|
||||||
<h2>
|
<h2>
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
import { BarGraphHorizontal, BarGraphVertical } from "components/BarGraph";
|
|
||||||
import { mockCategoricalData, moreMockCategoricalData } from "data/mocks";
|
import { mockCategoricalData, moreMockCategoricalData } from "data/mocks";
|
||||||
|
import { pageRoutes } from "data/routes";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useWindowDimensions } from "utils/getWindowDimensions";
|
import { useWindowDimensions } from "utils/getWindowDimensions";
|
||||||
import { useIsMobile } from "utils/isMobile";
|
import { useIsMobile } from "utils/isMobile";
|
||||||
|
|
||||||
|
import { BarGraphVertical, BarGraphHorizontal } from "@/components/BarGraph";
|
||||||
import { BottomNav } from "@/components/BottomNav";
|
import { BottomNav } from "@/components/BottomNav";
|
||||||
import { ComponentWrapper } from "@/components/ComponentWrapper";
|
import { ComponentWrapper } from "@/components/ComponentWrapper";
|
||||||
|
import { Header } from "@/components/Header";
|
||||||
import { WordCloud } from "../components/WordCloud";
|
import { SectionHeader } from "@/components/SectionHeader";
|
||||||
|
import { WordCloud } from "@/components/WordCloud";
|
||||||
|
|
||||||
import styles from "./samplePage.module.css";
|
import styles from "./samplePage.module.css";
|
||||||
|
|
||||||
|
@ -15,23 +17,29 @@ export default function SamplePage() {
|
||||||
const { width } = useWindowDimensions();
|
const { width } = useWindowDimensions();
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
|
|
||||||
|
// For components that are in the side wrappers, it looks better if they fill a certain amount of width, so we can make the width dynamic like this
|
||||||
|
const defaultGraphWidth = isMobile ? width / 1.25 : width / 2;
|
||||||
|
const defaultGraphHeight = 500;
|
||||||
|
|
||||||
|
// Make vars for common configs such as common margins
|
||||||
|
const defaultBarGraphMargin = { top: 20, bottom: 40, left: 150, right: 20 };
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.page}>
|
<div className={styles.page}>
|
||||||
|
<Header />
|
||||||
|
<SectionHeader
|
||||||
|
title="Demographics"
|
||||||
|
subtitle="An insight into the demographics of UW’s CS programs"
|
||||||
|
/>
|
||||||
<ComponentWrapper
|
<ComponentWrapper
|
||||||
heading="What program are you in?"
|
heading="What program are you in?"
|
||||||
bodyText="There are a total of 106 respondents of the CS Class Profile. Interestingly, there are a huge number of students that are just in CS, partially due to the overwhelming number of people in CS as seen in the total demographics."
|
bodyText="There are a total of 106 respondents of the CS Class Profile. Interestingly, there are a huge number of students that are just in CS, partially due to the overwhelming number of people in CS as seen in the total demographics."
|
||||||
>
|
>
|
||||||
<BarGraphVertical
|
<BarGraphVertical
|
||||||
data={mockCategoricalData}
|
data={mockCategoricalData}
|
||||||
// For components that are in the side wrappers, it looks better if they fill a certain amount of width, so we can make the width dynamic like this
|
width={defaultGraphWidth}
|
||||||
width={isMobile ? width / 1.25 : width / 2}
|
height={defaultGraphHeight}
|
||||||
height={500}
|
margin={defaultBarGraphMargin}
|
||||||
margin={{
|
|
||||||
top: 20,
|
|
||||||
bottom: 80,
|
|
||||||
left: 60,
|
|
||||||
right: 20,
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</ComponentWrapper>
|
</ComponentWrapper>
|
||||||
|
|
||||||
|
@ -46,8 +54,8 @@ export default function SamplePage() {
|
||||||
value: word.value,
|
value: word.value,
|
||||||
}))}
|
}))}
|
||||||
// For components that we don't want to match the width necessarily we can provide direct values
|
// For components that we don't want to match the width necessarily we can provide direct values
|
||||||
width={isMobile ? width / 1.5 : 800}
|
width={defaultGraphWidth}
|
||||||
height={500}
|
height={defaultGraphHeight}
|
||||||
/>
|
/>
|
||||||
</ComponentWrapper>
|
</ComponentWrapper>
|
||||||
|
|
||||||
|
@ -59,14 +67,9 @@ export default function SamplePage() {
|
||||||
<BarGraphHorizontal
|
<BarGraphHorizontal
|
||||||
className={styles.barGraphDemo}
|
className={styles.barGraphDemo}
|
||||||
data={mockCategoricalData}
|
data={mockCategoricalData}
|
||||||
width={isMobile ? width / 1.45 : width / 2}
|
width={defaultGraphWidth}
|
||||||
height={500}
|
height={defaultGraphHeight}
|
||||||
margin={{
|
margin={defaultBarGraphMargin}
|
||||||
top: 20,
|
|
||||||
bottom: 40,
|
|
||||||
left: 150,
|
|
||||||
right: 20,
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</ComponentWrapper>
|
</ComponentWrapper>
|
||||||
|
|
||||||
|
@ -79,32 +82,19 @@ export default function SamplePage() {
|
||||||
<BarGraphHorizontal
|
<BarGraphHorizontal
|
||||||
className={styles.barGrapDemo}
|
className={styles.barGrapDemo}
|
||||||
data={mockCategoricalData}
|
data={mockCategoricalData}
|
||||||
width={isMobile ? width / 1.45 : width / 2}
|
width={defaultGraphWidth}
|
||||||
height={500}
|
height={defaultGraphHeight}
|
||||||
margin={{
|
margin={defaultBarGraphMargin}
|
||||||
top: 20,
|
|
||||||
bottom: 40,
|
|
||||||
left: 150,
|
|
||||||
right: 20,
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</ComponentWrapper>
|
</ComponentWrapper>
|
||||||
|
|
||||||
<ComponentWrapper
|
<ComponentWrapper heading="What program are you in?" align="left">
|
||||||
heading="What program are you in?"
|
|
||||||
bodyText="There are a total of 106 respondents of the CS Class Profile. Interestingly, there are a huge number of students that are just in CS, partially due to the overwhelming number of people in CS as seen in the total demographics."
|
|
||||||
>
|
|
||||||
<BarGraphHorizontal
|
<BarGraphHorizontal
|
||||||
className={styles.barGraphDemo}
|
className={styles.barGraphDemo}
|
||||||
data={mockCategoricalData}
|
data={mockCategoricalData}
|
||||||
width={isMobile ? width / 1.45 : width / 2}
|
width={defaultGraphWidth}
|
||||||
height={500}
|
height={defaultGraphHeight}
|
||||||
margin={{
|
margin={defaultBarGraphMargin}
|
||||||
top: 20,
|
|
||||||
bottom: 40,
|
|
||||||
left: 150,
|
|
||||||
right: 20,
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</ComponentWrapper>
|
</ComponentWrapper>
|
||||||
|
|
||||||
|
@ -119,15 +109,86 @@ export default function SamplePage() {
|
||||||
text: word.key,
|
text: word.key,
|
||||||
value: word.value,
|
value: word.value,
|
||||||
}))}
|
}))}
|
||||||
width={isMobile ? width / 1.5 : width / 2}
|
width={defaultGraphWidth}
|
||||||
height={500}
|
height={defaultGraphHeight}
|
||||||
/>
|
/>
|
||||||
</ComponentWrapper>
|
</ComponentWrapper>
|
||||||
|
|
||||||
|
<ComponentWrapper heading="What program are you in? " align="right">
|
||||||
|
<WordCloud
|
||||||
|
data={moreMockCategoricalData.map((word) => ({
|
||||||
|
text: word.key,
|
||||||
|
value: word.value,
|
||||||
|
}))}
|
||||||
|
width={defaultGraphWidth}
|
||||||
|
height={defaultGraphHeight}
|
||||||
|
/>
|
||||||
|
</ComponentWrapper>
|
||||||
|
<ComponentWrapper heading="What program are you in?" align="center">
|
||||||
|
<WordCloud
|
||||||
|
data={moreMockCategoricalData.map((word) => ({
|
||||||
|
text: word.key,
|
||||||
|
value: word.value,
|
||||||
|
}))}
|
||||||
|
width={defaultGraphWidth}
|
||||||
|
height={defaultGraphHeight}
|
||||||
|
/>
|
||||||
|
</ComponentWrapper>
|
||||||
|
|
||||||
|
<ComponentWrapper heading="What program are you in?" align="left">
|
||||||
|
<WordCloud
|
||||||
|
data={moreMockCategoricalData.map((word) => ({
|
||||||
|
text: word.key,
|
||||||
|
value: word.value,
|
||||||
|
}))}
|
||||||
|
width={defaultGraphWidth}
|
||||||
|
height={defaultGraphHeight}
|
||||||
|
/>
|
||||||
|
</ComponentWrapper>
|
||||||
|
|
||||||
|
<ComponentWrapper
|
||||||
|
heading="What program are you in?"
|
||||||
|
bodyText="There are a total of 106 respondents of the CS Class Profile. Interestingly, there are a huge number of students that are just in CS, partially due to the overwhelming number of people in CS as seen in the total demographics."
|
||||||
|
align="right"
|
||||||
|
noBackground
|
||||||
|
>
|
||||||
|
<BarGraphHorizontal
|
||||||
|
className={styles.barGraphDemo}
|
||||||
|
data={mockCategoricalData}
|
||||||
|
width={defaultGraphWidth}
|
||||||
|
height={defaultGraphHeight}
|
||||||
|
margin={defaultBarGraphMargin}
|
||||||
|
/>
|
||||||
|
</ComponentWrapper>
|
||||||
|
|
||||||
|
<ComponentWrapper
|
||||||
|
heading="What program are you in?"
|
||||||
|
bodyText="There are a total of 106 respondents of the CS Class Profile. Interestingly, there are a huge number of students that are just in CS, partially due to the overwhelming number of people in CS as seen in the total demographics."
|
||||||
|
align="left"
|
||||||
|
>
|
||||||
|
<BarGraphHorizontal
|
||||||
|
className={styles.barGraphDemo}
|
||||||
|
data={mockCategoricalData}
|
||||||
|
width={defaultGraphWidth}
|
||||||
|
height={defaultGraphHeight}
|
||||||
|
margin={defaultBarGraphMargin}
|
||||||
|
/>
|
||||||
|
</ComponentWrapper>
|
||||||
|
|
||||||
|
<ComponentWrapper heading="What program are you in?" align="center">
|
||||||
|
<WordCloud
|
||||||
|
data={moreMockCategoricalData.map((word) => ({
|
||||||
|
text: word.key,
|
||||||
|
value: word.value,
|
||||||
|
}))}
|
||||||
|
width={defaultGraphWidth}
|
||||||
|
height={defaultGraphHeight}
|
||||||
|
/>
|
||||||
|
</ComponentWrapper>
|
||||||
|
|
||||||
<BottomNav
|
<BottomNav
|
||||||
leftPageLink="/"
|
leftPage={pageRoutes.demographics}
|
||||||
leftPageName="Demographics"
|
rightPage={pageRoutes.contributors}
|
||||||
rightPageLink="/"
|
|
||||||
rightPageName="Co-ops"
|
|
||||||
></BottomNav>
|
></BottomNav>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<svg width="144" height="100" viewBox="0 0 144 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<line x1="139" y1="5" x2="5.00003" y2="4.99999" stroke="#E18E89" stroke-width="10" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<line x1="139" y1="50" x2="5.00003" y2="50" stroke="#E18E89" stroke-width="10" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<line x1="139" y1="95" x2="5.00003" y2="95" stroke="#E18E89" stroke-width="10" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 495 B |
|
@ -0,0 +1,3 @@
|
||||||
|
<svg width="118" height="63" viewBox="0 0 118 63" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M116.615 34.4078C118.278 32.7447 118.278 30.0483 116.615 28.3852L89.513 1.28349C87.8499 -0.379606 85.1535 -0.379606 83.4904 1.28349C81.8273 2.94658 81.8273 5.64299 83.4904 7.30609L107.581 31.3965L83.4904 55.4869C81.8273 57.15 81.8273 59.8464 83.4904 61.5095C85.1535 63.1726 87.8499 63.1726 89.513 61.5095L116.615 34.4078ZM0.75 35.6551H113.603V27.1379H0.75V35.6551Z" fill="#603E2F"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 496 B |
Loading…
Reference in New Issue