Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/assets/recap/column-left.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/column-right.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/desktop-photo-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/desktop-photo-10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/desktop-photo-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/desktop-photo-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/desktop-photo-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/desktop-photo-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/desktop-photo-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/desktop-photo-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/desktop-photo-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/desktop-photo-9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/door-shadow.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/door.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/lights.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/mobile-door.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/mobile-lights.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/mobile-photo-1.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/mobile-photo-2.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/mobile-photo-3.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/mobile-photo-4.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/mobile-photo-5.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/mobile-photo-6.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/mobile-photo-7.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/mobile-photo-8.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/recap/mobile-photo-9.webp
Binary file added public/assets/recap/photo-full-1.png
Binary file added public/assets/recap/photo-full-10.png
Binary file added public/assets/recap/photo-full-2.png
Binary file added public/assets/recap/photo-full-3.png
Binary file added public/assets/recap/photo-full-4.png
Binary file added public/assets/recap/photo-full-5.png
Binary file added public/assets/recap/photo-full-6.png
Binary file added public/assets/recap/photo-full-7.png
Binary file added public/assets/recap/photo-full-8.png
Binary file added public/assets/recap/photo-full-9.png
Binary file added public/assets/recap/photos.webp
Binary file added public/assets/recap/right-door.webp
Binary file added public/assets/recap/side-shadow-left.webp
Binary file added public/assets/recap/side-shadow-right.webp
Binary file added public/assets/recap/top-shadow.webp
Binary file added public/assets/recap/wall.webp
Binary file added public/assets/stats/bear.webp
Binary file added public/assets/stats/clouds.webp
Binary file added public/assets/stats/hackers.webp
Binary file added public/assets/stats/lanterns.webp
Binary file added public/assets/stats/mentors.webp
Binary file added public/assets/stats/projects.webp
Binary file added public/assets/stats/recap-2027-mobile.webp
Binary file added public/assets/stats/recap-2027.webp
Binary file added public/assets/stats/texture.webp
Binary file added public/assets/stats/video-board.png
Binary file added public/assets/stats/video-frame.webp
Binary file added public/assets/stats/video-mat.png
Binary file added public/assets/stats/video-screen.png
Binary file added public/assets/stats/video-trim-glow.png
Binary file added public/assets/stats/video-trim.png
Binary file added public/assets/testimonials/bg.webp
Binary file added public/assets/testimonials/mobile-bg.webp
Binary file added public/assets/testimonials/mobile-pascale.webp
Binary file added public/assets/testimonials/mobile-qazi.webp
Binary file added public/assets/testimonials/mobile-vaibhav.webp
Binary file added public/assets/testimonials/pascale-base-0.png
Binary file added public/assets/testimonials/pascale-base-1.png
Binary file added public/assets/testimonials/pascale-base-2.png
Binary file added public/assets/testimonials/pascale-base-3.png
Binary file added public/assets/testimonials/pascale-base-4.png
Binary file added public/assets/testimonials/pascale-base-5.png
Binary file added public/assets/testimonials/pascale-base-6.png
Binary file added public/assets/testimonials/pascale-base-7.png
Binary file added public/assets/testimonials/pascale-base-8.png
Binary file added public/assets/testimonials/pascale-base-9.png
Binary file added public/assets/testimonials/pascale-base.webp
Binary file added public/assets/testimonials/pascale-mobile-0.png
Binary file added public/assets/testimonials/pascale-mobile-1.png
Binary file added public/assets/testimonials/pascale-mobile-2.png
Binary file added public/assets/testimonials/pascale-mobile-3.png
Binary file added public/assets/testimonials/pascale-mobile-4.png
Binary file added public/assets/testimonials/pascale-mobile-5.png
Binary file added public/assets/testimonials/pascale-mobile-6.png
Binary file added public/assets/testimonials/pascale-mobile-7.png
Binary file added public/assets/testimonials/pascale-mobile-8.png
Binary file added public/assets/testimonials/pascale-selected-0.png
Binary file added public/assets/testimonials/pascale-selected-1.png
Binary file added public/assets/testimonials/pascale-selected-3.png
Binary file added public/assets/testimonials/pascale-selected-4.png
Binary file added public/assets/testimonials/pascale-selected-5.png
Binary file added public/assets/testimonials/pascale-selected-6.png
Binary file added public/assets/testimonials/pascale-selected-8.png
Binary file added public/assets/testimonials/pascale-selected-9.png
Binary file added public/assets/testimonials/pascale.webp
Binary file added public/assets/testimonials/qazi-base.webp
Binary file added public/assets/testimonials/qazi.webp
Binary file added public/assets/testimonials/vaibhav-base.webp
Binary file added public/assets/testimonials/vaibhav-wheel.webp
Binary file added public/assets/testimonials/vaibhav.webp
28 changes: 28 additions & 0 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,31 @@ body {
[data-motion-scope]:not([data-onscreen]) * {
animation-play-state: paused;
}

/* Keep live copy selectable on both layouts, including Safari/iOS.
Decorative images and carousel controls keep their own input behavior. */
:where(#stats, #recap, #testimonials, [role="dialog"])
:is(h1, h2, h3, p, figcaption, .recap-cue) {
-webkit-user-select: text;
user-select: text;
cursor: text;
}

/* The glyphs remain in the illustration; these spans supply selection/copy. */
.artwork-label {
color: transparent;
-webkit-user-select: text;
user-select: text;
pointer-events: auto;
cursor: text;
}
.artwork-label::selection {
color: white;
background: #176ea7cc;
}
.testi-slide:not([data-active]) .artwork-label,
.testi-base[aria-hidden="true"] .artwork-label {
pointer-events: none;
-webkit-user-select: none;
user-select: none;
}
6 changes: 6 additions & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import Faq from "@/sections/faq";
import Hero from "@/sections/hero";
import Navbar from "@/sections/navbar";
import PastProjects from "@/sections/past-projects";
import Recap from "@/sections/recap";
import SponsorsFooter from "@/sections/sponsors-footer";
import Stats from "@/sections/stats";
import Testimonials from "@/sections/testimonials";

export default function Home() {
return (
Expand All @@ -14,6 +17,9 @@ export default function Home() {
<Navbar />
<Hero />
<About />
<Stats />
<Recap />
<Testimonials />
<PastProjects />
<Faq />
<SponsorsFooter />
Expand Down
143 changes: 5 additions & 138 deletions src/components/hero/hero-lanterns.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
"use client";

import { type CSSProperties, useEffect, useRef } from "react";
import { useLanternMotion } from "@/hooks/use-lantern-motion";

import { type CSSProperties, useRef } from "react";

/** The lantern art's own size (Figma "Red Round Lantern"). */
const LANTERN_W = 47.689;
const LANTERN_H = 67.722;

/** The gate art's own width (gate.svg); lanterns are placed in its units. */
const GATE_W = 848;
const pct = (value: number, of: number) => `${(value / of) * 100}%`;

type Lantern = {
/** Rotated bounding box, as Figma reports it, relative to the gate's
Expand Down Expand Up @@ -60,31 +63,6 @@ const LANTERNS: Lantern[] = [
* whenever the lantern speeds up (so it trails behind, like a loose weight).
* Angles are degrees, time is seconds.
*/
/** Hook spring: about a 1.7 s swing, dying away over a few seconds. */
const BODY_K = 14;
const BODY_DAMP = 0.9;
/** Tassel spring: quicker and a little looser. */
const TASSEL_K = 45;
const TASSEL_DAMP = 2.2;
/** How hard the lantern's own acceleration throws the tassel. */
const TASSEL_LAG = 1.1;
/** Spin (deg/s) given per lantern-width/s of cursor speed, and its caps. */
const KNOCK_GAIN = 2.6;
const MAX_SPIN = 140;
const MAX_ANGLE = 30;
/** How far around the lantern (in lantern widths) the cursor still hits it. */
const REACH = 0.25;
/** Below this, a lantern counts as still and the loop can stop. */
const REST = 0.02;

type Motion = { body: number; bodyV: number; tassel: number; tasselV: number };

const pct = (value: number, of: number) => `${(value / of) * 100}%`;

/** A cursor to knock them with: a mouse or trackpad, not a finger. Touch
* screens just get the breeze. */
const KNOCK_QUERY = "(hover: hover) and (pointer: fine)";

type HeroLanternsProps = {
/** The scene's design frame, which the lanterns are placed in. */
frame: { width: number; height: number };
Expand All @@ -103,118 +81,7 @@ export const HeroLanterns = ({ frame, gate }: HeroLanternsProps) => {
const layerRef = useRef<HTMLDivElement>(null);
const scale = gate.width / GATE_W;

useEffect(() => {
const layer = layerRef.current;
const scene = layer?.parentElement;
if (!layer || !scene) return;
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
if (!window.matchMedia(KNOCK_QUERY).matches) return;

const lanterns = Array.from(layer.children) as HTMLElement[];
const motion: Motion[] = lanterns.map(() => ({
body: 0,
bodyV: 0,
tassel: 0,
tasselV: 0,
}));
let last: { x: number; y: number; t: number } | null = null;
let raf = 0;
let then = 0;

const step = (now: number) => {
// Cap the step so a stalled tab doesn't fling them on its return.
const dt = Math.min((now - then) / 1000, 1 / 30);
then = now;
let moving = false;
motion.forEach((m, i) => {
const bodyA = -BODY_K * m.body - BODY_DAMP * m.bodyV;
m.bodyV += bodyA * dt;
m.body = Math.max(
-MAX_ANGLE,
Math.min(MAX_ANGLE, m.body + m.bodyV * dt)
);
const tasselA =
-TASSEL_K * m.tassel - TASSEL_DAMP * m.tasselV - TASSEL_LAG * bodyA;
m.tasselV += tasselA * dt;
m.tassel += m.tasselV * dt;

const still =
Math.abs(m.body) < REST &&
Math.abs(m.bodyV) < REST &&
Math.abs(m.tassel) < REST &&
Math.abs(m.tasselV) < REST;
if (still) {
m.body = m.bodyV = m.tassel = m.tasselV = 0;
} else {
moving = true;
}
lanterns[i].style.setProperty("--knock", `${m.body.toFixed(2)}deg`);
lanterns[i].style.setProperty(
"--knock-tassel",
`${m.tassel.toFixed(2)}deg`
);
});
raf = moving ? requestAnimationFrame(step) : 0;
};

const onMove = (event: PointerEvent) => {
const point = { x: event.clientX, y: event.clientY, t: event.timeStamp };
const prev = last;
last = point;
if (!prev) return;
const dt = (point.t - prev.t) / 1000;
if (dt <= 0 || dt > 0.1) return;

let knocked = false;
lanterns.forEach((lantern, i) => {
const rect = lantern.getBoundingClientRect();
const pad = rect.width * REACH;
// Walk the path since the last event so a fast flick still connects.
let hit = false;
for (let s = 0; s <= 1 && !hit; s += 0.125) {
const x = prev.x + (point.x - prev.x) * s;
const y = prev.y + (point.y - prev.y) * s;
hit =
x > rect.left - pad &&
x < rect.right + pad &&
y > rect.top - pad &&
y < rect.bottom + pad;
}
if (!hit) return;
// Width-relative speed, so it feels the same at any screen size.
// Pushing right swings the bottom right, which is anticlockwise.
const speed = (point.x - prev.x) / rect.width / dt;
const push = Math.max(
-MAX_SPIN,
Math.min(MAX_SPIN, -speed * KNOCK_GAIN)
);
// Carried along, not kicked once per event: a lantern only speeds
// up while the cursor moves faster than it in that direction, so
// the knock depends on the sweep's speed, not on the event rate.
const m = motion[i];
if (push > 0 ? push > m.bodyV : push < m.bodyV) {
m.bodyV += (push - m.bodyV) * 0.6;
knocked = true;
}
});

if (knocked && !raf) {
then = performance.now();
raf = requestAnimationFrame(step);
}
};
const onLeave = () => {
last = null;
};

scene.addEventListener("pointermove", onMove, { passive: true });
scene.addEventListener("pointerleave", onLeave);
return () => {
scene.removeEventListener("pointermove", onMove);
scene.removeEventListener("pointerleave", onLeave);
cancelAnimationFrame(raf);
};
}, []);
useLanternMotion(layerRef);

return (
<div
Expand Down
75 changes: 75 additions & 0 deletions src/components/recap/recap-scene-mobile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import { LightboxGallery, LightboxTrigger } from "@/components/ui/lightbox";
import { SceneLayer } from "@/components/ui/scene-layer";
import { RECAP_MOBILE } from "@/constants/recap";
import { RECAP_DESKTOP_PHOTOS } from "@/constants/recap-photos";
import { frameStyle } from "@/lib/frame";

import "./recap.css";

/**
* Phone recap: the same wall of polaroids, edge to edge, no garage frame to
* open. The photos drift a little so the wall doesn't read as one flat image.
*/
const PHOTOS = [
{ box: RECAP_MOBILE.photo1, src: "mobile-photo-1" },
{ box: RECAP_MOBILE.photo2, src: "mobile-photo-2" },
{ box: RECAP_MOBILE.photo3, src: "mobile-photo-3" },
{ box: RECAP_MOBILE.photo4, src: "mobile-photo-4" },
{ box: RECAP_MOBILE.photo5, src: "mobile-photo-5" },
{ box: RECAP_MOBILE.photo6, src: "mobile-photo-6" },
{ box: RECAP_MOBILE.photo7, src: "mobile-photo-7" },
{ box: RECAP_MOBILE.photo8, src: "mobile-photo-8" },
{ box: RECAP_MOBILE.photo9, src: "mobile-photo-9" },
];

export const RecapSceneMobile = () => (
<div className="@container relative aspect-[407/874] w-full overflow-hidden bg-[#0b101c]">
<SceneLayer
src="/assets/recap/mobile-door.webp"
box={RECAP_MOBILE.door}
priority
/>

<LightboxGallery>
{PHOTOS.map((photo, index) => {
const full = RECAP_DESKTOP_PHOTOS[[0, 1, 2, 3, 4, 5, 6, 8, 9][index]];
return (
<LightboxTrigger
key={photo.src}
photo={{
src: full.fullSrc,
rotation: full.rotation,
alt: `nwHacks recap photo ${index + 1}`,
caption: `nwHacks recap photo ${index + 1}`,
width: full.fullWidth,
height: full.fullHeight,
}}
className="recap-photo recap-mobile-photo absolute"
style={{
...frameStyle(photo.box),
animationDelay: `${index * 0.35}s`,
}}
>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
src={`/assets/recap/${photo.src}.webp`}
alt={`nwHacks recap photo ${index + 1}`}
draggable={false}
className="size-full select-none"
/>
</LightboxTrigger>
);
})}
</LightboxGallery>

<SceneLayer
src="/assets/recap/mobile-lights.webp"
box={RECAP_MOBILE.lights}
fit="contain"
/>

<h2 className="absolute inset-x-0 top-[3.09%] text-center font-display text-[7.37cqw] leading-none text-white">
Recap
</h2>
</div>
);
Loading
Loading