Skip to content

Commit c8f6dd8

Browse files
committed
refactor: focus styles
1 parent 70fdad3 commit c8f6dd8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/routes/[id]/components/trimmer.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<Resizable
1414
className={{
15-
root: `group h-10 bg-white/5 border-2 border-white/10 rounded-lg absolute ring ring-transparent ring-offset-0 [&.current-trim]:bg-blue-700/20 [&.current-trim]:border-blue-700/50 [&.current-trim]:focus-within:ring-blue-700/30 hover:bg-blue-700/20 hover:border-blue-700/50 has-[:active]:bg-blue-700/20 has-[:active]:border-blue-700/50 focus-within:ring-white/5 focus-within:hover:ring-blue-700/30 hover:z-10 ${
15+
root: `group h-10 bg-white/5 border-2 border-white/10 rounded-lg absolute ring ring-transparent ring-offset-0 [&.current-trim]:bg-blue-700/20 [&.current-trim]:border-blue-700/50 [&.current-trim]:focus-within:ring-blue-700/20 hover:bg-blue-700/20 hover:border-blue-700/50 has-[:active]:bg-blue-700/20 has-[:active]:border-blue-700/50 focus-within:ring-white/5 focus-within:hover:ring-blue-700/20 hover:z-10 ${
1616
$videoStatus.currentTime >= $edits.startAt && $videoStatus.currentTime <= $edits.endAt
1717
? 'current-trim'
1818
: ''

src/routes/[id]/components/zoom-list.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
{@const prevZoom = idx === 0 ? null : $zooms.at(idx - 1)}
1515
<Resizable
1616
className={{
17-
root: `group h-10 bg-white/5 border-2 border-white/10 rounded-lg absolute ring ring-transparent ring-offset-0 [&.current-zoom]:bg-emerald-800/30 [&.current-zoom]:border-emerald-800/80 [&.current-zoom]:focus-within:ring-emerald-800/30 hover:bg-emerald-800/30 hover:border-emerald-800/80 has-[:active]:bg-emerald-800/30 has-[:active]:border-emerald-800/80 focus-within:ring-white/5 focus-within:hover:ring-emerald-800/30 ${
17+
root: `group h-10 bg-white/5 border-2 border-white/10 rounded-lg absolute ring ring-transparent ring-offset-0 [&.current-zoom]:bg-emerald-800/30 [&.current-zoom]:border-emerald-800/80 [&.current-zoom]:focus-within:ring-emerald-800/30 hover:bg-emerald-800/30 hover:border-emerald-800/80 has-[:active]:bg-emerald-800/30 has-[:active]:border-emerald-800/80 focus-within:ring-white/5 focus-within:hover:ring-emerald-800/30 focus-within:active:ring-emerald-800/30 ${
1818
$videoStatus.currentTime >= zoom.start && $videoStatus.currentTime <= zoom.end
1919
? 'current-zoom'
2020
: ''
2121
}`,
2222
handle:
23-
'h-full absolute cursor-ew-resize hidden z-10 group-hover:block group-active:visible group-[.current-zoom]:block group-has-[:active]:block',
23+
'h-full absolute cursor-ew-resize z-10 opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto group-active:opacity-100 group-active:pointer-events-auto group-[.current-zoom]:opacity-100 group-[.current-zoom]:pointer-events-auto group-[.current-zoom]:has-[:active]:!opacity-100 group-[.current-zoom]:has-[:active]:!pointer-events-auto group-has-[:active]:opacity-100 group-has-[:active]:pointer-events-auto',
2424
handleW: '-left-[12px]',
2525
handleE: '-right-[12px]'
2626
}}
@@ -104,7 +104,7 @@
104104
const currentZoom = document.querySelector('.current-zoom');
105105
const handles = currentZoom?.querySelectorAll('button');
106106

107-
handles?.forEach((e) => e.classList.add('invisible'));
107+
handles?.forEach((e) => e.classList.add('!opacity-0', '!pointer-events-none'));
108108
}}
109109
on:mouseleave={({ detail }) => {
110110
const { e } = detail;
@@ -114,7 +114,7 @@
114114
const currentZoom = document.querySelector('.current-zoom');
115115
const handles = currentZoom?.querySelectorAll('button');
116116

117-
handles?.forEach((e) => e.classList.remove('invisible'));
117+
handles?.forEach((e) => e.classList.remove('!opacity-0', '!pointer-events-none'));
118118
}}
119119
>
120120
<div

0 commit comments

Comments
 (0)