-
Notifications
You must be signed in to change notification settings - Fork 107
/
modal.riot
executable file
·53 lines (45 loc) · 996 Bytes
/
modal.riot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<modal>
<div class="modal animated faster { state.animation }">
<h2 class="modal-title">{ props.title }</h2>
<div class="modal-body">
<slot />
</div>
</div>
<script>
export default {
state: {
animation: '',
},
onMounted() {
this.update({ animation: 'pulse' })
this.props.state.on('close', (callback) => {
this.update({ animation: 'zoomOut' })
setTimeout(() => {
callback()
}, 500)
})
},
}
</script>
<style>
:host {
font-family: Helvetica Neue, Helvetica, Arial, serif;
position: absolute;
display: block;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
h2 {
margin: 0;
font-size: 1.2rem;
}
.modal {
padding: 24px;
background: #e3f5ff;
border: 4px solid #ffffff;
border-radius: 4px;
box-shadow: 0 0 4px rgba(0 0 0 / 0.2);
}
</style>
</modal>