From b70337e949240a767483b78c8c27da357f406ba1 Mon Sep 17 00:00:00 2001 From: Minh Vo Date: Tue, 23 Dec 2025 22:54:40 -0500 Subject: [PATCH] create flip card to separate description from event image --- src/app.css | 41 +++ src/components/event/EventBlock.svelte | 360 ++++++++++++++----------- 2 files changed, 242 insertions(+), 159 deletions(-) diff --git a/src/app.css b/src/app.css index d1dd4f3..627bef5 100644 --- a/src/app.css +++ b/src/app.css @@ -204,3 +204,44 @@ h2 { @apply mt-3 text-sm leading-5; } } + +.flip-box { + height: 100%; + width: 100%; + perspective: 1000px; /* Remove this if you don't want the 3D effect */ + } + + .flip-box-inner { + display: grid; + width: 100%; + height: 100%; + text-align: center; + transition: transform 0.8s; + transform-style: preserve-3d; + } + + + .flip-box-front,.flip-box-back { + grid-area: 1/1; + width: 100%; + -webkit-backface-visibility: hidden; /* Safari */ + backface-visibility: hidden; + } + .flip-box-front { + z-index: 2; + transform: rotateY(0deg); + } + + .flip-box-front { + z-index: 2; + transform: rotateY(0deg); + } + + .flip-box-back { + transform: rotateY(180deg); + } + + .show-back { + transform: rotateY(180deg); + } + diff --git a/src/components/event/EventBlock.svelte b/src/components/event/EventBlock.svelte index 3548c1a..c6c7a44 100644 --- a/src/components/event/EventBlock.svelte +++ b/src/components/event/EventBlock.svelte @@ -1,5 +1,4 @@ +
- -
- {#if thumbnail} - {eventTitle} - {:else if eventCategory?.[0] === 'social'} - Social Event - {:else if eventCategory?.[0] === 'technical'} - Technical Event - {:else if eventCategory?.[0] === 'professional'} - Professional Event - {:else if eventCategory?.[0] === 'academic'} - Academic Event - {:else} - ECSESS Event - {/if} - - -
- - -
- {#if isPastEvent} - - Past Event - + class=" + flip-box + group bg-ecsess-950 shadow-ecsess-950/50 relative flex flex-col overflow-hidden rounded-2xl shadow-lg transition-all duration-300 hover:-translate-y-3 hover:shadow-2xl" + > + +
+ +
+ +
+ {#if thumbnail} + {eventTitle} + {:else if eventCategory?.[0] === 'social'} + Social Event + {:else if eventCategory?.[0] === 'technical'} + Technical Event + {:else if eventCategory?.[0] === 'professional'} + Professional Event + {:else if eventCategory?.[0] === 'academic'} + Academic Event {:else} - - Upcoming - + ECSESS Event {/if} - {#if eventCategory && eventCategory.length > 0} -
- {#each eventCategory as category} - - {category} - - {/each} -
- {/if} -
- - -
-

- {eventTitle} -

-
-
- - -
- - {#if eventDescription} -
- + +
- {/if} + +
+ {#if isPastEvent} + + Past Event + + {:else} + + Upcoming + + {/if} - -
-
-
- -
-
-

{date}

-
+ {#if eventCategory && eventCategory.length > 0} +
+ {#each eventCategory as category} + + {category} + + {/each} +
+ {/if}
-
-
- + +
+

+ {eventTitle} +

+
+ +
+
+
+ +
+
+

{date}

+
-
-

- {location ?? 'TBA'} -

+ +
+
+ +
+
+

+ {location ?? 'TBA'} +

+
-
- - - {#if !isPastEvent} -
- +
+ View Details + +
+
+ +
+ +
+

+ {eventTitle} +

+
+
+ +
+ {#if eventDescription} + + {:else} +

No description available for this event.

+ {/if} - -
- {#if registrationLink} - - - Register - - {:else} -
- - Drop In -
- {/if} - - {#if paymentLink} - - - Pay - - {:else} -
- Free! -
- {/if}
- {/if} +
+ + {#if !isPastEvent} +
+ + + + +
+ {#if registrationLink} + + + Register + + {:else} +
+ + Drop In +
+ {/if} + + {#if paymentLink} + + + Pay + + {:else} +
+ Free! +
+ {/if} +
+
+ {/if} +
+
+ +
+ +
+