Skip to content

Commit 35c64a7

Browse files
committed
fix: ssr and make the hero actually readable
1 parent 343e0b4 commit 35c64a7

File tree

7 files changed

+8875
-23
lines changed

7 files changed

+8875
-23
lines changed

pnpm-lock.yaml

Lines changed: 8864 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Gradient/index.module.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
--gradient-color-1: #{$gradient-color-1};
88
--gradient-color-2: #{$gradient-color-2};
99
--gradient-color-3: #{$gradient-color-3};
10-
--gradient-color-4: #{$gradient-color-4};
1110
--gradient-speed: #{$gradient-speed};
1211
}
1312

src/components/Gradient/index.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import clsx from 'clsx';
2-
import { useEffect } from 'react';
2+
import { useLayoutEffect } from 'react';
33
import isSafari from '../../utils/isSafari';
44
import styles from './index.module.scss';
55

@@ -13,7 +13,7 @@ export interface SubGradientProps {
1313
}
1414

1515
function AnimatedGradient({ className }: SubGradientProps) {
16-
useEffect(() => {
16+
useLayoutEffect(() => {
1717
if (window?.Gradient != null) {
1818
const gradient = new window.Gradient();
1919
gradient.freqX = 14e-5;
@@ -33,22 +33,14 @@ function AnimatedGradient({ className }: SubGradientProps) {
3333
);
3434
}
3535

36-
const isSSR = () => typeof window === 'undefined';
37-
38-
// Wrapper component to handle client-side only rendering
39-
function AnimatedGradientNoSSRWrapper(props: SubGradientProps) {
40-
// Only render the AnimatedGradient component on the client-side
41-
return !isSSR() ? <AnimatedGradient {...props} /> : null;
42-
}
43-
4436
/**
4537
* Expanded gradient with a wave-masked bottom border.
4638
* Used in the home page with the hero icon
4739
*/
4840
function ExpandedGradient({ className }: SubGradientProps) {
4941
return (
5042
<div className={clsx(styles.gradientContainer, className)}>
51-
<AnimatedGradientNoSSRWrapper
43+
<AnimatedGradient
5244
className={clsx(
5345
isSafari() ? styles.gradientSafari : styles.gradient,
5446
)}

src/components/Hero/index.module.scss

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ $hero-gradient: linear-gradient(#0003, #000a 30%, #000e 60%, #000f 80%);
2525

2626
.heroImage {
2727
width: 25%;
28-
svg {
29-
mask: $hero-gradient;
30-
}
28+
filter: opacity(0.9);
29+
3130
@include down($breakpoint-sm) {
3231
flex-direction: column;
3332
}
@@ -36,6 +35,6 @@ $hero-gradient: linear-gradient(#0003, #000a 30%, #000e 60%, #000f 80%);
3635
.heroTitle {
3736
color: $text-alt;
3837
display: flex;
39-
mask: $hero-gradient;
38+
filter: opacity(0.9);
4039
text-shadow: $text-shadow;
4140
}

src/components/Navbar/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
22
import Link from 'next/link';
33
import { useState } from 'react';
4+
import { faBars } from '@fortawesome/free-solid-svg-icons';
45
import ScottyLabsIcon from '../../icons/ScottyLabsIcon';
56
import Gradient from '../Gradient';
67
import styles from './index.module.scss';
@@ -24,7 +25,7 @@ function Toolbar({ collapsed }: { collapsed: Boolean }) {
2425
<div className={styles.navMobile}>
2526
<div className={styles.navSandwich}>
2627
<FontAwesomeIcon
27-
icon="bars"
28+
icon={faBars}
2829
onClick={() =>
2930
setMobileLinksVisible(!mobileLinksVisible)
3031
}

src/pages/design.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ export default function Design() {
3535
'illustrator',
3636
'after-effects',
3737
]}
38-
description={
39-
"Every year, ScottyLabs hosts Pittsburgh's largest hackathon TartanHacks. The event's logo, merchandise, advertisements and motion graphics are designed for a different theme and visual language"
40-
}
38+
description="Every year, ScottyLabs hosts Pittsburgh's largest hackathon TartanHacks. The event's logo, merchandise, advertisements and motion graphics are designed for a different theme and visual language"
4139
image={
4240
<Image
4341
src="/design/tartanhacks.png"

src/styles/variables.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ $carousel-circle-unfocused: #d9d9d9;
4444
$accent-color-primary: #2f80ed;
4545
$accent-color-darker: #2a72cf;
4646

47-
$gradient-color-1: #f60101;
47+
$gradient-color-1: #0780ba;
4848
$gradient-color-2: #272a92;
49-
$gradient-color-3: #00e7d6;
50-
$gradient-color-4: #0780ba;
49+
$gradient-color-3: #25a4d2;
5150
$gradient-speed: 0.000003;
5251

5352
$logo-hover-transition: 0.2s;

0 commit comments

Comments
 (0)