Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 app/apple-icon.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 app/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { Analytics } from '@vercel/analytics/next';
import { SpeedInsights } from '@vercel/speed-insights/next';
import type { Metadata, Viewport } from 'next';
import type { ReactNode } from 'react';
import ThemeScript from '@/components/common/ThemeScript';
import Footer from '@/components/layout/Footer';
import Header from '@/components/layout/Header';
import Layout from '@/components/layout/Layout';
import '@/lib/fonts';
import { baseOpenGraph, feedPath } from '@/lib/seo';
import { siteDescription, siteName, siteUrl } from '@/lib/site';
import '@/styles/globals.css';
Expand All @@ -14,10 +16,6 @@ export const metadata: Metadata = {
title: { template: `%s | ${siteName}`, default: siteName },
description: siteDescription,
applicationName: siteName,
icons: {
icon: { url: '/logo.png', type: 'image/png' },
apple: { url: '/logo.png', type: 'image/png' },
},
alternates: { types: { 'application/rss+xml': feedPath } },
openGraph: {
...baseOpenGraph,
Expand Down Expand Up @@ -49,6 +47,7 @@ export default function RootLayout({ children }: { children: ReactNode }) {
<Layout header={<Header />} footer={<Footer />}>
{children}
</Layout>
<Analytics />
<SpeedInsights />
</body>
</html>
Expand Down
2 changes: 1 addition & 1 deletion app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { getAllAuthors } from '@/lib/content/authors';
import { getPostsByAuthor, getPublishedPosts } from '@/lib/content/posts';
import { absoluteUrl } from '@/lib/seo';

// /team is left out for the time being
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const [posts, authors] = await Promise.all([
getPublishedPosts(),
Expand All @@ -22,6 +21,7 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {

return [
{ url: absoluteUrl('/'), changeFrequency: 'daily', priority: 1 },
{ url: absoluteUrl('/team'), changeFrequency: 'monthly', priority: 0.6 },
{
url: absoluteUrl('/blog'),
lastModified: latest,
Expand Down
79 changes: 72 additions & 7 deletions app/team/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,77 @@
import type { Metadata } from 'next';
import UnderDev from '@/components/common/UnderDev';
import JsonLd from '@/components/common/JsonLd';
import MemberLoop from '@/components/team/MemberLoop';
import Timeline from '@/components/team/Timeline';
import { absoluteUrl, pageMetadata } from '@/lib/seo';
import { getTeam } from '@/lib/team';
import { siteName, siteUrl } from '@/lib/site';
import type { Person } from '@/lib/timeline';

// Kept out of search results while the page is under development.
export const metadata: Metadata = {
export const revalidate = 86400;

const description = `The story of ${siteName}, from its founding in 2021 to today.`;

export const metadata: Metadata = pageMetadata({
title: 'Team',
robots: { index: false, follow: true },
};
description,
path: '/team',
});

const person = ({ name, href }: Person) => ({
'@type': 'Person',
name,
...(href && { url: href.startsWith('/') ? absoluteUrl(href) : href }),
});

export default async function TeamPage() {
const { timeline, community } = await getTeam();
const first = timeline[0].year;
const founders = timeline[0].milestones
.flatMap((milestone) => milestone.people ?? [])
.filter(({ role }) => role === 'founder' || role === 'co-founder');

return (
<div className='mx-auto flex w-full max-w-4xl flex-col gap-16 py-8 md:gap-24 md:py-12'>
<JsonLd
data={{
'@type': 'AboutPage',
name: `Team | ${siteName}`,
url: absoluteUrl('/team'),
description,
isPartOf: { '@id': `${siteUrl}/#website` },
mainEntity: {
'@type': 'Organization',
'@id': `${siteUrl}/#organization`,
name: siteName,
foundingDate: String(first),
founder: founders.map(person),
member: community.map(person),
},
}}
/>
<header className='flex flex-col gap-4'>
<h1 className='text-3xl font-semibold text-balance sm:text-5xl'>
Established since <span className='text-awesome'>{first}</span>
</h1>
<p className='text-muted-foreground max-w-xl text-sm text-pretty sm:text-base'>
A timeline of all events and projects undertaken by OSF thus far.
</p>
</header>

<Timeline data={timeline} />

export default function TeamPage() {
return <UnderDev />;
{community.length > 0 && (
<section className='flex flex-col gap-4'>
<div className='flex flex-col gap-1'>
<h2 className='text-lg font-medium'>Our community</h2>
<p className='text-muted-foreground text-sm'>
All the other members and contributors who form our large
community.
</p>
</div>
<MemberLoop people={community} />
</section>
)}
</div>
);
}
19 changes: 16 additions & 3 deletions components/authors/AuthorCard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
import { Globe, Mail } from 'lucide-react';
import type { ReactNode } from 'react';
import Link from 'next/link';
import BrandIcon from '@/components/common/BrandIcon';
import { iconButton } from '@/components/layout/styles';
import type { Author } from '@/types/blog';
import AuthorAvatar from './AuthorAvatar';

const linkIcons: Record<string, ReactNode> = {
Website: <Globe />,
GitHub: <BrandIcon brand='GitHub' />,
LinkedIn: <BrandIcon brand='LinkedIn' />,
X: <BrandIcon brand='X' />,
Email: <Mail />,
};

interface AuthorCardProps {
author: Author;
linkToProfile?: boolean;
Expand Down Expand Up @@ -47,7 +58,7 @@ const AuthorCard = ({ author, linkToProfile = true }: AuthorCardProps) => {
)}
</div>
{author.links.length > 0 && (
<ul className='flex flex-wrap gap-2'>
<ul className='-ml-2 flex flex-wrap gap-1'>
{author.links.map((link) => (
<li key={link.href}>
<a
Expand All @@ -56,9 +67,11 @@ const AuthorCard = ({ author, linkToProfile = true }: AuthorCardProps) => {
link.href.startsWith('mailto:') ? undefined : '_blank'
}
rel='noopener noreferrer'
className='hover:bg-muted text-muted-foreground hover:text-foreground rounded-md border px-2 py-1 text-xs transition-colors'
aria-label={link.label}
title={link.label}
className={`${iconButton} [&>svg]:size-4`}
>
{link.label}
{linkIcons[link.label] ?? link.label}
</a>
</li>
))}
Expand Down
5 changes: 1 addition & 4 deletions components/blog/PostNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ const PostNavigation = ({ newer, older }: PostNavigationProps) => (
className='grid grid-cols-1 gap-4 sm:grid-cols-2'
>
{older ? (
<Link
href={`/blog/${older.id}`}
className={cn(base, 'hover:bg-muted')}
>
<Link href={`/blog/${older.id}`} className={cn(base, 'hover:bg-muted')}>
<ArrowLeft className='size-4 shrink-0 transition-transform group-hover:-translate-x-1' />
<span className='flex flex-col items-start'>
<span className='text-muted-foreground text-xs'>Previous Post</span>
Expand Down
5 changes: 4 additions & 1 deletion components/common/BrandIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { SVGProps } from 'react';
import type { socialLinks } from '@/lib/site';

type Brand = (typeof socialLinks)[number]['label'];
export type Brand = (typeof socialLinks)[number]['label'] | 'LinkedIn' | 'X';

const brandPaths: Record<Brand, string> = {
Instagram:
Expand All @@ -12,6 +12,9 @@ const brandPaths: Record<Brand, string> = {
'M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z',
'MS Teams':
'M3 5h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Zm1 3v2h3v6h2v-6h3V8ZM19 3.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5ZM16 10h6a1 1 0 0 1 1 1v4.5a3.5 3.5 0 0 1-3.5 3.5H16Z',
LinkedIn:
'M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065 2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z',
X: 'M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z',
};

// Simple Icons brand marks for the social links; they inherit the text color.
Expand Down
93 changes: 74 additions & 19 deletions components/home/KarnatakaMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from 'lucide-react';
import type { Map as MapLibreMap, StyleSpecification } from 'maplibre-gl';
import { useEffect, useRef, useState } from 'react';
import 'maplibre-gl/dist/maplibre-gl.css';
import { preconnect } from 'react-dom';

const campuses = {
manipal: {
Expand Down Expand Up @@ -59,9 +59,10 @@ const regions = [

type RegionId = (typeof regions)[number]['id'];

// Liberty shows buildings, landmarks and street names once zoomed in.
const lightStyleUrl = 'https://tiles.openfreemap.org/styles/liberty';
const darkStyleUrl = 'https://tiles.openfreemap.org/styles/dark';
// Liberty shows buildings, landmarks and street names once zoomed in.
const tileOrigin = 'https://tiles.openfreemap.org';
const lightStyleUrl = `${tileOrigin}/styles/liberty`;
const darkStyleUrl = `${tileOrigin}/styles/dark`;

type Theme = 'light' | 'dark';

Expand Down Expand Up @@ -177,6 +178,28 @@ const KarnatakaMap = () => {
const [region, setRegion] = useState<RegionId>('manipal');
const [loaded, setLoaded] = useState(false);
const [fullscreen, setFullscreen] = useState(false);
// Set when the browser can't give MapLibre a WebGL2 context.
const [unsupported, setUnsupported] = useState(false);
// MapLibre is about a megabyte, so it loads once the map is nearly in view.
const [nearby, setNearby] = useState(false);

// The style and tiles are fetched with CORS, so warm up a matching connection.
preconnect(tileOrigin, { crossOrigin: 'anonymous' });

useEffect(() => {
const element = root.current;
if (!element) return;
const observer = new IntersectionObserver(
([entry]) => {
if (!entry.isIntersecting) return;
setNearby(true);
observer.disconnect();
},
{ rootMargin: '400px' }
);
observer.observe(element);
return () => observer.disconnect();
}, []);

useEffect(() => {
const sync = () =>
Expand All @@ -186,32 +209,39 @@ const KarnatakaMap = () => {
}, []);

useEffect(() => {
if (!nearby) return;
let cancelled = false;
let observer: MutationObserver | undefined;

(async () => {
const [{ Map, Marker, Popup, setWorkerUrl }, loadedStyles] =
await Promise.all([import('maplibre-gl'), loadStyles()]);
await Promise.all([import('./maplibre'), loadStyles()]);
setWorkerUrl(
new URL('maplibre-gl/dist/maplibre-gl-worker.mjs', import.meta.url).href
);
if (cancelled || !container.current) return;

let theme = currentTheme();
const start = regions[0];
const instance = new Map({
container: container.current,
style: loadedStyles[theme],
center: [...start.center],
zoom: start.zoom,
minZoom: 4,
maxZoom: 18,
attributionControl: { compact: true },
fadeDuration: 0,
// One finger (or a plain mouse wheel) scrolls the page instead of
// getting stuck in the map; two fingers or Ctrl/⌘ + wheel move it.
cooperativeGestures: true,
});
let instance: MapLibreMap;
try {
instance = new Map({
container: container.current,
style: loadedStyles[theme],
center: [...start.center],
zoom: start.zoom,
minZoom: 4,
maxZoom: 18,
attributionControl: { compact: true },
fadeDuration: 0,
// One finger (or a plain mouse wheel) scrolls the page instead of
// getting stuck in the map; two fingers or Ctrl/⌘ + wheel move it.
cooperativeGestures: true,
});
} catch {
setUnsupported(true);
return;
}
map.current = instance;
// Label the canvas
instance
Expand Down Expand Up @@ -285,7 +315,7 @@ const KarnatakaMap = () => {
map.current?.remove();
map.current = null;
};
}, []);
}, [nearby]);

const goTo = (id: RegionId) => {
setRegion(id);
Expand All @@ -308,6 +338,31 @@ const KarnatakaMap = () => {
else void root.current?.requestFullscreen();
};

if (unsupported)
return (
<div className='bg-background absolute inset-0 flex flex-col items-center justify-center gap-3 p-4 text-center text-sm'>
<MapPin aria-hidden='true' className='text-primary size-6' />
<p className='text-muted-foreground max-w-xs'>
Your browser can&apos;t show this map (it needs WebGL2). Find our
campuses on OpenStreetMap instead:
</p>
<ul className='flex flex-col gap-1'>
{Object.values(campuses).map(({ name, lngLat }) => (
<li key={name}>
<a
href={`https://www.openstreetmap.org/?mlat=${lngLat[1]}&mlon=${lngLat[0]}#map=17/${lngLat[1]}/${lngLat[0]}`}
target='_blank'
rel='noreferrer'
className='text-primary font-medium hover:underline'
>
{name}
</a>
</li>
))}
</ul>
</div>
);

return (
<div ref={root} className='bg-background absolute inset-0'>
<div
Expand Down
5 changes: 5 additions & 0 deletions components/home/maplibre.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Loaded on demand, so the map's stylesheet arrives with its code instead of
// blocking the first paint of the home page.
import 'maplibre-gl/dist/maplibre-gl.css';

export { Map, Marker, Popup, setWorkerUrl } from 'maplibre-gl';
Loading
Loading