Skip to content

Commit

Permalink
Documented parts of the website!
Browse files Browse the repository at this point in the history
  • Loading branch information
milkcee12 committed Sep 4, 2024
1 parent 6cdde70 commit 5cba1fb
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/lib/components/FaqDetails.svelte
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- Individual dropdown component used in Faqs.svelte -->
<script lang="ts">
export let question: string;
export let answer: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
let navList: HTMLUListElement;
$: activeSection;
/**
* Activated when user taps on a navbar item. Toggles the active styling
* on that item and scrolls to the corresponding section.
*/
function toggleActive(event: any) {
event.preventDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
$: activeSection;
$: isOpen;
/**
* Activated when user taps on a navbar item. Toggles the active styling
* on that item and scrolls to the corresponding section.
*/
function toggleActive(event: any) {
event.preventDefault();
isOpen = false;
Expand Down
6 changes: 6 additions & 0 deletions src/lib/components/sections/HeroSection.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
<img src="/images/hero-section-chocobar.png" alt="AthenaHacks chocolate keyboard. March 2-3" />
</div>
<div class="content">
<!-- [BEGIN] Organizer application links -->
<!-- TODO: Add application links -->
<!-- [END] Organizer application links -->

<!-- [BEGIN] Hackathon application links -->
<!-- <Button
tilt="left"
backgroundColor="blue"
Expand All @@ -27,6 +32,7 @@
href="https://airtable.com/appC2yvmYQ33jcGYT/shrhXDTWiI3Th8VT0"
target="_blank">AthenaHacks 2024 Volunteer Application</Button
> -->
<!-- [END] application links -->
<Socials />
<div class="tech-together">
<p><small><i>AthenaHacks powered by </i></small></p>
Expand Down
17 changes: 13 additions & 4 deletions src/lib/components/sections/Team.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,30 @@
['Programs', import.meta.glob('$lib/images/people/programs/*.jpg')]
]);
/** Info from data/team.yml.*/
const teamData: { [key: string]: any } = data;
/**
* Given a folder location, iterate and retrieve all images.
* - Parse images for src string.
* - Parse filename for organizer's first/last name.
* - Look up organizer in teamData to get any additional data.
*/
async function loadProfilePhotosFromModule(module: any) {
const iterableModule = Object.entries(module);
const images = await Promise.all(
iterableModule.map(async ([filepath, resolver]: any) => {
// Resolve image src from file system
const imageData: any = await resolver().then(({ default: imageUrl }: any) => {
// Parse organizer name from image filename.
let name: string = filepath.split('\\').pop()!.split('/').pop()!;
name = name
.replace(/\.[^/.]+$/, '')
.replace('_', ' ')
.replace(/\w\S*/g, function (txt: string) {
return txt.charAt(0).toUpperCase() + txt.substring(1).toLowerCase();
});
// Join image data with any additional teamData.
return {
name: name,
data: teamData[name] ?? null,
Expand All @@ -36,15 +45,15 @@
return imageData;
})
);
// console.log(images);
return images;
}
</script>

<section id="team">
<Header>Our Team</Header>
<div class="team-gallery">
{#each [...modules] as [dept, module]}
<!-- Iterate through each folder containing images from each team. -->
{#each [...modules] as [team, module]}
{#await loadProfilePhotosFromModule(module) then images}
{#each images as { name, data, src }}
<div class="profile-item">
Expand All @@ -61,7 +70,7 @@
<p class="name">{name}</p>
<p>
<small><i>({data?.pronouns ?? 'she/her'})</i></small><br />
<small>{dept}</small>
<small>{team}</small>
</p>
</figcaption>
</figure>
Expand Down
1 change: 1 addition & 0 deletions src/lib/scss/_globals.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** Global styles for the entire website. */
@import url('https://fonts.googleapis.com/css2?family=Lilita+One&family=Open+Sans:wght@500;700&display=swap');

html {
Expand Down
5 changes: 4 additions & 1 deletion src/lib/scss/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// Adapted from https://css-tricks.com/snippets/sass/mixin-manage-breakpoints/
/**
* Used to easily create responsive styles based on viewport width.
* Adapted from https://css-tricks.com/snippets/sass/mixin-manage-breakpoints/
*/

$breakpoints: (
'small': (max-width: 767px),
Expand Down
1 change: 1 addition & 0 deletions src/lib/scss/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** Any global constants. */
$background-color: #FCF7F0;
$blue: #BFE2FF;
$dark-blue: #93DDFC;
Expand Down
5 changes: 3 additions & 2 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import '$lib/scss/_globals.scss';
import DesktopNavbar from '$lib/components/DesktopNavbar.svelte';
import DesktopNavbar from '$lib/components/NavbarDesktop.svelte';
import Footer from '$lib/components/Footer.svelte';
import HeroSection from '$lib/components/sections/HeroSection.svelte';
import About from '$lib/components/sections/About.svelte';
Expand All @@ -9,7 +9,7 @@
import Faqs from '$lib/components/sections/Faqs.svelte';
import Sponsors from '$lib/components/sections/Sponsors.svelte';
import Team from '$lib/components/sections/Team.svelte';
import MobileNavbar from '$lib/components/MobileNavbar.svelte';
import MobileNavbar from '$lib/components/NavbarMobile.svelte';
import Schedule from '$lib/components/sections/Schedule.svelte';
import MemoryLane from '$lib/components/sections/MemoryLane.svelte';
</script>
Expand Down Expand Up @@ -39,6 +39,7 @@
<Sponsors />
<Keynote />
<Team />

<Footer />

<style lang="scss">
Expand Down

0 comments on commit 5cba1fb

Please sign in to comment.