fix: tooltip on right edge of screen will be left sided now

This commit is contained in:
N1C4T
2026-01-11 00:38:45 +04:00
parent 3c40dc6742
commit a9323835a6
2 changed files with 5 additions and 2 deletions

View File

@@ -66,6 +66,9 @@ export function Tooltip({ tooltip, onMouseEnter, onMouseLeave, setRef }: Tooltip
});
};
const isRightAnchored = typeof window !== 'undefined' && (current.x + 300 > window.innerWidth);
const contentTransform = isRightAnchored ? 'translateX(-278px)' : 'translateX(-22px)';
return (
<div
ref={setRef}
@@ -89,7 +92,7 @@ export function Tooltip({ tooltip, onMouseEnter, onMouseLeave, setRef }: Tooltip
backgroundColor: 'var(--bg-secondary)',
borderLeftColor: 'var(--accent)',
boxShadow: '0 4px 20px rgba(0,0,0,0.2)',
transform: 'translateX(-22px)', // Shift tooltip so arrow aligns with mouse (arrow is at left: 16px + half width)
transform: contentTransform, // Shift tooltip so arrow aligns with mouse
}}
>
<p className="text-[13px] leading-[1.55] text-[var(--text-secondary)] break-words" style={{ wordBreak: 'break-word' }}>

View File

@@ -196,7 +196,7 @@ export const apps: AppData[] = [
{ id: 'davinci-resolve', name: 'DaVinci Resolve', description: 'Professional video editing, color grading, and VFX software', category: 'Creative', iconUrl: si('davinciresolve', '#E52222'), targets: { arch: 'davinci-resolve', nix: 'davinci-resolve' }, unavailableReason: 'Not in most official repos. Use [AUR](https://aur.archlinux.org/packages/davinci-resolve) or download from [blackmagicdesign.com](https://www.blackmagicdesign.com/products/davinciresolve).' },
// GAMING
{ id: 'steam', name: 'Steam', description: 'Largest PC gaming platform and store', category: 'Gaming', iconUrl: si('steam', '#00ADEE'), targets: { ubuntu: 'steam', debian: 'steam-installer', arch: 'steam', fedora: 'steam', opensuse: 'steam', nix: 'steam', flatpak: 'com.valvesoftware.Steam', snap: 'steam', homebrew: '--cask steam' }, unavailableReason: 'Arch requires [multilib](https://wiki.archlinux.org/title/Official_repositories#multilib) enabled first: uncomment `[multilib]` section in `/etc/pacman.conf`, then run `sudo pacman -Sy`, then `sudo pacman -S steam`.' },
{ id: 'steam', name: 'Steam', description: 'Largest PC gaming platform and store', category: 'Gaming', iconUrl: si('steam', '#00ADEE'), targets: { ubuntu: 'steam', debian: 'steam-installer', fedora: 'steam', opensuse: 'steam', nix: 'steam', flatpak: 'com.valvesoftware.Steam', snap: 'steam', homebrew: '--cask steam' }, unavailableReason: 'Arch requires [multilib](https://wiki.archlinux.org/title/Official_repositories#multilib) enabled first: uncomment `[multilib]` section in `/etc/pacman.conf`, then run `sudo pacman -Sy`, then `sudo pacman -S steam`.' },
{ id: 'lutris', name: 'Lutris', description: 'Open gaming platform for all your games', category: 'Gaming', iconUrl: si('lutris', '#FF8F00'), targets: { ubuntu: 'lutris', debian: 'lutris', arch: 'lutris', fedora: 'lutris', opensuse: 'lutris', nix: 'lutris', flatpak: 'net.lutris.Lutris' }, unavailableReason: 'Lutris is not available as a Snap package.' },
{ id: 'heroic', name: 'Heroic', description: 'Open-source Epic Games and GOG launcher', category: 'Gaming', iconUrl: si('heroicgameslauncher', '#7B62E8'), targets: { arch: 'heroic-games-launcher-bin', nix: 'heroic', flatpak: 'com.heroicgameslauncher.hgl', homebrew: '--cask heroic' }, unavailableReason: 'Only available via [AUR](https://aur.archlinux.org/packages/heroic-games-launcher-bin) or [Flatpak](https://flathub.org/apps/details/com.heroicgameslauncher.hgl). see [heroicgameslauncher.com](https://heroicgameslauncher.com/downloads) for more info.' },
{ id: 'prism', name: 'Prism Launcher', description: 'Open-source Minecraft launcher with mod support', category: 'Gaming', iconUrl: 'https://raw.githubusercontent.com/PrismLauncher/PrismLauncher/develop/program_info/org.prismlauncher.PrismLauncher.logo.svg', targets: { arch: 'prismlauncher', nix: 'prismlauncher', flatpak: 'org.prismlauncher.PrismLauncher', homebrew: '--cask prismlauncher' }, unavailableReason: 'Only available via [AUR](https://aur.archlinux.org/packages/prismlauncher) or [Flatpak](https://flathub.org/apps/details/org.prismlauncher.PrismLauncher). see [prismlauncher.org](https://prismlauncher.org/download/) for more info.' },