change modal transition

release/0.2
Björn 3 years ago
parent 5c19f27149
commit cebf205183

16
dist/index.html vendored

@ -167,6 +167,18 @@
<div class="grid"> <div class="grid">
<div class="col-12"> <div class="col-12">
<h2>Modal</h2> <h2>Modal</h2>
<button class="button" onclick="openModal()">
Open
</button>
<script type="text/javascript">
function openModal() {
document.querySelector('.modal').classList.add('modal--open')
}
function closeModal() {
document.querySelector('.modal').classList.remove('modal--open')
}
</script>
<div class="modal"> <div class="modal">
<div class="modal__inner"> <div class="modal__inner">
<div class="modal__title t-center"> <div class="modal__title t-center">
@ -179,10 +191,10 @@
Do you really wan't to delete all files? Do you really wan't to delete all files?
</div> </div>
<div class="modal__footer"> <div class="modal__footer">
<button class="button button--danger"> <button class="button button--danger" onclick="closeModal()">
Confirm Confirm
</button> </button>
<button class="button float-right"> <button class="button float-right" onclick="closeModal()">
Reject Reject
</button> </button>
</div> </div>

20
dist/plain-ui.css vendored

@ -4897,15 +4897,19 @@ img.media {
height: 100%; height: 100%;
top: 0; top: 0;
left: 0; left: 0;
display: flex;
visibility: hidden;
transition: visibility 0s linear 0.5s;
padding: 1em; padding: 1em;
z-index: 20; z-index: 20;
display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.modal__inner { .modal__inner {
position: relative; position: relative;
z-index: 21; z-index: 21;
transition: transform 0.5s;
transform: scale(0);
max-width: 500px; max-width: 500px;
} }
.modal__inner .button { .modal__inner .button {
@ -4933,10 +4937,22 @@ img.media {
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
background: rgba(0, 0, 0, 0.87); background-color: transparent;
transition: background-color 0.5s;
z-index: 19; z-index: 19;
content: ""; content: "";
} }
.modal--open {
display: flex;
visibility: visible;
transition: visibility 0s linear 0s;
}
.modal--open:before {
background: rgba(0, 0, 0, 0.87);
}
.modal--open .modal__inner {
transform: scale(1);
}
.masonry { .masonry {
display: flex; display: flex;

@ -40,6 +40,10 @@
font-size: 0.8em; font-size: 0.8em;
} }
&--outline {
}
&--no-style { &--no-style {
margin: 0; margin: 0;
padding: 0; padding: 0;

@ -17,10 +17,13 @@
top: 0; top: 0;
left: 0; left: 0;
display: flex;
visibility: hidden;
transition: visibility 0s linear 0.5s;
padding: 1em; padding: 1em;
z-index: 20; z-index: 20;
display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -28,6 +31,9 @@
position: relative; position: relative;
z-index: 21; z-index: 21;
transition: transform 0.5s;
transform: scale(0);
max-width: 500px; max-width: 500px;
.button { .button {
@ -62,9 +68,25 @@
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
background: rgba(0,0,0,.87); background-color: transparent;
transition: background-color 0.5s;
z-index: 19; z-index: 19;
content: ''; content: '';
} }
&--open {
display: flex;
visibility: visible;
transition: visibility 0s linear 0s;
&:before {
background: rgba(0,0,0,.87);
}
.modal__inner {
transform: scale(1);
}
}
} }
} }
Loading…
Cancel
Save