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

Couple of Fixes for Block Components #102

Merged
merged 2 commits into from
Jul 31, 2024
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
16 changes: 8 additions & 8 deletions components/TeamCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ const flipped = ref(false);
</script>
<template>
<div class="opacity-0 cursor-pointer select-none animate-fade-in" @click="flipped = !flipped">
<div class="relative w-full h-full overflow-hidden group rounded-card">
<div class="relative w-full aspect-square overflow-hidden group rounded-card">
<!-- Front of Team Card -->
<NuxtImg
v-if="person.image"
width="400"
height="400"
class="object-cover w-full h-full transition duration-300 grayscale group-hover:grayscale-0"
:src="person.image as string"
:alt="person.name ?? ''"
Expand All @@ -25,23 +27,21 @@ const flipped = ref(false);
class="absolute inset-0 p-2 -m-2 overflow-hidden bg-primary/80 backdrop-blur-sm"
:initial="{
opacity: 0,
y: 100,
x: 100,
y: 25,
x: 200,
scale: 0.9,
}"
:enter="{
opacity: 1,
scale: 1,
x: 0,
y: 0,
transformOrigin: 'bottom right',
}"
:leave="{
opacity: 0,
scale: 0.9,
x: 100,
y: 100,
transformOrigin: 'bottom right',
x: 200,
y: 25,
}"
>
<div class="relative p-4 space-y-2">
Expand Down Expand Up @@ -69,7 +69,7 @@ const flipped = ref(false);
<TypographyHeadline v-if="person.name" :content="person.name" size="sm" class="text-white drop-shadow">
{{ person?.name }}
</TypographyHeadline>
<TypographyTitle v-if="person.job_title">
<TypographyTitle v-if="person.job_title" class="text-white/50">
{{ person?.job_title }}
</TypographyTitle>
</div>
Expand Down
29 changes: 14 additions & 15 deletions components/blocks/Columns.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,27 @@ defineProps<{
<BlocksButtonGroup v-if="row?.button_group" :data="row?.button_group as BlockButtonGroup" class="mt-4" />
</div>
<div
class="order-first block w-full overflow-hidden border aspect-square dark:border-gray-700 rounded-card"
v-if="row.image"
v-motion
class="order-first block w-full h-full overflow-hidden border dark:border-gray-700 rounded-card"
:initial="{ opacity: 0, scale: 0.5, y: 0 }"
:visibleOnce="{ opacity: 1, scale: 1, y: 0 }"
:duration="1000"
:delay="250"
:class="[
{
'lg:order-last': row?.image_position === 'right',
'lg:order-first': row?.image_position === 'left',
},
]"
>
<div
v-motion
:initial="{ opacity: 0, scale: 0.8, y: 50 }"
:visibleOnce="{ opacity: 1, scale: 1, y: 0 }"
:duration="1000"
:delay="250"
>
<NuxtImg
v-if="row.image"
:alt="safeRelation(row.image)?.description ?? ''"
:src="safeRelationId(row.image) ?? ''"
class="object-cover object-center w-full h-full bg-gray-100 rounded-card dark:brightness-90"
/>
</div>
<NuxtImg
:alt="safeRelation(row.image)?.description ?? ''"
:src="safeRelationId(row.image) ?? ''"
height="600"
width="600"
class="object-cover object-center w-full h-full bg-gray-100 rounded-card dark:brightness-90"
/>
</div>
</div>
</div>
Expand Down
Loading