mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-17 14:27:02 +08:00
fix: peek view modal controls animation (#7180)
This commit is contained in:
@@ -43,7 +43,7 @@ const fadeOut = keyframes({
|
|||||||
|
|
||||||
const slideRight = keyframes({
|
const slideRight = keyframes({
|
||||||
from: {
|
from: {
|
||||||
transform: 'translateX(-100%)',
|
transform: 'translateX(-200%)',
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
},
|
},
|
||||||
to: {
|
to: {
|
||||||
@@ -58,7 +58,7 @@ const slideLeft = keyframes({
|
|||||||
opacity: 1,
|
opacity: 1,
|
||||||
},
|
},
|
||||||
to: {
|
to: {
|
||||||
transform: 'translateX(-100%)',
|
transform: 'translateX(-200%)',
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -96,18 +96,6 @@ export const modalContentContainer = style({
|
|||||||
width: '90%',
|
width: '90%',
|
||||||
height: '90%',
|
height: '90%',
|
||||||
maxWidth: 1248,
|
maxWidth: 1248,
|
||||||
});
|
|
||||||
|
|
||||||
export const modalContent = style({
|
|
||||||
flex: 1,
|
|
||||||
height: '100%',
|
|
||||||
backgroundColor: cssVar('backgroundOverlayPanelColor'),
|
|
||||||
boxShadow: '0px 0px 0px 2.23px rgba(0, 0, 0, 0.08)',
|
|
||||||
borderRadius: '8px',
|
|
||||||
minHeight: 300,
|
|
||||||
// :focus-visible will set outline
|
|
||||||
outline: 'none',
|
|
||||||
position: 'relative',
|
|
||||||
willChange: 'transform, opacity',
|
willChange: 'transform, opacity',
|
||||||
transformOrigin: transformOrigin,
|
transformOrigin: transformOrigin,
|
||||||
selectors: {
|
selectors: {
|
||||||
@@ -126,13 +114,24 @@ export const modalContent = style({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const modalContent = style({
|
||||||
|
flex: 1,
|
||||||
|
height: '100%',
|
||||||
|
backgroundColor: cssVar('backgroundOverlayPanelColor'),
|
||||||
|
boxShadow: '0px 0px 0px 2.23px rgba(0, 0, 0, 0.08)',
|
||||||
|
borderRadius: '8px',
|
||||||
|
minHeight: 300,
|
||||||
|
// :focus-visible will set outline
|
||||||
|
outline: 'none',
|
||||||
|
position: 'relative',
|
||||||
|
});
|
||||||
|
|
||||||
export const modalControls = style({
|
export const modalControls = style({
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
zIndex: -1,
|
zIndex: -1,
|
||||||
minWidth: '48px',
|
minWidth: '48px',
|
||||||
padding: '8px 0 0 16px',
|
padding: '8px 0 0 16px',
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
transformOrigin: transformOrigin,
|
|
||||||
pointerEvents: 'auto',
|
pointerEvents: 'auto',
|
||||||
selectors: {
|
selectors: {
|
||||||
'&[data-state=entered], &[data-state=entering]': {
|
'&[data-state=entered], &[data-state=entering]': {
|
||||||
|
|||||||
@@ -114,11 +114,10 @@ export const PeekViewModalContainer = ({
|
|||||||
[styles.animationTimeout]: `${animationTimeout}ms`,
|
[styles.animationTimeout]: `${animationTimeout}ms`,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<div className={styles.modalContentContainer}>
|
<div className={styles.modalContentContainer} data-state={status}>
|
||||||
<Dialog.Content
|
<Dialog.Content
|
||||||
{...contentOptions}
|
{...contentOptions}
|
||||||
className={styles.modalContent}
|
className={styles.modalContent}
|
||||||
data-state={status}
|
|
||||||
>
|
>
|
||||||
{hideOnEntering && status === 'entering' ? null : children}
|
{hideOnEntering && status === 'entering' ? null : children}
|
||||||
</Dialog.Content>
|
</Dialog.Content>
|
||||||
|
|||||||
Reference in New Issue
Block a user