2023-07-27 05:31:52 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-10-17 11:12:00 +00:00
|
|
|
<template>
|
2023-01-14 04:29:41 +00:00
|
|
|
<Transition
|
|
|
|
:name="transitionName"
|
2023-06-01 08:19:46 +00:00
|
|
|
:enterActiveClass="normalizeClass({
|
|
|
|
[$style.transition_modalDrawer_enterActive]: transitionName === 'modal-drawer',
|
|
|
|
[$style.transition_modalPopup_enterActive]: transitionName === 'modal-popup',
|
|
|
|
[$style.transition_modal_enterActive]: transitionName === 'modal',
|
|
|
|
[$style.transition_send_enterActive]: transitionName === 'send',
|
|
|
|
})"
|
|
|
|
:leaveActiveClass="normalizeClass({
|
|
|
|
[$style.transition_modalDrawer_leaveActive]: transitionName === 'modal-drawer',
|
|
|
|
[$style.transition_modalPopup_leaveActive]: transitionName === 'modal-popup',
|
|
|
|
[$style.transition_modal_leaveActive]: transitionName === 'modal',
|
|
|
|
[$style.transition_send_leaveActive]: transitionName === 'send',
|
|
|
|
})"
|
|
|
|
:enterFromClass="normalizeClass({
|
|
|
|
[$style.transition_modalDrawer_enterFrom]: transitionName === 'modal-drawer',
|
|
|
|
[$style.transition_modalPopup_enterFrom]: transitionName === 'modal-popup',
|
|
|
|
[$style.transition_modal_enterFrom]: transitionName === 'modal',
|
|
|
|
[$style.transition_send_enterFrom]: transitionName === 'send',
|
|
|
|
})"
|
|
|
|
:leaveToClass="normalizeClass({
|
|
|
|
[$style.transition_modalDrawer_leaveTo]: transitionName === 'modal-drawer',
|
|
|
|
[$style.transition_modalPopup_leaveTo]: transitionName === 'modal-popup',
|
|
|
|
[$style.transition_modal_leaveTo]: transitionName === 'modal',
|
|
|
|
[$style.transition_send_leaveTo]: transitionName === 'send',
|
|
|
|
})"
|
2023-05-19 04:58:09 +00:00
|
|
|
:duration="transitionDuration" appear @afterLeave="emit('closed')" @enter="emit('opening')" @afterEnter="onOpened"
|
2023-01-14 04:29:41 +00:00
|
|
|
>
|
2023-01-14 12:04:20 +00:00
|
|
|
<div v-show="manualShowing != null ? manualShowing : showing" v-hotkey.global="keymap" :class="[$style.root, { [$style.drawer]: type === 'drawer', [$style.dialog]: type === 'dialog', [$style.popup]: type === 'popup' }]" :style="{ zIndex, pointerEvents: (manualShowing != null ? manualShowing : showing) ? 'auto' : 'none', '--transformOrigin': transformOrigin }">
|
2023-03-09 10:59:11 +00:00
|
|
|
<div data-cy-bg :data-cy-transparent="isEnableBgTransparent" class="_modalBg" :class="[$style.bg, { [$style.bgTransparent]: isEnableBgTransparent }]" :style="{ zIndex }" @click="onBgClick" @mousedown="onBgClick" @contextmenu.prevent.stop="() => {}"></div>
|
2023-01-14 12:04:20 +00:00
|
|
|
<div ref="content" :class="[$style.content, { [$style.fixed]: fixed }]" :style="{ zIndex }" @click.self="onBgClick">
|
2021-12-16 17:14:40 +00:00
|
|
|
<slot :max-height="maxHeight" :type="type"></slot>
|
2021-03-05 07:59:43 +00:00
|
|
|
</div>
|
2020-10-17 11:12:00 +00:00
|
|
|
</div>
|
2022-12-30 04:37:14 +00:00
|
|
|
</Transition>
|
2020-10-17 11:12:00 +00:00
|
|
|
</template>
|
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
<script lang="ts" setup>
|
2023-12-07 05:42:09 +00:00
|
|
|
import { nextTick, normalizeClass, onMounted, onUnmounted, provide, watch, ref, shallowRef, computed } from 'vue';
|
2023-09-19 07:37:43 +00:00
|
|
|
import * as os from '@/os.js';
|
|
|
|
import { isTouchUsing } from '@/scripts/touch.js';
|
|
|
|
import { defaultStore } from '@/store.js';
|
|
|
|
import { deviceKind } from '@/scripts/device-kind.js';
|
2020-10-17 11:12:00 +00:00
|
|
|
|
|
|
|
function getFixedContainer(el: Element | null): Element | null {
|
|
|
|
if (el == null || el.tagName === 'BODY') return null;
|
|
|
|
const position = window.getComputedStyle(el).getPropertyValue('position');
|
|
|
|
if (position === 'fixed') {
|
|
|
|
return el;
|
|
|
|
} else {
|
|
|
|
return getFixedContainer(el.parentElement);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-14 12:04:20 +00:00
|
|
|
type ModalTypes = 'popup' | 'dialog' | 'drawer';
|
2022-01-28 03:20:42 +00:00
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
const props = withDefaults(defineProps<{
|
2022-01-28 03:30:47 +00:00
|
|
|
manualShowing?: boolean | null;
|
2022-03-06 14:21:19 +00:00
|
|
|
anchor?: { x: string; y: string; };
|
2023-05-31 16:00:55 +00:00
|
|
|
src?: HTMLElement | null;
|
2022-01-28 03:20:42 +00:00
|
|
|
preferType?: ModalTypes | 'auto';
|
2022-01-28 03:14:21 +00:00
|
|
|
zPriority?: 'low' | 'middle' | 'high';
|
|
|
|
noOverlap?: boolean;
|
|
|
|
transparentBg?: boolean;
|
|
|
|
}>(), {
|
|
|
|
manualShowing: null,
|
|
|
|
src: null,
|
2022-03-19 13:03:53 +00:00
|
|
|
anchor: () => ({ x: 'center', y: 'bottom' }),
|
2022-01-28 03:14:21 +00:00
|
|
|
preferType: 'auto',
|
|
|
|
zPriority: 'low',
|
|
|
|
noOverlap: true,
|
|
|
|
transparentBg: false,
|
|
|
|
});
|
2021-12-16 17:14:40 +00:00
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
const emit = defineEmits<{
|
|
|
|
(ev: 'opening'): void;
|
2022-06-11 06:45:44 +00:00
|
|
|
(ev: 'opened'): void;
|
2022-01-28 03:14:21 +00:00
|
|
|
(ev: 'click'): void;
|
|
|
|
(ev: 'esc'): void;
|
|
|
|
(ev: 'close'): void;
|
|
|
|
(ev: 'closed'): void;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
provide('modal', true);
|
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
const maxHeight = ref<number>();
|
|
|
|
const fixed = ref(false);
|
|
|
|
const transformOrigin = ref('center');
|
|
|
|
const showing = ref(true);
|
|
|
|
const content = shallowRef<HTMLElement>();
|
2022-01-28 03:14:21 +00:00
|
|
|
const zIndex = os.claimZIndex(props.zPriority);
|
2023-12-07 05:42:09 +00:00
|
|
|
const useSendAnime = ref(false);
|
|
|
|
const type = computed<ModalTypes>(() => {
|
2023-01-02 00:52:10 +00:00
|
|
|
if (props.preferType === 'auto') {
|
|
|
|
if (!defaultStore.state.disableDrawer && isTouchUsing && deviceKind === 'smartphone') {
|
|
|
|
return 'drawer';
|
|
|
|
} else {
|
|
|
|
return props.src != null ? 'popup' : 'dialog';
|
|
|
|
}
|
2022-01-28 03:14:21 +00:00
|
|
|
} else {
|
2023-01-02 00:52:10 +00:00
|
|
|
return props.preferType!;
|
2022-01-28 03:14:21 +00:00
|
|
|
}
|
2023-01-02 00:52:10 +00:00
|
|
|
});
|
2023-12-07 05:42:09 +00:00
|
|
|
const isEnableBgTransparent = computed(() => props.transparentBg && (type.value === 'popup'));
|
|
|
|
const transitionName = computed((() =>
|
2023-01-08 00:58:35 +00:00
|
|
|
defaultStore.state.animation
|
2023-12-07 05:42:09 +00:00
|
|
|
? useSendAnime.value
|
2023-01-08 02:47:16 +00:00
|
|
|
? 'send'
|
2023-12-07 05:42:09 +00:00
|
|
|
: type.value === 'drawer'
|
2023-01-08 02:47:16 +00:00
|
|
|
? 'modal-drawer'
|
2023-12-07 05:42:09 +00:00
|
|
|
: type.value === 'popup'
|
2023-01-08 02:47:16 +00:00
|
|
|
? 'modal-popup'
|
|
|
|
: 'modal'
|
2023-01-08 00:58:35 +00:00
|
|
|
: ''
|
|
|
|
));
|
2023-12-07 05:42:09 +00:00
|
|
|
const transitionDuration = computed((() =>
|
|
|
|
transitionName.value === 'send'
|
2023-01-08 02:47:16 +00:00
|
|
|
? 400
|
2023-12-07 05:42:09 +00:00
|
|
|
: transitionName.value === 'modal-popup'
|
2023-01-08 02:47:16 +00:00
|
|
|
? 100
|
2023-12-07 05:42:09 +00:00
|
|
|
: transitionName.value === 'modal'
|
2023-01-08 00:58:35 +00:00
|
|
|
? 200
|
2023-12-07 05:42:09 +00:00
|
|
|
: transitionName.value === 'modal-drawer'
|
2023-01-08 02:47:16 +00:00
|
|
|
? 200
|
|
|
|
: 0
|
2023-01-08 00:58:35 +00:00
|
|
|
));
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
let contentClicking = false;
|
2021-12-16 17:14:40 +00:00
|
|
|
|
2022-12-31 10:46:16 +00:00
|
|
|
function close(opts: { useSendAnimation?: boolean } = {}) {
|
|
|
|
if (opts.useSendAnimation) {
|
2023-12-07 05:42:09 +00:00
|
|
|
useSendAnime.value = true;
|
2022-12-31 10:46:16 +00:00
|
|
|
}
|
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
// eslint-disable-next-line vue/no-mutating-props
|
|
|
|
if (props.src) props.src.style.pointerEvents = 'auto';
|
2023-12-07 05:42:09 +00:00
|
|
|
showing.value = false;
|
2022-01-28 03:14:21 +00:00
|
|
|
emit('close');
|
2022-12-31 10:46:16 +00:00
|
|
|
}
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2022-12-31 10:46:16 +00:00
|
|
|
function onBgClick() {
|
2022-01-28 03:14:21 +00:00
|
|
|
if (contentClicking) return;
|
|
|
|
emit('click');
|
2022-12-31 10:46:16 +00:00
|
|
|
}
|
2021-12-16 17:14:40 +00:00
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
if (type.value === 'drawer') {
|
|
|
|
maxHeight.value = window.innerHeight / 1.5;
|
2022-01-28 03:14:21 +00:00
|
|
|
}
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
const keymap = {
|
|
|
|
'esc': () => emit('esc'),
|
|
|
|
};
|
2021-03-05 07:59:43 +00:00
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
const MARGIN = 16;
|
2023-02-25 04:44:37 +00:00
|
|
|
const SCROLLBAR_THICKNESS = 16;
|
2021-02-27 17:22:53 +00:00
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
const align = () => {
|
|
|
|
if (props.src == null) return;
|
2023-12-07 05:42:09 +00:00
|
|
|
if (type.value === 'drawer') return;
|
|
|
|
if (type.value === 'dialog') return;
|
2021-02-27 17:22:53 +00:00
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
if (content.value == null) return;
|
2022-01-28 03:14:21 +00:00
|
|
|
|
2022-03-19 13:03:53 +00:00
|
|
|
const srcRect = props.src.getBoundingClientRect();
|
2022-07-13 12:17:19 +00:00
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
const width = content.value!.offsetWidth;
|
|
|
|
const height = content.value!.offsetHeight;
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
let left;
|
|
|
|
let top;
|
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
const x = srcRect.left + (fixed.value ? 0 : window.pageXOffset);
|
|
|
|
const y = srcRect.top + (fixed.value ? 0 : window.pageYOffset);
|
2022-03-06 14:21:19 +00:00
|
|
|
|
|
|
|
if (props.anchor.x === 'center') {
|
|
|
|
left = x + (props.src.offsetWidth / 2) - (width / 2);
|
|
|
|
} else if (props.anchor.x === 'left') {
|
|
|
|
// TODO
|
|
|
|
} else if (props.anchor.x === 'right') {
|
|
|
|
left = x + props.src.offsetWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (props.anchor.y === 'center') {
|
2022-01-28 03:14:21 +00:00
|
|
|
top = (y - (height / 2));
|
2022-03-06 14:21:19 +00:00
|
|
|
} else if (props.anchor.y === 'top') {
|
|
|
|
// TODO
|
|
|
|
} else if (props.anchor.y === 'bottom') {
|
|
|
|
top = y + props.src.offsetHeight;
|
2022-01-28 03:14:21 +00:00
|
|
|
}
|
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
if (fixed.value) {
|
2022-01-28 03:14:21 +00:00
|
|
|
// 画面から横にはみ出る場合
|
2023-02-25 04:44:37 +00:00
|
|
|
if (left + width > (window.innerWidth - SCROLLBAR_THICKNESS)) {
|
|
|
|
left = (window.innerWidth - SCROLLBAR_THICKNESS) - width;
|
2022-01-28 03:14:21 +00:00
|
|
|
}
|
|
|
|
|
2023-02-25 04:44:37 +00:00
|
|
|
const underSpace = ((window.innerHeight - SCROLLBAR_THICKNESS) - MARGIN) - top;
|
2022-03-19 13:03:53 +00:00
|
|
|
const upperSpace = (srcRect.top - MARGIN);
|
2022-02-13 07:35:53 +00:00
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
// 画面から縦にはみ出る場合
|
2023-02-25 04:44:37 +00:00
|
|
|
if (top + height > ((window.innerHeight - SCROLLBAR_THICKNESS) - MARGIN)) {
|
2022-03-06 14:21:19 +00:00
|
|
|
if (props.noOverlap && props.anchor.x === 'center') {
|
2022-01-28 03:14:21 +00:00
|
|
|
if (underSpace >= (upperSpace / 3)) {
|
2023-12-07 05:42:09 +00:00
|
|
|
maxHeight.value = underSpace;
|
2022-01-28 03:14:21 +00:00
|
|
|
} else {
|
2023-12-07 05:42:09 +00:00
|
|
|
maxHeight.value = upperSpace;
|
2022-01-28 03:14:21 +00:00
|
|
|
top = (upperSpace + MARGIN) - height;
|
2021-02-27 17:22:53 +00:00
|
|
|
}
|
|
|
|
} else {
|
2023-02-25 04:44:37 +00:00
|
|
|
top = ((window.innerHeight - SCROLLBAR_THICKNESS) - MARGIN) - height;
|
2022-01-28 03:14:21 +00:00
|
|
|
}
|
2022-02-13 07:35:53 +00:00
|
|
|
} else {
|
2023-12-07 05:42:09 +00:00
|
|
|
maxHeight.value = underSpace;
|
2022-01-28 03:14:21 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// 画面から横にはみ出る場合
|
2023-02-25 04:44:37 +00:00
|
|
|
if (left + width - window.pageXOffset > (window.innerWidth - SCROLLBAR_THICKNESS)) {
|
|
|
|
left = (window.innerWidth - SCROLLBAR_THICKNESS) - width + window.pageXOffset - 1;
|
2022-01-28 03:14:21 +00:00
|
|
|
}
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2023-02-25 04:44:37 +00:00
|
|
|
const underSpace = ((window.innerHeight - SCROLLBAR_THICKNESS) - MARGIN) - (top - window.pageYOffset);
|
2022-03-19 13:03:53 +00:00
|
|
|
const upperSpace = (srcRect.top - MARGIN);
|
2022-02-13 07:35:53 +00:00
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
// 画面から縦にはみ出る場合
|
2023-02-25 04:44:37 +00:00
|
|
|
if (top + height - window.pageYOffset > ((window.innerHeight - SCROLLBAR_THICKNESS) - MARGIN)) {
|
2022-03-06 14:21:19 +00:00
|
|
|
if (props.noOverlap && props.anchor.x === 'center') {
|
2022-01-28 03:14:21 +00:00
|
|
|
if (underSpace >= (upperSpace / 3)) {
|
2023-12-07 05:42:09 +00:00
|
|
|
maxHeight.value = underSpace;
|
2022-01-28 03:14:21 +00:00
|
|
|
} else {
|
2023-12-07 05:42:09 +00:00
|
|
|
maxHeight.value = upperSpace;
|
2022-01-28 03:14:21 +00:00
|
|
|
top = window.pageYOffset + ((upperSpace + MARGIN) - height);
|
2020-10-17 11:12:00 +00:00
|
|
|
}
|
2022-01-28 03:14:21 +00:00
|
|
|
} else {
|
2023-02-25 04:44:37 +00:00
|
|
|
top = ((window.innerHeight - SCROLLBAR_THICKNESS) - MARGIN) - height + window.pageYOffset - 1;
|
2021-02-27 17:22:53 +00:00
|
|
|
}
|
2022-02-13 07:35:53 +00:00
|
|
|
} else {
|
2023-12-07 05:42:09 +00:00
|
|
|
maxHeight.value = underSpace;
|
2022-01-28 03:14:21 +00:00
|
|
|
}
|
|
|
|
}
|
2021-02-27 17:22:53 +00:00
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
if (top < 0) {
|
|
|
|
top = MARGIN;
|
|
|
|
}
|
2021-02-27 17:22:53 +00:00
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
if (left < 0) {
|
|
|
|
left = 0;
|
|
|
|
}
|
2021-02-27 17:22:53 +00:00
|
|
|
|
2022-03-06 14:21:19 +00:00
|
|
|
let transformOriginX = 'center';
|
|
|
|
let transformOriginY = 'center';
|
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
if (top >= srcRect.top + props.src.offsetHeight + (fixed.value ? 0 : window.pageYOffset)) {
|
2022-03-06 14:21:19 +00:00
|
|
|
transformOriginY = 'top';
|
2023-12-07 05:42:09 +00:00
|
|
|
} else if ((top + height) <= srcRect.top + (fixed.value ? 0 : window.pageYOffset)) {
|
2022-03-06 14:21:19 +00:00
|
|
|
transformOriginY = 'bottom';
|
|
|
|
}
|
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
if (left >= srcRect.left + props.src.offsetWidth + (fixed.value ? 0 : window.pageXOffset)) {
|
2022-03-19 13:03:53 +00:00
|
|
|
transformOriginX = 'left';
|
2023-12-07 05:42:09 +00:00
|
|
|
} else if ((left + width) <= srcRect.left + (fixed.value ? 0 : window.pageXOffset)) {
|
2022-03-19 13:03:53 +00:00
|
|
|
transformOriginX = 'right';
|
2022-01-28 03:14:21 +00:00
|
|
|
}
|
2021-02-27 17:22:53 +00:00
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
transformOrigin.value = `${transformOriginX} ${transformOriginY}`;
|
2022-03-06 14:21:19 +00:00
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
content.value.style.left = left + 'px';
|
|
|
|
content.value.style.top = top + 'px';
|
2022-01-28 03:14:21 +00:00
|
|
|
};
|
|
|
|
|
2022-06-11 06:45:44 +00:00
|
|
|
const onOpened = () => {
|
|
|
|
emit('opened');
|
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
// モーダルコンテンツにマウスボタンが押され、コンテンツ外でマウスボタンが離されたときにモーダルバックグラウンドクリックと判定させないためにマウスイベントを監視しフラグ管理する
|
2023-12-07 05:42:09 +00:00
|
|
|
const el = content.value!.children[0];
|
2022-01-28 03:14:21 +00:00
|
|
|
el.addEventListener('mousedown', ev => {
|
|
|
|
contentClicking = true;
|
|
|
|
window.addEventListener('mouseup', ev => {
|
|
|
|
// click イベントより先に mouseup イベントが発生するかもしれないのでちょっと待つ
|
|
|
|
window.setTimeout(() => {
|
|
|
|
contentClicking = false;
|
|
|
|
}, 100);
|
|
|
|
}, { passive: true, once: true });
|
|
|
|
}, { passive: true });
|
|
|
|
};
|
|
|
|
|
2023-05-31 16:00:55 +00:00
|
|
|
const alignObserver = new ResizeObserver((entries, observer) => {
|
|
|
|
align();
|
|
|
|
});
|
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
onMounted(() => {
|
|
|
|
watch(() => props.src, async () => {
|
|
|
|
if (props.src) {
|
|
|
|
// eslint-disable-next-line vue/no-mutating-props
|
|
|
|
props.src.style.pointerEvents = 'none';
|
|
|
|
}
|
2023-12-07 05:42:09 +00:00
|
|
|
fixed.value = (type.value === 'drawer') || (getFixedContainer(props.src) != null);
|
2022-01-28 03:14:21 +00:00
|
|
|
|
2022-06-10 05:36:55 +00:00
|
|
|
await nextTick();
|
2023-01-14 23:34:26 +00:00
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
align();
|
2022-06-11 06:45:44 +00:00
|
|
|
}, { immediate: true });
|
2022-01-28 03:14:21 +00:00
|
|
|
|
|
|
|
nextTick(() => {
|
2023-12-07 05:42:09 +00:00
|
|
|
alignObserver.observe(content.value!);
|
2022-01-28 03:14:21 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2023-05-31 16:00:55 +00:00
|
|
|
onUnmounted(() => {
|
|
|
|
alignObserver.disconnect();
|
|
|
|
});
|
|
|
|
|
2022-01-28 03:14:21 +00:00
|
|
|
defineExpose({
|
|
|
|
close,
|
2020-10-17 11:12:00 +00:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2023-01-14 04:29:41 +00:00
|
|
|
<style lang="scss" module>
|
|
|
|
.transition_send_enterActive,
|
|
|
|
.transition_send_leaveActive {
|
2022-12-31 10:46:16 +00:00
|
|
|
> .bg {
|
|
|
|
transition: opacity 0.3s !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .content {
|
2023-01-07 08:27:09 +00:00
|
|
|
transform: translateY(0px);
|
|
|
|
transition: opacity 0.3s ease-in, transform 0.3s cubic-bezier(.5,-0.5,1,.5) !important;
|
2022-12-31 10:46:16 +00:00
|
|
|
}
|
|
|
|
}
|
2023-01-14 04:29:41 +00:00
|
|
|
.transition_send_enterFrom,
|
|
|
|
.transition_send_leaveTo {
|
2022-12-31 10:46:16 +00:00
|
|
|
> .bg {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .content {
|
|
|
|
pointer-events: none;
|
|
|
|
opacity: 0;
|
2023-01-07 08:27:09 +00:00
|
|
|
transform: translateY(-300px);
|
2022-12-31 10:46:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-14 04:29:41 +00:00
|
|
|
.transition_modal_enterActive,
|
|
|
|
.transition_modal_leaveActive {
|
2021-03-05 07:59:43 +00:00
|
|
|
> .bg {
|
2021-12-16 17:14:40 +00:00
|
|
|
transition: opacity 0.2s !important;
|
2021-03-05 07:59:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
> .content {
|
2021-12-16 17:14:40 +00:00
|
|
|
transform-origin: var(--transformOrigin);
|
|
|
|
transition: opacity 0.2s, transform 0.2s !important;
|
2021-03-05 07:59:43 +00:00
|
|
|
}
|
2020-10-17 11:12:00 +00:00
|
|
|
}
|
2023-01-14 04:29:41 +00:00
|
|
|
.transition_modal_enterFrom,
|
|
|
|
.transition_modal_leaveTo {
|
2021-03-05 07:59:43 +00:00
|
|
|
> .bg {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .content {
|
|
|
|
pointer-events: none;
|
|
|
|
opacity: 0;
|
2021-12-16 17:14:40 +00:00
|
|
|
transform-origin: var(--transformOrigin);
|
2021-03-05 07:59:43 +00:00
|
|
|
transform: scale(0.9);
|
|
|
|
}
|
2020-10-17 11:12:00 +00:00
|
|
|
}
|
|
|
|
|
2023-06-01 08:19:46 +00:00
|
|
|
.transition_modalPopup_enterActive,
|
|
|
|
.transition_modalPopup_leaveActive {
|
2021-03-05 07:59:43 +00:00
|
|
|
> .bg {
|
2023-01-08 00:58:35 +00:00
|
|
|
transition: opacity 0.1s !important;
|
2021-03-05 07:59:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
> .content {
|
2021-12-16 17:14:40 +00:00
|
|
|
transform-origin: var(--transformOrigin);
|
2023-01-08 00:58:35 +00:00
|
|
|
transition: opacity 0.1s cubic-bezier(0, 0, 0.2, 1), transform 0.1s cubic-bezier(0, 0, 0.2, 1) !important;
|
2021-03-05 07:59:43 +00:00
|
|
|
}
|
2020-10-17 11:12:00 +00:00
|
|
|
}
|
2023-06-01 08:19:46 +00:00
|
|
|
.transition_modalPopup_enterFrom,
|
|
|
|
.transition_modalPopup_leaveTo {
|
2021-03-05 07:59:43 +00:00
|
|
|
> .bg {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .content {
|
|
|
|
pointer-events: none;
|
|
|
|
opacity: 0;
|
2021-12-16 17:14:40 +00:00
|
|
|
transform-origin: var(--transformOrigin);
|
2021-03-05 07:59:43 +00:00
|
|
|
transform: scale(0.9);
|
|
|
|
}
|
2020-10-17 11:12:00 +00:00
|
|
|
}
|
|
|
|
|
2023-06-01 08:19:46 +00:00
|
|
|
.transition_modalDrawer_enterActive {
|
2021-12-16 17:14:40 +00:00
|
|
|
> .bg {
|
|
|
|
transition: opacity 0.2s !important;
|
|
|
|
}
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2021-12-16 17:14:40 +00:00
|
|
|
> .content {
|
|
|
|
transition: transform 0.2s cubic-bezier(0,.5,0,1) !important;
|
|
|
|
}
|
|
|
|
}
|
2023-06-01 08:19:46 +00:00
|
|
|
.transition_modalDrawer_leaveActive {
|
2021-12-16 17:14:40 +00:00
|
|
|
> .bg {
|
|
|
|
transition: opacity 0.2s !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .content {
|
|
|
|
transition: transform 0.2s cubic-bezier(0,.5,0,1) !important;
|
|
|
|
}
|
|
|
|
}
|
2023-06-01 08:19:46 +00:00
|
|
|
.transition_modalDrawer_enterFrom,
|
|
|
|
.transition_modalDrawer_leaveTo {
|
2021-12-16 17:14:40 +00:00
|
|
|
> .bg {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .content {
|
|
|
|
pointer-events: none;
|
|
|
|
transform: translateY(100%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-14 04:29:41 +00:00
|
|
|
.root {
|
2021-12-16 17:14:40 +00:00
|
|
|
&.dialog {
|
|
|
|
> .content {
|
|
|
|
position: fixed;
|
|
|
|
top: 0;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
2020-10-17 11:12:00 +00:00
|
|
|
margin: auto;
|
2021-12-16 17:14:40 +00:00
|
|
|
padding: 32px;
|
|
|
|
display: flex;
|
2023-07-26 04:50:58 +00:00
|
|
|
overflow: auto;
|
2021-12-16 17:14:40 +00:00
|
|
|
|
|
|
|
@media (max-width: 500px) {
|
|
|
|
padding: 16px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.popup {
|
|
|
|
> .content {
|
|
|
|
position: absolute;
|
|
|
|
|
|
|
|
&.fixed {
|
|
|
|
position: fixed;
|
2020-10-17 11:12:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-16 17:14:40 +00:00
|
|
|
&.drawer {
|
|
|
|
position: fixed;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2022-07-13 12:41:06 +00:00
|
|
|
overflow: clip;
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2021-12-16 17:14:40 +00:00
|
|
|
> .content {
|
2020-10-17 11:12:00 +00:00
|
|
|
position: fixed;
|
2021-12-16 17:14:40 +00:00
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
margin: auto;
|
2020-10-17 11:12:00 +00:00
|
|
|
}
|
|
|
|
}
|
2023-01-14 04:29:41 +00:00
|
|
|
}
|
2021-12-16 17:14:40 +00:00
|
|
|
|
2023-01-14 04:29:41 +00:00
|
|
|
.bg {
|
|
|
|
&.bgTransparent {
|
|
|
|
background: transparent;
|
|
|
|
-webkit-backdrop-filter: none;
|
|
|
|
backdrop-filter: none;
|
|
|
|
}
|
2020-10-17 11:12:00 +00:00
|
|
|
}
|
|
|
|
</style>
|