sanyuelanv-turntable
Version:
优化转盘转动效果 1. 缓动加速转动, 2. 均速转动 **(在没有接收到结果的时候一直均速转动)** 3. **(接受到结果)** 缓动减速转动直到停止
80 lines (71 loc) • 1.43 kB
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,viewport-fit=cover">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
* {
padding: 0;
margin: 0;
border: 0;
user-select: none;
}
html,
body {
width: 100%;
height: 100%;
overflow: hidden;
}
.main {
width: 400px;
height: 400px;
position: relative;
}
#main {
position: absolute;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, 0);
}
#bg {
position: absolute;
left: 0;
top: 0;
width: 400px;
background-size: contain;
height: 400px;
}
#point {
position: absolute;
left: 0;
top: 0;
width: 400px;
background-size: contain;
height: 400px;
}
#fps {
position: absolute;
right: 20px;
top: 20px;
width: 60px;
height: 30px;
background-color: aqua;
color: black;
display: flex;
align-items: center;
justify-content: center;
}
</style>
</head>
<body>
<div class="main">
<div id='bg'></div>
<canvas id='main'></canvas>
<div id='point'></div>
</div>
<p>点击开始转动,再次点击停止</p>
<div id="fps"></div>
</body>
</html>