Skip to content

Commit cb8d41b

Browse files
committed
finally fixed the schedule styling for good (hopefully)
1 parent eca0c3d commit cb8d41b

9 files changed

Lines changed: 119 additions & 64 deletions

File tree

Lines changed: 1 addition & 0 deletions
Loading

client/src/components/button/ButtonOutlined/ButtonOutlined.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import './ButtonOutlined.scss';
44

5-
const ButtonOutlined = ({ label, onClick, isSecondary, isDisabled, style, className }) => {
5+
const ButtonOutlined = ({ label, sub, onClick, isSecondary, isDisabled, style, className }) => {
66
return (
77
<div
88
style={style}
@@ -11,13 +11,17 @@ const ButtonOutlined = ({ label, onClick, isSecondary, isDisabled, style, classN
1111
isDisabled ? 'button-outlined-disabled' : ''
1212
} ${className}`}
1313
>
14-
{label}
14+
<div className="text-container">
15+
<h1>{label}</h1>
16+
<h2>{sub}</h2>
17+
</div>
1518
</div>
1619
);
1720
};
1821

1922
ButtonOutlined.propTypes = {
2023
label: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
24+
sub: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
2125
onClick: PropTypes.func,
2226
isSecondary: PropTypes.bool,
2327
isDisabled: PropTypes.bool,

client/src/components/button/ButtonOutlined/ButtonOutlined.scss

Lines changed: 30 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -16,65 +16,53 @@
1616

1717
.button-outlined {
1818
margin: 15px 10px;
19-
background-color: var(--button-outlined-bg);
20-
color: var(--button-outlined-font);
21-
display: inline-block;
22-
border-radius: 11.5px;
23-
padding: 10px 26px;
24-
box-shadow: var(--shadow);
19+
20+
border-image-source: var(--schedule-dates-pixel-border);
21+
background-color: var(--monster);
22+
color: var(--lavender);
23+
box-shadow: inset -6px -6px var(--button-pressed-shadow);
24+
border-radius: 18px;
2525
text-align: center;
26-
font-weight: 600;
2726
cursor: url('../../../../assets/cursor/cursor.png'), auto; // Apply custom cursor here
2827
user-select: none;
29-
border-image-source: var(--pixel-border-pressed);
3028
border-image-slice: 30;
3129
border-image-width: 30px;
3230
border-image-outset: 1px;
3331
border-image-repeat: repeat;
34-
//box-shadow: inset 4px 4px #00000028, inset -4px -4px #ffffff25;
3532
position: relative;
33+
min-width: 200px;
3634

37-
//BUTTON BORDERS
38-
/* removed borders on buttons so there is less cramping on mobile view
39-
&::before,
40-
&::after {
41-
content: '';
42-
position: absolute;
43-
width: 60px;
44-
height: 60px;
45-
background-repeat: no-repeat;
46-
z-index: 0;
47-
}
35+
padding: 10px 26px;
4836

49-
&::before {
50-
top: -10px;
51-
left: -10px;
52-
background-image: var(--top-left-corner-border);
37+
h1 {
38+
font-size: 35px;
39+
font-family: 'Jersey 20', sans-serif;
5340
}
54-
55-
&::after {
56-
bottom: -45px;
57-
right: -15px;
58-
background-image: var(--bottom-right-corner-border);
41+
h2 {
42+
font-size: 12px;
5943
}
60-
61-
//BUTTON BORDERS END
62-
*/
6344

6445
@include devices(tablet) {
65-
font-size: 16px;
66-
padding: 10px 30px;
67-
border-width: 3px;
46+
padding: 25px 30px;
6847
margin: 8px 6px;
6948
}
7049
}
7150

7251
.button-outlined-secondary {
73-
background-color: var(--button-outlined-bg-secondary);
74-
color: var(--button-outlined-font);
75-
font-weight: unset;
76-
box-shadow: 3px 3px 3px #00000038;
77-
border-image-source: var(--pixel-border);
52+
// background-color: var(--button-outlined-bg-secondary);
53+
// color: var(--button-outlined-font);
54+
// font-weight: unset;
55+
// box-shadow: 3px 3px 3px #00000038;
56+
box-shadow: inset -6px -6px #3d0f58;
57+
color: var(--mikado);
58+
background-color: var(--schedule-container);
59+
// border-image-source: var(--pixel-border);
60+
border-radius: 18px;
61+
border-image-source: var(--schedule-dates-pixel-border-selected);
62+
border-image-slice: 12;
63+
border-image-width: 12px;
64+
border-image-outset: 1px;
65+
border-image-repeat: repeat;
7866

7967
&:hover {
8068
border-color: var(--light-purple);
@@ -85,8 +73,8 @@
8573
&:active {
8674
transform: translateY(2px);
8775
//box-shadow: inset 4px 4px #00000038, inset -4px -4px #ffffff44;
88-
background-color: var(--button-active-bg);
89-
border-image-source: var(--pixel-border-pressed);
76+
// background-color: var(--button-active-bg);
77+
// border-image-source: var(--pixel-border-pressed);
9078
}
9179
}
9280

client/src/components/buttonSelector/buttonSelector/ButtonSelector.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ const ButtonSelector = ({
2020
<ButtonOutlined
2121
key={index}
2222
onClick={() => setActiveButton(index)}
23-
label={item.name}
23+
label={item.title}
24+
sub={item.sub}
2425
style={{
25-
backgroundColor: `${item.buttonColor}`,
26-
flex: 1,
26+
// backgroundColor: `${item.buttonColor}`,
27+
// flex: 1,
2728
display: 'flex',
2829
justifyContent: 'center',
2930
alignItems: 'center',
30-
maxWidth: maxWidthButton,
31+
// maxWidth: maxWidthButton,
3132
...style,
3233
}}
3334
className={classNameButton}

client/src/components/buttonSelector/buttonSelector/ButtonSelector.scss

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,45 @@
22
.button-selector-items {
33
display: flex;
44
justify-content: center;
5-
flex-wrap: wrap;
5+
justify-content: space-evenly;
6+
// flex-wrap: wrap;
67
padding: 10px;
7-
row-gap: 10px;
8+
// padding: 10px 40px;
9+
gap: 10px;
10+
// max-width: 100%;
11+
overflow-x: auto;
12+
scrollbar-width: 0px;
13+
font-family: 'Proxima Nova', sans-serif;
14+
// mask-image: radial-gradient(circle,rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0.52) 75%, rgba(0, 0, 0, 0) 100%);
15+
// -webkit-mask-image: linear-gradient(to right, #00000000, black 20%, black 80%, #00000000);
16+
// --webkit-mask-image: radial-gradient(circle,rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0.52) 75%, rgba(0, 0, 0, 0) 100%);
817
}
918

1019
.button-selector-no-stretch {
1120
display: inline-block;
1221
margin: auto;
1322
text-align: center;
1423
}
24+
25+
::-webkit-scrollbar {
26+
width: 8px;
27+
height: 8px;
28+
}
29+
30+
/* Track (background of the scrollbar) */
31+
::-webkit-scrollbar-track {
32+
background: var(--bg-primary);
33+
// border-radius: 8px;
34+
}
35+
36+
/* Thumb (the draggable part) */
37+
::-webkit-scrollbar-thumb {
38+
background-color: var(--mikado);
39+
// border-radius: 8px;
40+
// border: 2px solid #f0f0f0; /* creates padding around the thumb */
41+
}
42+
43+
/* On hover */
44+
::-webkit-scrollbar-thumb:hover {
45+
background-color: var(--palegold);
46+
}

client/src/components/schedule/ScheduleHome/ScheduleHome.jsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ const ScheduleComponent = () => {
2929
}
3030
const [selectedDayIndex, setSelectedDayIndex] = useState(count);
3131
const [closeAll, setCloseAll] = useState(false);
32-
const buttonList = Object.keys(data).map((item) => {
33-
return { name: item };
32+
const buttonList = Object.keys(data).map((item, index) => {
33+
const dayOfWeek = item.split(' ')[0];
34+
const date = item.split(' ')[1] + ' ' + item.split(' ')[2];
35+
return { name: item, title: dayOfWeek, sub: date };
3436
});
3537

3638
return (
@@ -47,13 +49,15 @@ const ScheduleComponent = () => {
4749
setSelectedDayIndex(index);
4850
setCloseAll(!closeAll);
4951
}}
50-
style={{
51-
maxWidth: '250px',
52-
marginTop: '0px',
53-
marginBottom: '10px',
54-
padding: '11px 15px',
55-
minWidth: '110px',
56-
}}
52+
style={
53+
{
54+
// maxWidth: '20px',
55+
// marginTop: '0px',
56+
// marginBottom: '10px',
57+
// padding: '11px 15px',
58+
// minWidth: '110px',
59+
}
60+
}
5761
/>
5862
</div>
5963
<div className="schedule-container-dates desktop-only">
@@ -154,6 +158,7 @@ export const ScheduleComponentAccordion = ({ scheduleDay, closeAll }) => {
154158
setIsOpen={setIsOpen}
155159
isOpen={isOpen}
156160
canOpen={scheduleDay['Event Description'] !== undefined}
161+
dark={scheduleDay['Color'] == 'night' || scheduleDay['Color'] == 'general'}
157162
>
158163
<p dangerouslySetInnerHTML={{ __html: scheduleDay['Event Description'] }} />
159164
</SingleAccordion>

client/src/components/schedule/ScheduleHome/ScheduleHome.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
@include devices(tablet) {
1616
flex-direction: column;
17-
padding: 0px;
17+
margin: 0px 10%;
1818
}
1919
}
2020

@@ -120,9 +120,11 @@
120120
h1 {
121121
font-size: 48px;
122122
font-family: 'Jersey 20', sans-serif;
123+
padding-left: 20px;
123124
}
124125
h2 {
125126
font-size: 20px;
127+
padding-left: 20px;
126128
}
127129

128130
&:active {

client/src/components/text/Accordion/SingleAccordion/SingleAccordion.jsx

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
import { React, useState, useRef, useEffect, useContext } from 'react';
22
import PropTypes from 'prop-types';
33
import faAngleDown from '../../../../assets/accordion/angle-up-solid.svg';
4+
import faAngleDownDark from '../../../../assets/accordion/angle-up-solid_yellow.svg';
45
import './SingleAccordion.scss';
56
import { DarkModeContext } from '../../../../util/DarkModeProvider';
67

7-
const SingleAccordion = ({ header, children, isOpen, setIsOpen, canOpen, className, style }) => {
8+
const SingleAccordion = ({
9+
header,
10+
children,
11+
isOpen,
12+
setIsOpen,
13+
canOpen,
14+
className,
15+
style,
16+
dark,
17+
}) => {
818
const { darkMode } = useContext(DarkModeContext);
919

1020
const [height, setHeight] = useState('0px');
@@ -15,6 +25,17 @@ const SingleAccordion = ({ header, children, isOpen, setIsOpen, canOpen, classNa
1525
useEffect(() => {
1626
setHeight(isOpen ? `${content.current.scrollHeight}px` : '0px');
1727
setRotate(isOpen ? 'accord-icon' : 'accord-icon rotate');
28+
29+
// Without this event listener, if you open an accordion then resize, it'll retain
30+
// the height it had when you opened it, but the text will get resized, so it'll get
31+
// cut off
32+
const handleResize = () => {
33+
setHeight(isOpen ? `${content.current.scrollHeight}px` : '0px');
34+
};
35+
window.addEventListener('resize', handleResize);
36+
return () => {
37+
window.removeEventListener('resize', handleResize);
38+
};
1839
}, [isOpen]);
1940

2041
function toggleAccordion() {
@@ -32,9 +53,9 @@ const SingleAccordion = ({ header, children, isOpen, setIsOpen, canOpen, classNa
3253
{canOpen !== false ? (
3354
<div style={{ marginLeft: 'auto' }} className={'accord-text'}>
3455
<img
35-
src={faAngleDown}
56+
src={dark ? faAngleDownDark : faAngleDown}
3657
className={`${rotate}`}
37-
style={{ filter: darkMode ? 'invert(1)' : 'unset' }}
58+
// style={{ filter: darkMode ? 'invert(1)' : 'unset' }}
3859
alt="Accordion Button"
3960
width="15px"
4061
/>
@@ -58,6 +79,7 @@ SingleAccordion.propTypes = {
5879
canOpen: PropTypes.bool.isRequired,
5980
className: PropTypes.string,
6081
style: PropTypes.object,
82+
dark: PropTypes.bool,
6183
};
6284

6385
export { SingleAccordion };

client/src/pages/Home/Home.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@
437437
overflow: hidden;
438438
position: relative;
439439
// Add a gradient fade on the left and right edges for a clean look
440-
mask-image: linear-gradient(to right, #00000080, black 20%, black 80%, #00000080);
440+
mask-image: linear-gradient(to right, #00000000, black 20%, black 80%, #00000000);
441441
-webkit-mask-image: linear-gradient(to right, #00000000, black 20%, black 80%, #00000000);
442442
}
443443

0 commit comments

Comments
 (0)