|
@@ -43,11 +43,13 @@ export default function LotteryScreen() {
|
|
|
const timerRef = useRef<any>(null);
|
|
const timerRef = useRef<any>(null);
|
|
|
|
|
|
|
|
// Layout calculations
|
|
// Layout calculations
|
|
|
- const itemWidth = (num === 1) ? 94 : 72; // Adjusted to 72 to match mask calculation exactly (was 71)
|
|
|
|
|
- // Uniapp width logic:
|
|
|
|
|
- // width() { return (screenWidth - (this.num == 1 ? 94 : 72)) / 2 }
|
|
|
|
|
- const maskWidth = (SCREEN_WIDTH - ((num === 1) ? 94 : 72)) / 2;
|
|
|
|
|
|
|
+ const singleItemWidth = 240;
|
|
|
|
|
+ const itemWidth = (num === 1) ? singleItemWidth : 72;
|
|
|
|
|
+ const maskWidth = (SCREEN_WIDTH - ((num === 1) ? singleItemWidth : 72)) / 2;
|
|
|
const padding = SCREEN_WIDTH > 375 ? 32 : 0;
|
|
const padding = SCREEN_WIDTH > 375 ? 32 : 0;
|
|
|
|
|
+
|
|
|
|
|
+ // Dynamic styles
|
|
|
|
|
+ const singleReelHeight = singleItemWidth * 1.35 + 20; // 324 + 20
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
init();
|
|
init();
|
|
@@ -56,6 +58,12 @@ export default function LotteryScreen() {
|
|
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
|
};
|
|
};
|
|
|
}, []);
|
|
}, []);
|
|
|
|
|
+
|
|
|
|
|
+ // ... (rest of the file)
|
|
|
|
|
+
|
|
|
|
|
+ // Update render styles inline or via StyleSheet
|
|
|
|
|
+ // I will update the stylesheet usage in return and the StyleSheet definition below
|
|
|
|
|
+
|
|
|
|
|
|
|
|
const init = async () => {
|
|
const init = async () => {
|
|
|
try {
|
|
try {
|
|
@@ -201,7 +209,13 @@ export default function LotteryScreen() {
|
|
|
{/* Reels */}
|
|
{/* Reels */}
|
|
|
<View style={num === 1 ? styles.height1 : styles.height5}>
|
|
<View style={num === 1 ? styles.height1 : styles.height5}>
|
|
|
{results.map((item, index) => (
|
|
{results.map((item, index) => (
|
|
|
- <View key={index} style={styles.reelRow}>
|
|
|
|
|
|
|
+ <View
|
|
|
|
|
+ key={index}
|
|
|
|
|
+ style={[
|
|
|
|
|
+ styles.reelRow,
|
|
|
|
|
+ num === 1 && { height: singleReelHeight, marginBottom: 0 }
|
|
|
|
|
+ ]}
|
|
|
|
|
+ >
|
|
|
<LotteryReel
|
|
<LotteryReel
|
|
|
key={`reel-${index}-${pool.length}-${results.length}`}
|
|
key={`reel-${index}-${pool.length}-${results.length}`}
|
|
|
pool={pool.length > 0 ? pool : results}
|
|
pool={pool.length > 0 ? pool : results}
|
|
@@ -225,8 +239,8 @@ export default function LotteryScreen() {
|
|
|
style={[
|
|
style={[
|
|
|
styles.middleImage,
|
|
styles.middleImage,
|
|
|
{
|
|
{
|
|
|
- height: num === 1 ? 200 : 540,
|
|
|
|
|
- top: num === 1 ? -35 : -10,
|
|
|
|
|
|
|
+ height: num === 1 ? 360 : 540,
|
|
|
|
|
+ top: num === 1 ? -20 : -10,
|
|
|
}
|
|
}
|
|
|
]}
|
|
]}
|
|
|
contentFit="contain"
|
|
contentFit="contain"
|
|
@@ -235,6 +249,7 @@ export default function LotteryScreen() {
|
|
|
)}
|
|
)}
|
|
|
</View>
|
|
</View>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
{/* Video Overlay */}
|
|
{/* Video Overlay */}
|
|
|
{videoVisible && videoUrl ? (
|
|
{videoVisible && videoUrl ? (
|
|
|
<View style={styles.videoContainer}>
|
|
<View style={styles.videoContainer}>
|
|
@@ -298,7 +313,8 @@ const styles = StyleSheet.create({
|
|
|
flex: 1,
|
|
flex: 1,
|
|
|
// justifyContent: 'center',
|
|
// justifyContent: 'center',
|
|
|
alignItems: 'center',
|
|
alignItems: 'center',
|
|
|
- marginTop: 100, // Adjust based on visual
|
|
|
|
|
|
|
+ marginTop: 0, // Remove fixed margin, let flex center it or use justify center if needed
|
|
|
|
|
+ justifyContent: 'center', // Center vertically
|
|
|
},
|
|
},
|
|
|
reelsContainer: {
|
|
reelsContainer: {
|
|
|
position: 'relative',
|
|
position: 'relative',
|
|
@@ -315,7 +331,7 @@ const styles = StyleSheet.create({
|
|
|
height: 94, // Height of one row (card height + tiny padding)
|
|
height: 94, // Height of one row (card height + tiny padding)
|
|
|
},
|
|
},
|
|
|
height1: {
|
|
height1: {
|
|
|
- height: 130, // 1 row + gaps
|
|
|
|
|
|
|
+ height: 360, // Accommodate larger card (approx 325px height)
|
|
|
justifyContent: 'center',
|
|
justifyContent: 'center',
|
|
|
},
|
|
},
|
|
|
height5: {
|
|
height5: {
|