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"> <div className="editor-toolkit-btns">
<Button <Button
toolTip="Show Full" toolTip="Reset Zoom & Pan"
tooltipPosition="top" tooltipPosition="top"
icon={<ArrowsExpandIcon />} icon={<ArrowsExpandIcon />}
disabled={scale === minScale && panned === false} disabled={scale === minScale && panned === false}

View File

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