Skip to content

Commit f025581

Browse files
scrolling, scaling, sleeping...
1 parent 9784a7a commit f025581

13 files changed

Lines changed: 88 additions & 30 deletions

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
7+
<meta name="theme-color" content="#006662" />
78
<title>CAPY</title>
89
<meta name="description" content="All-in-one student involvement utility." />
910
<link rel="preconnect" href="https://fonts.googleapis.com" />

src/index.css

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ body,
1515
html,
1616
body {
1717
overflow: hidden;
18+
background: var(--c-bg);
19+
transition: background-color 200ms ease;
1820
}
1921

20-
@media (max-width: 768px) {
21-
html,
22-
body {
23-
background: var(--c-bg);
24-
}
22+
body.rail-active {
23+
background: var(--c-surface-light);
2524
}
2625

2726
body {

src/lander/Lander.module.css

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,16 @@
7979
@media (max-width: 768px) {
8080
.appRoot {
8181
overflow: hidden;
82-
height: 100svh;
83-
min-height: 100svh;
82+
height: 100dvh;
83+
min-height: 100dvh;
8484
padding: 0;
85+
background: var(--c-bg);
8586
}
8687

8788
.mobileSnapScroller {
8889
display: block;
8990
width: 100%;
90-
height: 100svh;
91+
height: 100dvh;
9192
overflow-y: scroll;
9293
overflow-x: hidden;
9394
scroll-snap-type: y mandatory;
@@ -101,8 +102,8 @@
101102

102103
:global(.panel) {
103104
width: 100%;
104-
height: 100svh;
105-
min-height: 100svh;
105+
height: 100dvh;
106+
min-height: 100dvh;
106107
border-radius: 0;
107108
border: none;
108109
scroll-snap-align: start;

src/lander/Lander.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ function Lander() {
5151
<main className={styles.mobileSnapScroller}>
5252
<HeroSection />
5353
<FeaturesSection />
54-
<InterfaceSection />
55-
<ContactSection />
5654
<CapyRailSection />
5755
</main>
5856
) : (

src/lander/sections/CapyRailSection.module.css

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,20 @@
132132
@media (max-width: 768px) {
133133
.capyRailPanel {
134134
width: 100%;
135-
height: 100svh;
135+
height: 100dvh;
136136
border: none;
137137
border-radius: 0;
138138
background: var(--c-surface-light);
139139
}
140140

141141
.railContent {
142142
width: calc(100% - var(--space-32));
143-
margin: var(--space-50) var(--space-16) var(--space-32);
144-
height: calc(100svh - var(--space-50) - var(--space-32));
143+
margin: calc(var(--space-50) + env(safe-area-inset-top)) var(--space-16)
144+
calc(var(--space-32) + env(safe-area-inset-bottom));
145+
height: calc(
146+
100dvh - var(--space-50) - var(--space-32) - env(safe-area-inset-top) -
147+
env(safe-area-inset-bottom)
148+
);
145149
}
146150

147151
.railLinks {

src/lander/sections/CapyRailSection.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useEffect } from 'react'
12
import { AnimatedPanel } from '@/shared/components/AnimatedPanel'
23
import { AspectImage } from '@/shared/components/AspectImage'
34
import { StaggerWords } from '@/shared/components/StaggerWords'
@@ -15,6 +16,22 @@ const socialAssets = [
1516
]
1617

1718
export function CapyRailSection() {
19+
useEffect(() => {
20+
const el = document.getElementById('more')
21+
if (!el) return
22+
const observer = new IntersectionObserver(
23+
([entry]) => {
24+
document.body.classList.toggle('rail-active', entry.intersectionRatio >= 0.85)
25+
},
26+
{ threshold: [0, 0.85, 1] },
27+
)
28+
observer.observe(el)
29+
return () => {
30+
observer.disconnect()
31+
document.body.classList.remove('rail-active')
32+
}
33+
}, [])
34+
1835
return (
1936
<AnimatedPanel className={`panel ${styles.capyRailPanel}`} id="more" staggerIndex={4}>
2037
<div className={styles.verticalMarkWrap} aria-hidden="true">

src/lander/sections/ContactSection.module.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@
7474
@media (max-width: 768px) {
7575
.contactPanel {
7676
width: 100%;
77-
height: 100svh;
78-
padding: var(--space-50) var(--space-24) var(--space-32);
77+
height: 100dvh;
78+
padding: calc(var(--space-50) + env(safe-area-inset-top)) var(--space-24)
79+
calc(var(--space-32) + env(safe-area-inset-bottom));
7980
backdrop-filter: none;
8081
}
8182

src/lander/sections/FeaturesSection.module.css

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,25 @@
4545
display: flex;
4646
flex-direction: column;
4747
width: 100%;
48-
height: 100svh;
48+
height: 100dvh;
4949
overflow-y: auto;
5050
gap: var(--space-16);
51-
padding: var(--space-50) var(--space-24) var(--space-32);
51+
padding: calc(var(--space-50) + env(safe-area-inset-top)) var(--space-24)
52+
calc(var(--space-32) + env(safe-area-inset-bottom));
5253
}
5354

54-
.card-col1-row1,
5555
.card-col2-row1,
5656
.card-col2-row2,
57-
.card-col1-row2-span2,
57+
.card-col1-row2-span2 {
58+
display: none;
59+
}
60+
61+
.card-col1-row1,
5862
.card-col2-row3 {
5963
grid-column: unset;
6064
grid-row: unset;
61-
min-height: 200px;
62-
flex-shrink: 0;
65+
min-height: 100px;
66+
flex: 1 1 0;
67+
flex-shrink: 1;
6368
}
6469
}

src/lander/sections/HeroSection.module.css

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.heroPanel {
2+
position: relative;
23
width: min(1415px, calc(100vw - var(--space-24) * 2));
34
border: 1px solid var(--c-surface-border);
45
background: linear-gradient(180deg, rgba(56, 171, 162, 0.2), rgba(43, 137, 130, 0.16));
@@ -11,6 +12,10 @@
1112
overflow: hidden;
1213
}
1314

15+
.heroLogoMark {
16+
display: none;
17+
}
18+
1419
.heroRows {
1520
display: flex;
1621
flex-direction: column;
@@ -29,6 +34,10 @@
2934
line-height: 0.92;
3035
}
3136

37+
.heroTitleLead {
38+
white-space: nowrap;
39+
}
40+
3241
.heroRowTitle h1 span:last-child {
3342
justify-self: end;
3443
text-align: right;
@@ -148,14 +157,27 @@
148157
@media (max-width: 768px) {
149158
.heroPanel {
150159
width: 100%;
151-
height: 100svh;
152-
padding: var(--space-50) var(--space-24) var(--space-32);
160+
height: 100dvh;
161+
padding: calc(var(--space-50) + env(safe-area-inset-top)) var(--space-24)
162+
calc(var(--space-32) + env(safe-area-inset-bottom));
153163
justify-content: center;
154164
backdrop-filter: none;
165+
border: none;
166+
background: transparent;
167+
}
168+
169+
.heroLogoMark {
170+
display: block;
171+
position: absolute;
172+
top: calc(var(--space-24) + env(safe-area-inset-top));
173+
right: var(--space-24);
174+
width: clamp(72px, 22vw, 112px);
175+
height: auto;
176+
pointer-events: none;
155177
}
156178

157179
.heroRowTitle h1 {
158-
font-size: clamp(52px, 16vw, 80px);
180+
font-size: clamp(42px, 13vw, 68px);
159181
}
160182

161183
.heroDescription {

src/lander/sections/HeroSection.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useExitNavigation } from '@/shared/hooks/useExitNavigation'
55
import { StaggerWords } from '@/shared/components/StaggerWords'
66
import { TypewriterWord } from '@/shared/components/TypewriterWord'
77
import { PillButton } from '@/shared/components/PillButton'
8+
import { assets } from '@/shared/data/content'
89
import styles from './HeroSection.module.css'
910

1011
export function HeroSection() {
@@ -40,10 +41,11 @@ export function HeroSection() {
4041
return (
4142
<>
4243
<AnimatedPanel className={`panel ${styles.heroPanel}`} id="home" staggerIndex={0}>
44+
<img src={assets.logo} alt="CAPY" className={styles.heroLogoMark} aria-hidden="true" />
4345
<div className={styles.heroRows}>
4446
<div className={styles.heroRowTitle}>
4547
<h1>
46-
<span>
48+
<span className={styles.heroTitleLead}>
4749
more <TypewriterWord words={HERO_WORDS} />
4850
</span>
4951
<span>

0 commit comments

Comments
 (0)