Skip to content

Commit

Permalink
svg hover on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
SaswatPadhi committed Jan 1, 2024
1 parent 14c6e95 commit a1b91d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
const oldHeight = svg.getBoundingClientRect().height;
const panZoom = svgPanZoom(svg, {
controlIconsEnabled: !svg.parentElement.parentElement.classList.contains('no-pan-zoom-controls'),
preventMouseEventsDefault: false,
mouseWheelZoomEnabled: false,
});
svg.style.height = Math.round(oldHeight) + 'px';
Expand Down
9 changes: 8 additions & 1 deletion _sass/partials/_figures.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,15 @@ code[data-processed='true'] {
min-width: 75px;
}

@supports not #{'selector\(:has\(g.svg-pan-zoom-control\)\)'} {
& {
min-height: 85px;
min-width: 75px;
}
}

g.svg-pan-zoom-control {
opacity: 0.5;
opacity: 0.25;
transition: opacity 0.8s ease;
}

Expand Down

0 comments on commit a1b91d0

Please sign in to comment.