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

FIXED: issue #4 #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
146 changes: 74 additions & 72 deletions layouts/dynamic-image.vue
Original file line number Diff line number Diff line change
@@ -1,87 +1,89 @@

<template>
<!-- Image is at Left -->
<div v-if="left" class="relative h-full intro grid grid-cols-12">
<div class="absolute h-full w-full" style="z-index: -10">
<BubbleFrame v-if="!hideFrame"/>
</div>
<!-- Image -->
<div
:class="[equal ? 'col-span-6' : 'col-span-4', 'my-auto h-full']"
:style="{ zIndex: '-1' }"
>
<div class="w-full h-full">
<!-- Image is at Left -->
<div v-if="left" class="relative h-full intro grid grid-cols-12">
<div class="absolute h-full w-full" style="z-index: -10">
<BubbleFrame v-if="!hideFrame"/>
</div>
<!-- Image -->
<div
v-if="upperImage"
class="absolute top-1/2 transform -translate-y-1/2"
:class="left ? 'left-[80px]' : 'right-[80px]'"
:style="{
boxShadow: '0px 10px 30px rgba(0,0,0,0.7)',
zIndex: '5',
}"
:class="[equal ? 'col-span-6' : 'col-span-4', 'my-auto h-full']"
:style="{ zIndex: '-1' }"
>
<img :src="upperImage" class="w-[450px]" alt="" loading="lazy" />
<div
v-if="upperImage"
class="absolute top-1/2 transform -translate-y-1/2"
:class="left ? 'left-[80px]' : 'right-[80px]'"
:style="{
boxShadow: '0px 10px 30px rgba(0,0,0,0.7)',
zIndex: '5',
}"
>
<img :src="upperImage" class="w-[450px]" alt="" loading="lazy" />
</div>
<div
v-if="image"
class="my-auto h-full"
:style="upperImage ? { ...style, filter: 'blur(3px)' } : { ...style }"
></div>
</div>
<!-- Layout -->
<div
v-if="image"
class="my-auto h-full"
:style="upperImage ? { ...style, filter: 'blur(3px)' } : { ...style }"
></div>
</div>
<!-- Layout -->
<div
:class="[
'slidev-layout my-auto',
image ? 'col-span-6' : 'col-span-12',
equal ? 'col-span-6' : 'col-span-8',
]"
>
<slot />
:class="[
'slidev-layout my-auto',
image ? 'col-span-6' : 'col-span-12',
equal ? 'col-span-6' : 'col-span-8',
]"
>
<slot />
</div>
</div>
</div>

<!-- Image is at Right -->
<div v-else class="relative h-full intro grid grid-cols-12">
<div class="absolute h-full w-full" style="z-index: -10">
<backgroundBubble />
</div>
<!-- Layout -->
<div
:class="[
'slidev-layout my-auto',
image ? 'col-span-6' : 'col-span-12',
equal ? 'col-span-6' : 'col-span-8',
]"
>
<slot />
</div>
<!-- Image -->
<div
:class="[equal ? 'col-span-6' : 'col-span-4', 'my-auto h-full']"
:style="{ zIndex: '-1' }"
>
<!-- Image is at Right -->
<div v-else class="relative h-full intro grid grid-cols-12">
<div class="absolute h-full w-full" style="z-index: -10">
<backgroundBubble />
</div>
<!-- Layout -->
<div
v-if="upperImage"
class="absolute top-1/2 transform -translate-y-1/2"
:class="left ? 'left-[80px]' : 'right-[80px]'"
:style="{
boxShadow: '0px 10px 30px rgba(0,0,0,0.7)',
zIndex: '5',
}"
:class="[
'slidev-layout my-auto',
image ? 'col-span-6' : 'col-span-12',
equal ? 'col-span-6' : 'col-span-8',
]"
>
<img :src="upperImage" class="w-[450px]" alt="" loading="lazy" />
<slot />
</div>
<!-- Image -->
<div
v-if="image"
class="my-auto h-full"
:style="
upperImage
? {
...style,
filter: 'blur(3px)',
}
: { ...style }
"
></div>
:class="[equal ? 'col-span-6' : 'col-span-4', 'my-auto h-full']"
:style="{ zIndex: '-1' }"
>
<div
v-if="upperImage"
class="absolute top-1/2 transform -translate-y-1/2"
:class="left ? 'left-[80px]' : 'right-[80px]'"
:style="{
boxShadow: '0px 10px 30px rgba(0,0,0,0.7)',
zIndex: '5',
}"
>
<img :src="upperImage" class="w-[450px]" alt="" loading="lazy" />
</div>
<div
v-if="image"
class="my-auto h-full"
:style="
upperImage
? {
...style,
filter: 'blur(3px)',
}
: { ...style }
"
></div>
</div>
</div>
</div>
</template>
Expand Down