Modal close button visible on mobile

This commit is contained in:
Daniel Kluge 2022-06-13 14:48:37 +02:00
parent e39eb7eda8
commit 15983766f8
2 changed files with 25 additions and 5 deletions

View File

@ -57,7 +57,7 @@ const ProjectModal: NextPage = () => {
})(); })();
return <div className={styles.modal}> return <div className={styles.modal}>
<a onClick={() => setVisible(false)}> <a onClick={() => setVisible(false)} href={"#"}>
<div className={styles.modalClose}><div className={styles.modalCloseAlign}>X</div></div> <div className={styles.modalClose}><div className={styles.modalCloseAlign}>X</div></div>
</a> </a>
<div className={styles.modalContainer}> <div className={styles.modalContainer}>

View File

@ -28,19 +28,39 @@
margin: 0 auto; margin: 0 auto;
} }
.modalClose { .modalClose {
float: right; box-shadow: #000 2px 2px 2px;
position: relative; border: 1px solid #ccc;
background: var(--modal-gray, #0e0f0e); background: var(--modal-gray, #0e0f0e);
border-radius: 50%; border-radius: 50%;
width: 2em; width: 2em;
height: 2em; height: 2em;
font-family: sans-serif; font-family: sans-serif;
margin-top: -3em;
margin-bottom: 1em;
z-index: 100; z-index: 100;
} }
/* Mobile possitioning */
@media all and (min-width: 1050px) {
.modalClose {
position: relative;
float: right;
margin-top: -3em;
margin-bottom: 1em;
}
}
/* Else */
@media not all and (min-width: 1050px) {
.modalClose {
position: absolute;
float: none;
bottom: 2%;
left: 50%;
transform: translate(-50%, 0);
}
}
.modalCloseAlign { .modalCloseAlign {
margin: 0; margin: 0;
position: absolute; position: absolute;