Skip to content

Commit

Permalink
VueUiWheel improved animation
Browse files Browse the repository at this point in the history
  • Loading branch information
graphieros committed Dec 18, 2023
1 parent 5a0603d commit 63b65b7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-data-ui",
"private": false,
"version": "1.9.28",
"version": "1.9.29",
"type": "module",
"description": "A user-empowering data visualization Vue components library",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3513,7 +3513,7 @@ const updateStep = ref(0);
<h4 style="color: #5f8bee">Manual testing arena</h4>
</div>

<Box @copy="copyConfig(PROD_CONFIG.vue_ui_wheel)">
<Box @copy="copyConfig(PROD_CONFIG.vue_ui_wheel)" open>
<template #title>VueUiWheel</template>
<template #dev>
<WheelTest
Expand Down
9 changes: 8 additions & 1 deletion src/Box.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
import { ref } from "vue";
const showConfig = ref(false);
const props = defineProps({
open: {
type: Boolean,
default: false
}
})
const emit = defineEmits(['copy'])
const isCopying = ref(false);
Expand All @@ -18,7 +25,7 @@ function copy() {

<template>
<div style="width: 100%;margin-top:12px; background: #2A2A2A;">
<details>
<details :open="open">
<summary style="user-select:none;cursor:pointer;height:30px;background:linear-gradient(to right, #2A2A2A, #1A1A1A);line-height:24px;font-size:24px;padding:12px;">
<span style="color:#42d392">
<slot name="title"></slot>
Expand Down
17 changes: 17 additions & 0 deletions src/components/vue-ui-wheel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ defineExpose({
:stroke="tick.color"
:stroke-width="5"
:stroke-linecap="wheelConfig.style.chart.layout.wheel.ticks.rounded ? 'round' : 'butt'"
:class="{ 'vue-ui-tick-animated': wheelConfig.style.chart.animation.use && i <= activeValue }"
/>
<circle
v-if="wheelConfig.style.chart.layout.innerCircle.show"
Expand Down Expand Up @@ -230,4 +231,20 @@ defineExpose({
user-select: none;
position: relative;
}
.vue-ui-tick-animated {
animation: animate-tick 0.3s ease-in;
transform-origin: center;
}
@keyframes animate-tick {
0% {
stroke-width: 8;
}
80% {
stroke-width: 6;
}
100% {
stroke-width: 5;
}
}
</style>

0 comments on commit 63b65b7

Please sign in to comment.