format using prettier
This commit is contained in:
14
src/app.css
14
src/app.css
@@ -207,29 +207,29 @@ h2 {
|
||||
|
||||
/* Scrollbar Styles */
|
||||
*::-webkit-scrollbar {
|
||||
@apply h-1 w-1;
|
||||
@apply h-1 w-1;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-track {
|
||||
@apply rounded bg-ecsess-700;
|
||||
@apply bg-ecsess-700 rounded;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-track:hover {
|
||||
@apply bg-ecsess-900;
|
||||
@apply bg-ecsess-900;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-track:active {
|
||||
@apply bg-ecsess-900;
|
||||
@apply bg-ecsess-900;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-thumb {
|
||||
@apply rounded-md bg-ecsess-100;
|
||||
@apply bg-ecsess-100 rounded-md;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-thumb:hover {
|
||||
@apply bg-ecsess-300;
|
||||
@apply bg-ecsess-300;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-thumb:active {
|
||||
@apply bg-ecsess-300;
|
||||
@apply bg-ecsess-300;
|
||||
}
|
||||
|
||||
@@ -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,20 +61,22 @@
|
||||
const flipCard = (e: MouseEvent) => {
|
||||
showDescription = !showDescription;
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<div
|
||||
class="
|
||||
flip-box
|
||||
group relative flex flex-col rounded-2xl"
|
||||
>
|
||||
>
|
||||
<!--Flip Card container-->
|
||||
<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="
|
||||
@@ -75,55 +84,35 @@
|
||||
onclick={flipCard}
|
||||
></div>
|
||||
<!-- 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}
|
||||
/>
|
||||
{:else if eventCategory?.[0] === 'social'}
|
||||
<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"
|
||||
/>
|
||||
{:else if eventCategory?.[0] === 'professional'}
|
||||
<img
|
||||
class="h-full w-full object-cover "
|
||||
src="/Professional.jpg"
|
||||
alt="Professional Event"
|
||||
/>
|
||||
{:else if eventCategory?.[0] === 'academic'}
|
||||
<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"
|
||||
/>
|
||||
{/if}
|
||||
<div class="relative h-80 overflow-hidden rounded-2xl">
|
||||
{#if thumbnail}
|
||||
<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" />
|
||||
{:else if eventCategory?.[0] === 'technical'}
|
||||
<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"
|
||||
src="/Professional.jpg"
|
||||
alt="Professional Event"
|
||||
/>
|
||||
{:else if eventCategory?.[0] === 'academic'}
|
||||
<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" />
|
||||
{/if}
|
||||
|
||||
<!-- Gradient overlay -->
|
||||
<div
|
||||
class="absolute inset-0 rounded-2xl bg-gradient-to-b from-transparent via-ecsess-800/30 to-ecsess-950"
|
||||
></div>
|
||||
<!-- Event Title Overlay -->
|
||||
<div class="absolute right-0 bottom-0 left-0 p-6">
|
||||
<h3 class="text-2xl leading-tight font-bold text-white drop-shadow-2xl">
|
||||
{eventTitle}
|
||||
</h3>
|
||||
</div>
|
||||
<!-- Gradient overlay -->
|
||||
<div
|
||||
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">
|
||||
<h3 class="text-2xl leading-tight font-bold text-white drop-shadow-2xl">
|
||||
{eventTitle}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Badges -->
|
||||
<div class="absolute top-0 right-0 left-0 flex items-start justify-between gap-2 p-4">
|
||||
@@ -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,37 +169,36 @@
|
||||
</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
|
||||
<a
|
||||
href={registrationLink[0].url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
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>
|
||||
|
||||
>
|
||||
<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 "
|
||||
class="bg-ecsess-500 flex items-center justify-center gap-2 rounded-xl px-4 py-3 text-sm font-bold text-white"
|
||||
>
|
||||
<FilePen class="h-4 w-4" strokeWidth={2.5} />
|
||||
Drop In
|
||||
</div>
|
||||
</div>
|
||||
{/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}
|
||||
@@ -242,9 +228,11 @@
|
||||
<div class="p-4 lg:hidden">
|
||||
<p>Click to view more</p>
|
||||
</div>
|
||||
</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 {
|
||||
@@ -334,4 +332,4 @@
|
||||
.show-back {
|
||||
@apply rotate-y-180;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -62,26 +62,31 @@
|
||||
|
||||
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 => {
|
||||
const getPaymentLink = (e: EventPost, type: EventLinkKind): LinkType[] | null => {
|
||||
let generalLinks: LinkType[] = [];
|
||||
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];
|
||||
}
|
||||
}
|
||||
}
|
||||
return generalLinks.length > 0 ? generalLinks : null;
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { InputValue } from '@portabletext/svelte';
|
||||
|
||||
|
||||
export type EventPost = {
|
||||
id: string;
|
||||
name: string;
|
||||
@@ -19,18 +18,18 @@ export enum EventCategory {
|
||||
PROFESSIONAL = 'professional',
|
||||
SOCIAL = 'social',
|
||||
TECHNICAL = 'technical'
|
||||
};
|
||||
}
|
||||
|
||||
export type LinkType = {
|
||||
title: string;
|
||||
kind: EventLinkKind;
|
||||
url: string;
|
||||
title: string;
|
||||
kind: EventLinkKind;
|
||||
url: string;
|
||||
};
|
||||
export enum EventLinkKind {
|
||||
PAYMENT = 'payment',
|
||||
REGISTRATION = 'registration',
|
||||
GENERAL = 'general'
|
||||
};
|
||||
}
|
||||
|
||||
export type FAQ = {
|
||||
question: string;
|
||||
|
||||
@@ -17,14 +17,14 @@ const eventQuery = `*[_type == "events"]{
|
||||
}`;
|
||||
|
||||
export const load = async ({ url }) => {
|
||||
let listOfEvents: EventPost[] = await getFromCMS(eventQuery);
|
||||
let listOfEvents: EventPost[] = await getFromCMS(eventQuery);
|
||||
|
||||
let sortedEvents = listOfEvents.sort(
|
||||
(a, b) => new Date(b.date).getTime() - new Date(a.date).getTime()
|
||||
);
|
||||
let sortedEvents = listOfEvents.sort(
|
||||
(a, b) => new Date(b.date).getTime() - new Date(a.date).getTime()
|
||||
);
|
||||
|
||||
return {
|
||||
events: sortedEvents,
|
||||
canonical: url.href
|
||||
};
|
||||
return {
|
||||
events: sortedEvents,
|
||||
canonical: url.href
|
||||
};
|
||||
};
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
let events: EventPost[] = data.events ?? [];
|
||||
let group = $state<EventCategory>(EventCategory.ALL_EVENTS);
|
||||
let categories: {value: EventCategory; label: string}[] = [
|
||||
{ value: EventCategory.ALL_EVENTS, label: 'All Events' },
|
||||
{ value: EventCategory.ACADEMIC, label: 'Academic' },
|
||||
{ value: EventCategory.PROFESSIONAL, label: 'Professional' },
|
||||
{ value: EventCategory.SOCIAL, label: 'Social' },
|
||||
{ value: EventCategory.TECHNICAL, label: 'Technical' }
|
||||
];
|
||||
let categories: { value: EventCategory; label: string }[] = [
|
||||
{ value: EventCategory.ALL_EVENTS, label: 'All Events' },
|
||||
{ value: EventCategory.ACADEMIC, label: 'Academic' },
|
||||
{ value: EventCategory.PROFESSIONAL, label: 'Professional' },
|
||||
{ value: EventCategory.SOCIAL, label: 'Social' },
|
||||
{ value: EventCategory.TECHNICAL, label: 'Technical' }
|
||||
];
|
||||
// Handle tab change
|
||||
function handleTabChange(selectedCategory: EventCategory) {
|
||||
group = selectedCategory;
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user