format using prettier

This commit is contained in:
Minh Vo
2025-12-30 10:27:10 -05:00
parent ce494e182a
commit b92ab62f1d
7 changed files with 144 additions and 137 deletions

View File

@@ -211,7 +211,7 @@ h2 {
}
*::-webkit-scrollbar-track {
@apply rounded bg-ecsess-700;
@apply bg-ecsess-700 rounded;
}
*::-webkit-scrollbar-track:hover {
@@ -223,7 +223,7 @@ h2 {
}
*::-webkit-scrollbar-thumb {
@apply rounded-md bg-ecsess-100;
@apply bg-ecsess-100 rounded-md;
}
*::-webkit-scrollbar-thumb:hover {

View File

@@ -1,5 +1,12 @@
<script lang="ts">
import { CalendarDays, MapPin, Link as LinkIcon, FilePen, CalendarPlus, ExternalLink as ExternalLinkIcon } from '@lucide/svelte';
import {
CalendarDays,
MapPin,
Link as LinkIcon,
FilePen,
CalendarPlus,
ExternalLink as ExternalLinkIcon
} from '@lucide/svelte';
import RichText from 'components/RichText.svelte';
let {
@@ -12,7 +19,7 @@
paymentLink, //[LinkType]
generalLink, //[LinkType]
eventCategory,
isPastEvent = false,
isPastEvent = false
} = $props();
let showDescription = $state(false);
@@ -54,10 +61,8 @@
const flipCard = (e: MouseEvent) => {
showDescription = !showDescription;
};
</script>
<div
class="
flip-box
@@ -67,7 +72,11 @@
<div class="flip-box-inner rounded-2xl" class:show-back={showDescription}>
<!--Front Side-->
<!--Opacity thing is to fix the visual bug on ios-->
<div class="flex flex-col flip-box-front bg-ecsess-950 shadow-xl shadow-ecsess-950/60 rounded-2xl transition-opacity duration-500 {showDescription ? 'opacity-0 pointer-events-none' : 'opacity-100'}">
<div
class="flip-box-front bg-ecsess-950 shadow-ecsess-950/60 flex flex-col rounded-2xl shadow-xl transition-opacity duration-500 {showDescription
? 'pointer-events-none opacity-0'
: 'opacity-100'}"
>
<!--Flip button-->
<div
class="
@@ -77,23 +86,11 @@
<!-- Image Container with Gradient Overlay -->
<div class="relative h-80 overflow-hidden rounded-2xl">
{#if thumbnail}
<img
class="h-full w-full object-cover "
src={thumbnail}
alt={eventTitle}
/>
<img class="h-full w-full object-cover" src={thumbnail} alt={eventTitle} />
{:else if eventCategory?.[0] === 'social'}
<img
class="h-full w-full object-cover "
src="/Social.jpg"
alt="Social Event"
/>
<img class="h-full w-full object-cover" src="/Social.jpg" alt="Social Event" />
{:else if eventCategory?.[0] === 'technical'}
<img
class="h-full w-full object-cover "
src="/Technical.jpg"
alt="Technical Event"
/>
<img class="h-full w-full object-cover" src="/Technical.jpg" alt="Technical Event" />
{:else if eventCategory?.[0] === 'professional'}
<img
class="h-full w-full object-cover"
@@ -101,22 +98,14 @@
alt="Professional Event"
/>
{:else if eventCategory?.[0] === 'academic'}
<img
class="h-full w-full object-cover "
src="/Academic.jpg"
alt="Academic Event"
/>
<img class="h-full w-full object-cover" src="/Academic.jpg" alt="Academic Event" />
{:else}
<img
class="h-full w-full object-cover "
src="/ECSESS.png"
alt="ECSESS Event"
/>
<img class="h-full w-full object-cover" src="/ECSESS.png" alt="ECSESS Event" />
{/if}
<!-- Gradient overlay -->
<div
class="absolute inset-0 rounded-2xl bg-gradient-to-b from-transparent via-ecsess-800/30 to-ecsess-950"
class="via-ecsess-800/30 to-ecsess-950 absolute inset-0 rounded-2xl bg-gradient-to-b from-transparent"
></div>
<!-- Event Title Overlay -->
<div class="absolute right-0 bottom-0 left-0 p-6">
@@ -154,9 +143,8 @@
{/if}
</div>
<!-- Info Grid -->
<div class="bg-ecsess-900/40 space-y-3 rounded-xl p-4 m-5">
<div class="bg-ecsess-900/40 m-5 space-y-3 rounded-xl p-4">
<div class="flex items-center gap-3">
<div
class="bg-ecsess-400 flex h-10 w-10 items-center justify-center rounded-full shadow-md"
@@ -181,25 +169,24 @@
</div>
</div>
</div>
<div class="relative p-4 px-6 z-100 flex-1">
<div class="relative z-100 flex-1 p-4 px-6">
<!-- Action Buttons -->
{#if !isPastEvent}
<div class="space-y-2">
<!-- Registration & Payment Row & Add to Calendar Button -->
<div class="grid sm:grid-cols-3 grid-cols-2 gap-3 md:gap-2">
<div class="grid grid-cols-2 gap-3 sm:grid-cols-3 md:gap-2">
{#if registrationLink}
<a
href={registrationLink[0].url}
target="_blank"
rel="noopener noreferrer"
class="bg-ecsess-500 hover:bg-ecsess-600 flex flex-1 items-center justify-center gap-2 rounded-xl px-4 p3 text-sm font-bold text-white
shadow-md shadow-ecsess-300 transition-all hover:shadow-lg hover:-translate-y-1
class="bg-ecsess-500 hover:bg-ecsess-600 p3 shadow-ecsess-300 flex flex-1 items-center justify-center gap-2 rounded-xl px-4 text-sm font-bold
text-white shadow-md transition-all hover:-translate-y-1 hover:shadow-lg
"
>
<FilePen class="h-4 w-4" strokeWidth={2.5} />
Register
</a>
{:else}
<div
class="bg-ecsess-500 flex items-center justify-center gap-2 rounded-xl px-4 py-3 text-sm font-bold text-white"
@@ -210,8 +197,8 @@
{/if}
<button
onclick={addToCalendar}
class="hover:cursor-pointer bg-ecsess-700 hover:bg-ecsess-800 flex w-full items-center justify-center gap-2 rounded-xl px-4 py-3 text-sm font-bold text-white
shadow-md shadow-ecsess-400 transition-all hover:shadow-lg hover:-translate-y-1 "
class="bg-ecsess-700 hover:bg-ecsess-800 shadow-ecsess-400 flex w-full items-center justify-center gap-2 rounded-xl px-4 py-3 text-sm font-bold text-white
shadow-md transition-all hover:-translate-y-1 hover:cursor-pointer hover:shadow-lg"
>
<CalendarPlus class="h-5 w-5" strokeWidth={2.5} />
Add to Calendar
@@ -221,20 +208,19 @@
href={paymentLink[0].url}
target="_blank"
rel="noopener noreferrer"
class="sm:col-span-1 col-span-2 bg-ecsess-800 hover:bg-ecsess-900 flex items-center justify-center gap-2 rounded-xl px-4 py-3 text-sm font-bold text-white
shadow-md shadow-ecsess-500 transition-all hover:shadow-lg hover:-translate-y-1 "
class="bg-ecsess-800 hover:bg-ecsess-900 shadow-ecsess-500 col-span-2 flex items-center justify-center gap-2 rounded-xl px-4 py-3 text-sm font-bold text-white
shadow-md transition-all hover:-translate-y-1 hover:shadow-lg sm:col-span-1"
>
<LinkIcon class="h-4 w-4" strokeWidth={2.5} />
Pay
</a>
{:else}
<div
class="sm:col-span-1 col-span-2 bg-ecsess-800 flex items-center justify-center gap-2 rounded-xl px-4 py-3 text-sm font-bold text-white "
class="bg-ecsess-800 col-span-2 flex items-center justify-center gap-2 rounded-xl px-4 py-3 text-sm font-bold text-white sm:col-span-1"
>
Free!
</div>
{/if}
</div>
</div>
{/if}
@@ -244,7 +230,9 @@
</div>
</div>
<!-- Back Side -->
<div class=" flex flex-col flip-box-back bg-ecsess-950 shadow-xl shadow-ecsess-950/60 rounded-2xl">
<div
class=" flip-box-back bg-ecsess-950 shadow-ecsess-950/60 flex flex-col rounded-2xl shadow-xl"
>
<!--Flip button-->
<div
class="
@@ -257,11 +245,11 @@
{eventTitle}
</h3>
</div>
<div class="relative h-56 md:h-64 xl:h-84 flex flex-col z-20 my-2"
onclick={flipCard}
>
<div class="relative z-20 my-2 flex h-56 flex-col md:h-64 xl:h-84" onclick={flipCard}>
<!-- Description -->
<div class="text-ecsess-100 p-6 flex flex-1 justify-center overflow-y-auto border-y border-ecsess-800">
<div
class="text-ecsess-100 border-ecsess-800 flex flex-1 justify-center overflow-y-auto border-y p-6"
>
{#if eventDescription}
<RichText value={eventDescription} />
{:else}
@@ -272,15 +260,17 @@
<!-- General Links -->
<!--add max-h-41 we decide to go back to scrollable-->
<div class="relative z-20 gap-4 flex flex-1 flex-wrap w-full items-center justify-center p-6 overflow-auto ">
<div
class="relative z-20 flex w-full flex-1 flex-wrap items-center justify-center gap-4 overflow-auto p-6"
>
{#if generalLink}
{#each generalLink as link}
<a
href={link.url}
target="_blank"
rel="noopener noreferrer"
class="bg-ecsess-600 hover:bg-ecsess-700 flex items-center justify-center gap-2 rounded-xl px-4 py-3 text-sm font-bold text-white
shadow-md shadow-ecsess-400 transition-all hover:shadow-lg hover:-translate-y-1"
class="bg-ecsess-600 hover:bg-ecsess-700 shadow-ecsess-400 flex items-center justify-center gap-2 rounded-xl px-4 py-3 text-sm font-bold
text-white shadow-md transition-all hover:-translate-y-1 hover:shadow-lg"
>
<ExternalLinkIcon class="h-4 w-4" strokeWidth={2.5} />
{link.title}
@@ -289,7 +279,6 @@
{/if}
</div>
</div>
</div>
</div>
@@ -302,18 +291,27 @@
}
.flip-box-inner {
@apply grid w-full h-full text-center duration-800 transform-3d;
@apply grid h-full w-full text-center duration-800 transform-3d;
}
@keyframes rotate-and-back {
0% { transform: rotateY(0); }
33% { transform: rotateY(5deg); }
66% { transform: rotateY(-5deg); }
100% { transform: rotateY(0); }
0% {
transform: rotateY(0);
}
33% {
transform: rotateY(5deg);
}
66% {
transform: rotateY(-5deg);
}
100% {
transform: rotateY(0);
}
}
/*Only work with normal css for now */
@media (min-width: 448px) { /* Apply hover effect only on screens wider than md*/
@media (min-width: 448px) {
/* Apply hover effect only on screens wider than md*/
.flip-box:hover .flip-box-front {
animation: rotate-and-back 0.3s ease-in-out;
}
@@ -321,10 +319,10 @@
.flip-box-front,
.flip-box-back {
@apply grid-1/1 h-full w-full backface-hidden rounded-2xl [-webkit-backface-visibility:hidden];
@apply grid-1/1 h-full w-full rounded-2xl [-webkit-backface-visibility:hidden] backface-hidden;
}
.flip-box-front {
@apply z-2 transform-rotate-y-0 transform-3d;
@apply transform-rotate-y-0 z-2 transform-3d;
}
.flip-box-back {

View File

@@ -62,14 +62,20 @@
const upcomingEvents = $derived(
filtered
.filter((e: { date: string; }) => !isPastEvent(e.date))
.sort((a: { date: string; }, b: { date: string; }) => parseEventDate(a.date).getTime() - parseEventDate(b.date).getTime())
.filter((e: { date: string }) => !isPastEvent(e.date))
.sort(
(a: { date: string }, b: { date: string }) =>
parseEventDate(a.date).getTime() - parseEventDate(b.date).getTime()
)
);
const finishedEvents = $derived(
filtered
.filter((e: { date: string; }) => isPastEvent(e.date))
.sort((a: { date: string; }, b: { date: string; }) => parseEventDate(b.date).getTime() - parseEventDate(a.date).getTime())
.filter((e: { date: string }) => isPastEvent(e.date))
.sort(
(a: { date: string }, b: { date: string }) =>
parseEventDate(b.date).getTime() - parseEventDate(a.date).getTime()
)
);
const getPaymentLink = (e: EventPost, type: EventLinkKind): LinkType[] | null => {
@@ -77,8 +83,7 @@
for (const link of e.links ?? []) {
if (type == EventLinkKind.GENERAL && link.kind === EventLinkKind.GENERAL && link.url !== '') {
generalLinks.push(link);
}
else if (link.kind === type && link.url !== '') {
} else if (link.kind === type && link.url !== '') {
return [link];
}
}

View File

@@ -1,13 +1,14 @@
<script>
let { value, selected, onclick, children } = $props();
</script>
<div>
<button
{value}
onclick={() => onclick(value)}
class="hover:border-b-ecsess-200 {selected ? 'border-b-ecsess-200' : 'border-b-transparent'} border-b-4 px-2 pb-2 text-lg transition-all ease-in-out"
class="hover:border-b-ecsess-200 {selected
? 'border-b-ecsess-200'
: 'border-b-transparent'} border-b-4 px-2 pb-2 text-lg transition-all ease-in-out"
>
{@render children()}
</button>

View File

@@ -1,6 +1,5 @@
import type { InputValue } from '@portabletext/svelte';
export type EventPost = {
id: string;
name: string;
@@ -19,7 +18,7 @@ export enum EventCategory {
PROFESSIONAL = 'professional',
SOCIAL = 'social',
TECHNICAL = 'technical'
};
}
export type LinkType = {
title: string;
@@ -30,7 +29,7 @@ export enum EventLinkKind {
PAYMENT = 'payment',
REGISTRATION = 'registration',
GENERAL = 'general'
};
}
export type FAQ = {
question: string;

View File

@@ -32,9 +32,13 @@
<p class="page-title">Events</p>
<div>
<ul class="flex justify-center flex-wrap gap-2">
<ul class="flex flex-wrap justify-center gap-2">
{#each categories as category}
<EventTabsTrigger value={category.value} selected={group=== category.value} onclick={handleTabChange}>{category.label}</EventTabsTrigger>
<EventTabsTrigger
value={category.value}
selected={group === category.value}
onclick={handleTabChange}>{category.label}</EventTabsTrigger
>
{/each}
</ul>