-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce css filters for projector correction
- Loading branch information
Showing
8 changed files
with
209 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<script setup lang="ts"> | ||
const props = defineProps<{ | ||
max: number | ||
min: number | ||
step: number | ||
unit?: string | ||
default?: number | ||
}>() | ||
const value = defineModel<number>('modelValue', { | ||
type: Number, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div relative h-22px w-60 flex-auto @dblclick="props.default !== undefined ? value = props.default : null"> | ||
<input | ||
v-model.number="value" type="range" class="slider" | ||
v-bind="props" | ||
absolute bottom-0 left-0 right-0 top-0 z-10 w-full align-top | ||
> | ||
<span | ||
v-if="props.default != null" | ||
border="r main" absolute bottom-0 top-0 h-full w-1px op75 | ||
:style="{ | ||
left: `${(props.default - min) / (max - min) * 100}%`, | ||
}" | ||
/> | ||
</div> | ||
<div relative h-22px> | ||
<input v-model.number="value" type="number" v-bind="props" border="~ base rounded" m0 w-20 bg-gray:5 pl2 align-top text-sm> | ||
<span v-if="props.unit" pointer-events-none absolute right-1 top-0.5 text-xs op25>{{ props.unit }}</span> | ||
</div> | ||
</template> | ||
|
||
<style> | ||
.slider { | ||
appearance: none; | ||
height: 22px; | ||
outline: none; | ||
opacity: 0.7; | ||
-webkit-transition: 0.2s; | ||
transition: opacity 0.2s; | ||
--uno: border border-main rounded of-hidden bg-gray/5; | ||
} | ||
.slider:hover { | ||
opacity: 1; | ||
} | ||
.slider::-webkit-slider-thumb { | ||
-webkit-appearance: none; | ||
appearance: none; | ||
width: 5px; | ||
height: 22px; | ||
background: var(--slidev-theme-primary); | ||
cursor: pointer; | ||
z-index: 10; | ||
} | ||
.slider::-moz-range-thumb { | ||
width: 5px; | ||
height: 22px; | ||
background: var(--slidev-theme-primary); | ||
cursor: pointer; | ||
z-index: 10; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters