Skip to content

Commit

Permalink
add animation to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
rwv committed Nov 17, 2023
1 parent 816def4 commit ac1a9ec
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/components/scan-settings/settings/BlurSetting.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<n-form-item :label="t('settings.blur')" :show-feedback="false">
<template #label>
<span :style="style">
<span :style="style" class="blur-label">
{{ t("settings.blur") }}
</span>
</template>
Expand Down Expand Up @@ -36,3 +36,9 @@ const style = computed(() => {
};
});
</script>

<style scoped>
.blur-label {
transition: filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
</style>
8 changes: 7 additions & 1 deletion src/components/scan-settings/settings/BrightnessSetting.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<n-form-item :label="t('settings.brightness')" :show-feedback="false">
<template #label>
<span :style="style">
<span :style="style" class="brightness-label">
{{ t("settings.brightness") }}
</span>
</template>
Expand Down Expand Up @@ -41,3 +41,9 @@ const style = computed(() => {
};
});
</script>

<style scoped>
.brightness-label {
transition: filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
</style>
8 changes: 7 additions & 1 deletion src/components/scan-settings/settings/ContrastSetting.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<n-form-item :label="t('settings.contrast')" :show-feedback="false">
<template #label>
<span :style="style">
<span :style="style" class="contrast-label">
{{ t("settings.contrast") }}
</span>
</template>
Expand Down Expand Up @@ -41,3 +41,9 @@ const style = computed(() => {
};
});
</script>

<style scoped>
.contrast-label {
transition: filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
</style>
1 change: 1 addition & 0 deletions src/components/scan-settings/settings/NoiseSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const style = computed(() => {
top: 0;
content: url("./noise.svg");
opacity: var(--noise-opacity);
transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
Expand Down
10 changes: 9 additions & 1 deletion src/components/scan-settings/settings/RotateSetting.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<template>
<n-form-item :show-feedback="false">
<template #label>
<span :style="style">{{ t("settings.rotate") }}</span>
<span :style="style" class="rotate-label">{{
t("settings.rotate")
}}</span>
</template>
<n-slider
v-model:value="rotate_computed"
Expand Down Expand Up @@ -42,3 +44,9 @@ const style = computed(() => {
};
});
</script>

<style scoped>
.rotate-label {
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
v-for="(character, i) in characters"
:key="i"
:style="characterStyle[i]"
class="rotate-label-character"
>
{{ character }}
</span>
Expand Down Expand Up @@ -60,3 +61,9 @@ const characterStyle = computed(() => {
});
});
</script>

<style scoped>
.rotate-label-character {
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
</style>

0 comments on commit ac1a9ec

Please sign in to comment.