Ver Fonte

no message

zhejiushizhuce há 2 anos atrás
pai
commit
d553f30712

+ 3 - 1
src/components/DropCoins.jsx

@@ -8,6 +8,7 @@ import logo from '@assets/dropcoin.json';
 import flycoin from '@assets/flycoin.json';
 import {useEffect, useRef, useState} from "react";
 import styled from "styled-components/macro";
+import SoundHelp from "@utils/SoundManger";
 
 const objInfo={
     timerIds:[]
@@ -42,7 +43,8 @@ const DropCoins = ({...props}) => {
         if (isShow){
             let timer=setTimeout(()=>{
                 coinRef.current.setSpeed(1.5);
-                coinRef.current.play()
+                coinRef.current.play();
+                SoundHelp.playSound("sound_bonus");
             },100)
             objInfo.timerIds.push(timer);
             coins.forEach((coin,i)=>{

+ 1 - 0
src/components/GameItem/styles.module.scss

@@ -89,6 +89,7 @@
       fill:  rgba(0, 0, 0, 0.5);
       background: rgba(255, 255, 255, 0.1);
       border-radius: 50%;
+      transition: all var(--transition);
       &_active{
         padding: 0.2rem 0.2rem 0.27rem 0.2rem;
         fill: #ffdf46;

+ 1 - 1
src/components/GameList/index.jsx

@@ -107,7 +107,7 @@ const GameList=({data,status,reqMore,user})=>{
             let rect=target.getBoundingClientRect();
             let cH = document.documentElement.clientHeight;
             let cB=rect.bottom;
-            if (cH-cB>80)row=row+1;
+            if (cH-cB>90)row=row+1;
         }else row=row+1;
         if (row>=total)row=total-1;
         let roomRowItem={

+ 19 - 6
src/components/GameSmallList/index.jsx

@@ -121,11 +121,16 @@ const GameSmallList=({data,user})=>{
             let rect=gridList.getBoundingClientRect();
             let gridListTop=rect.top-rectP.top;
             let height=0;
+            let gap=0;
             if (gridList.children&&gridList.children.length>0){
                 let first=gridList.children[0];
-                height=first.clientHeight;
+                let cB=rect.top+first.clientHeight;
+                let cH = document.documentElement.clientHeight;
+                if (cH-cB>90){
+                    height=first.clientHeight;
+                    gap=rowGap*16*fontScale;
+                }
             }
-            let gap=rowGap*16*fontScale;
             let top=gridListTop+height+gap*2;
             return top;
         }
@@ -268,11 +273,19 @@ const GameSmallList=({data,user})=>{
     const renderMobileList = () => {
         let gridStyle = {}
         let len=list.length;
+        let roomTop=getRoomConTop();
         if (selected !== -1) {
-            if (len<5){
-                gridStyle.marginBottom=`${rowTop}rem`;
+            let top=roomTop;
+            if (top<50){
+                gridStyle.paddingTop=`${roomHeight+rowGap}rem`;
+            }
+            else
+            {
+                if (len<5){
+                    gridStyle.paddingBottom=`${roomHeight+rowGap}rem`;
+                }
+                else gridStyle.rowGap=`${rowTop}rem`;
             }
-            else gridStyle.rowGap=`${rowTop}rem`;
         }
         return (
             <>
@@ -298,7 +311,7 @@ const GameSmallList=({data,user})=>{
                         })
                     }
                 </div>
-                <StyledRoomCon top={getRoomConTop()}>
+                <StyledRoomCon top={roomTop}>
                     {renderRoom()}
                 </StyledRoomCon>
             </>

+ 5 - 2
src/utils/SoundManger.js

@@ -1,6 +1,8 @@
 import button_click from "@assets/sound/click2.mp3";
+import sound_bonus from "@assets/sound/bonus.mp3";
 const defaultAudio={
-    "button_click":button_click
+    "button_click":button_click,
+    "sound_bonus":sound_bonus
 }
 class SoundManger {
     constructor(){
@@ -85,7 +87,8 @@ class SoundManger {
                 "sound/bonus.mp3",
             ]
             let preNames=[
-                "button_click"
+                "button_click",
+                "sound_bonus",
             ]
             for (let i = 0; i < preAudios.length; i++) {
                 let path=preAudios[i];