Skip to content

Commit

Permalink
Merge pull request marcoaaguiar#125 from rxl3/main
Browse files Browse the repository at this point in the history
Fix mobile tooltip formatting
  • Loading branch information
marcoaaguiar authored Dec 3, 2024
2 parents 1efab69 + 55532dc commit 72f9238
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@
if (tooltipTopInContainer < 0) {
tooltipY += -tooltipTopInContainer + 20;
}
if (tooltipRect.x >= containerRect.x) {
tooltipX = 0;
}
}
}
Expand Down Expand Up @@ -372,7 +376,7 @@
// Add event listeners for global mouse events to handle panning
onMount(() => {
const checkScreenSize = () => {
if (window.innerWidth <= 768) {
if (window.innerWidth < 768) {
sidebarVisable = false;
} else {
sidebarVisable = true;
Expand Down Expand Up @@ -438,7 +442,7 @@
>
<!-- Left Sidebar -->
<aside
class={`h-full grid grid-cols-1 ${sidebarVisable ? 'bg-[#111]' : 'absolute'} grid-rows-[auto_auto_auto_1fr] gap-2 p-2 min-h-0`}
class={`h-full grid grid-cols-1 ${sidebarVisable ? 'bg-[#111]' : 'absolute'} grid-rows-[auto_auto_auto_1fr] gap-2 p-2 min-h-0 z-20`}
>
<!-- Toggle Button for Aside -->
<button
Expand Down Expand Up @@ -587,6 +591,15 @@
</div>
{/if}
</aside>
{#if sidebarVisable}
<button
class="md:hidden fixed h-svh w-svw outline-none border-none z-10"
aria-label="collapse sidebar alt"
onclick={() => {
sidebarVisable = false;
}}
></button>
{/if}
<!-- Tree View -->
<div class="bg-black">
<!-- Skill Tree Container -->
Expand Down Expand Up @@ -666,7 +679,7 @@
<div
bind:this={tooltipEl}
class="absolute w-[400px] pointer-events-none"
style="left: {tooltipX}px; top: {tooltipY}px;"
style="left: {tooltipX}px; top: {tooltipY}px; max-width: calc(100%-40px)"
>
<TreeNodeTooltip node={tooltipNode} />
</div>
Expand Down

0 comments on commit 72f9238

Please sign in to comment.