2021-09-09 07:34:51 +00:00
|
|
|
<!--
|
|
|
|
// Copyright © 2020 Anticrm Platform Contributors.
|
|
|
|
//
|
|
|
|
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License. You may
|
|
|
|
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
//
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
-->
|
|
|
|
<script lang="ts">
|
2021-12-07 12:14:24 +00:00
|
|
|
import { afterUpdate, onDestroy } from 'svelte'
|
2022-06-27 14:42:23 +00:00
|
|
|
import { resizeObserver } from '../resize'
|
2022-06-22 13:27:10 +00:00
|
|
|
import { closeTooltip, tooltipstore as tooltip } from '../tooltips'
|
|
|
|
import type { TooltipAlignment } from '../types'
|
|
|
|
import Component from './Component.svelte'
|
2021-09-09 07:34:51 +00:00
|
|
|
import Label from './Label.svelte'
|
|
|
|
|
|
|
|
let tooltipHTML: HTMLElement
|
2021-12-07 12:14:24 +00:00
|
|
|
let nubHTML: HTMLElement
|
2022-04-14 06:07:07 +00:00
|
|
|
let dir: TooltipAlignment
|
2021-09-27 08:06:05 +00:00
|
|
|
let rect: DOMRect
|
2021-11-25 11:09:37 +00:00
|
|
|
let rectAnchor: DOMRect
|
2021-11-04 11:17:36 +00:00
|
|
|
let tooltipSW: boolean // tooltipSW = true - Label; false - Component
|
2021-12-07 12:14:24 +00:00
|
|
|
let nubDirection: 'top' | 'bottom' | 'left' | 'right' | undefined = undefined
|
|
|
|
let clWidth: number
|
2022-06-16 01:25:49 +00:00
|
|
|
let docWidth: number
|
|
|
|
let docHeight: number
|
2021-09-09 07:34:51 +00:00
|
|
|
|
2022-06-16 01:25:49 +00:00
|
|
|
$: tooltipSW = !$tooltip.component && $tooltip.kind !== 'submenu'
|
2022-03-29 14:29:53 +00:00
|
|
|
$: onUpdate = $tooltip.onUpdate
|
2022-06-16 01:25:49 +00:00
|
|
|
$: kind = $tooltip.kind
|
|
|
|
|
|
|
|
const clearStyles = (): void => {
|
|
|
|
tooltipHTML.style.top =
|
|
|
|
tooltipHTML.style.bottom =
|
|
|
|
tooltipHTML.style.left =
|
|
|
|
tooltipHTML.style.right =
|
|
|
|
tooltipHTML.style.height =
|
|
|
|
''
|
|
|
|
}
|
2021-12-07 12:14:24 +00:00
|
|
|
|
|
|
|
const fitTooltip = (): void => {
|
2021-11-25 11:09:37 +00:00
|
|
|
if (($tooltip.label || $tooltip.component) && tooltipHTML) {
|
2021-09-09 07:34:51 +00:00
|
|
|
if ($tooltip.element) {
|
2021-11-25 11:09:37 +00:00
|
|
|
rect = $tooltip.element.getBoundingClientRect()
|
2022-02-15 09:06:05 +00:00
|
|
|
rectAnchor = $tooltip.anchor
|
|
|
|
? $tooltip.anchor.getBoundingClientRect()
|
|
|
|
: $tooltip.element.getBoundingClientRect()
|
2021-09-09 07:34:51 +00:00
|
|
|
|
2021-09-27 08:06:05 +00:00
|
|
|
if ($tooltip.component) {
|
2022-06-16 01:25:49 +00:00
|
|
|
clearStyles()
|
|
|
|
if (rect.bottom + tooltipHTML.clientHeight + 28 < docHeight) {
|
2021-12-07 12:14:24 +00:00
|
|
|
tooltipHTML.style.top = `calc(${rect.bottom}px + 5px + .25rem)`
|
2021-09-27 08:06:05 +00:00
|
|
|
dir = 'bottom'
|
2022-06-16 01:25:49 +00:00
|
|
|
} else if (rect.top > docHeight - rect.bottom) {
|
|
|
|
tooltipHTML.style.bottom = `calc(${docHeight - rect.y}px + 5px + .25rem)`
|
2021-12-07 12:14:24 +00:00
|
|
|
if (tooltipHTML.clientHeight > rect.top - 28) {
|
2021-09-27 08:06:05 +00:00
|
|
|
tooltipHTML.style.top = '1rem'
|
2021-12-10 09:39:58 +00:00
|
|
|
tooltipHTML.style.height = `calc(${rect.top}px - 5px - 1.25rem)`
|
2021-09-27 08:06:05 +00:00
|
|
|
}
|
|
|
|
dir = 'top'
|
|
|
|
} else {
|
2021-12-07 12:14:24 +00:00
|
|
|
tooltipHTML.style.top = `calc(${rect.bottom}px + 5px + .25rem)`
|
2022-06-16 01:25:49 +00:00
|
|
|
if (tooltipHTML.clientHeight > docHeight - rect.bottom - 28) {
|
2021-09-27 08:06:05 +00:00
|
|
|
tooltipHTML.style.bottom = '1rem'
|
2022-06-16 01:25:49 +00:00
|
|
|
tooltipHTML.style.height = `calc(${docHeight - rect.bottom}px - 5px - 1.25rem)`
|
2021-09-27 08:06:05 +00:00
|
|
|
}
|
|
|
|
dir = 'bottom'
|
|
|
|
}
|
2021-12-07 12:14:24 +00:00
|
|
|
|
2021-12-24 09:06:34 +00:00
|
|
|
const tempLeft = rect.width / 2 + rect.left - clWidth / 2
|
2022-06-16 01:25:49 +00:00
|
|
|
if (tempLeft + clWidth > docWidth - 8) tooltipHTML.style.right = '.5rem'
|
2021-12-24 09:06:34 +00:00
|
|
|
else if (tempLeft < 8) tooltipHTML.style.left = '.5rem'
|
|
|
|
else tooltipHTML.style.left = `${tempLeft}px`
|
2021-12-07 12:14:24 +00:00
|
|
|
|
|
|
|
if (nubHTML) {
|
|
|
|
nubHTML.style.top = rect.top + 'px'
|
|
|
|
nubHTML.style.left = rect.left + 'px'
|
|
|
|
nubHTML.style.width = rect.width + 'px'
|
|
|
|
nubHTML.style.height = rect.height + 'px'
|
|
|
|
nubDirection = dir
|
2021-09-27 08:06:05 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (!$tooltip.direction) {
|
2022-06-16 01:25:49 +00:00
|
|
|
if (rectAnchor.right < docWidth / 5) dir = 'right'
|
|
|
|
else if (rectAnchor.left > docWidth - docWidth / 5) dir = 'left'
|
2021-11-25 11:09:37 +00:00
|
|
|
else if (rectAnchor.top < tooltipHTML.clientHeight) dir = 'bottom'
|
2021-09-27 08:06:05 +00:00
|
|
|
else dir = 'top'
|
|
|
|
} else dir = $tooltip.direction
|
|
|
|
|
|
|
|
if (dir === 'right') {
|
2021-11-25 11:09:37 +00:00
|
|
|
tooltipHTML.style.top = rectAnchor.y + rectAnchor.height / 2 + 'px'
|
|
|
|
tooltipHTML.style.left = `calc(${rectAnchor.right}px + .75rem)`
|
2021-09-27 08:06:05 +00:00
|
|
|
tooltipHTML.style.transform = 'translateY(-50%)'
|
|
|
|
} else if (dir === 'left') {
|
2021-11-25 11:09:37 +00:00
|
|
|
tooltipHTML.style.top = rectAnchor.y + rectAnchor.height / 2 + 'px'
|
2022-06-16 01:25:49 +00:00
|
|
|
tooltipHTML.style.right = `calc(${docWidth - rectAnchor.x}px + .75rem)`
|
2021-09-27 08:06:05 +00:00
|
|
|
tooltipHTML.style.transform = 'translateY(-50%)'
|
|
|
|
} else if (dir === 'bottom') {
|
2021-11-25 11:09:37 +00:00
|
|
|
tooltipHTML.style.top = `calc(${rectAnchor.bottom}px + .5rem)`
|
|
|
|
tooltipHTML.style.left = rectAnchor.x + rectAnchor.width / 2 + 'px'
|
2021-09-27 08:06:05 +00:00
|
|
|
tooltipHTML.style.transform = 'translateX(-50%)'
|
|
|
|
} else if (dir === 'top') {
|
2022-06-16 01:25:49 +00:00
|
|
|
tooltipHTML.style.bottom = `calc(${docHeight - rectAnchor.y}px + .75rem)`
|
2021-11-25 11:09:37 +00:00
|
|
|
tooltipHTML.style.left = rectAnchor.x + rectAnchor.width / 2 + 'px'
|
2021-09-27 08:06:05 +00:00
|
|
|
tooltipHTML.style.transform = 'translateX(-50%)'
|
|
|
|
}
|
|
|
|
tooltipHTML.classList.remove('no-arrow')
|
2021-09-09 07:34:51 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
tooltipHTML.style.top = '50%'
|
|
|
|
tooltipHTML.style.left = '50%'
|
|
|
|
tooltipHTML.style.width = 'min-content'
|
|
|
|
tooltipHTML.style.height = 'min-content'
|
|
|
|
tooltipHTML.style.transform = 'translate(-50%, -50%)'
|
|
|
|
tooltipHTML.classList.add('no-arrow')
|
|
|
|
}
|
|
|
|
tooltipHTML.style.visibility = 'visible'
|
|
|
|
} else if (tooltipHTML) tooltipHTML.style.visibility = 'hidden'
|
|
|
|
}
|
2021-09-27 08:06:05 +00:00
|
|
|
|
2022-06-16 01:25:49 +00:00
|
|
|
const fitSubmenu = (): void => {
|
|
|
|
if (($tooltip.label || $tooltip.component) && tooltipHTML) {
|
|
|
|
clearStyles()
|
|
|
|
if ($tooltip.element) {
|
|
|
|
rect = $tooltip.element.getBoundingClientRect()
|
|
|
|
const rectP = tooltipHTML.getBoundingClientRect()
|
|
|
|
const dirH =
|
|
|
|
docWidth - rect.right - rectP.width - 16 > 0 ? 'right' : rect.left > docWidth - rect.right ? 'left' : 'right'
|
|
|
|
const dirV =
|
|
|
|
docHeight - rect.top - rectP.height - 16 > 0
|
|
|
|
? 'bottom'
|
|
|
|
: rect.bottom > docHeight - rect.top
|
|
|
|
? 'top'
|
|
|
|
: 'bottom'
|
|
|
|
if (dirH === 'right') tooltipHTML.style.left = rect.right - 4 + 'px'
|
|
|
|
else tooltipHTML.style.right = docWidth - rect.left - 4 + 'px'
|
|
|
|
if (dirV === 'bottom') tooltipHTML.style.top = rect.top - 4 + 'px'
|
|
|
|
else tooltipHTML.style.bottom = docHeight - rect.bottom - 4 + 'px'
|
|
|
|
tooltipHTML.style.visibility = 'visible'
|
|
|
|
}
|
|
|
|
} else if (tooltipHTML) tooltipHTML.style.visibility = 'hidden'
|
|
|
|
}
|
|
|
|
|
2021-09-27 08:06:05 +00:00
|
|
|
const hideTooltip = (): void => {
|
2021-12-17 09:06:08 +00:00
|
|
|
if (tooltipHTML) tooltipHTML.style.visibility = 'hidden'
|
2021-09-27 08:06:05 +00:00
|
|
|
closeTooltip()
|
|
|
|
}
|
|
|
|
|
|
|
|
const whileShow = (ev: MouseEvent): void => {
|
2021-11-25 11:09:37 +00:00
|
|
|
if ($tooltip.element && tooltipHTML) {
|
2021-09-27 08:06:05 +00:00
|
|
|
const rectP = tooltipHTML.getBoundingClientRect()
|
2022-06-16 01:25:49 +00:00
|
|
|
const dT: number = dir === 'bottom' && $tooltip.kind !== 'submenu' ? 12 : 0
|
|
|
|
const dB: number = dir === 'top' && $tooltip.kind !== 'submenu' ? 12 : 0
|
2021-11-25 11:09:37 +00:00
|
|
|
const inTrigger: boolean = ev.x >= rect.left && ev.x <= rect.right && ev.y >= rect.top && ev.y <= rect.bottom
|
|
|
|
const inPopup: boolean =
|
|
|
|
ev.x >= rectP.left && ev.x <= rectP.right && ev.y >= rectP.top - dT && ev.y <= rectP.bottom + dB
|
2022-05-05 08:29:46 +00:00
|
|
|
|
2022-06-16 01:25:49 +00:00
|
|
|
if ((tooltipSW && !inTrigger) || !(inTrigger || inPopup)) hideTooltip()
|
2021-09-27 08:06:05 +00:00
|
|
|
}
|
|
|
|
}
|
2021-12-07 12:14:24 +00:00
|
|
|
|
2022-06-16 01:25:49 +00:00
|
|
|
afterUpdate(() => (kind === 'submenu' ? fitSubmenu() : fitTooltip()))
|
2021-12-07 12:14:24 +00:00
|
|
|
onDestroy(() => hideTooltip())
|
2021-09-09 07:34:51 +00:00
|
|
|
</script>
|
|
|
|
|
2022-02-15 09:06:05 +00:00
|
|
|
<svelte:window
|
2022-06-16 01:25:49 +00:00
|
|
|
bind:innerWidth={docWidth}
|
|
|
|
bind:innerHeight={docHeight}
|
2022-02-15 09:06:05 +00:00
|
|
|
on:resize={hideTooltip}
|
|
|
|
on:mousemove={(ev) => {
|
|
|
|
whileShow(ev)
|
|
|
|
}}
|
2022-05-12 04:10:52 +00:00
|
|
|
on:keydown={(evt) => {
|
|
|
|
if (($tooltip.component || $tooltip.label) && evt.key === 'Escape') {
|
|
|
|
evt.preventDefault()
|
|
|
|
evt.stopImmediatePropagation()
|
|
|
|
hideTooltip()
|
|
|
|
}
|
|
|
|
}}
|
2022-02-15 09:06:05 +00:00
|
|
|
/>
|
2022-06-16 01:25:49 +00:00
|
|
|
{#if $tooltip.component && $tooltip.kind !== 'submenu'}
|
2022-06-27 14:42:23 +00:00
|
|
|
<div
|
|
|
|
class="popup-tooltip"
|
|
|
|
class:doublePadding={$tooltip.label}
|
|
|
|
use:resizeObserver={(element) => {
|
|
|
|
clWidth = element.clientWidth
|
|
|
|
}}
|
|
|
|
bind:this={tooltipHTML}
|
|
|
|
>
|
2022-02-15 09:06:05 +00:00
|
|
|
{#if $tooltip.label}<div class="fs-title mb-4">
|
|
|
|
<Label label={$tooltip.label} params={$tooltip.props ?? {}} />
|
|
|
|
</div>{/if}
|
2022-04-29 05:27:17 +00:00
|
|
|
{#if typeof $tooltip.component === 'string'}
|
|
|
|
<Component
|
|
|
|
is={$tooltip.component}
|
|
|
|
props={$tooltip.props}
|
|
|
|
on:update={onUpdate !== undefined ? onUpdate : async () => {}}
|
|
|
|
/>
|
|
|
|
{:else}
|
|
|
|
<svelte:component
|
|
|
|
this={$tooltip.component}
|
|
|
|
{...$tooltip.props}
|
|
|
|
on:update={onUpdate !== undefined ? onUpdate : async () => {}}
|
|
|
|
/>
|
|
|
|
{/if}
|
2021-09-27 08:06:05 +00:00
|
|
|
</div>
|
2021-12-07 12:14:24 +00:00
|
|
|
<div bind:this={nubHTML} class="nub {nubDirection ?? ''}" />
|
2022-06-16 01:25:49 +00:00
|
|
|
{:else if $tooltip.label && $tooltip.kind !== 'submenu'}
|
2021-12-07 12:14:24 +00:00
|
|
|
<div class="tooltip {dir ?? ''}" bind:this={tooltipHTML}>
|
2022-02-15 09:06:05 +00:00
|
|
|
<Label label={$tooltip.label} params={$tooltip.props ?? {}} />
|
2021-09-09 07:34:51 +00:00
|
|
|
</div>
|
2022-06-16 01:25:49 +00:00
|
|
|
{:else if $tooltip.kind === 'submenu'}
|
2022-06-27 14:42:23 +00:00
|
|
|
<div
|
|
|
|
class="submenu-container {dir ?? ''}"
|
|
|
|
use:resizeObserver={(element) => {
|
|
|
|
clWidth = element.clientWidth
|
|
|
|
}}
|
|
|
|
bind:this={tooltipHTML}
|
|
|
|
>
|
2022-06-16 01:25:49 +00:00
|
|
|
{#if typeof $tooltip.component === 'string'}
|
|
|
|
<Component
|
|
|
|
is={$tooltip.component}
|
|
|
|
props={$tooltip.props}
|
|
|
|
on:update={onUpdate !== undefined ? onUpdate : async () => {}}
|
|
|
|
/>
|
|
|
|
{:else}
|
|
|
|
<svelte:component
|
|
|
|
this={$tooltip.component}
|
|
|
|
{...$tooltip.props}
|
|
|
|
on:update={onUpdate !== undefined ? onUpdate : async () => {}}
|
|
|
|
/>
|
|
|
|
{/if}
|
|
|
|
</div>
|
2021-09-09 07:34:51 +00:00
|
|
|
{/if}
|
|
|
|
|
|
|
|
<style lang="scss">
|
2022-06-16 01:25:49 +00:00
|
|
|
.submenu-container {
|
|
|
|
position: fixed;
|
|
|
|
width: auto;
|
|
|
|
height: auto;
|
|
|
|
border-radius: 0.5rem;
|
|
|
|
z-index: 10000;
|
|
|
|
}
|
2022-02-02 09:05:33 +00:00
|
|
|
.popup-tooltip {
|
2021-12-10 09:39:58 +00:00
|
|
|
overflow: hidden;
|
2021-09-27 08:06:05 +00:00
|
|
|
position: fixed;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2022-05-05 08:29:46 +00:00
|
|
|
padding: 0.5rem;
|
2022-07-07 02:21:30 +00:00
|
|
|
max-width: 50vw;
|
2022-05-05 08:29:46 +00:00
|
|
|
color: var(--caption-color);
|
|
|
|
background-color: var(--accent-bg-color);
|
|
|
|
border: 1px solid var(--divider-color);
|
2022-02-15 09:06:05 +00:00
|
|
|
border-radius: 0.75rem;
|
2022-05-17 10:04:07 +00:00
|
|
|
box-shadow: var(--popup-aside-shadow);
|
2021-09-27 08:06:05 +00:00
|
|
|
user-select: none;
|
2021-11-19 06:09:42 +00:00
|
|
|
z-index: 10000;
|
2022-05-05 08:29:46 +00:00
|
|
|
|
|
|
|
&.doublePadding {
|
|
|
|
padding: 1rem;
|
|
|
|
}
|
2021-09-27 08:06:05 +00:00
|
|
|
}
|
|
|
|
|
2021-12-07 12:14:24 +00:00
|
|
|
.nub {
|
|
|
|
position: fixed;
|
|
|
|
// background-color: rgba(255, 255, 0, .5);
|
|
|
|
user-select: none;
|
2021-12-09 09:09:35 +00:00
|
|
|
pointer-events: none;
|
2021-12-07 12:14:24 +00:00
|
|
|
z-index: 10000;
|
|
|
|
|
2022-02-15 09:06:05 +00:00
|
|
|
&::after,
|
|
|
|
&::before {
|
2021-12-07 12:14:24 +00:00
|
|
|
position: absolute;
|
|
|
|
width: 18px;
|
|
|
|
height: 7px;
|
|
|
|
}
|
|
|
|
&::before {
|
2022-05-05 08:29:46 +00:00
|
|
|
background-color: var(--accent-bg-color);
|
2022-02-15 09:06:05 +00:00
|
|
|
clip-path: url('#nub-bg');
|
2021-12-07 12:14:24 +00:00
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
&::after {
|
2022-05-05 08:29:46 +00:00
|
|
|
background-color: var(--divider-color);
|
2022-02-15 09:06:05 +00:00
|
|
|
clip-path: url('#nub-border');
|
2021-12-07 12:14:24 +00:00
|
|
|
z-index: 2;
|
|
|
|
}
|
|
|
|
|
2022-02-15 09:06:05 +00:00
|
|
|
&.top::after,
|
|
|
|
&.bottom::after,
|
|
|
|
&.top::before,
|
|
|
|
&.bottom::before,
|
|
|
|
&.right::after,
|
|
|
|
&.left::after,
|
|
|
|
&.right::before,
|
|
|
|
&.left::before {
|
|
|
|
content: '';
|
|
|
|
}
|
|
|
|
&.top::after,
|
|
|
|
&.bottom::after,
|
|
|
|
&.top::before,
|
|
|
|
&.bottom::before {
|
2021-12-07 12:14:24 +00:00
|
|
|
left: 50%;
|
|
|
|
margin-left: -9px;
|
|
|
|
}
|
2022-02-15 09:06:05 +00:00
|
|
|
&.top::after,
|
|
|
|
&.top::before {
|
|
|
|
top: calc(-7px - 0.25rem);
|
2021-12-07 12:14:24 +00:00
|
|
|
transform: rotate(180deg);
|
|
|
|
}
|
2022-02-15 09:06:05 +00:00
|
|
|
&.bottom::after,
|
|
|
|
&.bottom::before {
|
|
|
|
bottom: calc(-7px - 0.25rem);
|
2021-12-07 12:14:24 +00:00
|
|
|
}
|
|
|
|
|
2022-02-15 09:06:05 +00:00
|
|
|
&.right::after,
|
|
|
|
&.left::after,
|
|
|
|
&.right::before,
|
|
|
|
&.left::before {
|
2021-12-07 12:14:24 +00:00
|
|
|
top: 50%;
|
|
|
|
margin-top: -9px;
|
|
|
|
}
|
2022-02-15 09:06:05 +00:00
|
|
|
&.left::after,
|
|
|
|
&.left::before {
|
2021-12-07 12:14:24 +00:00
|
|
|
transform-origin: left top;
|
2022-02-15 09:06:05 +00:00
|
|
|
left: -0.25rem;
|
2021-12-07 12:14:24 +00:00
|
|
|
transform: rotate(90deg);
|
|
|
|
}
|
2022-02-15 09:06:05 +00:00
|
|
|
&.right::after,
|
|
|
|
&.right::before {
|
2021-12-07 12:14:24 +00:00
|
|
|
transform-origin: right top;
|
2022-02-15 09:06:05 +00:00
|
|
|
right: -0.25rem;
|
2021-12-07 12:14:24 +00:00
|
|
|
transform: rotate(-90deg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-09 07:34:51 +00:00
|
|
|
.tooltip {
|
|
|
|
position: fixed;
|
2022-02-15 09:06:05 +00:00
|
|
|
padding: 0.5rem 0.75rem;
|
2021-12-07 12:14:24 +00:00
|
|
|
text-align: center;
|
2022-05-05 08:29:46 +00:00
|
|
|
color: var(--caption-color);
|
|
|
|
background-color: var(--accent-bg-color);
|
|
|
|
border: 1px solid var(--divider-color);
|
2022-02-15 09:06:05 +00:00
|
|
|
border-radius: 0.75rem;
|
2022-05-17 10:04:07 +00:00
|
|
|
box-shadow: var(--popup-aside-shadow);
|
2021-09-09 07:34:51 +00:00
|
|
|
user-select: none;
|
2021-11-19 06:09:42 +00:00
|
|
|
z-index: 10000;
|
2021-09-09 07:34:51 +00:00
|
|
|
|
2022-02-15 09:06:05 +00:00
|
|
|
&::after,
|
|
|
|
&::before {
|
2021-09-09 07:34:51 +00:00
|
|
|
content: '';
|
|
|
|
position: absolute;
|
2021-12-07 12:14:24 +00:00
|
|
|
width: 18px;
|
|
|
|
height: 7px;
|
|
|
|
}
|
|
|
|
&::before {
|
2022-05-05 08:29:46 +00:00
|
|
|
background-color: var(--accent-bg-color);
|
2022-02-15 09:06:05 +00:00
|
|
|
clip-path: url('#nub-bg');
|
2021-12-07 12:14:24 +00:00
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
&::after {
|
2022-05-05 08:29:46 +00:00
|
|
|
background-color: var(--divider-color);
|
2022-02-15 09:06:05 +00:00
|
|
|
clip-path: url('#nub-border');
|
2021-12-07 12:14:24 +00:00
|
|
|
z-index: 2;
|
2021-09-09 07:34:51 +00:00
|
|
|
}
|
|
|
|
|
2022-02-15 09:06:05 +00:00
|
|
|
&.top::after,
|
|
|
|
&.bottom::after,
|
|
|
|
&.top::before,
|
|
|
|
&.bottom::before {
|
2021-09-09 07:34:51 +00:00
|
|
|
left: 50%;
|
2021-12-07 12:14:24 +00:00
|
|
|
margin-left: -9px;
|
2021-09-09 07:34:51 +00:00
|
|
|
}
|
|
|
|
&.top {
|
|
|
|
bottom: 100%;
|
2022-02-15 09:06:05 +00:00
|
|
|
&::after,
|
|
|
|
&::before {
|
2022-05-05 08:29:46 +00:00
|
|
|
bottom: -6px;
|
2021-12-07 12:14:24 +00:00
|
|
|
transform: rotate(180deg);
|
2021-09-09 07:34:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
&.bottom {
|
|
|
|
top: 100%;
|
2022-02-15 09:06:05 +00:00
|
|
|
&::after,
|
|
|
|
&::before {
|
2021-12-07 12:14:24 +00:00
|
|
|
top: -7px;
|
2021-09-09 07:34:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-15 09:06:05 +00:00
|
|
|
&.right::after,
|
|
|
|
&.left::after,
|
|
|
|
&.right::before,
|
|
|
|
&.left::before {
|
2021-09-09 07:34:51 +00:00
|
|
|
top: 50%;
|
2021-12-07 12:14:24 +00:00
|
|
|
margin-top: -9px;
|
2021-09-09 07:34:51 +00:00
|
|
|
}
|
|
|
|
&.right {
|
|
|
|
left: 100%;
|
2022-02-15 09:06:05 +00:00
|
|
|
&::after,
|
|
|
|
&::before {
|
2021-12-07 12:14:24 +00:00
|
|
|
transform-origin: right top;
|
2022-05-12 11:29:49 +00:00
|
|
|
left: -24px;
|
2021-12-07 12:14:24 +00:00
|
|
|
transform: rotate(-90deg);
|
2021-09-09 07:34:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
&.left {
|
|
|
|
right: 100%;
|
2022-02-15 09:06:05 +00:00
|
|
|
&::after,
|
|
|
|
&::before {
|
2021-12-07 12:14:24 +00:00
|
|
|
transform-origin: left top;
|
2022-05-12 11:29:49 +00:00
|
|
|
right: -24px;
|
2021-12-07 12:14:24 +00:00
|
|
|
transform: rotate(90deg);
|
2021-09-09 07:34:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.no-arrow {
|
2022-02-15 09:06:05 +00:00
|
|
|
box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.75);
|
|
|
|
&::after,
|
|
|
|
&::before {
|
2021-09-09 07:34:51 +00:00
|
|
|
content: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|