Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6: Fix hero component and create new pages #929

Merged
merged 4 commits into from
Oct 11, 2023
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
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions src/routes/(site)/6/+layout.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<script lang="ts">
import { preloadData } from '$app/navigation';
import { onMount } from 'svelte';
import Navbar from '$lib/components/nav/bar.svelte';
import Footer from '$lib/components/footer/footer.svelte';
import AcmToaster from '$lib/components/toaster/toaster.svelte';
import { AcmTheme, theme } from '$lib/public/legacy/theme';

function changeTheme(event: MediaQueryListEvent) {
theme.set(event.matches ? AcmTheme.Dark : AcmTheme.Light);
}

onMount(() => {
theme.init();

if ('matchMedia' in window) {
const mediaList = matchMedia('(prefers-color-scheme: dark)');
mediaList.addEventListener('change', changeTheme);
return () => mediaList.removeEventListener('change', changeTheme);
}

// preloadData improves the load time of the events page, see #772
// https://kit.svelte.dev/docs/modules#$app-navigation-preloaddata
preloadData('/events');
});
</script>

<Navbar />
<main><slot /></main>
<Footer />
<AcmToaster />

<svelte:head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</svelte:head>

<style>
main {
min-height: 100vh;
}
</style>
39 changes: 39 additions & 0 deletions src/routes/(site)/6/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<script>
import Spacing from '$lib/public/legacy/spacing.svelte';
import Hero from './hero.svelte';
import Desc from './desc.svelte';
import Teams from './teams.svelte';
import Testimony from './testimony.svelte';
import Lucky from './lucky.svelte';
import Blog from './blog.svelte';
</script>

<svelte:head>
<title>ACM at CSUF</title>
</svelte:head>

<Spacing --min="175px" --med="200px" --max="200px" />

<Hero />

<Spacing --min="120px" --med="175px" --max="200px" />

<Desc />

<Spacing --min="120px" --med="175px" --max="200px" />

<Teams />

<Spacing --min="120px" --med="175px" --max="200px" />

<Testimony />

<Spacing --min="120px" --med="175px" --max="200px" />

<Lucky />

<Spacing --min="120px" --med="175px" --max="200px" />

<Blog />

<Spacing --min="75px" --med="100px" --max="120px" />
Empty file added src/routes/(site)/6/blog.svelte
Empty file.
Empty file added src/routes/(site)/6/desc.svelte
Empty file.
94 changes: 94 additions & 0 deletions src/routes/(site)/6/hero.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<script lang="ts">
import AcmButton from '$lib/components/button/button.svelte';
</script>

<section class="hero-container">
<div class="hero-inner-container">
<div class="hero-text">
<h1 class="brand-header size-xl">
<span>We are the largest</span> <span class="multicolor-text">Computer Science</span>
<span>community at CSUF</span>
</h1>
<div class="join-button">
<AcmButton text="Join today!" link="/discord" redirect={true} />
</div>
</div>

<img
src="/assets/png/capy-power.png"
alt="Chip the Capybara surrounded by all ACM Team badges"
/>
</div>
</section>

<style>
section {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move <img> above text container in mobile view

display: grid;
}

section .hero-inner-container {
display: grid;
grid-template-columns: 1fr;
align-items: center;
gap: 1em;
}

section .hero-inner-container .hero-text {
display: grid;
align-items: center;
text-align: center;
gap: 1em;
}

section .hero-inner-container .hero-text span.multicolor-text {
background: linear-gradient(
to right,
var(--acm-turquoise),
var(--acm-blue),
var(--acm-bluer),
var(--acm-purple),
var(--acm-pink)
);
-webkit-background-clip: text;
color: transparent;
}

section .hero-inner-container .hero-text span {
display: block;
}

section .hero-inner-container .hero-text .join-button {
display: grid;
justify-self: center;
}

section .hero-inner-container img {
max-width: clamp(20rem, 17.342rem + 10.13vw, 30rem);
justify-self: center;
}

@media screen and (min-width: 768px) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace @media queries with container queries

section {
display: grid;
place-items: center;
align-items: center;
max-width: 1280px;
margin: 0 auto;
}

section .hero-inner-container {
display: grid;
grid-template-columns: 1fr 1fr;
align-items: center;
gap: 4em;
}

section .hero-inner-container .hero-text {
text-align: start;
}

section .hero-inner-container .hero-text .join-button {
justify-self: start;
}
}
</style>
Empty file.
Empty file.
Empty file.
Binary file added static/assets/png/capy-power.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading