Skip to content

Commit

Permalink
Move more components into global components, add SIGPwny/WiCyS logo
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiteHoodHacker committed Sep 11, 2024
1 parent eccb6ac commit bfeb8ab
Show file tree
Hide file tree
Showing 32 changed files with 172 additions and 92 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import Avatar from '@/components/Profile/Avatar.astro';
import Persona from '@/components/Profile/Persona';
import ProfileCard from '@/components/Profile/ProfileCard.astro';
import Avatar from './Avatar.astro';
import Persona from './Persona';
import ProfileCard from './ProfileCard.astro';
const { profiles, limit } = Astro.props;
const show_count = limit && profiles.length > limit ? limit - 1 : profiles.length;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Avatar from '@/components/Profile/Avatar.astro';
import { SocialIcon, getSocialIconDisplayName } from '@/components/Icons';
import Avatar from './Avatar.astro';
import { SocialIcon, getSocialIconDisplayName } from '$/components/Icons';
const { profile, showFull } = Astro.props;
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions _global/content/profiles/org/sigpwny/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ links:
- {name: "website", url: "https://sigpwny.com/"}
- {name: "github", url: "https://github.com/sigpwny"}
- {name: "twitter", url: "https://twitter.com/sigpwny"}
card_image:
foreground: ./pwny8-banner-transparent.svg
---
17 changes: 17 additions & 0 deletions _global/content/profiles/org/sigpwny/pwny8-banner-transparent.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions _global/content/profiles/org/wicys/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ links:
- {name: "website", url: "https://wicys.github.io/"}
- {name: "instagram", url: "https://www.instagram.com/wicys.illinois/"}
- {name: "github", url: "https://github.com/wicys"}
card_image:
foreground: ./wicys-illinois-single-color.svg
---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
15 changes: 12 additions & 3 deletions fallctf.com/src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<div>
footer
</div>
---
import Link from '$/components/Link.astro';
---
<footer>
<div class="flex flex-col items-center px-4 py-8">
<div class="flex flex-col items-center space-y-4">
<p class="text-sm text-center">
&copy; {new Date().getFullYear()} <Link href="https://sigpwny.com/">SIGPwny</Link>. ACM@UIUC is a 501(c)(3) non-profit organization.
</p>
</div>
</div>
</footer>
10 changes: 8 additions & 2 deletions fallctf.com/src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import { defineCollection } from 'astro:content';
import { glob } from 'astro/loaders';
import { EventSchema } from '$/schema';
import { EventSchema, ProfileSchema } from '$/schema';

const events = defineCollection({
type: 'content_layer',
loader: glob({ pattern: '**/*.mdx', base: '../_global/content/events' }),
schema: (props) => EventSchema(props),
});

export const collections = { events }
const profiles = defineCollection({
type: 'content_layer',
loader: glob({ pattern: '**/*.mdx', base: '../_global/content/profiles' }),
schema: (props) => ProfileSchema(props),
});

export const collections = { events, profiles };
10 changes: 7 additions & 3 deletions fallctf.com/src/layouts/Base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'katex/dist/katex.min.css';
import type { HeadProps } from '$/components/BaseHead.astro';
import BaseHead from '$/components/BaseHead.astro';
import Header from '@/components/Header.astro';
import Footer from '@/components/Footer.astro';
const props: Omit<HeadProps, "site_name"> = Astro.props;
---
Expand All @@ -15,8 +16,11 @@ const props: Omit<HeadProps, "site_name"> = Astro.props;
<head>
<BaseHead {...props} site_name="fallctf.com" />
</head>
<body class="flex flex-col min-h-screen bg-black text-white">
<Header />
<slot />
<body>
<div class="flex flex-col min-h-screen bg-black text-white">
<Header />
<slot />
</div>
<Footer />
</body>
</html>
139 changes: 89 additions & 50 deletions fallctf.com/src/pages/2024.astro
Original file line number Diff line number Diff line change
@@ -1,64 +1,68 @@
---
import Layout from '@/layouts/Event.astro';
import Link from '$/components/Link.astro';
import Card from '$/components/Card.astro';
import Avatar from '$/components/Profile/Avatar.astro';
import FallCTFLogo from '@/components/FallCTFLogo';
import { getProfilesFromNames } from '$/utils/profiles';
import { getFallCTFEvents } from '@/utils/fallctf-events';
import svg_sigpwny from '$/content/profiles/org/sigpwny/pwny8-banner-transparent.svg?raw';
import svg_wicys from '$/content/profiles/org/wicys/wicys-illinois-single-color.svg?raw';
const events = (await getFallCTFEvents()).filter((event) => event.data.year === '2024');
if (events.length === 0) {
return Astro.error(404, 'Event not found');
}
const event = events[0].data;
const event = {
...events[0].data,
// Add sponsor_profiles, which is a list of resolved profiles from names in sponsors
sponsors_profiles: events[0].data.sponsors ? (await getProfilesFromNames(events[0].data.sponsors)) : undefined,
};
---
<style>
details {
@apply relative border-b border-surface-250;
}
details:last-child {
@apply border-none;
}
details summary {
@apply pl-8 pr-4 py-2 list-none cursor-pointer bg-surface-100 hover:bg-surface-150 overflow-hidden;
}
details div {
@apply pl-8 pr-4 pt-1 pb-4 bg-surface-100;
}
details:first-child summary {
@apply rounded-t-xl;
}
details:last-child:not([open]) summary {
@apply rounded-b-xl;
}
details:last-child[open] div {
@apply rounded-b-xl;
}
summary:focus {
@apply outline-none;
}
summary:focus-visible {
@apply ring-2 ring-inset ring-white;
}

summary:before {
content: '';
border-width: .4rem;
border-style: solid;
border-color: transparent transparent transparent #fff;
position: absolute;
top: 1rem;
left: 1rem;
transform: rotate(0);
transform-origin: .2rem 50%;
transition: 0.2s transform ease;
}

details[open] > summary:before {
transform: rotate(90deg);
}

details summary::-webkit-details-marker {
display: none;
}
details {
@apply relative border-b border-surface-250;
}
details:last-child {
@apply border-none;
}
details summary {
@apply pl-8 pr-4 py-2 list-none cursor-pointer bg-surface-100 hover:bg-surface-150 overflow-hidden;
}
details div {
@apply pl-8 pr-4 pt-1 pb-4 bg-surface-100;
}
details:first-child summary {
@apply rounded-t-xl;
}
details:last-child:not([open]) summary {
@apply rounded-b-xl;
}
details:last-child[open] div {
@apply rounded-b-xl;
}
summary:focus {
@apply outline-none;
}
summary:focus-visible {
@apply ring-2 ring-inset ring-white;
}
summary:before {
content: '';
border-width: .4rem;
border-style: solid;
border-color: transparent transparent transparent #fff;
position: absolute;
top: 1rem;
left: 1rem;
transform: rotate(0);
transform-origin: .2rem 50%;
transition: 0.2s transform ease;
}
details[open] > summary:before {
transform: rotate(90deg);
}
</style>

<Layout
Expand Down Expand Up @@ -87,8 +91,32 @@ details summary::-webkit-details-marker {
<div
slot="body"
transition:name="body"
class="container"
>
<div class="container max-w-prose mx-auto">
<div class="pb-16">
<h2>Sponsored By</h2>
<div class="grid gap-4 grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5">
{event.sponsors_profiles!.map((sponsor) => (
<div class="flex grow">
<Card card_image={sponsor.card_image}>
{/* If the sponsor does not have any displayable card_image, use profile picture and name instead */}
<span
slot={!sponsor.card_image?.foreground && !sponsor.card_image?.background ? "image" : undefined}
class="absolute h-full w-full flex flex-col items-center justify-center p-[5%] font-bold text-lg md:text-2xl text-center"
>
{sponsor.profile_image ? (
<span class="w-auto h-1/2 aspect-square">
<Avatar profile={sponsor} />
</span>
) : null}
<span>{sponsor.name}</span>
</span>
</Card>
</div>
))}
</div>
</div>
<div class="max-w-prose mx-auto">
<h2>Frequently Asked Questions</h2>
<div class="flex flex-col md-root rounded-xl">
<details>
Expand Down Expand Up @@ -125,6 +153,17 @@ details summary::-webkit-details-marker {
<span>Some of our sponsors will be attending in-person and will be available to talk to during the event.</span>
</div>
</details>
<details>
<summary>I'm not from UIUC. Can I play Fall CTF?</summary>
<div>Currently, Fall CTF registration is limited to UIUC students. If you are not from UIUC and wish to participate, please email <a href="mailto:[email protected]">[email protected]</a> for a manual review.</div>
</details>
</div>
</div>
<div class="my-20 font-bold text-center container max-w-prose">
<p class="mb-8">Organized By</p>
<div class="flex flex-col md:flex-row max-w-64 md:max-w-none gap-8 md:gap-16 mx-auto items-center pointer-events-none select-none text-white">
<Fragment set:html={svg_sigpwny} />
<Fragment set:html={svg_wicys} />
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions sigpwny.com/src/components/CalendarSubscribe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import {
AppleSvg,
GoogleCalendarSvg,
MicrosoftOutlookSvg
} from '@/components/Icons';
} from '$/components/Icons';
import {
CalendarRegular,
CalendarSyncRegular,
CheckmarkCircleFilled,
LinkRegular
} from '@/components/Icons/fluentui';
} from '$/components/Icons/fluentui';


export default function CalendarSubscribe(props: any) {
Expand Down
2 changes: 1 addition & 1 deletion sigpwny.com/src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import consts from '@/consts';
import Link from '$/components/Link.astro';
import { PwnyBanner, SocialIcon } from '@/components/Icons';
import { PwnyBanner, SocialIcon } from '$/components/Icons';
---

<footer>
Expand Down
6 changes: 3 additions & 3 deletions sigpwny.com/src/components/Meeting/Row.astro
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
import Link from '$/components/Link.astro';
import PersonaGroup from '@/components/Profile/PersonaGroup.astro';
import PersonaGroup from '$/components/Profile/PersonaGroup.astro';
import { getCollection, getEntries } from 'astro:content';
import { PdfSvg, YouTubeSvg } from '@/components/Icons';
import { PdfSvg, YouTubeSvg } from '$/components/Icons';
import { CountdownBadge } from '@/components/ReactMigration/Countdown';
import { TagGroup } from '@/components/ReactMigration/Tag';
import { convertDate, weekNumber } from '@/utils/meetings';
import { getProfilesFromNames } from '@/utils/profiles';
import { getProfilesFromNames } from '$/utils/profiles';
import dayjs from 'dayjs';
import duration from 'dayjs/plugin/duration';
Expand Down
2 changes: 1 addition & 1 deletion sigpwny.com/src/components/Nav/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { motion } from 'framer-motion';
import { PwnySvg } from '@/components/Icons';
import { PwnySvg } from '$/components/Icons';
import consts from '@/consts';
import './styles.css';

Expand Down
2 changes: 1 addition & 1 deletion sigpwny.com/src/components/Sidebar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChevronRightRegular } from '@/components/Icons/fluentui';
import { ChevronRightRegular } from '$/components/Icons/fluentui';
import './styles.css';


Expand Down
2 changes: 1 addition & 1 deletion sigpwny.com/src/pages/about.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import Layout from '@/layouts/Base.astro';
import { getCollection } from 'astro:content';
import ProfileCard from '@/components/Profile/ProfileCard.astro';
import ProfileCard from '$/components/Profile/ProfileCard.astro';
async function filterByRole(role: string) {
Expand Down
Loading

0 comments on commit bfeb8ab

Please sign in to comment.