Skip to content

Commit

Permalink
Fix the cursor for images that cannot be zoomed in lightbox
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmz committed Jan 10, 2024
1 parent 1699157 commit b32a598
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 35 deletions.
1 change: 1 addition & 0 deletions src/services/lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import PhotoSwipeLightbox from 'photoswipe/lightbox';
import Mousetrap from 'mousetrap';
import 'photoswipe/photoswipe.css';
import '../../styles/shared/lighbox.scss';

const prevHotKeys = ['a', 'ф', 'h', 'р', '4'];
const nextHotKeys = ['d', 'в', 'k', 'л', '6'];
Expand Down
39 changes: 39 additions & 0 deletions styles/shared/lighbox.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.pswp-media__container {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.5rem;
max-width: 100%;
max-height: 100%;
}

.pswp-media__content {
flex: 1;
position: relative;
width: 100%;
height: auto;
}

.pswp-media__title {
flex: 0;
color: white;

& > a,
& > a:hover,
& > a:focus {
color: inherit;
}
}

.pswp-media__embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

// Override the 'zoom-in' cursor for images that cannot be zoomed in
.pswp__img {
cursor: default;
}
35 changes: 0 additions & 35 deletions styles/shared/media-viewer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,3 @@ video:not(.pswp-media__embed) {
}
}
}

.pswp-media__container {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.5rem;
max-width: 100%;
max-height: 100%;
}

.pswp-media__content {
flex: 1;
position: relative;
width: 100%;
height: auto;
}

.pswp-media__title {
flex: 0;
color: white;

& > a,
& > a:hover,
& > a:focus {
color: inherit;
}
}

.pswp-media__embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

0 comments on commit b32a598

Please sign in to comment.