pleroma-fe/src/components/dialog_modal/dialog_modal.vue

128 lines
2.3 KiB
Vue
Raw Normal View History

2019-02-18 17:49:32 +03:00
<template>
2019-07-05 10:17:44 +03:00
<span
2024-12-29 22:19:49 +02:00
class="dialog-container"
2025-01-07 22:08:12 +02:00
:class="{ 'dark-overlay': darkOverlay, '-center-mobile': mobileCenter }"
2019-07-05 10:17:44 +03:00
@click.self.stop="onCancel()"
>
<div
class="dialog-modal panel panel-default"
@click.stop=""
>
2019-02-18 17:49:32 +03:00
<div class="panel-heading dialog-modal-heading">
2024-10-22 08:24:06 +00:00
<h1 class="title">
2019-07-05 10:17:44 +03:00
<slot name="header" />
2024-10-22 08:24:06 +00:00
</h1>
2019-02-18 17:49:32 +03:00
</div>
2024-03-06 20:35:03 +02:00
<div class="panel-body dialog-modal-content">
2019-07-05 10:17:44 +03:00
<slot name="default" />
2019-02-18 17:49:32 +03:00
</div>
<div class="dialog-modal-footer user-interactions panel-footer">
2019-07-05 10:17:44 +03:00
<slot name="footer" />
2019-02-18 17:49:32 +03:00
</div>
</div>
</span>
</template>
<script src="./dialog_modal.js"></script>
<style lang="scss">
// TODO: unify with other modals.
.dark-overlay {
&::before {
bottom: 0;
content: " ";
display: block;
cursor: default;
left: 0;
position: fixed;
right: 0;
top: 0;
2023-01-09 13:02:16 -05:00
background: rgb(27 31 35 / 50%);
2022-04-06 15:05:09 -04:00
z-index: 2000;
2019-02-18 17:49:32 +03:00
}
}
2024-12-29 22:19:49 +02:00
.dialog-container {
display: grid;
position: fixed;
2019-02-18 17:49:32 +03:00
top: 0;
2024-12-29 22:19:49 +02:00
bottom: 0;
left: 0;
right: 0;
justify-content: center;
align-items: center;
justify-items: center;
}
.dialog-modal.panel {
2019-02-18 17:49:32 +03:00
max-height: 80vh;
max-width: 90vw;
2022-04-06 15:05:09 -04:00
z-index: 2001;
2019-02-18 17:49:32 +03:00
cursor: default;
display: block;
.dialog-modal-heading {
.title {
text-align: center;
2019-02-18 17:49:32 +03:00
}
}
.dialog-modal-content {
margin: 0;
2023-01-09 13:02:16 -05:00
padding: 1rem;
2019-02-18 17:49:32 +03:00
white-space: normal;
2024-12-30 00:21:17 +02:00
text-align: center;
2019-02-18 17:49:32 +03:00
}
.dialog-modal-footer {
margin: 0;
2023-01-09 13:02:16 -05:00
padding: 0.5em;
2024-03-04 19:45:42 +02:00
border-top: 1px solid var(--border);
2024-12-29 18:48:58 +02:00
display: grid;
justify-content: end;
2024-12-29 18:48:58 +02:00
grid-gap: 0.5em;
2024-12-29 22:29:50 +02:00
grid-template-columns: min-content;
grid-auto-columns: min-content;
grid-auto-flow: column dense;
2024-12-29 18:48:58 +02:00
height: auto;
2019-02-18 17:49:32 +03:00
button {
width: auto;
2024-12-29 22:29:50 +02:00
white-space: nowrap;
2024-12-29 18:48:58 +02:00
padding-left: 2em;
padding-right: 2em;
}
}
}
#modal.-mobile {
2024-12-29 22:19:49 +02:00
.dialog-container {
justify-content: stretch;
align-items: end;
justify-items: stretch;
2025-01-07 22:08:12 +02:00
&.-center-mobile {
align-items: center;
}
2024-12-29 22:19:49 +02:00
}
2024-12-29 18:48:58 +02:00
.dialog-modal.panel {
2024-12-29 22:19:49 +02:00
min-width: 100vw;
}
2024-12-29 18:48:58 +02:00
2024-12-29 22:19:49 +02:00
.dialog-modal-footer {
flex-direction: column;
justify-content: flex-end;
2024-12-29 22:29:50 +02:00
grid-template-columns: 1fr;
grid-auto-columns: none;
grid-auto-rows: auto;
grid-auto-flow: row dense;
2024-12-29 18:48:58 +02:00
2024-12-29 22:19:49 +02:00
button {
grid-column: 1;
2024-12-30 01:13:08 +02:00
height: 3em;
2019-02-18 17:49:32 +03:00
}
}
}
</style>