mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-28 20:28:52 +03:00
Carousel very buggy on mobile. Add close button.
This commit is contained in:
parent
5797b9bc38
commit
80b3432ccb
2 changed files with 29 additions and 5 deletions
15
src/app.css
15
src/app.css
|
@ -325,16 +325,22 @@ a.hashtag {
|
||||||
max-height: 100vh;
|
max-height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.carousel-top-controls {
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
.carousel-controls {
|
.carousel-controls {
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
:is(.carousel-top-controls, .carousel-controls) {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
bottom: 0;
|
padding: 16px;
|
||||||
text-align: center;
|
|
||||||
padding: 32px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
button.carousel-button {
|
button.carousel-button {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
|
@ -460,4 +466,7 @@ button.carousel-dot.active {
|
||||||
.box {
|
.box {
|
||||||
padding: 32px;
|
padding: 32px;
|
||||||
}
|
}
|
||||||
|
:is(.carousel-top-controls, .carousel-controls) {
|
||||||
|
padding: 32px;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -785,10 +785,25 @@ function Status({ statusID, status, withinContext, size = 'm', skeleton }) {
|
||||||
</div>
|
</div>
|
||||||
{showMediaModal !== false && (
|
{showMediaModal !== false && (
|
||||||
<Modal>
|
<Modal>
|
||||||
|
<div class="carousel-top-controls">
|
||||||
|
<span />
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="carousel-button plain"
|
||||||
|
onClick={() => setShowMediaModal(false)}
|
||||||
|
>
|
||||||
|
<Icon icon="x" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
class="carousel"
|
class="carousel"
|
||||||
onClick={() => {
|
onClick={(e) => {
|
||||||
setShowMediaModal(false);
|
if (
|
||||||
|
e.target.classList.contains('carousel-item') ||
|
||||||
|
e.target.classList.contains('media')
|
||||||
|
) {
|
||||||
|
setShowMediaModal(false);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in a new issue