feat: Video player UI improvements, double click to fullscreen and click to pause

This commit is contained in:
Aleksi Lassila
2023-08-16 13:23:19 +03:00
parent 2db658bfec
commit cd99f4e593
9 changed files with 292 additions and 211 deletions

View File

@@ -74,7 +74,10 @@
style={position === 'fixed'
? `left: ${
fixedPosition.x - (fixedPosition.x > windowWidth / 2 ? menu?.clientWidth : 0)
}px; top: ${fixedPosition.y - (bottom ? (fixedPosition.y > windowHeight / 2 ? menu?.clientHeight : 0) : 0)}px;`
}px; top: ${
fixedPosition.y -
(bottom ? (fixedPosition.y > windowHeight / 2 ? menu?.clientHeight : 0) : 0)
}px;`
: menu?.getBoundingClientRect()?.left > windowWidth / 2
? `right: 0;${bottom ? 'bottom: 40px;' : ''}`
: `left: 0;${bottom ? 'bottom: 40px;' : ''}`}

View File

@@ -0,0 +1,22 @@
<script lang="ts">
import classNames from 'classnames';
import { Check } from 'radix-icons-svelte';
import ContextMenuItem from './ContextMenuItem.svelte';
export let selected = false;
</script>
<ContextMenuItem on:click>
<div class="flex items-center gap-2 justify-between cursor-pointer">
<Check
size={20}
class={classNames({
'opacity-0': !selected,
'opacity-100': selected
})}
/>
<div class="flex items-center text-left w-32">
<slot />
</div>
</div>
</ContextMenuItem>

View File

@@ -1,19 +0,0 @@
<script lang="ts">
import classNames from 'classnames';
import { Check } from "radix-icons-svelte";
import ContextMenuItem from "./ContextMenuItem.svelte";
export let selected = false;
</script>
<ContextMenuItem on:click>
<div class="flex items-center justify-between cursor-pointer">
<Check size={20} class={classNames('mr-4', {
'opacity-0': !selected,
'opacity-100': selected
})} />
<div class="flex items-center text-left w-32">
<slot />
</div>
</div>
</ContextMenuItem>