Skip to content

Commit ea95365

Browse files
Increased size of label region (#1019)
1 parent 0933b58 commit ea95365

File tree

8 files changed

+99
-28
lines changed

8 files changed

+99
-28
lines changed

src/components/LandingPage/layout/Menu/Menu.tsx

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,43 @@ interface MenuProps {
1717

1818
export default function Menu({ className, scrollHasStarted, section }: MenuProps) {
1919
const [showMenu, setShowMenu] = React.useState(false);
20+
const [showMenuComponent, setShowMenuComponent] = React.useState(true);
21+
const [lastScrollY, setLastScrollY] = React.useState(0);
22+
23+
React.useEffect(() => {
24+
const handleScroll = () => {
25+
const currentScrollY = window.scrollY;
26+
27+
if (currentScrollY > lastScrollY && currentScrollY > 50) {
28+
// Scrolling down
29+
setShowMenuComponent(false);
30+
} else if (currentScrollY < lastScrollY) {
31+
// Scrolling up
32+
setShowMenuComponent(true);
33+
}
34+
35+
setLastScrollY(currentScrollY);
36+
};
37+
38+
window.addEventListener('scroll', handleScroll, { passive: true });
39+
40+
return () => window.removeEventListener('scroll', handleScroll);
41+
}, [lastScrollY]);
2042

2143
return (
2244
<>
2345
<div
2446
id={ID_MENU}
25-
className={classNames(className, styles.menuContainer, scrollHasStarted && styles.stuck)}
47+
className={classNames(
48+
className,
49+
styles.menuContainer,
50+
scrollHasStarted && styles.stuck,
51+
!showMenuComponent && styles.hidden
52+
)}
53+
style={{
54+
transform: showMenuComponent ? 'translateY(0)' : 'translateY(-100%)',
55+
transition: 'transform 0.3s ease-in-out',
56+
}}
2657
>
2758
<Link href="/" className={styles.logo}>
2859
<h2>Open Brain Institute</h2>

src/env.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const env = createEnv({
2626
CI_COMMIT_SHORT_SHA: z.string().optional(),
2727
npm_package_version: z.string().optional(),
2828

29-
AUTH_MANAGER_URI: z.string().url(),
29+
AUTH_MANAGER_URI: z.string().url().optional(),
3030
},
3131

3232
client: {
@@ -74,6 +74,7 @@ export const env = createEnv({
7474
NEXT_PUBLIC_CORE_WEB_APP_VERSION: z.string().optional(),
7575
NEXT_PUBLIC_NOTEBOOK_SERVICE_BASE_URL: z.string().optional(),
7676
NEXT_PUBLIC_OBI_ONE_URL: z.string().optional(),
77+
NEXT_PUBLIC_AUTH_MANAGER_URI: z.string().url().optional(),
7778
},
7879

7980
experimental__runtimeEnv: {
@@ -117,6 +118,8 @@ export const env = createEnv({
117118
NEXT_PUBLIC_CDN_URI: process.env.NEXT_PUBLIC_CDN_URI,
118119
NEXT_PUBLIC_CORE_WEB_APP_VERSION: process.env.NEXT_PUBLIC_CORE_WEB_APP_VERSION,
119120

121+
NEXT_PUBLIC_AUTH_MANAGER_URI: process.env.NEXT_PUBLIC_AUTH_MANAGER_URI,
122+
120123
NEXT_PUBLIC_NOTEBOOK_SERVICE_BASE_URL: process.env.NEXT_PUBLIC_NOTEBOOK_SERVICE_BASE_URL,
121124
NEXT_PUBLIC_OBI_ONE_URL: process.env.NEXT_PUBLIC_OBI_ONE_URL,
122125
},

src/features/brain-region-hierarchy/region-banner.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import { CloseOutlined } from '@ant-design/icons';
44

5-
import { useGetSelectedBrainRegion } from '@/features/brain-region-hierarchy/context';
65
import { HierarchySquare } from '@/components/icons/buttons';
6+
import { useGetSelectedBrainRegion } from '@/features/brain-region-hierarchy/context';
77
import { Button } from '@/ui/molecules/button';
88
import { cn } from '@/utils/css-class';
99

@@ -54,14 +54,16 @@ export function RegionBanner({ view, onSwitchView }: Props) {
5454
<div className="flex items-center justify-center gap-2">
5555
{selectedBrainRegion && (
5656
<div className="flex items-center justify-center gap-1 select-none">
57-
<span className="text-label text-base">Region:</span>
57+
<span className="text-neutral-5 mr-2 text-lg">Region:</span>
5858
<div className="text-primary-9/90 flex items-center justify-center gap-1.5">
5959
<div
6060
key={`color-${selectedBrainRegion.id}-${selectedBrainRegion.color_hex_triplet}`}
6161
className="block h-3! w-3! min-w-3! rounded-full"
6262
style={{ backgroundColor: `#${selectedBrainRegion.color_hex_triplet}` }}
6363
/>
64-
<span className="line-clamp-2 leading-5 font-bold">{selectedBrainRegion.name}</span>
64+
<span className="line-clamp-2 text-lg leading-5 font-bold">
65+
{selectedBrainRegion.name}
66+
</span>
6567
</div>
6668
</div>
6769
)}

src/ui/segments/sfn-2025/content/experience.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function SFNExperience() {
1616
return (
1717
<div
1818
ref={ref}
19-
className="text-primary-9 relative flex min-h-[50vh] w-full flex-col px-[8vw] py-12 md:py-[25vh]"
19+
className="text-primary-9 relative flex w-full flex-col justify-center overflow-hidden px-[8vw] py-12 md:h-[50vh]"
2020
>
2121
<div className="relative z-10">
2222
<h2 className="font-serif text-6xl! leading-none font-normal md:leading-[1.2]!">
@@ -34,16 +34,17 @@ export default function SFNExperience() {
3434
</div>
3535

3636
<motion.div
37-
className="absolute top-0 right-0 z-0"
37+
className="absolute inset-y-0 right-0 z-0 flex items-center justify-center"
3838
initial={{ scale: 0.8, opacity: 0 }}
39-
animate={isInView ? { scale: 1, opacity: 1 } : { scale: 0.8, opacity: 0 }}
39+
animate={isInView ? { scale: 0.8, opacity: 1 } : { scale: 0.6, opacity: 0 }}
4040
transition={{
4141
duration: 0.3,
4242
ease: 'easeOut',
4343
}}
4444
>
4545
<Image
4646
src="/images/sfn/background_white-brain.webp"
47+
className="relative -right-[20vw]"
4748
alt="Experience image"
4849
width={1512}
4950
height={814}

src/ui/segments/sfn-2025/content/video.tsx

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
'use client';
22

3-
import { PlayCircleOutlined, SoundFilled, SoundOutlined } from '@ant-design/icons';
3+
import {
4+
FullscreenOutlined,
5+
PlayCircleOutlined,
6+
SoundFilled,
7+
SoundOutlined,
8+
} from '@ant-design/icons';
49
import { motion, useInView } from 'framer-motion';
510
import { useEffect, useRef, useState } from 'react';
611

7-
import { cn } from '@/utils/css-class';
8-
912
export default function SFNVideo() {
1013
const ref = useRef(null);
1114
const videoRef = useRef<HTMLVideoElement>(null);
@@ -42,6 +45,20 @@ export default function SFNVideo() {
4245
}
4346
};
4447

48+
const toggleFullscreen = () => {
49+
if (videoRef.current) {
50+
if (!document.fullscreenElement) {
51+
videoRef.current.requestFullscreen().catch((_error) => {
52+
// Fullscreen might not be available
53+
});
54+
} else {
55+
document.exitFullscreen().catch((_error) => {
56+
// Exit fullscreen might fail
57+
});
58+
}
59+
}
60+
};
61+
4562
const handleVideoClick = () => {
4663
if (videoRef.current) {
4764
if (videoRef.current.paused) {
@@ -61,7 +78,7 @@ export default function SFNVideo() {
6178
};
6279

6380
return (
64-
<div ref={ref} className="relative h-full w-full px-8 py-12 md:px-[10vw] md:py-[15vh]">
81+
<div ref={ref} className="relative h-full w-full px-8 py-12 md:px-[15vw] md:py-[15vh]">
6582
<motion.video
6683
ref={videoRef}
6784
muted={isMuted}
@@ -95,18 +112,28 @@ export default function SFNVideo() {
95112
</button>
96113
)}
97114

98-
{/* Mute Button */}
99-
<button
100-
type="button"
101-
onClick={toggleMute}
102-
className={cn(
103-
'bg-opacity-50 hover:bg-opacity-70 absolute top-52 right-[12vw] z-10 flex h-12 w-12 items-center justify-center rounded-full bg-black text-white transition-all',
104-
isMuted ? 'Unmute video' : 'Mute video'
105-
)}
106-
aria-label={isMuted ? 'Unmute video' : 'Mute video'}
107-
>
108-
{isMuted ? <SoundOutlined className="text-xl" /> : <SoundFilled className="text-xl" />}
109-
</button>
115+
{/* Control Buttons */}
116+
<div className="absolute top-52 right-[17vw] z-10 flex gap-3">
117+
{/* Mute Button */}
118+
<button
119+
type="button"
120+
onClick={toggleMute}
121+
className="bg-opacity-50 hover:bg-opacity-70 flex h-12 w-12 items-center justify-center rounded-full bg-black text-white transition-all"
122+
aria-label={isMuted ? 'Unmute video' : 'Mute video'}
123+
>
124+
{isMuted ? <SoundOutlined className="text-xl" /> : <SoundFilled className="text-xl" />}
125+
</button>
126+
127+
{/* Fullscreen Button */}
128+
<button
129+
type="button"
130+
onClick={toggleFullscreen}
131+
className="bg-opacity-50 hover:bg-opacity-70 flex h-12 w-12 items-center justify-center rounded-full bg-black text-white transition-all"
132+
aria-label="Toggle fullscreen"
133+
>
134+
<FullscreenOutlined className="text-xl" />
135+
</button>
136+
</div>
110137
</div>
111138
);
112139
}

src/ui/segments/sfn-2025/content/virtual-labs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default function SFNVirtualLabs() {
2424
return (
2525
<div
2626
ref={ref}
27-
className="text-primary-9 relative flex min-h-[80vh] w-full flex-col items-center justify-center overflow-hidden bg-gray-100 px-8 py-4 md:min-h-[50vh] md:flex-row-reverse md:justify-start md:py-8"
27+
className="text-primary-9 relative flex w-full flex-col items-center justify-center overflow-hidden bg-gray-100 px-8 py-4 md:h-[50vh] md:min-h-[50vh] md:flex-row-reverse md:justify-start"
2828
onMouseMove={handleMouseMove}
2929
>
3030
<div className="relative z-10 flex w-full flex-col pr-8 md:w-1/2">
@@ -51,7 +51,7 @@ export default function SFNVirtualLabs() {
5151
>
5252
<Image
5353
src="/images/sfn/brain-region_image-01.webp"
54-
className="relative -left-[20vw] h-full w-auto"
54+
className="relative -left-[32vw] h-full w-auto"
5555
alt="Multiple brain region image"
5656
width={990}
5757
height={558}

src/ui/segments/sfn-2025/hero.module.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
height: max(100vh, 600px);
66
color: #fffe;
77
background-color: var(--color-primary);
8+
hyphens: auto;
89

910
--color-bg: var(--color-primary);
1011
--gradient-angle: 150deg;
@@ -66,6 +67,12 @@
6667
max-width: auto;
6768
}
6869

70+
@media (max-width: 768px) {
71+
.hero .text {
72+
padding: 0 5vw;
73+
}
74+
}
75+
6976
.hero .text h1 {
7077
margin-bottom: 20px;
7178
font-size: 10vmin;

src/ui/segments/sfn-2025/hero.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ export default function HeroSFN({
5454
<div>
5555
<h1 className={styles.largeTitle}>{title}</h1>
5656
</div>
57-
<div className="font-title text-whit flex flex-row gap-x-12 rounded-full border border-solid border-white px-16 py-8 text-3xl!">
57+
<div className="font-title flex flex-col gap-5 rounded-lg border border-solid border-white px-5 py-5 text-3xl! text-white md:flex-row md:gap-12 md:rounded-full md:px-16 md:py-8">
5858
<div>November 15 – 19</div>
59-
<div>Booth #3631</div>
6059
<div>San Diego Convention Center</div>
60+
<div>Booth #3631</div>
6161
</div>
6262
</div>
6363
</div>

0 commit comments

Comments
 (0)