PluginProbe ʕ •ᴥ•ʔ
Hostinger Tools / 3.0.71
Hostinger Tools v3.0.71
3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.4 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.2 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 3.0.0 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.18 3.0.19 3.0.2 3.0.20 3.0.21 3.0.22 3.0.23 3.0.24 3.0.25 3.0.26 3.0.27 3.0.28 3.0.29 3.0.3 3.0.30 3.0.31 3.0.32 3.0.33 3.0.34 3.0.35 3.0.36 3.0.37 3.0.38 3.0.39 3.0.4 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.0.46 3.0.47 3.0.48 3.0.49 3.0.5 3.0.50 3.0.51 3.0.52 3.0.53 3.0.54 3.0.55 3.0.56 3.0.57 3.0.58 3.0.59 3.0.6 3.0.60 3.0.61 3.0.62 3.0.65 3.0.7 3.0.8 3.0.9 trunk 1.8.0
hostinger / vue-frontend / src / components / Modals / Base / Modals.vue
hostinger / vue-frontend / src / components / Modals / Base Last commit date
BaseModal.vue 9 months ago Modals.vue 9 months ago
Modals.vue
135 lines
1 <script lang="ts" setup>
2 import { computed, defineAsyncComponent } from "vue";
3
4 import Icon from "@/components/Icon/Icon.vue";
5 import { useModal } from "@/composables";
6 import { useModalStore } from "@/stores";
7
8 const { closeModal } = useModal();
9 const modalStore = useModalStore();
10 const activeModal = computed(() => modalStore.activeModal);
11
12 const modalComponent = computed(
13 () =>
14 activeModal.value &&
15 defineAsyncComponent(
16 () => import(`@/components/Modals/${activeModal.value?.name}.vue`)
17 )
18 );
19 </script>
20
21 <template>
22 <Transition name="fade">
23 <div
24 v-if="activeModal"
25 class="modal__wrapper"
26 >
27 <div
28 class="modal__container"
29 :class="{
30 'modal__container--xxl': activeModal.settings?.isXXL,
31 'modal__container--xl': activeModal.settings?.isXL,
32 'modal__container--lg': activeModal.settings?.isLG,
33 }"
34 >
35 <Icon
36 v-if="activeModal.settings?.hasCloseButton"
37 name="icon-close"
38 class="modal__icon"
39 color="gray"
40 @click="closeModal"
41 />
42 <div
43 class="modal__content"
44 :class="{
45 'modal__content--no-content-padding':
46 activeModal.settings?.noContentPadding,
47 'modal__content--no-border':
48 activeModal.settings?.noBorder,
49 }"
50 >
51 <component
52 :is="modalComponent"
53 v-bind="activeModal.data"
54 />
55 </div>
56 </div>
57 </div>
58 </Transition>
59 </template>
60
61 <style lang="scss" scoped>
62 .modal {
63 &__wrapper {
64 --modal-backdrop: rgba(0, 0, 0, 0.3);
65
66 overflow: auto;
67 position: fixed;
68 z-index: var(--z-index-modal);
69 height: 100%;
70 top: 0;
71 left: 0;
72 bottom: 0;
73 right: 0;
74 background-color: var(--modal-backdrop);
75 display: flex;
76 align-items: center;
77 justify-content: center;
78
79 &.is-above-intercom {
80 z-index: var(--z-index-intercom-2);
81 }
82 }
83
84 &__icon {
85 position: absolute;
86 top: 16px;
87 right: 16px;
88 cursor: pointer;
89 }
90
91 &__container {
92 position: relative;
93 max-height: calc(100vh - 6rem);
94 width: 100%;
95 max-width: 500px;
96
97 &--auto-width {
98 max-width: none !important;
99 width: auto;
100 }
101
102 &--lg {
103 max-width: 600px;
104 }
105
106 &--xl {
107 max-width: 800px;
108 }
109
110 &--xxl {
111 max-width: 964px;
112 }
113 }
114
115 &__content {
116 border: 1px solid var(--gray-border);
117 border-radius: 16px;
118 background-color: var(--light);
119
120 padding: 32px 40px 40px;
121 @media screen and (max-width: 600px) {
122 padding: 32px 40px 40px;
123 }
124
125 &--no-content-padding {
126 padding: 0;
127 }
128
129 &--no-border {
130 border: none;
131 }
132 }
133 }
134 </style>
135