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
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@ The SFU Computing Science Student Society website is a statically generated Astr

- Node 26
- npm
- Git LFS

## Git LFS

This repository stores PNG and JPEG assets with [Git LFS](https://git-lfs.com/). Install Git LFS
before cloning the repository, then enable it for your user account:

```sh
git lfs install
```

Git downloads LFS-managed assets automatically during a new clone. If you cloned the repository
before installing Git LFS, download them explicitly:

```sh
git lfs pull
```

Add and commit images through the normal Git workflow; the existing `.gitattributes` file handles
PNG and JPEG files automatically. To confirm which files are managed by Git LFS, run:

```sh
git lfs ls-files
```

## Development

Expand Down Expand Up @@ -51,4 +75,3 @@ Page content goes here.

Adjust the relative layout path for nested pages. Ordinary `.astro` pages can import and render
the same `SiteLayout.astro` component with `title` and optional `description` props.

24 changes: 6 additions & 18 deletions src/components/Hero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { Image } from 'astro:assets';
<Image
class="hero__circle hero__circle--red"
src={redCircle}
loading="eager"
alt=""
data-motion-depth="0.35"
width={322}
priority
/>
<Image
class="hero__circle hero__circle--blue"
Expand All @@ -26,6 +26,7 @@ import { Image } from 'astro:assets';
alt=""
width={179}
data-motion-depth="1"
priority
/>
</div>
<div class="hero__circle-group hero__circle-group--pink-teal">
Expand All @@ -36,6 +37,7 @@ import { Image } from 'astro:assets';
alt=""
data-motion-depth="0.35"
width={254}
priority
/>
<Image
class="hero__circle hero__circle--pink"
Expand All @@ -44,6 +46,7 @@ import { Image } from 'astro:assets';
alt=""
data-motion-depth="1"
width={137}
priority
/>
</div>
</div>
Expand All @@ -55,6 +58,7 @@ import { Image } from 'astro:assets';
loading="eager"
alt="CSSS black logo"
data-motion-depth="0.35"
priority
/>
<h1 data-motion-depth="0.35">SFU Computing Science Student Society</h1>
</div>
Expand All @@ -67,12 +71,7 @@ import { Image } from 'astro:assets';
// Maximum number of pixels any layer can move from its resting position on either axis.
const HERO_MOTION_BOUNDARY = 96;

let cleanupHeroMotion: (() => void) | undefined;

function initializeHeroMotion() {
cleanupHeroMotion?.();
cleanupHeroMotion = undefined;

const hero = document.querySelector<HTMLElement>('#hero');
const motionArea = hero?.querySelector<HTMLElement>('.hero__border');

Expand Down Expand Up @@ -120,20 +119,9 @@ import { Image } from 'astro:assets';

motionArea.addEventListener('pointermove', handlePointerMove);
motionArea.addEventListener('pointerleave', resetLayers);

cleanupHeroMotion = () => {
motionArea.removeEventListener('pointermove', handlePointerMove);
motionArea.removeEventListener('pointerleave', resetLayers);
movers.forEach(({ moveX, moveY }) => {
moveX.tween.kill();
moveY.tween.kill();
});
gsap.set(layers, { clearProps: 'transform' });
};
}

document.addEventListener('astro:before-swap', () => cleanupHeroMotion?.());
document.addEventListener('astro:page-load', initializeHeroMotion);
initializeHeroMotion();
</script>

<style>
Expand Down
15 changes: 3 additions & 12 deletions src/components/Navbar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface Props {
const { title, items = [] } = Astro.props;
---

<header class="navbar" transition:persist="site-navbar">
<header class="navbar">
<div class="navbar__content">
<div class="navbar__left">
<a class="navbar__title chip" href="/">{title}</a>
Expand Down Expand Up @@ -128,22 +128,12 @@ const { title, items = [] } = Astro.props;
toggleButton?.setAttribute('aria-expanded', 'false');
}

let isNavigating = false;

const updateScrolledState = () => {
if (!isNavigating) {
navbarElement.classList.toggle('navbar--scrolled', window.scrollY > 24);
}
navbarElement.classList.toggle('navbar--scrolled', window.scrollY > 24);
};

updateScrolledState();
window.addEventListener('scroll', updateScrolledState, { passive: true });
document.addEventListener('astro:before-preparation', () => {
isNavigating = true;
});
document.addEventListener('astro:page-load', () => {
isNavigating = false;
});

if (toggleButton) {
toggleButton.addEventListener('click', () => {
Expand Down Expand Up @@ -227,6 +217,7 @@ const { title, items = [] } = Astro.props;
top: 0;
left: 0;
right: 0;
view-transition-name: site-navbar;
z-index: var(--navbar-z-index);
width: 100vw;
background-color: var(--navbar-clr-bg);
Expand Down
2 changes: 1 addition & 1 deletion src/components/cards/CardGallery.astro
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const gridWidthVariables = `--min-width: ${minWidth}px; --max-width: ${maxWidth}
items.map((item, i) => {
return item.href ? (
<li>
<a href={item.href}>
<a href={item.href} aria-label={item.label}>
<LabelCard class="card image-reveal" label={item.label} colour={getAccentColour(i)}>
<Image
class="card__img"
Expand Down
39 changes: 21 additions & 18 deletions src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import '../styles/fonts.css';
import '../styles/theme.css';

import type { ImageMetadata } from 'astro';
import { ClientRouter } from 'astro:transitions';
import { Font } from 'astro:assets';

import Seo from '@components/Seo.astro';
Expand Down Expand Up @@ -34,7 +33,6 @@ const { pageTitle, description, image, noindex = false } = Astro.props;
<Font cssVariable="--font-body" />
<Seo title={pageTitle} description={description} image={image} noindex={noindex} />
<slot name="head" />
<ClientRouter fallback="swap" />
</head>
<body>
<slot />
Expand All @@ -44,19 +42,12 @@ const { pageTitle, description, image, noindex = false } = Astro.props;

gsap.registerPlugin(ScrollTrigger);

let revealContext: ReturnType<typeof gsap.context> | undefined;
let revealGeneration = 0;

function initializeScrollReveals() {
const generation = ++revealGeneration;
revealContext?.revert();

if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
revealContext = undefined;
return;
}

revealContext = gsap.context(context => {
gsap.context(context => {
const elements = gsap.utils.toArray<HTMLElement>('.image-reveal');
if (elements.length === 0) return;
const imageReady = new WeakMap<Element, Promise<void>>();
Expand All @@ -82,8 +73,6 @@ const { pageTitle, description, image, noindex = false } = Astro.props;

await Promise.all(batch.map(element => imageReady.get(element)));

if (generation !== revealGeneration) return;

const connectedBatch = batch.filter(element => element.isConnected);
if (connectedBatch.length === 0) return;

Expand All @@ -105,12 +94,26 @@ const { pageTitle, description, image, noindex = false } = Astro.props;
ScrollTrigger.refresh();
}

document.addEventListener('astro:before-swap', () => {
revealGeneration += 1;
revealContext?.revert();
revealContext = undefined;
});
document.addEventListener('astro:page-load', initializeScrollReveals);
initializeScrollReveals();
</script>
</body>
</html>

<style is:global>
@view-transition {
navigation: auto;
}

::view-transition-old(site-navbar),
::view-transition-new(site-navbar) {
animation: none;
mix-blend-mode: normal;
}

@media (prefers-reduced-motion: reduce) {
::view-transition-old(root),
::view-transition-new(root) {
animation-duration: 0.01ms;
}
}
</style>
2 changes: 2 additions & 0 deletions src/pages/affiliates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import Clubs from '@components/affiliates/Clubs.astro';
Being a Computing Science major means you'll be mingling with other clubs and unions, so make sure to check them out too!

## Student Societies

<StudentSocieties />

## Clubs

<Clubs />
4 changes: 4 additions & 0 deletions src/pages/common-room.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ banner: /src/assets/images/common-room/banner.png
Located on Burnaby campus at **Applied Sciences Building (ASB) 9971**, the Common Room is the hub for all CSSS members. We strive to make the room an inclusive space and offer a bunch of services to support our members.

## Relax

The Common Room is where you can come hang out with people who are in the same journey as you. Come socialize, ask for help or talk about another JavaScript framework. The Common Room is the place to make friends and meet your future co-workers.

## Refresh

Tucked away in the side room is a kitchenette that has a fridge, freezer, sink, kettle, microwave and utensils. We also offer hot chocolate, tea, and coffee; free of charge to our members! If you need an extra boost **we also have the cheapest vending machines on campus**.

## Review

The Common Room is not just a place to recharge (but we do have a bunch of outlets for you to use if you need it), it's also a great place to study as a group.
There are several tables, couches, chairs, and whiteboards to help you do all the homework that comes with the CS program.
We also have the Exam Bank, a repository of past exams. Just ask an Executive and they'll be happy to assist.

## Part of WiCS?

You can access the WiCS lounge from the Common Room.
8 changes: 8 additions & 0 deletions src/pages/events/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,48 @@ We send out reminders through email and on our <a href={socialLinks.discord} tar
## Regular Events

### General Meetings

The CSSS holds general meetings every two weeks to keep their members informed about what's going on and what's coming up.
These meetings are a great way to stay up to date on any changes that may affect you.
They are also your chance to learn more about what the Executive team does, how you can get involved and make sure your voice is heard.

### Events Committee

The CSSS holds event committee meetings every two weeks to plan and discuss events.
If you're interested in the logistics of how events are done or want to be a part of the committee this is a great place to do it.

### Board Game Nights

If meetings aren't exciting enough for you, join us for boardgame nights!
Every other Friday we book **TASC 9204** , pull out a few board games and give out **FREE FOOD**.
If you're down for some Friday night fun, then pull up, sit down, and, maybe, just maybe, the Executives will serenade you with karaoke.

## Yearly Events

### Frosh Week

Frosh Week runs during the first week of September and is our way of welcoming the new members of our program.
If you just became a Computing Science student then don't miss this event.
You'll learn a lot about our program, meet the people who are about to embark on the same journey as you, and get rammed.

### Tech Fair

Tech Fair is our way of bringing the tech scene of the Greater Vancouver area to you.
Did you know that there are other companies in Vancouver beyond Amazon, Microsoft, SAP and EA?
This is a great opportunity for you to mingle with your future co-workers and learn why Vancouver is considered the Silicon Valley of the North.

### Fall Hacks

Fall Hacks is our Fall term Hackathon which pits teams against each other for a 12 hour sprint.
If you're looking to get a taste of what software development is like then sign up, no experience necessary!

### Mountain Madness

Mountain Madness is our Spring term Hackathon which pits teams against each other for a 24 hour marathon.
If you liked Fall Hacks then you're statistically going to like Mountain Madness twice as much.

### Silicon Valley Trip

Join us on our pilgrimage to Silicon Valley, the birthplace of technology.
Every year, a group of us head down to California to see the sights and visit a bunch of tech companies.
This is definitely an educational trip and not just a way to collect stickers for your laptop.
3 changes: 2 additions & 1 deletion src/pages/officers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ description: CSSS officers page.
banner: /src/assets/images/officers/banner.png
---

import CurrentExecutives from '@components/officers/CurrentExecutives.astro'
import CurrentExecutives from '@components/officers/CurrentExecutives.astro';

The CSSS has multiple roles, with the Executives leading us.
The Executives at the CSSS are here to represent the Computing Science program at SFU.
They plan events, create an inclusive community, and provide resources to the students they represent.

## Executives

<CurrentExecutives />
8 changes: 8 additions & 0 deletions src/styles/reset.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* reset: removes unwanted browser defaults
* base: structural component styling
* theme: everything related to the CSSS branding
* components: styles that affect package components
*/
@layer reset, base, theme;

@layer reset {
*,
*::before,
Expand Down
8 changes: 0 additions & 8 deletions src/styles/theme.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
/**
* reset: removes unwanted browser defaults
* base: structural component styling
* theme: everything related to the CSSS branding
* components: styles that affect package components
*/
@layer reset, base, theme;

@layer base {
:root {
/* Spacing tokens */
Expand Down
25 changes: 6 additions & 19 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,17 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@assets": [
"src/assets"
],
"@assets/*": [
"src/assets/*"
],
"@components": [
"src/components"
],
"@components/*": [
"src/components/*"
]
"@assets": ["src/assets"],
"@assets/*": ["src/assets/*"],
"@components": ["src/components"],
"@components/*": ["src/components/*"]
},
"plugins": [
{
"name": "@astrojs/ts-plugin"
}
]
},
"include": [
".astro/types.d.ts",
"**/*"
],
"exclude": [
"dist"
]
"include": [".astro/types.d.ts", "**/*"],
"exclude": ["dist"]
}