tooltip add delay

This commit is contained in:
Qing 2022-05-21 13:37:38 +08:00
parent 22834a8243
commit ad62ef492e
2 changed files with 25 additions and 20 deletions

View File

@ -731,7 +731,7 @@ export default function Editor(props: EditorProps) {
/>
<div className="editor-toolkit-btns">
<Button
toolTip="Show Full"
toolTip="Reset Zoom & Pan"
tooltipPosition="top"
icon={<ArrowsExpandIcon />}
disabled={scale === minScale && panned === false}

View File

@ -1,28 +1,33 @@
$tooltip-translate: 100%;
$tooltip-margin: 1.5rem;
.info-tooltip {
&:hover:before {
content: attr(data-tooltip);
position: absolute;
background-color: var(--tooltip-bg);
color: var(--tooltip-text-color);
padding: 0.5rem;
border-radius: 0.3rem;
z-index: 2;
}
.info-tooltip {
&:hover:before {
content: attr(data-tooltip);
position: absolute;
background-color: var(--tooltip-bg);
color: var(--tooltip-text-color);
padding: 0.5rem;
border-radius: 0.3rem;
z-index: 2;
opacity: 0;
animation-name: opacityReveal;
animation-duration: 0.2s;
animation-fill-mode: forwards;
animation-delay: 1s;
}
}
.info-tooltip-top {
&:hover:before {
transform: translateY(calc($tooltip-translate * -1));
margin-bottom: $tooltip-margin;
}
&:hover:before {
transform: translateY(calc($tooltip-translate * -1));
margin-bottom: $tooltip-margin;
}
}
.info-tooltip-bottom {
&:hover:before {
transform: translateY($tooltip-translate);
margin-top: $tooltip-margin;
}
}
&:hover:before {
transform: translateY($tooltip-translate);
margin-top: $tooltip-margin;
}
}