Skip to content

Commit 2d00e95

Browse files
ww2497peterkos
andauthored
Carousel image clips over the front clip on mobile on tap/slide (#1078)
* Carousel image: removed transparency on hover for smaller screens * Changed hover effect to brightness from opacity * Older iOS can now close image modal * Disabled filter effect on mobile * Increased nav z-index from 4 to 5 Co-authored-by: Peter Kos <[email protected]>
1 parent 71439e3 commit 2d00e95

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

sass/main.scss

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ nav {
123123
top: 0;
124124
left: 0;
125125
right: 0;
126-
z-index: 4;
126+
z-index: 5;
127127

128128
.left, .right {
129129
display: flex;
@@ -359,10 +359,10 @@ nav {
359359
cursor: pointer;
360360
transition: 0.3s;
361361
z-index: 2;
362-
}
363362

364-
img:hover {
365-
opacity: 0.7;
363+
&:hover {
364+
filter: brightness(125%);
365+
}
366366
}
367367
}
368368

@@ -414,9 +414,17 @@ nav {
414414

415415
}
416416

417+
// Note that older versions of iOS (<14?)
418+
// require `cursor: pointer` to be set
419+
// in order for click events to be captured
420+
// by our intended HTML (here, #modal).
421+
// The cursor is reset on the #modal-content,
422+
// as on desktop, no action is possible on the image.
423+
// https://stackoverflow.com/a/16006333/1431900
417424
#modal {
418425
display: none;
419426
position: fixed;
427+
cursor: pointer;
420428
z-index: 100;
421429
padding: 100px;
422430
left: 0;
@@ -437,6 +445,7 @@ nav {
437445
display: block;
438446
width: 80%;
439447
max-width: 700px;
448+
cursor: default;
440449
animation-name: zoom;
441450
animation-duration: 0.6s;
442451
}
@@ -1217,6 +1226,10 @@ footer {
12171226
img {
12181227
width: $slide-size;
12191228
height: $slide-size;
1229+
1230+
&:hover {
1231+
filter: none;
1232+
}
12201233
}
12211234
}
12221235

0 commit comments

Comments
 (0)