General fix the homepage and the sponsor block overflow on mobile
This commit is contained in:
@@ -1,11 +1,12 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
let { href, external = false, children } = $props();
|
let { href, external = false, children, class: className = '' } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
{href}
|
{href}
|
||||||
target={external ? '_blank' : undefined}
|
target={external ? '_blank' : undefined}
|
||||||
rel={external ? 'noopener noreferrer' : undefined}
|
rel={external ? 'noopener noreferrer' : undefined}
|
||||||
|
class={className}
|
||||||
>
|
>
|
||||||
{@render children()}
|
{@render children()}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -12,9 +12,14 @@
|
|||||||
<h2 id="sponsors-title" class="text-ecsess-100 mb-2 text-4xl font-bold md:text-5xl">
|
<h2 id="sponsors-title" class="text-ecsess-100 mb-2 text-4xl font-bold md:text-5xl">
|
||||||
Our Sponsors
|
Our Sponsors
|
||||||
</h2>
|
</h2>
|
||||||
<p class="text-ecsess-200 mx-auto max-w-2xl text-base">
|
<p class="text-ecsess-200/90 mx-auto max-w-2xl text-base leading-relaxed md:text-lg">
|
||||||
We're grateful to our sponsors for their continued support of ECSESS and our community.
|
We're grateful to our sponsors for their continued support of ECSESS, our events, activities,
|
||||||
|
and our community.
|
||||||
</p>
|
</p>
|
||||||
|
<div
|
||||||
|
class="via-ecsess-150/40 mx-auto mt-6 h-px w-32 bg-linear-to-r from-transparent to-transparent"
|
||||||
|
aria-hidden="true"
|
||||||
|
></div>
|
||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
<Link href="/sponsor">
|
<Link href="/sponsor">
|
||||||
<Button>Become a Sponsor</Button>
|
<Button>Become a Sponsor</Button>
|
||||||
@@ -22,26 +27,32 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Sponsors Flex -->
|
<!-- Sponsors -->
|
||||||
{#if sponsors && sponsors.length > 0}
|
{#if sponsors && sponsors.length > 0}
|
||||||
<div class="flex flex-wrap justify-center gap-6 lg:gap-8">
|
<div class="mx-auto max-w-6xl">
|
||||||
{#each sponsors as sponsor}
|
<div class="flex flex-wrap justify-center gap-4 sm:gap-6" aria-labelledby="sponsors-title">
|
||||||
<Link href={sponsor.url} external>
|
{#each sponsors as sponsor}
|
||||||
<div
|
<Link
|
||||||
class="bg-ecsess-950 border-ecsess-800 hover:border-ecsess-700 group flex h-32 w-sm items-center justify-center rounded-lg border p-4 transition-all hover:shadow-lg"
|
href={sponsor.url}
|
||||||
|
external
|
||||||
|
class="group flex w-full max-w-[342px] justify-center rounded-xl focus-visible:outline-none"
|
||||||
>
|
>
|
||||||
<img
|
<div
|
||||||
src={sponsor.logo}
|
class="border-ecsess-150/15 bg-ecsess-950 group-hover:border-ecsess-150/30 group-hover:bg-ecsess-900 flex h-28 w-full items-center justify-center overflow-hidden rounded-xl border p-6 shadow-md transition-colors duration-150"
|
||||||
alt="{sponsor.name} Logo"
|
>
|
||||||
class="max-h-20 w-40 object-contain opacity-90 transition-opacity group-hover:opacity-100"
|
<img
|
||||||
/>
|
src={sponsor.logo}
|
||||||
</div>
|
alt={sponsor.name}
|
||||||
</Link>
|
class="max-h-16 w-full object-contain opacity-90 transition-opacity duration-150 group-hover:opacity-100"
|
||||||
{/each}
|
/>
|
||||||
|
</div>
|
||||||
|
</Link>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="text-ecsess-300 py-12 text-center">
|
<div class="text-ecsess-300 py-12 text-center">
|
||||||
<p>No sponsors at this time.</p>
|
<p>You can be our next sponsor!</p>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
<script>
|
<script>
|
||||||
let { thumbnail = '' } = $props();
|
let { thumbnail } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<meta property="og:image" content={thumbnail} />
|
{#if thumbnail}
|
||||||
<meta property="twitter:image" content={thumbnail} />
|
<meta property="og:image" content={thumbnail} />
|
||||||
|
<meta property="twitter:image" content={thumbnail} />
|
||||||
|
{/if}
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="bg-ecsess-100 text-ecsess-900 hover:bg-ecsess-200 grid h-full place-content-center rounded-md border-transparent text-center shadow-md transition-all hover:shadow-lg"
|
class="bg-ecsess-100 text-ecsess-900 hover:bg-ecsess-200 grid h-full place-content-center rounded-md text-center shadow-md transition-all hover:shadow-lg"
|
||||||
>
|
>
|
||||||
<p class="text-base leading-tight font-semibold">
|
<p class="text-base leading-tight font-semibold">
|
||||||
{officeHour.member.name.split(' ')[0]}
|
{officeHour.member.name.split(' ')[0]}
|
||||||
|
|||||||
@@ -36,15 +36,6 @@ export type FAQ = {
|
|||||||
answer: string;
|
answer: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type HomepageCMSResponse = {
|
|
||||||
description: InputValue;
|
|
||||||
councilPhoto: string;
|
|
||||||
faqs: {
|
|
||||||
question: string;
|
|
||||||
answer: string;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export type OfficeHour = {
|
export type OfficeHour = {
|
||||||
day: string;
|
day: string;
|
||||||
startTime: string;
|
startTime: string;
|
||||||
|
|||||||
@@ -5,5 +5,10 @@ const thumbnailQuery = `*[_type == "homepage"]{
|
|||||||
}[0]`;
|
}[0]`;
|
||||||
|
|
||||||
export const load = async () => {
|
export const load = async () => {
|
||||||
return { thumbnail: (await getFromCMS(thumbnailQuery)).thumbnail };
|
try {
|
||||||
|
return { thumbnail: (await getFromCMS(thumbnailQuery)).thumbnail };
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to fetch homepage thumbnail from CMS:', err);
|
||||||
|
return { thumbnail: null };
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { getFromCMS } from '$lib/utils.js';
|
import { getFromCMS } from '$lib/utils.js';
|
||||||
import type { HomepageCMSResponse, OfficeHour, Sponsors } from '$lib/schemas';
|
import type { OfficeHour, Sponsors } from '$lib/schemas';
|
||||||
|
|
||||||
const homepageQuery = `{
|
const homepageQuery = `{
|
||||||
"homepage": *[_type == "homepage"]{
|
"homepage": *[_type == "homepage"]{
|
||||||
@@ -28,14 +28,12 @@ export const load = async ({ url }) => {
|
|||||||
* Note that `description` is a rich/portable text type
|
* Note that `description` is a rich/portable text type
|
||||||
*/
|
*/
|
||||||
let homePageResp = await getFromCMS(homepageQuery);
|
let homePageResp = await getFromCMS(homepageQuery);
|
||||||
let homepageResp: HomepageCMSResponse = homePageResp.homepage;
|
let councilPhotoUrl: string = homePageResp.homepage.councilPhoto;
|
||||||
let officeHourResp: OfficeHour[] = homePageResp.officeHours;
|
let officeHourResp: OfficeHour[] = homePageResp.officeHours;
|
||||||
let sponsorsResp: Sponsors[] = homePageResp.sponsors;
|
let sponsorsResp: Sponsors[] = homePageResp.sponsors;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
description: homepageResp.description,
|
councilPhoto: councilPhotoUrl,
|
||||||
councilPhoto: homepageResp.councilPhoto,
|
|
||||||
faqs: homepageResp.faqs,
|
|
||||||
allOHs: officeHourResp,
|
allOHs: officeHourResp,
|
||||||
sponsors: sponsorsResp,
|
sponsors: sponsorsResp,
|
||||||
canonical: url.href
|
canonical: url.href
|
||||||
|
|||||||
Reference in New Issue
Block a user