From ab0924d80317b3a3d4e9ab8fe9c24aaf75cb59a0 Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Mon, 29 May 2023 00:05:43 -0600 Subject: [PATCH] Add tooltips --- .../static/css/tirefire/_tooltips.scss | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 projects/tentacles/src/python/tentacles/static/css/tirefire/_tooltips.scss diff --git a/projects/tentacles/src/python/tentacles/static/css/tirefire/_tooltips.scss b/projects/tentacles/src/python/tentacles/static/css/tirefire/_tooltips.scss new file mode 100644 index 0000000..9e0a26b --- /dev/null +++ b/projects/tentacles/src/python/tentacles/static/css/tirefire/_tooltips.scss @@ -0,0 +1,90 @@ +@import "tirefire/colors"; + +.tooltip { + position: relative; + + align-items: center; + justify-content: center; + flex-direction: column; +} + +.tooltip::after { + background-color: $secondary_light_grey; + border-radius: 2px; + color: $black; + display: none; + padding: 10px 15px; + position: absolute; + text-align: center; + z-index: 999; +} + +.tooltip::before { + background-color: $secondary_light_grey; + content: ' '; + display: none; + position: absolute; + width: 15px; + height: 15px; + z-index: 999; +} + +.tooltip:hover::after { + display: block; +} + +.tooltip:hover::before { + display: block; +} + +.tooltip.top::after { + content: attr(data-text); + top: 0; + left: 50%; + transform: translate(-50%, calc(-100% - 10px)); +} + +.tooltip.top::before { + top: 0; + left: 50%; + transform: translate(-50%, calc(-100% - 5px)) rotate(45deg); +} + +.tooltip.bottom::after { + content: attr(data-text);; + bottom: 0; + left: 50%; + transform: translate(-50%, calc(100% + 10px)); +} + +.tooltip.bottom::before { + bottom: 0; + left: 50%; + transform: translate(-50%, calc(100% + 5px)) rotate(45deg); +} + +.tooltip.right::after { + content: attr(data-text);; + top: 0; + right: 0; + transform: translateX(calc(100% + 10px)) translateY(calc(-50% + 10px)); +} + +.tooltip.right::before { + top: 50%; + right: 0; + transform: translate(calc(100% + 5px), -50%) rotate(45deg); +} + +.tooltip.left::after { + content: attr(data-text);; + top: 0; + left: 0; + transform: translateX(calc(-100% - 10px)) translateY(calc(-50% + 10px)); +} + +.tooltip.left::before { + top: 50%; + left: 0; + transform: translate(calc(-100% - 5px), -50%) rotate(45deg); +}