Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions js/app/packages/core/component/CustomScrollbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,28 +171,22 @@ function InnerCustomScrollbar(props: CustomScrollbarProps) {
return (
<Show when={isVisible()}>
<div
class={`absolute right-0 top-0 bottom-0 w-[2px] pointer-events-auto overflow-visible ${props.class || ''}`}
style={{
'background-color': 'transparent',
}}
class={`absolute right-0 top-0 bottom-0 w-[1px] pointer-events-auto overflow-visible bg-transparent ${props.class || ''}`}
onMouseEnter={() => setIsHovering(true)}
onMouseLeave={() => setIsHovering(false)}
>
{/* Track */}
<div
class="absolute inset-0 cursor-pointer"
class="absolute inset-0 cursor-pointer bg-transparent"
onClick={handleTrackClick}
style={{
'background-color': 'transparent',
}}
/>
{/* Thumb */}
<div
class="absolute right-0 cursor-grab active:cursor-grabbing transition-all duration-200 ease-out"
style={{
top: `${thumbTop()}px`,
height: `${thumbHeight()}px`,
width: '2px',
width: '1px',
'background-color': 'var(--color-accent)',
'transform-origin': 'right center',
opacity: (() => {
Expand All @@ -204,17 +198,6 @@ function InnerCustomScrollbar(props: CustomScrollbarProps) {
const normalizedVel = Math.min(vel / 5, 1);
return normalizedVel;
})(),
'box-shadow': (() => {
if (isDragging()) {
return '0 0 8px oklch(from var(--color-accent) l c h / 0.6), 0 0 4px oklch(from var(--color-accent) l c h / 0.4)';
}
const vel = scrollVelocity();
if (vel === 0) return 'none';
const normalizedVel = Math.min(vel / 5, 1);
const glowOpacity = normalizedVel * 0.6;
const glowOpacity2 = normalizedVel * 0.4;
return `0 0 ${8 * normalizedVel}px oklch(from var(--color-accent) l c h / ${glowOpacity}), 0 0 ${4 * normalizedVel}px oklch(from var(--color-accent) l c h / ${glowOpacity2})`;
})(),
transform: (() => {
if (isDragging()) return 'scaleX(1.6)';
const vel = scrollVelocity();
Expand All @@ -223,7 +206,7 @@ function InnerCustomScrollbar(props: CustomScrollbarProps) {
const normalizedVel = Math.min(vel / 5, 1);
return `scaleX(${1 + normalizedVel * 1.0})`;
})(),
'transition-property': 'opacity, box-shadow, transform',
'transition-property': 'opacity, transform',
}}
onMouseDown={handleMouseDown}
/>
Expand Down