Skip to content

Commit

Permalink
fix: fixed a problem with the zoom z-index and the navigation bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Franqsanz committed Nov 30, 2023
1 parent 27d727e commit eb741ca
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/ImageZoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function ImageZoom({ options, ...props }: ImageZoomProps) {
if (zoomRef.current === null) {
zoomRef.current = mediumZoom({
background: '#000000d6',
margin: 70,
margin: 24,
});
}

Expand All @@ -30,5 +30,5 @@ export function ImageZoom({ options, ...props }: ImageZoomProps) {
}
}

return <Image {...props} ref={attachZoom} />;
return <Image {...props} ref={attachZoom} position='relative' zIndex='2' />;
}
2 changes: 1 addition & 1 deletion src/components/nav/DesktopNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function DesktopNav() {
boxShadow='sm'
backdropFilter='auto'
backdropBlur='12px'
zIndex='999'
zIndex='1'
>
<Flex as='nav' w='100%' justify='space-around' align='center'>
<Flex align='center'>
Expand Down
2 changes: 1 addition & 1 deletion src/components/nav/MobileNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function MobileNav() {
position='sticky'
top='0'
p='2'
zIndex='999'
zIndex='1'
>
<Flex as='nav' w='100%' justify='space-between' align='center'>
<Flex align='center'>
Expand Down
3 changes: 1 addition & 2 deletions src/pages/Book.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ export default function Book() {
<Flex
as='figure'
justifyContent='center'
zIndex='9999'
position='relative'
zIndex='1'
>
<LazyLoad width={290} height={420} offset={0} threshold={0.99}>
<ImageZoom
Expand All @@ -347,7 +347,6 @@ export default function Book() {
filter='blur(10px)'
transition='filter 0.5s ease-in-out'
onLoad={handleImageLoad}
zIndex='9999'
/>
</LazyLoad>
</Flex>
Expand Down
3 changes: 3 additions & 0 deletions theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export default extendTheme({
borderRadius: '30px',
border: '4px solid #f2f2f2',
},
'.medium-zoom-overlay, .medium-zoom--opened': {
zIndex: 2,
},
},
h1: {
fontWeight: 'extrabold',
Expand Down

1 comment on commit eb741ca

@vercel
Copy link

@vercel vercel bot commented on eb741ca Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

xbu – ./

xbu-franqsanz.vercel.app
xbu.vercel.app
xbu-git-main-franqsanz.vercel.app

Please sign in to comment.