@@ -63,6 +68,9 @@ const emit = defineEmits<{
const containerEl = useTemplateRef('containerEl');
const thumbEl = useTemplateRef('thumbEl');
+const maxRatio = computed(() => Math.abs(props.max) / (props.max + Math.abs(Math.min(0, props.min))));
+const minRatio = computed(() => Math.abs(Math.min(0, props.min)) / (props.max + Math.abs(Math.min(0, props.min))));
+
const rawValue = ref((props.modelValue - props.min) / (props.max - props.min));
const steppedRawValue = computed(() => {
if (props.step) {
@@ -256,10 +264,30 @@ function onMousedown(ev: MouseEvent | TouchEvent) {
> .highlight {
position: absolute;
top: 0;
- left: 0;
height: 100%;
- background: var(--MI_THEME-accent);
- opacity: 0.5;
+ background: color(from var(--MI_THEME-buttonGradateA) srgb r g b / 0.5);
+ overflow: clip;
+
+ > .shine {
+ position: absolute;
+ top: 0;
+ width: 64px;
+ height: 100%;
+ }
+ }
+
+ > .highlight.right {
+ > .shine.right {
+ right: calc(#{$thumbWidth} / 2);
+ background: linear-gradient(-90deg, var(--MI_THEME-buttonGradateB), color(from var(--MI_THEME-buttonGradateA) srgb r g b / 0));
+ }
+ }
+
+ > .highlight.left {
+ > .shine.left {
+ left: calc(#{$thumbWidth} / 2);
+ background: linear-gradient(90deg, var(--MI_THEME-buttonGradateB), color(from var(--MI_THEME-buttonGradateA) srgb r g b / 0));
+ }
}
}