mirror of
https://github.com/outline/outline.git
synced 2026-11-29 08:39:20 +03:00
* feat: Mobile sidebar drag to close and touch-friendly mobile chrome * fix: Address review feedback on mobile header and sidebar gesture
156 lines
2.6 KiB
TypeScript
156 lines
2.6 KiB
TypeScript
import { keyframes } from "styled-components";
|
|
|
|
export const fadeIn = keyframes`
|
|
from { opacity: 0; }
|
|
to { opacity: 1; }
|
|
`;
|
|
|
|
export const fadeOut = keyframes`
|
|
from { opacity: 1; }
|
|
to { opacity: 0; }
|
|
`;
|
|
|
|
export const fadeAndScaleIn = keyframes`
|
|
from {
|
|
opacity: 0;
|
|
transform: scale(.98);
|
|
}
|
|
|
|
to {
|
|
opacity: 1;
|
|
transform: scale(1);
|
|
}
|
|
`;
|
|
|
|
export const fadeAndSlideDown = keyframes`
|
|
from {
|
|
opacity: 0;
|
|
transform: scale(.98) translateY(-10px);
|
|
}
|
|
|
|
to {
|
|
opacity: 1;
|
|
transform: scale(1) translateY(0px);
|
|
}
|
|
`;
|
|
|
|
export const fadeAndSlideUp = keyframes`
|
|
from {
|
|
opacity: 0;
|
|
transform: scale(.98) translateY(10px);
|
|
}
|
|
|
|
to {
|
|
opacity: 1;
|
|
transform: scale(1) translateY(0px);
|
|
}
|
|
`;
|
|
|
|
export const fadeInAndSlideLeft = keyframes`
|
|
from {
|
|
opacity: 0;
|
|
transform: translateX(10px);
|
|
}
|
|
|
|
to {
|
|
opacity: 1;
|
|
transform: translateX(0px);
|
|
}
|
|
`;
|
|
|
|
export const fadeOutAndSlideRight = keyframes`
|
|
from {
|
|
opacity: 1;
|
|
transform: translateX(0);
|
|
}
|
|
|
|
to {
|
|
opacity: 0;
|
|
transform: translateX(10px);
|
|
}
|
|
`;
|
|
|
|
export const bounceIn = keyframes`
|
|
from,
|
|
20%,
|
|
40%,
|
|
60%,
|
|
80%,
|
|
to {
|
|
-webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
}
|
|
|
|
0% {
|
|
opacity: 0;
|
|
-webkit-transform: scale3d(0.3, 0.3, 0.3);
|
|
transform: scale3d(0.3, 0.3, 0.3);
|
|
}
|
|
|
|
20% {
|
|
-webkit-transform: scale3d(1.1, 1.1, 1.1);
|
|
transform: scale3d(1.1, 1.1, 1.1);
|
|
}
|
|
|
|
40% {
|
|
-webkit-transform: scale3d(0.9, 0.9, 0.9);
|
|
transform: scale3d(0.9, 0.9, 0.9);
|
|
}
|
|
|
|
60% {
|
|
opacity: 1;
|
|
-webkit-transform: scale3d(1.03, 1.03, 1.03);
|
|
transform: scale3d(1.03, 1.03, 1.03);
|
|
}
|
|
|
|
80% {
|
|
-webkit-transform: scale3d(0.97, 0.97, 0.97);
|
|
transform: scale3d(0.97, 0.97, 0.97);
|
|
}
|
|
|
|
to {
|
|
opacity: 1;
|
|
-webkit-transform: scale3d(1, 1, 1);
|
|
transform: scale3d(1, 1, 1);
|
|
}
|
|
`;
|
|
|
|
export const popIn = keyframes`
|
|
0% {
|
|
opacity: 0;
|
|
transform: scale(0.6);
|
|
}
|
|
|
|
60% {
|
|
opacity: 1;
|
|
transform: scale(1.15);
|
|
}
|
|
|
|
100% {
|
|
opacity: 1;
|
|
transform: scale(1);
|
|
}
|
|
`;
|
|
|
|
export const pulsate = keyframes`
|
|
0% { opacity: 1; }
|
|
50% { opacity: 0.5; }
|
|
100% { opacity: 1; }
|
|
`;
|
|
|
|
export const pulse = keyframes`
|
|
0% { transform: scale(1); }
|
|
50% { transform: scale(1.1); }
|
|
100% { transform: scale(1); }
|
|
`;
|
|
|
|
/**
|
|
* The duration of the sidebar appearing animation in ms
|
|
*/
|
|
export const sidebarAppearDuration = 600;
|
|
|
|
/**
|
|
* The duration and easing of the vaul drawer, shared so that panels move the same way.
|
|
*/
|
|
export const drawerTransition = "500ms cubic-bezier(0.32, 0.72, 0, 1)";
|