Free Motion Capture for Everyone πβ¨
TypeScript
/* =========================================
TOOLTIP BASE
========================================= */
.tooltip-container, .prompt-tooltip-container {
position: absolute;
z-index: 9999;
min-width: max-content;
}
.prompt-tooltip-container {
min-width: 248px;
max-width: 248px;
/* Allow mouse/touch interaction */
pointer-events: auto;
/* Allow text selection */
user-select: text;
-webkit-user-select: text;
/* Enable normal touch behavior */
touch-action: auto;
/* Enable iOS touch callout */
-webkit-touch-callout: default;
}
/* =========================================
LOADING STATE WITH SHIMMER ANIMATION
========================================= */
@keyframes shimmer-border {
0% {
border-color: var(--color-info);
}
50% {
border-color: var(--log-detail-border);
}
100% {
border-color: var(--color-info);
}
}
.prompt-tooltip-container.loading > div {
/* border: 2px solid var(--color-info); */
animation: shimmer-border 1.5s ease-in-out infinite;
}
.tooltip-container:not(.prompt-tooltip-container, .dropdown) {
opacity: 0;
visibility: hidden;
pointer-events: none;
transition:
opacity 0.18s ease,
visibility 0.18s ease,
transform 0.18s ease;
}
/* =========================================
SHOW TOOLTIP ON HOVER
========================================= */
.button-sm-group:hover .tooltip-container,
.icon-button:hover .tooltip-container,
.tooltip-wrapper:hover .tooltip-container,
.stats-th:hover .tooltip-container,
.stats-source-cell:hover .tooltip-container {
opacity: 1;
visibility: visible;
}
/* =========================================
TOOLTIP INNER
========================================= */
.tooltip-inner {
position: relative;
background: var(--color-bg-primary);
will-change: transform, opacity;
}
.floating-tooltip-inner {
background: var(--color-bg-primary);
}
/* =========================================
POSITION : BOTTOM
========================================= */
.tooltip-container.pos-bottom {
top: calc(100% + 10px);
left: 50%;
transform:
translateX(-50%)
translateY(-8px);
/* opacity: 0; */
}
.button-sm-group:hover .tooltip-container.pos-bottom,
.icon-button:hover .tooltip-container.pos-bottom,
.stats-th:hover .tooltip-container.pos-bottom,
.stats-source-cell:hover .tooltip-container.pos-bottom {
transform:
translateX(-50%)
translateY(-4px);
/* opacity: 1; */
}
/* TRIANGLE */
.tooltip-container.pos-bottom::before {
content: "";
position: absolute;
top: -6px;
left: 50%;
transform: translateX(-50%);
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid var(--color-bg-primary);
}
/* =========================================
POSITION : BOTTOM-LEFT
========================================= */
.tooltip-container.pos-bottom-left {
top: calc(100% + 10px);
left: 0;
transform:
translateY(-8px);
}
.button-sm-group:hover .tooltip-container.pos-bottom-left,
.icon-button:hover .tooltip-container.pos-bottom-left,
.stats-th:hover .tooltip-container.pos-bottom-left,
.stats-source-cell:hover .tooltip-container.pos-bottom-left {
transform:
translateY(-4px);
}
/* TRIANGLE */
.tooltip-container.pos-bottom-left::before {
content: "";
position: absolute;
top: -6px;
left: 12px;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid var(--color-bg-primary);
}
/* =========================================
POSITION : BOTTOM-RIGHT
========================================= */
.tooltip-container.pos-bottom-right {
top: calc(100% + 10px);
right: 0;
transform:
translateY(-8px);
}
.button-sm-group:hover .tooltip-container.pos-bottom-right,
.icon-button:hover .tooltip-container.pos-bottom-right,
.stats-th:hover .tooltip-container.pos-bottom-right,
.stats-source-cell:hover .tooltip-container.pos-bottom-right {
transform:
translateY(-4px);
}
/* TRIANGLE */
.tooltip-container.pos-bottom-right::before {
content: "";
position: absolute;
top: -6px;
right: 12px;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid var(--color-bg-primary);
}
/* =========================================
POSITION : TOP
========================================= */
.tooltip-container.pos-top {
bottom: calc(100% + 10px);
left: 50%;
transform:
translateX(-50%)
translateY(6px);
}
.button-sm-group:hover .tooltip-container.pos-top,
.icon-button:hover .tooltip-container.pos-top {
transform:
translateX(-50%)
translateY(0);
}
/* TRIANGLE */
.tooltip-container.pos-top::before {
content: "";
position: absolute;
bottom: -6px;
left: 50%;
transform: translateX(-50%);
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid var(--color-bg-primary);
}
/* =========================================
POSITION : TOP-LEFT
========================================= */
.tooltip-container.pos-top-left {
bottom: calc(100% + 10px);
left: 0;
transform:
translateY(6px);
}
.button-sm-group:hover .tooltip-container.pos-top-left,
.icon-button:hover .tooltip-container.pos-top-left {
transform:
translateY(0);
}
/* TRIANGLE */
.tooltip-container.pos-top-left::before {
content: "";
position: absolute;
bottom: -6px;
left: 12px;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid var(--color-bg-primary);
}
/* =========================================
POSITION : TOP-RIGHT
========================================= */
.tooltip-container.pos-top-right {
bottom: calc(100% + 10px);
right: 0;
transform:
translateY(6px);
}
.button-sm-group:hover .tooltip-container.pos-top-right,
.icon-button:hover .tooltip-container.pos-top-right {
transform:
translateY(0);
}
/* TRIANGLE */
.tooltip-container.pos-top-right::before {
content: "";
position: absolute;
bottom: -6px;
right: 12px;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid var(--color-bg-primary);
}
/* =========================================
POSITION : LEFT
========================================= */
.tooltip-container.pos-left {
right: calc(100% + 10px);
top: 50%;
transform:
translateY(-50%)
translateX(6px);
}
.button-sm-group:hover .tooltip-container.pos-left,
.icon-button:hover .tooltip-container.pos-left {
transform:
translateY(-50%)
translateX(0);
}
/* TRIANGLE */
.tooltip-container.pos-left::before {
content: "";
position: absolute;
right: -6px;
top: 50%;
transform: translateY(-50%);
width: 0;
height: 0;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-left: 6px solid var(--color-bg-primary);
}
/* =========================================
POSITION : RIGHT
========================================= */
.tooltip-container.pos-right {
left: calc(100% + 10px);
top: 50%;
transform:
translateY(-50%)
translateX(-6px);
}
.button-sm-group:hover .tooltip-container.pos-right,
.icon-button:hover .tooltip-container.pos-right {
transform:
translateY(-50%)
translateX(0);
}
/* TRIANGLE */
.tooltip-container.pos-right::before {
content: "";
position: absolute;
left: -6px;
top: 50%;
transform: translateY(-50%);
width: 0;
height: 0;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-right: 6px solid var(--color-bg-primary);
}