Skip to content

Commit

Permalink
feat: remove graduated coords (winter '24); add BartCard component an…
Browse files Browse the repository at this point in the history
…d update about
  • Loading branch information
nicosalm committed Jan 13, 2025
1 parent 048daa6 commit 80a00ca
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .astro/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"_variables": {
"lastUpdateCheck": 1730150118275
"lastUpdateCheck": 1736791334401
}
}
24 changes: 12 additions & 12 deletions .astro/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,16 @@ declare module 'astro:content' {
} & { render(): Render[".md"] };
};
"events": {
"lightning-talks-fall-2024.md": {
id: "lightning-talks-fall-2024.md";
slug: "lightning-talks-fall-2024";
"lightning-talks-fall-2024-1.md": {
id: "lightning-talks-fall-2024-1.md";
slug: "lightning-talks-fall-2024-1";
body: string;
collection: "events";
data: InferEntrySchema<"events">
} & { render(): Render[".md"] };
"lightning-talks-fall-2024-2.md": {
id: "lightning-talks-fall-2024-2.md";
slug: "lightning-talks-fall-2024-2";
body: string;
collection: "events";
data: InferEntrySchema<"events">
Expand All @@ -205,15 +212,6 @@ declare module 'astro:content' {
collection: "events";
data: InferEntrySchema<"events">
} & { render(): Render[".md"] };
};
"resources": {
"README.md": {
id: "README.md";
slug: "readme";
body: string;
collection: "resources";
data: any
} & { render(): Render[".md"] };
};

};
Expand Down Expand Up @@ -317,6 +315,8 @@ declare module 'astro:content' {
};
};
"docs": {
};
"resources": {
};

};
Expand Down
103 changes: 103 additions & 0 deletions src/components/BartCard.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faLinkedin, faGithub } from "@fortawesome/free-brands-svg-icons";
import { faLink } from "@fortawesome/free-solid-svg-icons";
import type { CollectionEntry } from "astro:content";
import { getImage } from "astro:assets";
let { advisor } = Astro.props;
let advisorInfo = (advisor as CollectionEntry<"advisors">).data;
// Create advisor links array with icons
const advisorLinks = [
{
givenLink: advisorInfo.personalLink,
link: advisorInfo.personalLink,
icon: faLink,
}
].filter((e) => e.givenLink);
// Import and process images
const images = import.meta.glob("../assets/**");
let formattedHoverImageURL: string | null = null;
if (advisor.data.hover_image) {
const hoverImageImport =
await images[`../assets/profiles/${advisor.data.hover_image}`]();
const hoverFormattedImage = await getImage({
src: hoverImageImport.default
});
formattedHoverImageURL = hoverFormattedImage.src;
}
let formattedOriginalImageURL: string | null = null;
if (advisor.data.image) {
const originalImageImport =
await images[`../assets/profiles/${advisor.data.image}`]();
const originalFormattedImage = await getImage({
src: originalImageImport.default
});
formattedOriginalImageURL = originalFormattedImage.src;
}
---

<div class="hover:-translate-y-1 hover:scale-105 duration-300 hover:shadow-2xl
hover:shadow-red-800/50 shadow-xl font-lato bg-base-100
rounded-lg overflow-hidden flex flex-row w-full max-w-4xl mx-auto">
<figure class="w-1/4 flex-shrink-0">
{advisorInfo.image && formattedHoverImageURL == null && (
<img
src={formattedOriginalImageURL}
alt={advisorInfo.name}
class="w-full h-full object-cover"
/>
)}
{advisorInfo.image && formattedHoverImageURL != null && (
<img
id="advisorImage"
src={formattedOriginalImageURL}
onmouseover="this.src=this.getAttribute('data-hover-src')"
onmouseout="this.src=this.getAttribute('data-original-src')"
alt={advisorInfo.name}
class="w-full h-full object-cover"
data-hover-src={formattedHoverImageURL}
data-original-src={formattedOriginalImageURL}
/>
)}
</figure>

<div class="flex flex-col flex-grow p-8">
<div class="flex justify-between items-start mb-4">
<h1 class="text-3xl font-bold text-gray-800">{advisorInfo.name}</h1>
<p class="text-lg text-gray-600">Faculty Advisor</p>
</div>

<p class="text-base text-gray-700 mb-6">{advisorInfo.bio}</p>

<div class="space-y-2">
{advisorInfo.department && (
<p class="text-gray-700">
Department: {advisorInfo.department}
</p>
)}

{advisorInfo.office && (
<p class="text-gray-700">
Office: {advisorInfo.office}
</p>
)}
</div>

<div class="flex mt-4">
{advisorLinks.map((e) => (
<a
href={e.link}
rel="noopener nofollow"
target="_blank"
class="text-gray-600 hover:text-red-600 transition-colors"
>
<FontAwesomeIcon icon={e.icon} size="lg" />
</a>
))}
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion src/content/coordinators/ahmet-ahunbay.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Ahmet Ahunbay",
"image": "ahmet-ahunbay.jpg",
"isActive": true,
"isActive": false,
"grade": "Junior",
"study": "CS & DS",
"github": "ahmetahunbay",
Expand Down
2 changes: 1 addition & 1 deletion src/content/coordinators/chris-gottwaldt.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"grade": "Senior",
"name": "Chris Gottwaldt",
"isActive": true,
"isActive": false,
"image": "chris-gottwaldt.webp",
"study": "CS & DS",
"github": "christophergottwaldt",
Expand Down
2 changes: 1 addition & 1 deletion src/content/coordinators/grace-steinmetz.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"isActive": true,
"isActive": false,
"name": "Grace Steinmetz",
"study": "Computer Science",
"grade": "Senior",
Expand Down
2 changes: 1 addition & 1 deletion src/content/coordinators/nico-salm.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"image": "nico-salm.webp",
"study": "CS & DS",
"github": "nicosalm",
"personalLink": "https://salm.dev",
"personalLink": "https://salm.dev/blog",
"linkedIn": "nicosalm",
"bio": ""
}
2 changes: 1 addition & 1 deletion src/content/coordinators/pranav-dronavalli.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Pranav Dronavalli",
"isActive": true,
"isActive": false,
"grade": "Senior",
"study": "CS & Math",
"github": "dronavallipranav",
Expand Down
62 changes: 22 additions & 40 deletions src/pages/about.astro
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
---
import Layout from "../layouts/Layout.astro";
import CoordCard from "../components/CoordCard.astro";
import BartCard from "../components/BartCard.astro";
import { getCollection } from "astro:content";
const CoordsCollection = await getCollection("coordinators");
const coc = await getCollection("docs");
const coc_rendered = await coc
.filter((d: any) => d.id == "Code-of-Conduct.md")[0]
?.render();
console.log(coc.map((x) => x.id));
const advisorData = {
data: {
name: "Bart Miller",
image: "bart-miller.webp",
personalLink: "https://www.cs.wisc.edu/~bart/",
department: "Computer Sciences",
office: "CS Building 6375",
bio: "Barton Miller is a Vilas Distinguished Achievement Professor and the Amar and Belinder Sohi Professor of Computer Sciences at the University of Wisconsin, Madison. He received his B.A. degree from the University of California, San Diego in 1977, and M.S. and Ph.D. degrees in Computer Science from the University of California, Berkeley in 1980 and 1984. Professor Miller is a Fellow of the ACM.",
},
};
---

<Layout>
<div class="inline w-full overflow-hidden text-slate-800 mt-8">
<div class="mx-auto w-3/4">
<div class="text-gray-700 font-sans">
<!-- coords -->
<h1 class="text-4xl font-semibold font-lato text-center pb-2">
Meet the Coords
</h1>
Expand All @@ -29,48 +34,25 @@ console.log(coc.map((x) => x.id));
>
{
CoordsCollection.filter((d) => d.data.isActive).map((coord) => (
<CoordCard {coord} />
<CoordCard coord={coord} />
))
}
</div>
<div class="font-sans mt-8">
<h1 class="text-4xl font-semibold font-lato text-center pb-2">

<!-- faculty advisor -->
<div class="font-sans mt-24">
<h1 class="text-4xl font-semibold font-lato text-center">
Faculty Advisor
</h1>
<p class="text-lg text-gray-600 font-light pb-14 text-center">
<p class="text-lg text-gray-600 font-light pt-2 pb-16 text-center">
Our faculty advisor is Professor Bart Miller, who can be contacted
at bart (at) cs.wisc.edu
</p>
</div>
<div class="sm:mb-8 mx-auto sm:w-1/4 w-1/2">
<CoordCard
{...{
coord: {
data: {
name: "Bart Miller",
study: "Faculty Advisor",
image: "bart-miller.webp",
personalLink: "https://www.cs.wisc.edu/~bart/",
links: [
{
name: "Test",
url: "https://www.google.com",
},
],
bio: "Barton Miller is a Vilas Distinguished Achievement Professor and the Amar and Belinder Sohi Professor of Computer Sciences at the University of Wisconsin, Madison. He received his B.A. degree from the University of California, San Diego in 1977, and M.S. and Ph.D. degrees in Computer Science from the University of California, Berkeley in 1980 and 1984. Professor Miller is a Fellow of the ACM.",
},
},
}}
/>
</div>
</div>
<div class="inline w-full overflow-hidden text-slate-800">
<div class="mx-auto w-3/4">
<div class="text-base/6 font-sans prose prose-lg prose-zinc">
<coc_rendered.Content />
<div class="w-full max-w-5xl mx-auto mb-24">
<BartCard advisor={advisorData} />
</div>
</div>
</div>
</div>
</div></Layout
>
</div>
</Layout>

0 comments on commit 80a00ca

Please sign in to comment.