stubbed in modal dialog
This commit is contained in:
parent
20528eb0d1
commit
cdc15596df
11 changed files with 100 additions and 24 deletions
15
app/templates/modal/index.js
Normal file
15
app/templates/modal/index.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
const html = require('choo/html');
|
||||
|
||||
module.exports = function(state, emit) {
|
||||
return html`
|
||||
<div class="modal" onclick=${close}>
|
||||
<div class="modal__box" onclick=${e => e.stopPropagation()}>
|
||||
${state.modal(state, close)}
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
function close(event) {
|
||||
state.modal = null;
|
||||
emit('render');
|
||||
}
|
||||
};
|
22
app/templates/modal/modal.css
Normal file
22
app/templates/modal/modal.css
Normal file
|
@ -0,0 +1,22 @@
|
|||
.modal {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
z-index: 100;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
animation: fade-in 0.5s forwards;
|
||||
}
|
||||
|
||||
.modal__box {
|
||||
max-width: 480px;
|
||||
max-height: 300px;
|
||||
background: var(--pageBGColor);
|
||||
border-radius: 4px;
|
||||
color: var(--textColor);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue