show ctrl shortcuts for safari, closes #31

This commit is contained in:
vcoppe
2024-07-26 11:40:18 +02:00
parent a3f692f969
commit cfc537a59c

View File

@@ -8,14 +8,16 @@
export let click: boolean = false;
let isMac = false;
let isSafari = false;
onMount(() => {
isMac = navigator.userAgent.toUpperCase().indexOf('MAC') >= 0;
isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
});
</script>
<span class="ml-auto pl-2 text-xs tracking-widest text-muted-foreground"
>{shift ? '⇧' : ''}{ctrl ? (isMac ? '⌘' : $_('menu.ctrl') + '+') : ''}{key}{click
>{shift ? '⇧' : ''}{ctrl ? (isMac && !isSafari ? '⌘' : $_('menu.ctrl') + '+') : ''}{key}{click
? $_('menu.click')
: ''}</span
>