Skip to content

Commit c5e8dd5

Browse files
committed
Added consistent colors
1 parent 601e1ae commit c5e8dd5

File tree

9 files changed

+57
-41
lines changed

9 files changed

+57
-41
lines changed

src/assets/images/event/Images.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ import Images2023 from "./2023/Images2023";
44

55
let Images = [
66
{
7-
name: "2025",
7+
year: 2025,
88
subtitle: "Medical Edition",
99
items: Object.values(images)
1010
},
1111
{
12-
name: "2024",
12+
year: 2024,
1313
subtitle: "tomorrow's reality, today's vision. smart cities edition.",
1414
items: Images2024
1515
},
1616
{
17-
name: "2023",
17+
year: 2023,
1818
subtitle: "about://building-trust-in-digital-state",
1919
items: Images2023
2020
}

src/components/Features/Features.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { Box, Card, Container, Grid, Typography } from "@mui/material";
22
import { EmojiEvents, MoneyOff } from "@mui/icons-material";
33
import React from "react";
4+
import colorYears from "../Theme/HackHpiColors";
45

56
export function IconContainer(props) {
7+
const colors = colorYears[props.year] ?? colorYears.default;
68
return (
79
<Card
810
sx={{
911
background:
10-
"radial-gradient(ellipse 160% 110% at 0% 110%, rgba(58,12,163,1) 30%, rgba(63,253,106,1) 100%), #110320",
12+
`radial-gradient(ellipse 160% 110% at 0% 110%, ${colors.primary} 30%, ${colors.secondary} 100%), #110320`,
1113
//background: "linear-gradient(45deg, rgba(58,12,163,1) 0%, rgba(63,253,106,1) 100%)",
1214
backgroundPosition: "center",
1315
backgroundSize: "contain",

src/components/Gallery/Gallery.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function Gallery() {
6363
<Container sx={{display: "flex", justifyContent: "flex-end"}}>
6464
<Button variant="contained" color={"primary"} sx={{mt: 3}} onClick={() => setIsGalleryOpen(true)}>View full Gallery</Button>
6565
</Container>
66-
<GalleryDialog isOpen={isGalleryOpen} onClose={() => setIsGalleryOpen(false)}/>
66+
<GalleryDialog isOpen={isGalleryOpen} onClose={() => setIsGalleryOpen(false)} year={images[galleryTab].year}/>
6767
</Box>
6868
)
6969

src/components/Gallery/GalleryDialog/GalleryDialog.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
import {Close, KeyboardArrowLeft, KeyboardArrowRight} from "@mui/icons-material";
1717
import React, {useCallback, useEffect, useState} from "react";
1818
import images from "../../../assets/images/event/Images";
19+
import colorYears from "../../Theme/HackHpiColors";
1920

2021
const Transition = React.forwardRef(function Transition(
2122
props,
@@ -78,6 +79,8 @@ export function GalleryDialog(props) {
7879
element.scrollIntoView({behavior: 'smooth', block: 'center', inline: 'center'})
7980
}
8081

82+
const colors = colorYears[props.year] ?? colorYears.default;
83+
8184
return (
8285
<Dialog
8386
fullScreen
@@ -152,7 +155,7 @@ export function GalleryDialog(props) {
152155
(selectedImage === index) ? (
153156
<Box sx={{
154157
height: ".4rem",
155-
background: "linear-gradient(90deg, rgba(58,12,163,1) 0%, rgba(114,9,183,1) 100%)",
158+
background: `linear-gradient(90deg, ${colors.primary} 0%, ${colors.primary} 100%)`,
156159
width: "100%"
157160
}}/>
158161
) : undefined

src/components/Jury/Jury.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ function Jury() {
160160
elevation={5}
161161
key={judge.name}
162162
is2024={currentIndex !== 0}
163+
year={juryYears[currentIndex].year}
163164
>
164165
<Grid container spacing={5}>
165166
<Grid item xs={12} md={3}>

src/components/Speakers/Speakers.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function Speakers() {
9696
<Grid item xs={12} md={12}>
9797
<Stack spacing={3}>
9898
{speakerYears[currentIndex].speaker.map((speaker) => (
99-
<WindowCard elevation={5} key={speaker.name} is2024>
99+
<WindowCard elevation={5} key={speaker.name} is2024 year={speakerYears[currentIndex].year}>
100100
<Grid container spacing={5}>
101101
<Grid item xs={12} md={3}>
102102
<Paper
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* primary and secondary: used for gradient and window cards etc.
2+
* third_gradient: used for gradient
3+
* dark_background: used for gradient and overall background
4+
*/
5+
6+
const colorYears = {
7+
2024: {
8+
primary: "rgb(58, 12, 163, 1)",
9+
secondary: "rgb(114, 9, 183, 1)",
10+
third_gradient: "rgb(114, 9, 183, 1)",
11+
dark_background: "rgba(19,16,27,1)"
12+
},
13+
2025: {
14+
primary: "rgba(58,12,163,1)",
15+
secondary: "rgba(76,201,240,1)",
16+
third_gradient: "rgba(61,164,171,1)",
17+
dark_background: "rgba(19,16,27,1)"
18+
},
19+
2026: {
20+
primary: "rgba(11,157,106,1)",
21+
secondary: "rgba(63,253,106,1)",
22+
third_gradient: "rgba(63,88,252,1)",
23+
dark_background: "rgba(17,3,32,1)"
24+
},
25+
default: {
26+
primary: "rgba(11,157,106,1)",
27+
secondary: "rgba(63,253,106,1)",
28+
third_gradient: "rgba(63,88,252,1)",
29+
dark_background: "rgba(17,3,32,1)"
30+
}
31+
}
32+
33+
export default colorYears;

src/components/TimeTable/TimeTable.jsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
import * as React from "react";
1616
import {useState} from "react";
1717
import {IconContainer} from "../Features/Features";
18+
import colorYears from "../Theme/HackHpiColors";
1819

1920
const dayOneYears = [
2021
{
@@ -251,11 +252,12 @@ const dayTwoYears = [
251252
]
252253

253254
export function Table(props) {
255+
const colors = colorYears[props.year] ?? colorYears.default;
254256
return (
255257
<Card>
256258
<Box sx={{
257259
height: "5rem",
258-
background: "linear-gradient(150deg, rgba(58,12,163,1) 0%, rgba(114,9,183,1) 100%)",
260+
background: `linear-gradient(150deg, ${colors.primary} 0%, ${colors.secondary} 100%)`,
259261
display: "flex",
260262
alignItems: "center",
261263
pl: 3
@@ -278,7 +280,7 @@ export function Table(props) {
278280
alignContent: "center",
279281
alignItems: "center"
280282
}}>
281-
<IconContainer icon={item.icon}/>
283+
<IconContainer icon={item.icon} year={props.year}/>
282284
</Grid>
283285
<Grid item xs={8} sx={{display: "flex", alignItems: "center"}}>
284286
<Box>
@@ -344,11 +346,13 @@ export function TimeTable() {
344346
<Grid container spacing={5}>
345347
<Grid item md={6} xs={12}>
346348
<Table data={dayOneYears[currentIndex].dayOne} title={"Day 1"}
347-
subtitle={dayOneYears[currentIndex].subtitle}/>
349+
subtitle={dayOneYears[currentIndex].subtitle}
350+
year={dayOneYears[currentIndex].year}/>
348351
</Grid>
349352
<Grid item md={6} xs={12}>
350353
<Table data={dayTwoYears[currentIndex].dayTwo} title={"Day 2"}
351-
subtitle={dayTwoYears[currentIndex].subtitle}/>
354+
subtitle={dayTwoYears[currentIndex].subtitle}
355+
year={dayTwoYears[currentIndex].year}/>
352356
</Grid>
353357
</Grid>
354358
)}

src/components/WindowCard/WindowCard.jsx

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,9 @@
11
import {Box, Card, Stack} from "@mui/material";
2+
import colorYears from "../Theme/HackHpiColors";
23

34
export function WindowCard(props) {
4-
5-
function getSecondaryColor(year) {
6-
7-
8-
switch (props.year) {
9-
case 2024:
10-
return "rgba(114,9,183,1)"
11-
case 2025:
12-
return "rgba(76,201,240,1)"
13-
case 2026:
14-
return "rgba(63,253,106,1)"
15-
default:
16-
return "rgba(63,253,106,1)"
17-
}
18-
}
19-
function getPrimaryColor(year) {
20-
21-
22-
switch (props.year) {
23-
case 2024:
24-
case 2025:
25-
return "rgba(167,252,63,1)"
26-
case 2026:
27-
return "rgba(167,252,63,1)"
28-
default:
29-
return "rgba(167,252,63,1)"
30-
}
31-
}
32-
let backgroundSecondColor = getSecondaryColor(props.year);
33-
const backgroundGradient = `linear-gradient(90deg, rgba(167,252,63,1) 0%, ${backgroundSecondColor} 100%)`;
5+
const colors = colorYears[props.year] ?? colorYears.default;
6+
const backgroundGradient = `linear-gradient(90deg, ${colors.primary} 0%, ${colors.secondary} 100%)`;
347
return (
358
<Card elevation={7}>
369
<Box sx={{

0 commit comments

Comments
 (0)