Skip to content

Commit

Permalink
fixes lightbox
Browse files Browse the repository at this point in the history
- fixes zoom if horizontally constrained (previously only worked
  vertically)
- fixes links poking through lightbox
  • Loading branch information
Bastian Bechtold authored and Bastian Bechtold committed Apr 28, 2023
1 parent e60c943 commit ec2d0ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion static/lightbox.js
Expand Up @@ -135,7 +135,8 @@ function zoomLightbox(event) {
let imageY = (event.clientY-imageRect.top)/imageRect.height;

// zoom in:
let zoomFactor = imageRect.width / window.innerWidth;
let zoomFactor = Math.max(imageRect.width / window.innerWidth,
imageRect.height / window.innerHeight);
zoomFactor /= 1.0 - event.wheelDeltaY / 360;
zoomFactor = Math.min(Math.max(zoomFactor, 0.9), 5);
image.style['max-width'] = `${zoomFactor*100}%`;
Expand Down
1 change: 0 additions & 1 deletion static/style.css
Expand Up @@ -223,7 +223,6 @@ a:hover{
color:#395b7c;
}
p a {
position: relative;
text-decoration-color: #D6DDE4;
text-decoration-line: underline;
text-decoration-thickness: 2pt;
Expand Down

0 comments on commit ec2d0ca

Please sign in to comment.