boxing-hit.vue 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444
  1. <template>
  2. <view style="width:100%; margin-bottom: 50rpx;">
  3. <!-- 计时器 -->
  4. <view class="hitBoxingTimer flex justify-center">
  5. <boxingCountDown ref="boxingCountDownRef" :show-day="false" :second="showSportTime" color="#9695f7" background-color="#FFFFFF"
  6. border-color="#007AFF" splitorColor="#FFFFFF" />
  7. </view>
  8. <view v-if="mode == 'pkMode'" style="height: 50rpx;"></view>
  9. <view v-else style="height: 20rpx;"></view>
  10. <view style="display: flex; flex-direction: column; justify-content: center;align-items: center;
  11. position: relative; width: 100%;">
  12. <!-- 波动 -->
  13. <view v-if="mode !== 'pkMode'" class="flex justify-around align-center" style="width: 600rpx;height: 100rpx; margin: 20rpx;">
  14. <view style="height: 1rpx;width: 80rpx;background-color: #FFFFFF;"></view>
  15. <view style="display: flex; justify-content: center; align-self: center; height: 100%;">
  16. <view style="display: flex; justify-content: center; align-items: center;">
  17. <view class="wave-d-item " v-for="(item, index) in wave_d_time" :key="index" :class="wave_d_play?'hit-wave':''"
  18. :style="{'--time': item.run * wave_run_ratio,'--delay':item.delay * wave_run_ratio,'height': wave_d_play?item.sHeight+'rpx':'20rpx'}"></view>
  19. </view>
  20. <view style="display: flex; justify-content: center; align-items: center; flex-direction: row-reverse;">
  21. <view class="wave-d-item " v-for="(item, index) in wave_d_time" :key="index" :class="wave_d_play?'hit-wave':''"
  22. :style="{'--time': item.run * wave_run_ratio,'--delay':item.delay * wave_run_ratio,'height': wave_d_play?item.sHeight+'rpx':'20rpx'}"></view>
  23. </view>
  24. </view>
  25. <view style="height: 1rpx;width: 80rpx;background-color: #FFFFFF;"></view>
  26. </view>
  27. <view v-if="mode == 'pkMode'" style="height: 30rpx;"></view>
  28. <!-- 当前拳击力-->
  29. <view v-if="mode == 'pkMode'" class="flex justify-center align-center " style="margin-top: 40rpx; background-color: rgba(255,255,255,0.1); width: 420rpx; height: 90rpx;border-radius: 60rpx;">
  30. <image src="/static/modal/boxing-hit/b.png" style="width: 50rpx; height: 50rpx;" mode="aspectFit"></image>
  31. <view class="hit-current-count">
  32. {{currentHitStrength}}
  33. </view>
  34. </view>
  35. <!-- <view v-else style="position: relative; width: 100%;" :style="{'opacity': hitStrengthOpacity}">
  36. <view style="position: absolute;
  37. left: 0;
  38. top: 0;
  39. bottom: 0;
  40. right: 0;" class="flex justify-center">
  41. <view class="flex justify-center align-center " style="background-color: rgba(0,0,0,0.4); width: 300rpx; height: 90rpx;border-radius: 60rpx;">
  42. <view class="hit-current-count-power">力量</view>
  43. <view class="hit-current-count">
  44. {{currentHitStrength}}
  45. </view>
  46. </view>
  47. </view>
  48. </view> -->
  49. <view v-if="mode == 'pkMode'" style="height: 110rpx;"></view>
  50. <view v-else style="height: 20rpx;"></view>
  51. <!-- 控制按钮 -->
  52. <view class="flex justify-center " :class="mode == 'pkMode'?'big':''" style="margin-top: 40rpx;" @tap="onControlPlay">
  53. <view style="position: relative; width: 260rpx; height: 260rpx;">
  54. <image style="width: 100%; height: 100%;" src="/static/modal/boxing-hit/hit-button-bg.png"></image>
  55. <image class="hit-button-rotate " :class="bRingAnimation?'hit-button-bg-play':'hit-button-bg-paused'" style="position: absolute;top: 10%;left: 10%;bottom: 0;right: 0;width: 80%; height: 80%;"
  56. src="/static/modal/boxing-hit/hit-button-ef.png"></image>
  57. <view style="position: absolute;top: 0;left: 0;bottom: 0;right: 0;width: 100%; height: 100%; display: flex;justify-content: center; align-items: center;">
  58. <image style="width: 50rpx; height: 50rpx; transform: scale(-1,1);" :src="bControlRun?'/static/modal/boxing-hit/hit-pause.png':'/static/modal/boxing-hit/hit-play.png'"></image>
  59. </view>
  60. </view>
  61. </view>
  62. <!-- <view v-if="mode == 'pkMode'" style="height: 160rpx;"></view> -->
  63. <!-- <view style="margin-top: 40rpx;width: 310rpx; height: 90rpx;"></view> -->
  64. <!-- 模式按钮 @tap="onChangeMode"-->
  65. <!-- <view class="flex justify-center " style="margin-top: 40rpx;">
  66. <view style="position: relative; width: 310rpx; height: 90rpx;background-color: #FFFFFF; display: flex;flex-direction: row;justify-content: center;align-items: center; border-radius: 50rpx;">
  67. <image style="width: 45rpx; height: 45rpx;" src="/static/personal/switch.png"></image>
  68. <view style="margin-left: 20rpx;color:#9797FF; font-weight: bold;font-size: 17px;">{{mode=="pkMode"?'健身模式':'PK模式'}}
  69. </view>
  70. </view>
  71. </view> -->
  72. <!-- <view v-if="mode == 'pkMode'" style="height: 20rpx;"></view> -->
  73. <view v-if="mode == 'pkMode'" style="height: 170rpx;"></view>
  74. <!-- <view v-else style="height: 110rpx;"></view> -->
  75. <view v-else style="height: 80rpx;"></view>
  76. <view v-if="mode == 'pkMode'" class="hit-vertical-container" :style="{'top': mode == 'pkMode'?'-120rpx':'-300rpx'}">
  77. <view class="hit-vertical-bar">
  78. <view class="hit-vertical-child" v-for="(item, index) in 25" :key="index">
  79. <view :class="25-aiShowCount>=index+1? 'hit-vertical-active':'hit-vertical-inactive'"></view>
  80. <view :class="index%5 == 0?'':'hit-text-hidden'" class="hit-vertical-text">{{index+1}}</view>
  81. </view>
  82. </view>
  83. <view class="hit-vertical-bar">
  84. <view class="hit-vertical-child" v-for="(item, index) in 25" :key="index">
  85. <view :class="index%5 == 0?'':'hit-text-hidden'" class="hit-vertical-text">{{index+1}}</view>
  86. <view :class="25-myShowCount>=index+1? 'hit-vertical-active':'hit-vertical-inactive'"></view>
  87. </view>
  88. </view>
  89. </view>
  90. <view v-else class="hit-vertical-container" :style="{'top': mode == 'pkMode'?'-120rpx':'-300rpx'}">
  91. <view class="hit-vertical-bar">
  92. <view class="hit-vertical-child" v-for="(item, index) in 25" :key="index">
  93. <view :class="showCount>=index+1? 'hit-vertical-active':'hit-vertical-inactive'"></view>
  94. <view :class="index%5 == 0?'':'hit-text-hidden'" class="hit-vertical-text">{{(index+1)*2}}</view>
  95. </view>
  96. </view>
  97. <view class="hit-vertical-bar">
  98. <view class="hit-vertical-child" v-for="(item, index) in 25" :key="index">
  99. <view :class="index%5 == 0?'':'hit-text-hidden'" class="hit-vertical-text">{{(index+26)*2}}</view>
  100. <view :class="showCount>=index+26? 'hit-vertical-active':'hit-vertical-inactive'"></view>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. <!-- <button style="margin-top: 100rpx;" @tap="onTestHit('left')">击中</button> -->
  106. <!-- 显示数据 -->
  107. <view v-if="mode == 'pkMode'" class="flex justify-around " style="margin: 0rpx 15rpx;">
  108. <view class="boxing-item-bg">
  109. <image src="/static/modal/boxing-hit/f.png" class="boxing-hit-png " mode="aspectFit"></image>
  110. <view class="text-white text-13px" style="margin: 10rpx 0;">最大力量</view>
  111. <view class="hit-count">
  112. {{mode == 'pkMode'?PKMaxStrength:maxStrength}}
  113. </view>
  114. </view>
  115. <view class="boxing-item-bg">
  116. <image src="/static/modal/boxing-hit/b.png" class="boxing-hit-png " mode="aspectFit"></image>
  117. <view class="text-white text-13px" style="margin: 10rpx 0;">平均力量</view>
  118. <view class="hit-count">
  119. {{mode == 'pkMode'?PKAverageStrength:averageStrength}}
  120. </view>
  121. </view>
  122. <view class="boxing-item-bg">
  123. <image src="/static/modal/boxing-hit/e.png" class="boxing-hit-png " mode="aspectFit"></image>
  124. <view class="text-white text-13px" style="margin: 10rpx 0;">平均速度</view>
  125. <view class="hit-count">
  126. {{mode == 'pkMode'?PKAverageSpeed:averageSpeed}}
  127. </view>
  128. </view>
  129. <view class="boxing-item-bg">
  130. <image src="/static/modal/boxing-hit/n.png" class="boxing-hit-png " mode="aspectFit"></image>
  131. <view class="text-white text-13px" style="margin: 10rpx 0;">击打数</view>
  132. <view class="hit-count">
  133. {{mode == 'pkMode'?PKAllShowHitCount:allShowHitCount}}
  134. </view>
  135. </view>
  136. </view>
  137. <view v-else class="flex margin-bottom-sm justify-center align-center">
  138. <view class="flex align-center">
  139. <view class="flex justify-start flex-direction align-center">
  140. <image src="/static/mileageIcon-w.png" class="data-png-26 margin-sm" mode="aspectFit"></image>
  141. <text style="text-align: start; line-height: 24px; font-weight: 400;color: #FFFFFF;">{{mode == 'calorieMode'?'里程':'计数'}}</text>
  142. </view>
  143. <view class="flex justify-start flex-direction">
  144. <view style="height: 26px;" class="margin-top-sm margin-bottom-sm">
  145. <view class="cu-progress" style="height: 6rpx; width: 140rpx; border-radius: 45rpx;"></view>
  146. </view>
  147. <text style="text-align: start; line-height: 24px; font-weight: 400;color: #FFFFFF;">{{mode == 'calorieMode'?runMileage+'km':ropeJumpCount}}</text>
  148. </view>
  149. </view>
  150. <view style="width: 40rpx;"></view>
  151. <view class="flex align-center">
  152. <view class="flex justify-start flex-direction align-center">
  153. <image src="/static/icon-run-normal.png" class="data-png-26 margin-sm" mode="aspectFit"></image>
  154. <text style="text-align: start; line-height: 24px; font-weight: 400; color: #FFFFFF;">速度</text>
  155. </view>
  156. <view class="flex justify-start flex-direction">
  157. <view style="height: 26px;" class="margin-top-sm margin-bottom-sm">
  158. <view class="cu-progress" style="height: 6rpx; width: 140rpx; border-radius: 45rpx;"></view>
  159. </view>
  160. <text style="text-align: start; line-height: 24px; font-weight: 400;color: #FFFFFF;">{{runSpeed}}m/s</text>
  161. </view>
  162. </view>
  163. </view>
  164. </view>
  165. </template>
  166. <script>
  167. import boxingCountDown from '@/components/uni-count-down/uni-count-down.vue'
  168. import hitCharts from '@/components/u-charts/u-charts.js';
  169. import puchConfig from "@/util/util-js/puchConfig.js"
  170. import EquipmentAction from "@/util/util-js/EquipmentAction.js"
  171. export default {
  172. components: {
  173. boxingCountDown
  174. },
  175. props: {
  176. bUpdate: {
  177. type: Boolean,
  178. default: false
  179. },
  180. showTime: {
  181. type: Number,
  182. default: 0
  183. },
  184. //默认是防回弹更新
  185. bRebound: {
  186. type: Boolean,
  187. default: true,
  188. }
  189. },
  190. data() {
  191. return {
  192. mode: 'calorieMode', //pkMode calorieMode
  193. //满格的数值是 25
  194. maxShowCount: 25,
  195. //pk模式下,两边涨的区分,自己和ai
  196. myShowCount: 0,
  197. myPowerCount: 0,
  198. aiShowCount: 0,
  199. aiPowerCount: 0,
  200. //显示的点
  201. showCount: 0,
  202. //记录打击的次数
  203. powerCount: 0,
  204. //当前打击的最大值
  205. powerMaxCount: 0,
  206. xA1: 0,
  207. yA1: 0,
  208. zA1: 0,
  209. xA: 0,
  210. yA: 0,
  211. zA: 0,
  212. xO: 0,
  213. yO: 0,
  214. zO: 0,
  215. mass: 5,
  216. //大概消耗的卡路里
  217. calorie: 0,
  218. //与加速度相关的卡路里
  219. otherCalorie: 0,
  220. //大概消耗的卡路里
  221. PKCalorie: 0,
  222. //与加速度相关的卡路里
  223. PKOtherCalorie: 0,
  224. leftHookUrl: "/static/modal/boxing-post/left-hook.mp3",
  225. rightHookUrl: "/static/modal/boxing-post/right-hook.mp3",
  226. straightHookUrl: "/static/modal/boxing-post/straight-hook.mp3",
  227. hookAudioContext: null,
  228. //新手语音提示
  229. leftTipUrl: "/static/modal/boxing-post/tipLeft.mp3",
  230. rightTipUrl: "/static/modal/boxing-post/tipRight.mp3",
  231. straightTipUrl: "/static/modal/boxing-post/tipStraight.mp3",
  232. greatTipUrl: "/static/modal/boxing-post/tipGreat.mp3",
  233. giveGoTipUrl: "/static/modal/boxing-post/tipGiveItAGo.mp3",
  234. startTraining: "/static/modal/boxing-post/tipStartTraining.mp3",
  235. //击打状态音效
  236. hitUrl: "/static/elect/hit.mp3",
  237. missUrl: "/static/elect/miss.mp3",
  238. //是否在播放
  239. bPlay: false,
  240. //新手
  241. bGuide: false,
  242. //是否是特殊拳击
  243. bGuideEF: false,
  244. //运动时间
  245. showSportTime: this.showTime,
  246. sportTimeInterval: null,
  247. //拳击数据判断对象
  248. EquipmentActionObj: null,
  249. wave_array: [{
  250. wPlay: false
  251. },
  252. {
  253. wPlay: false
  254. },
  255. {
  256. wPlay: false
  257. },
  258. {
  259. wPlay: false
  260. },
  261. ],
  262. wave_run_array: [],
  263. wave_time: [{
  264. run: 0.5,
  265. delay: 3,
  266. height: 20
  267. },
  268. {
  269. run: 1,
  270. delay: 3,
  271. height: 30
  272. },
  273. {
  274. run: 2,
  275. delay: 3,
  276. height: 80
  277. },
  278. {
  279. run: 0.5,
  280. delay: 2,
  281. height: 50
  282. },
  283. {
  284. run: 1,
  285. delay: 2,
  286. height: 35
  287. },
  288. {
  289. run: 2,
  290. delay: 2,
  291. height: 20
  292. }
  293. ],
  294. wave_d_play: false,
  295. wave_d_timeout: null,
  296. wave_run_ratio: 0.4,
  297. wave_d_time: [{
  298. run: 1,
  299. delay: 1.1,
  300. height: 20,
  301. sHeight: 20,
  302. play: false
  303. },
  304. {
  305. run: 1,
  306. delay: 1,
  307. height: 30,
  308. sHeight: 20,
  309. play: true
  310. },
  311. {
  312. run: 1,
  313. delay: 0.9,
  314. height: 15,
  315. sHeight: 20,
  316. play: true
  317. },
  318. {
  319. run: 1,
  320. delay: 0.8,
  321. height: 50,
  322. sHeight: 20,
  323. play: true
  324. },
  325. {
  326. run: 1.3,
  327. delay: 0.7,
  328. height: 35,
  329. sHeight: 20,
  330. play: true
  331. },
  332. {
  333. run: 1.4,
  334. delay: 0.6,
  335. height: 20,
  336. sHeight: 20,
  337. play: true
  338. },
  339. {
  340. run: 1.5,
  341. delay: 0.5,
  342. height: 25,
  343. sHeight: 20,
  344. play: true
  345. },
  346. {
  347. run: 1.6,
  348. delay: 0.4,
  349. height: 40,
  350. sHeight: 20,
  351. play: true
  352. },
  353. {
  354. run: 1.7,
  355. delay: 0.3,
  356. height: 60,
  357. sHeight: 20,
  358. play: true
  359. },
  360. {
  361. run: 1.8,
  362. delay: 0.2,
  363. height: 50,
  364. sHeight: 20,
  365. play: true
  366. },
  367. {
  368. run: 1.9,
  369. delay: 0.1,
  370. height: 80,
  371. sHeight: 20,
  372. play: true
  373. },
  374. {
  375. run: 1.8,
  376. delay: 0,
  377. height: 70,
  378. sHeight: 20,
  379. play: true
  380. }
  381. ],
  382. bControlRun: false,
  383. bRingAnimation: false,
  384. maxStrength: 0,
  385. averageStrength: 0,
  386. allStrength: 0,
  387. averageSpeed: 0,
  388. averageSpeedInterval: null,
  389. tempHitCount: 0,
  390. allTempHitCount: 0,
  391. allShowHitCount: 0,
  392. currentHitStrength: 0,
  393. // testHitInterval: null,
  394. aiHitInterval: null,
  395. //击打时候动画对象
  396. hitStrengthOpacityInterval: null,
  397. hitStrengthOpacity: 0,
  398. //pk 模式下的数据
  399. PKMaxStrength: 0,
  400. PKAverageStrength: 0,
  401. PKAllStrength: 0,
  402. PKAverageSpeed: 0,
  403. PKAverageSpeedInterval: null,
  404. PKTempHitCount: 0,
  405. PKAllTempHitCount: 0,
  406. PKAllShowHitCount: 0,
  407. BLENum: 0,
  408. BLEACX: 0,
  409. BLEACYL: 0,
  410. /** 跑步参数*/
  411. runMileage:0,
  412. runSpeed:0,
  413. runTempCount:0,
  414. runAllTempCount:0,
  415. runAllCount:0,
  416. /**
  417. * 跳绳参数
  418. */
  419. ropeJumpCount:0
  420. }
  421. },
  422. watch: {
  423. bUpdate(val) {
  424. },
  425. showTime(val) {
  426. this.showSportTime = val;
  427. }
  428. },
  429. created() {
  430. let _self = this;
  431. _self.hookAudioContext = uni.createInnerAudioContext();
  432. _self.hookAudioContext.autoplay = false;
  433. _self.hookAudioContext.src = _self.straightHookUrl;
  434. _self.hookAudioContext.volume = 0.5;
  435. console.log(" ***** boxing-post created ******");
  436. _self.onBindAcc();
  437. _self.EquipmentActionObj = new EquipmentAction();
  438. _self.EquipmentActionObj.addEventListener("resultantHit", (e) => {
  439. // console.log("acc:",this.xA,this.yA,this.zA);
  440. // console.log("data:", this.xA1, this.yA1, this.zA1);
  441. if (this.mode == "pkMode") {
  442. this._pkHitOnly(e.acc, e.power);
  443. } else {
  444. this._HitOnly(e.acc, e.power);
  445. }
  446. })
  447. if (this.averageSpeedInterval) {
  448. clearInterval(this.averageSpeedInterval);
  449. this.averageSpeedInterval = null;
  450. }
  451. //计算平均速度
  452. this.averageSpeedInterval = setInterval(() => {
  453. if (this.mode == 'PKMode') {
  454. this.PKAverageSpeed = this.PKTempHitCount;
  455. this.PKTempHitCount = 0;
  456. } else {
  457. this.averageSpeed = this.tempHitCount;
  458. this.tempHitCount = 0;
  459. //跑步速度 70cm步长 速度:步长*步数/5秒
  460. this.runSpeed = this.runTempCount * 70 / 100;
  461. this.runTempCount = 0;
  462. }
  463. }, 5000)
  464. },
  465. beforeDestroy() {
  466. console.log(" ***** boxing-post destroyed ******");
  467. this.onUnbindAcc();
  468. // this.onUnbindOri();
  469. let _self = this;
  470. if (_self.hookAudioContext)
  471. _self.hookAudioContext.destroy();
  472. if (_self.sportTimeInterval) {
  473. clearInterval(_self.sportTimeInterval);
  474. _self.sportTimeInterval = null;
  475. }
  476. if (_self.averageSpeedInterval) {
  477. clearInterval(_self.averageSpeedInterval);
  478. _self.averageSpeedInterval = null;
  479. }
  480. // if (_self.testHitInterval) {
  481. // clearInterval(_self.testHitInterval);
  482. // _self.testHitInterval = null;
  483. // }
  484. if (this.aiHitInterval) {
  485. clearInterval(this.aiHitInterval);
  486. this.aiHitInterval = null;
  487. }
  488. },
  489. methods: {
  490. onSetRingAnimation(booleanValue) {
  491. this.bRingAnimation = booleanValue;
  492. },
  493. moveBoxingHandle() {
  494. return;
  495. },
  496. //测试打击
  497. onTestHit(data) {
  498. let _self = this;
  499. let maxPower = Math.floor(Math.random() * 13);
  500. // console.log("maxPower:", maxPower);
  501. if (this.mode == "pkMode") {
  502. this._pkHitOnly(maxPower, maxPower * 10);
  503. } else {
  504. for(let i=0;i<100;i++){
  505. this._HitOnly(maxPower, maxPower * 10);
  506. }
  507. }
  508. },
  509. //平时击打的力量槽动画播放
  510. onPlayPowerAnimation(bGreat) {
  511. // 暂时去掉 跑步声音
  512. // if (bGreat) {
  513. // this.hookAudioContext.stop();
  514. // this.hookAudioContext.src = this.greatTipUrl;
  515. // this.hookAudioContext.play();
  516. // } else {
  517. // this.hookAudioContext.stop();
  518. // this.hookAudioContext.src = this.hitUrl;
  519. // this.hookAudioContext.play();
  520. // }
  521. let _self = this;
  522. if (_self.powerInterval) {
  523. clearInterval(_self.powerInterval);
  524. _self.powerInterval = null;
  525. }
  526. let bAdd = true;
  527. let _oldPowerCount = _self.powerCount;
  528. let _currentMaxCount = _oldPowerCount + 10;
  529. let _duraciotn = 300 / _currentMaxCount;
  530. _self.powerInterval = setInterval(function() {
  531. if (_self.showCount >= _currentMaxCount) {
  532. bAdd = false;
  533. } else if (_self.showCount <= _oldPowerCount && !bAdd) {
  534. _self.showCount = _self.powerCount;
  535. clearInterval(_self.powerInterval);
  536. _self.powerInterval = null;
  537. return;
  538. }
  539. if (bAdd)
  540. _self.showCount++;
  541. else
  542. _self.showCount--;
  543. }, _duraciotn); //300ms/40格
  544. },
  545. //pk模式击打的力量槽动画播放
  546. onPKModePlayPowerAnimation(bGreat) {
  547. if (bGreat) {
  548. this.hookAudioContext.stop();
  549. this.hookAudioContext.src = this.greatTipUrl;
  550. this.hookAudioContext.play();
  551. } else {
  552. this.hookAudioContext.stop();
  553. this.hookAudioContext.src = this.hitUrl;
  554. this.hookAudioContext.play();
  555. }
  556. let _self = this;
  557. _self.myShowCount = _self.myPowerCount;
  558. // if (_self.powerInterval) {
  559. // clearInterval(_self.powerInterval);
  560. // _self.powerInterval = null;
  561. // }
  562. // let bAdd = true;
  563. // let _oldPowerCount = _self.myPowerCount;
  564. // let _currentMaxCount = _oldPowerCount + 10;
  565. // let _duraciotn = 300 / _currentMaxCount;
  566. // _self.powerInterval = setInterval(function() {
  567. // if (_self.myShowCount >= _currentMaxCount) {
  568. // bAdd = false;
  569. // } else if (_self.myShowCount <= _oldPowerCount && !bAdd) {
  570. // _self.myShowCount = _self.myPowerCount;
  571. // clearInterval(_self.powerInterval);
  572. // _self.powerInterval = null;
  573. // return;
  574. // }
  575. // if (bAdd)
  576. // _self.myShowCount++;
  577. // else
  578. // _self.myShowCount--;
  579. // }, _duraciotn); //300ms/40格
  580. },
  581. onBindAcc(globalAcc) {
  582. uni.$on('watchAcceleration', this.updateAcc);
  583. },
  584. onUnbindAcc() {
  585. uni.$off('watchAcceleration', this.updateAcc);
  586. },
  587. onBindOri(globalOri) {
  588. uni.$on('watchOrientation', this.updateOri);
  589. },
  590. onUnbindOri() {
  591. uni.$off('watchOrientation', this.updateOri);
  592. },
  593. updateAcc(acc) {
  594. // console.log("acc:" ,acc.xAxis,acc.yAxis,acc.zAxis);
  595. this.xA = acc.xAxis;
  596. this.yA = acc.yAxis;
  597. this.zA = acc.zAxis;
  598. // return;
  599. if (!this.bUpdate || !this.bPlay) return;
  600. this.EquipmentActionObj.updateAcc({
  601. xA: acc.xAxis,
  602. zA: acc.yAxis,
  603. yA: acc.zAxis,
  604. bLimitRebound: this.bRebound
  605. })
  606. },
  607. //旧的蓝牙模块更新数据
  608. onBLEUpdate(data) {
  609. if (!this.bPlay) return;
  610. if (data.num)
  611. this.BLENum = data.num;
  612. if (data.acx)
  613. this.BLEACX = data.acx;
  614. if (data.acy) {
  615. this.BLEACYL = data.acy;
  616. // let acc = Math.ceil((Math.abs(this.BLEACX) + Math.abs(this.BLEACYL))*0.0005);
  617. let _abs = (Math.abs(this.BLEACX) + Math.abs(this.BLEACYL));
  618. let _ratioAbs = _abs > 65000 ? 1 : _abs / 65000;
  619. // console.log("当前值:",(Math.abs(this.BLEACX) + Math.abs(this.BLEACYL)),acc,this._onReducedBlood(acc),_ratioAbs,Math.ceil(_ratioAbs*30));
  620. let acc = Math.ceil(_ratioAbs * 30);
  621. if (this.mode == "pkMode") {
  622. this._pkHitOnly(acc, acc * 10);
  623. } else {
  624. this._HitOnly(acc, acc * 10);
  625. }
  626. }
  627. },
  628. //hotman 情景下刷新
  629. onBLEHotmanUpdate(data) {
  630. console.log("onBLEHotmanUpdate:",data ,this.bUpdate,this.bPlay);
  631. if (!this.bUpdate || !this.bPlay) return;
  632. let {
  633. hit
  634. } = data;
  635. let power = parseInt(hit);
  636. let acc = power * 0.1;
  637. if (this.mode == "pkMode") {
  638. this._pkHitOnly(acc, power);
  639. } else {
  640. this._HitOnly(acc, power);
  641. }
  642. },
  643. //蓝牙更新数据
  644. onBLEHandleUpdate(data) {
  645. if (!this.bUpdate || !this.bPlay) return;
  646. let {
  647. ax,
  648. ay,
  649. az
  650. } = data.acc;
  651. let xA = ax * 9.80665;
  652. let yA = ay * 9.80665;
  653. let zA = az * 9.80665;
  654. this.xA1 = xA;
  655. this.yA1 = yA;
  656. this.zA1 = zA;
  657. // console.log("data:" ,xA,yA,zA);
  658. // updateAcc updateTriaxialAcc
  659. this.EquipmentActionObj.updateTriaxialAcc({
  660. xA: xA,
  661. zA: yA,
  662. yA: zA,
  663. bLimitRebound: true
  664. })
  665. },
  666. //rope 情景下刷新
  667. onBLERopeUpdate(data) {
  668. if (!this.bUpdate || !this.bPlay) return;
  669. let {
  670. jump
  671. } = data;
  672. let power = parseInt(jump);
  673. let acc = power * 0.1;
  674. console.log(jump,this.mode,acc,power);
  675. if (this.mode == "pkMode") {
  676. this._pkHitOnly(acc, power);
  677. } else {
  678. this._HitOnly(acc, power);
  679. }
  680. },
  681. updateOri(ori) {
  682. this.xO = ori.beta;
  683. this.zO = ori.alpha;
  684. this.yO = ori.gamma;
  685. },
  686. onControlPlay() {
  687. this._customControlPlay({
  688. bControlRun: this.bControlRun
  689. });
  690. },
  691. onCloseDevices() {
  692. let _self = this;
  693. if (!_self.bPlay) return;
  694. if (_self.sportTimeInterval) {
  695. clearInterval(_self.sportTimeInterval);
  696. _self.sportTimeInterval = null;
  697. }
  698. if (_self.aiHitInterval) {
  699. clearInterval(_self.aiHitInterval);
  700. _self.aiHitInterval = null;
  701. }
  702. _self.bPlay = false;
  703. _self.bControlRun = false;
  704. //如果是新手教程,也直接停掉
  705. _self.bGuide = false;
  706. _self.bGuideEF = false;
  707. if (_self.mode == "pkMode") {
  708. _self.myShowCount = 0;
  709. _self.myPowerCount = 0;
  710. _self.aiShowCount = 0;
  711. _self.aiPowerCount = 0;
  712. }
  713. _self.$emit("closeBoxingControl");
  714. },
  715. onHitPlay(bPlaying) {
  716. if (bPlaying) {
  717. this.bControlRun = bPlaying;
  718. } else {
  719. this.bControlRun = !this.bControlRun;
  720. }
  721. },
  722. _customControlPlay(data) {
  723. let _self = this;
  724. //1.检查是否符合要求,再进行训练
  725. if (data.bControlRun) {
  726. if (_self.sportTimeInterval) {
  727. clearInterval(_self.sportTimeInterval);
  728. _self.sportTimeInterval = null;
  729. }
  730. this.bPlay = false;
  731. // this.$refs.customControlButtons.onPlay();
  732. this.onHitPlay();
  733. //如果是新手教程,也直接停掉
  734. this.bGuide = false;
  735. this.bGuideEF = false;
  736. // if (this.testHitInterval) {
  737. // clearInterval(this.testHitInterval);
  738. // this.testHitInterval = null;
  739. // }
  740. if (this.mode == "pkMode") {
  741. this.myShowCount = 0;
  742. this.myPowerCount = 0;
  743. this.aiShowCount = 0;
  744. this.aiPowerCount = 0;
  745. }
  746. if (this.aiHitInterval) {
  747. clearInterval(this.aiHitInterval);
  748. this.aiHitInterval = null;
  749. }
  750. this.$emit("boxingPostControlPlay", false);
  751. } else {
  752. this.$emit("boxingPostCheck");
  753. }
  754. },
  755. _PKOver(data) {
  756. let _self = this;
  757. //1.检查是否符合要求,再进行训练
  758. if (_self.sportTimeInterval) {
  759. clearInterval(_self.sportTimeInterval);
  760. _self.sportTimeInterval = null;
  761. }
  762. this.bPlay = false;
  763. this.onHitPlay();
  764. //如果是新手教程,也直接停掉
  765. this.bGuide = false;
  766. this.bGuideEF = false;
  767. if (this.aiHitInterval) {
  768. clearInterval(this.aiHitInterval);
  769. this.aiHitInterval = null;
  770. }
  771. },
  772. //新手引导
  773. onGuideBoxingPostPlay() {
  774. console.log("onGuideBoxingPostPlay");
  775. let _self = this;
  776. _self.bPlay = true;
  777. //
  778. _self.bGuide = true;
  779. // 按钮事件
  780. // _self.$refs.customControlButtons.onPlay();
  781. _self.onHitPlay();
  782. },
  783. //训练退出时候,重新信息
  784. onBoxingPostStop() {
  785. },
  786. //调用播放
  787. onBoxingPostPlay(bPlaying) {
  788. let _self = this;
  789. //判断是否是pk模式,如果是pk模式,则用pk模式播放
  790. if (bPlaying) {
  791. _self.bPlay = true;
  792. // 按钮事件
  793. // _self.$refs.customControlButtons.onPlay(true);
  794. _self.onHitPlay(true);
  795. // if (_self.testHitInterval) {
  796. // clearInterval(_self.testHitInterval);
  797. // _self.testHitInterval = null;
  798. // }
  799. // _self.testHitInterval = setInterval(() => {
  800. // this.onTestHit();
  801. // }, 300)
  802. if (_self.sportTimeInterval) {
  803. clearInterval(_self.sportTimeInterval);
  804. _self.sportTimeInterval = null;
  805. }
  806. if (this.mode == 'pkMode') {
  807. if (this.aiHitInterval) {
  808. clearInterval(this.aiHitInterval);
  809. this.aiHitInterval = null;
  810. }
  811. this.aiHitInterval = setInterval(() => {
  812. let _random = Math.floor(Math.random() * 10);
  813. if (_random < 5) {
  814. this.onAiHitEvent();
  815. }
  816. }, 500)
  817. }
  818. //play true 时候,开启时间计算
  819. _self.sportTimeInterval = setInterval(() => {
  820. _self.showSportTime++;
  821. if (_self.showSportTime >= 20 && _self.showSportTime % 20 == 0) {
  822. _self.$emit("updateSportTime", _self.showSportTime);
  823. }
  824. }, 1000)
  825. }
  826. },
  827. //自由模式下的打击
  828. //首页现在尝试用于跑步
  829. _HitOnly(acc, power) {
  830. //动画的高度
  831. let _ratio = acc / 10;
  832. if (_ratio > 1) _ratio = 1;
  833. if (_ratio < 0.5) _ratio = 0.5;
  834. for (let i = 0; i < this.wave_d_time.length; i++) {
  835. this.wave_d_time[i].sHeight = this.wave_d_time[i].height * _ratio;
  836. }
  837. this.onPlayPowerAnimation();
  838. // this.allTempHitCount++;
  839. this.runAllTempCount++;
  840. this.allShowHitCount++;
  841. this.tempHitCount++;
  842. this.runTempCount ++;
  843. this.runAllCount = this.allShowHitCount;
  844. if(this.mode == 'calorieMode'){
  845. //里面转换千米
  846. //175公分的bai成人一般两步间距du为70厘米,zhi170公分为65厘米,180公分为75厘米。
  847. this.runMileage = this.runAllCount*70 / 100000;
  848. }else {
  849. this.ropeJumpCount = this.runAllCount;
  850. }
  851. this.currentHitStrength = power;
  852. if (this.maxStrength < power) {
  853. this.maxStrength = power;
  854. }
  855. this.allStrength += power;
  856. this.averageStrength = (this.allStrength / this.allShowHitCount).toFixed(1);
  857. //跑步的卡路里,allTempHiCount
  858. this.calorie = puchConfig.getRunCalorie(this.runAllTempCount);
  859. //击打的加速度添加的卡路里,是额外计算的卡路里
  860. // this.otherCalorie += puchConfig.getAccCalorie(acc);
  861. let _all = this.calorie;// this.calorie.add(this.otherCalorie);
  862. //100 大卡,为一个周期 分50份
  863. //现在显示1格子是2大卡,所以 _all要 除去一半
  864. this.powerCount = parseInt(_all / 2);
  865. if (this.powerCount >= 50) {
  866. console.log("同步卡路里");
  867. console.log("this.calorie:", this.calorie, this.otherCalorie, _all);
  868. this.$emit('updateCalorie', _all);
  869. // this.allTempHitCount = 0;
  870. this.runAllTempCount = 0;
  871. this.powerCount = 0;
  872. // this.otherCalorie = 0;
  873. }
  874. if (!this.wave_d_play) {
  875. if (this.wave_d_timeout) {
  876. clearTimeout(this.wave_d_timeout);
  877. this.wave_d_timeout = null;
  878. }
  879. this.wave_d_play = true;
  880. this.wave_d_timeout = setTimeout(() => {
  881. this.wave_d_play = false;
  882. }, 1000 * this.wave_run_ratio)
  883. }
  884. if (this.hitStrengthOpacityInterval) {
  885. clearTimeout(this.hitStrengthOpacityInterval);
  886. this.hitStrengthOpacityInterval = null;
  887. }
  888. this.hitStrengthOpacity = 1;
  889. this.hitStrengthOpacityInterval = setTimeout(() => {
  890. this.hitStrengthOpacity = 0;
  891. }, 1000)
  892. },
  893. //pk模式下的打击
  894. _pkHitOnly(acc, power) {
  895. this.onPKModePlayPowerAnimation();
  896. this.PKAllTempHitCount++;
  897. this.PKAllShowHitCount++;
  898. this.PKTempHitCount++;
  899. this.currentHitStrength = power;
  900. if (this.PKMaxStrength < power) {
  901. this.PKMaxStrength = power;
  902. }
  903. this.PKAllStrength += power;
  904. this.PKAverageStrength = (this.PKAllStrength / this.PKAllShowHitCount).toFixed(1);
  905. //击打次数一个卡路里,就是基础卡路里
  906. this.PKCalorie = puchConfig.getBoxingCalorie(this.PKAllTempHitCount);
  907. //击打的加速度添加的卡路里,是额外计算的卡路里
  908. // this.PKOtherCalorie += puchConfig.getAccCalorie(acc);
  909. // console.log( puchConfig.getAccCalorie(acc),this.calorie);
  910. let _all = this.PKCalorie; // this.PKCalorie.add(this.PKOtherCalorie);
  911. //10 大卡,为一个周期 分25份
  912. // this.myPowerCount = parseInt(_all * 2.5 * 20);
  913. //中一个小拳头扣一滴血,中一个中拳头去2滴血,中一个大拳头去3滴血。
  914. let _myBloodPoint = this._onReducedBlood(acc);
  915. this.myPowerCount += _myBloodPoint;
  916. //用户打击完成
  917. if (this.myPowerCount >= this.maxShowCount) {
  918. console.log("this.calorie:", this.PKCalorie, this.PKOtherCalorie, _all);
  919. this.$emit('updateCalorie', _all);
  920. this.PKAllTempHitCount = 0;
  921. this.myPowerCount = 0;
  922. this.myShowCount = 0;
  923. this.PKOtherCalorie = 0;
  924. //通知结果
  925. this.$emit('gameOver', {
  926. myWin: true
  927. });
  928. this._PKOver();
  929. this.aiPowerCount = 0;
  930. this.aiShowCount = 0;
  931. }
  932. this.$emit('hitEvent', _myBloodPoint);
  933. },
  934. onAiHitEvent() {
  935. let _acc = Math.ceil(Math.random() * 30);
  936. let _aiBloodPoint = this._onReducedBlood(_acc);
  937. this.aiPowerCount += _aiBloodPoint;
  938. // this.aiPowerCount += 20;
  939. this.$emit('aiHitEvent', _aiBloodPoint);
  940. this.aiShowCount = this.aiPowerCount; // parseInt(this.aiPowerCount / 10);
  941. if (this.aiShowCount >= this.maxShowCount) {
  942. this.$emit('gameOver', {
  943. myWin: false
  944. });
  945. this._PKOver();
  946. this.aiPowerCount = 0;
  947. this.aiShowCount = 0;
  948. this.myPowerCount = 0;
  949. this.myShowCount = 0;
  950. }
  951. },
  952. //根据加速度计算血量
  953. _onReducedBlood(acc) {
  954. let _ratio = acc > 30 ? 1 : acc / 30;
  955. // console.log("_ratio:", _ratio);
  956. if (_ratio > 0.9) {
  957. //大拳头
  958. return 3;
  959. } else if (_ratio > 0.7) {
  960. //中拳头
  961. return 2;
  962. } else {
  963. //小拳头
  964. return 1;
  965. }
  966. },
  967. onChangeMode() {
  968. //todo 切换模式时候,停止当前运行状态
  969. if (this.bControlRun) {
  970. uni.showToast({
  971. title: '先停止,再切换模式',
  972. mask: true,
  973. icon: 'none',
  974. duration: 2000,
  975. })
  976. return;
  977. }
  978. //当前的拳击力设置为0
  979. this.currentHitStrength = 0;
  980. let _name = 'pk模式';
  981. if (this.mode == 'pkMode') {
  982. this.mode = 'calorieMode';
  983. _name = '长跑模式'; //健身模式
  984. } else if (this.mode == 'calorieMode') {
  985. this.mode = 'pkMode';
  986. _name = 'pk模式';
  987. }
  988. let _data = {
  989. mode: this.mode,
  990. name: _name
  991. }
  992. this.$emit('modeEvent', _data);
  993. },
  994. //设置一个切换模式
  995. onSetMode(modeValue) {
  996. console.log("modeValue =====", modeValue);
  997. //todo 切换模式时候,停止当前运行状态
  998. if (this.bControlRun) {
  999. uni.showToast({
  1000. title: '先停止,再切换模式',
  1001. mask: true,
  1002. icon: 'none',
  1003. duration: 2000,
  1004. })
  1005. return;
  1006. }
  1007. //当前的拳击力设置为0
  1008. this.currentHitStrength = 0;
  1009. let _name = 'pk模式';
  1010. if (modeValue == 'calorieMode') {
  1011. this.mode = 'calorieMode';
  1012. _name = '长跑模式';
  1013. } else if (modeValue == 'pkMode') {
  1014. this.mode = 'pkMode';
  1015. _name = 'pk模式';
  1016. } else if(modeValue == 'ropeMode'){
  1017. this.mode = 'ropeMode';
  1018. _name = '跳绳模式'
  1019. }
  1020. let _data = {
  1021. mode: this.mode,
  1022. name: _name
  1023. }
  1024. this.$emit('modeEvent', _data);
  1025. }
  1026. }
  1027. }
  1028. </script>
  1029. <style>
  1030. /* Loader Bar */
  1031. .hit-vertical-container {
  1032. position: absolute;
  1033. top: -50rpx;
  1034. left: 0;
  1035. right: 0;
  1036. display: flex;
  1037. justify-content: space-between;
  1038. /* border: 1rpx solid #000000; */
  1039. pointer-events: none;
  1040. }
  1041. .hit-vertical-bar {
  1042. display: flex;
  1043. flex-direction: column-reverse;
  1044. }
  1045. .hit-vertical-child {
  1046. /* position: relative; */
  1047. width: 70rpx;
  1048. height: 20rpx;
  1049. margin: 14rpx 24rpx 0 24rpx;
  1050. display: flex;
  1051. /* align-content: center; */
  1052. justify-content: space-between;
  1053. }
  1054. .hit-vertical-text {
  1055. color: #FFFFFF;
  1056. font-size: 8px;
  1057. }
  1058. .hit-text-hidden {
  1059. visibility: hidden;
  1060. }
  1061. .hit-vertical-active {
  1062. background-color: #FFFFFF;
  1063. width: 30rpx;
  1064. height: 100%;
  1065. }
  1066. .hit-vertical-inactive {
  1067. width: 30rpx;
  1068. height: 100%;
  1069. background: rgba(144, 141, 246, 1);
  1070. }
  1071. .boxing-item-bg {
  1072. border-radius: 15rpx;
  1073. background-color: rgba(255, 255, 255, 0.1);
  1074. display: flex;
  1075. flex-direction: column;
  1076. align-items: center;
  1077. /* width: 160rpx; */
  1078. }
  1079. .hit-count {
  1080. width: 160rpx;
  1081. height: 60rpx;
  1082. font-size: 22px;
  1083. font-weight: bold;
  1084. color: #FFFFFF;
  1085. line-height: 60rpx;
  1086. }
  1087. .hit-current-count-power {
  1088. /* margin: 0 5rpx; */
  1089. font-size: 19px;
  1090. line-height: 60rpx;
  1091. /* font-weight: bold; */
  1092. color: #FFFFFF;
  1093. }
  1094. .hit-current-count {
  1095. /* width: 160rpx; */
  1096. /* height: 100rpx; */
  1097. margin: 0 30rpx;
  1098. font-size: 22px;
  1099. line-height: 60rpx;
  1100. font-weight: bold;
  1101. color: #FFFFFF;
  1102. /* line-height: 22px; */
  1103. }
  1104. #loadbar {
  1105. list-style: none;
  1106. width: 400rpx;
  1107. margin: 0 20rpx;
  1108. }
  1109. #loadbar-child {
  1110. float: left;
  1111. position: relative;
  1112. width: 60rpx;
  1113. height: 10rpx;
  1114. margin-left: 1px;
  1115. background: rgba(255, 255, 255, 0.5);
  1116. }
  1117. #loadbar-child:first-child {
  1118. margin-left: 0;
  1119. }
  1120. .bar {
  1121. background-color: #FFFFFF;
  1122. width: 60rpx;
  1123. height: 10rpx;
  1124. }
  1125. .show-png {
  1126. width: 78rpx;
  1127. height: 78rpx;
  1128. margin: 0 10px;
  1129. }
  1130. .boxing-hit-png {
  1131. margin-top: 40rpx;
  1132. width: 50rpx;
  1133. height: 50rpx;
  1134. transition: transform 0.15s;
  1135. }
  1136. .boxing-change {
  1137. transform: scale(1.58);
  1138. }
  1139. .hitBoxingTimer {
  1140. position: absolute;
  1141. top: -60rpx;
  1142. left: 0;
  1143. right: 0;
  1144. }
  1145. .wave-item {
  1146. width: 8rpx;
  1147. height: 20rpx;
  1148. margin: 5rpx;
  1149. background-color: #FFFFFF;
  1150. border-radius: 10rpx;
  1151. transition: height 0.5s;
  1152. }
  1153. .wave-d-item {
  1154. width: 8rpx;
  1155. height: 20rpx;
  1156. margin: 5rpx;
  1157. background-color: #FFFFFF;
  1158. border-radius: 10rpx;
  1159. transition: height 0.5s;
  1160. }
  1161. .hit-wave {
  1162. animation: hit-d-scale calc(var(--time) * 0.5s) linear calc(var(--delay) * 1s) 1 alternate;
  1163. }
  1164. .wave-play {
  1165. animation-play-state: running;
  1166. }
  1167. .wave-pause {
  1168. animation-play-state: paused;
  1169. }
  1170. @keyframes hit-scale {
  1171. 0% {
  1172. transform: scale(1, 1);
  1173. /* background-color: #999; */
  1174. }
  1175. 100% {
  1176. transform: scale(1, 3);
  1177. /* background-color: #333; */
  1178. }
  1179. }
  1180. @keyframes hit-d-scale {
  1181. 0% {
  1182. transform: scale(1, 1);
  1183. }
  1184. 25% {
  1185. transform: scale(1, 3);
  1186. }
  1187. 50% {
  1188. transform: scale(1, 1);
  1189. }
  1190. 75% {
  1191. transform: scale(1, 3);
  1192. }
  1193. 100% {
  1194. transform: scale(1, 1);
  1195. }
  1196. }
  1197. .hit-button-rotate {
  1198. animation: hit-rotate 2s steps(16, end) infinite;
  1199. }
  1200. .hit-button-bg-play {
  1201. animation-play-state: running;
  1202. }
  1203. .hit-button-bg-paused {
  1204. animation-play-state: paused;
  1205. }
  1206. @keyframes hit-rotate {
  1207. from {
  1208. transform: rotate(0deg);
  1209. }
  1210. to {
  1211. transform: rotate(360deg);
  1212. }
  1213. }
  1214. .big {
  1215. transform: scale(1.2);
  1216. }
  1217. /* .progress-bar-container{
  1218. } */
  1219. </style>