Comments (7)
我想让 旋转减速 慢慢减速 那种效果 怎么设置
现在不就是慢慢减速吗, 如果你想让他更慢一些, 可以试着调减速时间, 具体参数请浏览文档 > defaultConfig
如果用着顺手可以点个 star 支持一下
from lucky-canvas.
想让 缓慢减速时间延长 且越来越慢 最终停止的那种 defaultConfig里面的属性设置了 感觉效果没变化
from lucky-canvas.
想让 缓慢减速时间延长 且越来越慢 最终停止的那种 defaultConfig里面的属性设置了 感觉效果没变化
你先说一下你用的哪个版本, 旋转速度相关属性是v3.2.1
新增的, 然后贴一下代码我看看怎么用的
from lucky-canvas.
v3.2.1
data () {
return {
prizes: [],
defaultStyle: {
fontColor: '#d64737',
fontSize: '14px'
},
blocks: [
{ padding: '13px', background: '#d64737' }
],
buttons: [
{ radius: '50px', background: '#d64737' },
{ radius: '45px', background: '#fff' },
{ radius: '41px', background: '#f6c66f', pointer: true },
{ radius: '35px', background: '#ffdea0', fonts: [{ text: '开始\n抽奖', width: '65%', top: '-50%' }] }
],
defaultConfig: {
speed: 30,
accelerationTime: 1000,
decelerationTime: 14000,
offsetDegree: 90
}
}
},
mounted () {
this.getPrizesList()
},
methods: {
getPrizesList () {
this.prizes = []
const data = ['1元红包', '100元红包', '0.5元红包', '2元红包', '10元红包', '50元红包', '0.3元红包', '5元红包']
data.forEach((item, index) => {
this.prizes.push({
title: item,
background: index % 2 ? '#f9e3bb' : '#f8d384',
fonts: [{ text: item, top: '10%' }],
imgs: [{ src: require(../../assets/choujiang/${index}.png
), width: '30%', top: '35%' }]
})
})
},
startCallBack () {
this.$refs.LuckyWheel.play()
setTimeout(() => {
this.$refs.LuckyWheel.stop(Math.random() * 8 >> 0)
}, 5000)
from lucky-canvas.
我测过了, 没什么问题, 唯一的问题就是你这个减速时间太长了, 建议1000 ~ 5000毫秒
from lucky-canvas.
如果你的意思是减速函数不够缓慢的话, 后期我会开放自定义减速函数
from lucky-canvas.
又或者你有更好的缓动函数也可以提供给我
from lucky-canvas.
Related Issues (20)
- 有没有交流群,建个交流群更方便
- 微信小程序请教 HOT 1
- 扇形奖品图比较模糊,优化建议
- 老虎机旋转过程中突然加速 HOT 1
- Vue gutter不生效
- 大转盘点击抽奖后背景图片消失 HOT 3
- react,老虎机用图片没显示
- 建议!可以给 buttons 添加 点击动画吗?
- 项目安装依赖不成功 HOT 1
- range属性用法不太明白 HOT 5
- 作者你好,@lucky-canvas/vue 不支持按需引入吗?
- 运行环境为Taro v3.6.8,报错
- 九宫格uniapp小程序体验版真机报错 HOT 1
- 怎样让 `LuckyWheel` 组件的 prizes 文字径向显示而非换行 HOT 2
- @lucky-canvas/react 版本0.1.13不支持2k和4k屏中背景图片满屏铺吗?
- 希望uni-app 的版本支持下自定义转盘的rpxCalcMaxDeviceWidth HOT 1
- vue升级2.7的时候此组件不能用了,会报@vue/composition-api 2.7警告 HOT 1
- TypeError: Failed to execute 'putImageData' on 'CanvasRenderingContext2D' HOT 4
- 老虎机奖品图片有高度限制
- 在swiper中,effect(切换效果)设置为‘fade’,点击大转盘开始按钮,事件不会触发 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lucky-canvas.