floating-games-sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/package.json +44 -0
  2. package/src/FloatingGames.tsx +25 -0
  3. package/src/assets/fonts/Creepster-Regular.ttf +0 -0
  4. package/src/assets/images/android-icon-background.png +0 -0
  5. package/src/assets/images/android-icon-foreground.png +0 -0
  6. package/src/assets/images/android-icon-monochrome.png +0 -0
  7. package/src/assets/images/blocks-icon.png +0 -0
  8. package/src/assets/images/bright-rubber-puzzles-blue.png +0 -0
  9. package/src/assets/images/close.png +0 -0
  10. package/src/assets/images/eriri.png +0 -0
  11. package/src/assets/images/favicon.png +0 -0
  12. package/src/assets/images/first-play.png +0 -0
  13. package/src/assets/images/game-over.gif +0 -0
  14. package/src/assets/images/game-pad.png +0 -0
  15. package/src/assets/images/game-pad2.png +0 -0
  16. package/src/assets/images/game-page-bg1.png +0 -0
  17. package/src/assets/images/hands-down-bg.png +0 -0
  18. package/src/assets/images/icon.png +0 -0
  19. package/src/assets/images/lets-play.gif +0 -0
  20. package/src/assets/images/lucky-day.gif +0 -0
  21. package/src/assets/images/maths.png +0 -0
  22. package/src/assets/images/not-playing.png +0 -0
  23. package/src/assets/images/number-puzzle-select.png +0 -0
  24. package/src/assets/images/number-puzzle-selector.png +0 -0
  25. package/src/assets/images/pause-clock.png +0 -0
  26. package/src/assets/images/pause-icon.png +0 -0
  27. package/src/assets/images/play-icon.png +0 -0
  28. package/src/assets/images/play-now.gif +0 -0
  29. package/src/assets/images/play-play.png +0 -0
  30. package/src/assets/images/play.png +0 -0
  31. package/src/assets/images/quit-game.png +0 -0
  32. package/src/assets/images/quit-icon.png +0 -0
  33. package/src/assets/images/quit.png +0 -0
  34. package/src/assets/images/review-win-selector.png +0 -0
  35. package/src/assets/images/select-bg.png +0 -0
  36. package/src/assets/images/select-logo.png +0 -0
  37. package/src/assets/images/spin-wheel-select.png +0 -0
  38. package/src/assets/images/spin-wheel-selector.png +0 -0
  39. package/src/assets/images/splash-icon.png +0 -0
  40. package/src/assets/images/start-button.png +0 -0
  41. package/src/assets/images/start-game.png +0 -0
  42. package/src/assets/images/stop-quit.png +0 -0
  43. package/src/assets/images/waiting-for-you.gif +0 -0
  44. package/src/assets/sounds/selector-music.mp3 +0 -0
  45. package/src/assets/sounds/timeup-sound.wav +0 -0
  46. package/src/components/atoms/Amount.tsx +48 -0
  47. package/src/components/atoms/FloatingMenu.tsx +119 -0
  48. package/src/components/atoms/ShimmerHR.tsx +64 -0
  49. package/src/components/atoms/UseAnimatedCounter.tsx +31 -0
  50. package/src/components/games/Chain.tsx +26 -0
  51. package/src/components/games/GameItem.tsx +38 -0
  52. package/src/components/games/GameSelectorScreen.tsx +221 -0
  53. package/src/components/games/GameSplash.tsx +44 -0
  54. package/src/components/games/HangingSign.tsx +75 -0
  55. package/src/components/games/SplashScreen.tsx +69 -0
  56. package/src/components/games/number-puzzle/DragTile.tsx +65 -0
  57. package/src/components/games/number-puzzle/GameScreen.tsx +597 -0
  58. package/src/components/games/number-puzzle/PuzzleSplash.tsx +50 -0
  59. package/src/components/games/number-puzzle/TileComponent.tsx +47 -0
  60. package/src/components/games/review-and-win/EmojiTracker.tsx +96 -0
  61. package/src/components/games/review-and-win/GameScreen.tsx +135 -0
  62. package/src/components/games/review-and-win/Tile.tsx +60 -0
  63. package/src/components/games/spin-wheel/SpinAndWin.tsx +507 -0
  64. package/src/components/payment/CheckoutScreen.tsx +50 -0
  65. package/src/components/payment/FundAccount.tsx +281 -0
  66. package/src/components/payment/Payment.tsx +45 -0
  67. package/src/components/reusables/AppSelect.tsx +70 -0
  68. package/src/components/reusables/CountdownTimer.tsx +116 -0
  69. package/src/components/reusables/FloatingButton.tsx +71 -0
  70. package/src/components/reusables/SoundPlayer.ts +28 -0
  71. package/src/components/utils/shuffle.ts +48 -0
  72. package/src/context/GameContext.tsx +15 -0
  73. package/src/index.tsx +5 -0
  74. package/src/modals/BottomSheetModal.tsx +38 -0
  75. package/src/modals/GameOverModal.tsx +76 -0
  76. package/src/modals/PauseModal.tsx +95 -0
  77. package/src/navigation/GameNavigator.tsx +48 -0
@@ -0,0 +1,38 @@
1
+ import React, { forwardRef, useMemo } from 'react';
2
+ import { View, Text, StyleSheet } from 'react-native';
3
+ import BottomSheet from '@gorhom/bottom-sheet';
4
+
5
+ type Props = {
6
+ children: React.ReactNode;
7
+ };
8
+
9
+ const AppBottomSheet = forwardRef<BottomSheet, Props>(({ children }, ref) => {
10
+ const snapPoints = useMemo(() => ['25%', '50%'], []);
11
+
12
+ return (
13
+ <BottomSheet
14
+ ref={ref}
15
+ snapPoints={snapPoints}
16
+ index={-1}
17
+ enablePanDownToClose
18
+ backgroundStyle={styles.bg}
19
+ >
20
+ <View style={styles.content}>
21
+ {children}
22
+ </View>
23
+ </BottomSheet>
24
+ );
25
+ });
26
+
27
+ export default AppBottomSheet;
28
+
29
+ const styles = StyleSheet.create({
30
+ bg: {
31
+ borderRadius: 20,
32
+ backgroundColor: '#f00'
33
+ },
34
+ content: {
35
+ flex: 1,
36
+ padding: 20,
37
+ },
38
+ });
@@ -0,0 +1,76 @@
1
+ import React from 'react';
2
+ import { Modal, View, Text, TouchableOpacity, StyleSheet, Image } from 'react-native';
3
+
4
+ type Props = {
5
+ visible: boolean;
6
+ onClose: () => void;
7
+ title?: string;
8
+ children?: React.ReactNode;
9
+ };
10
+
11
+ export default function GameOverModal({
12
+ visible,
13
+ onClose,
14
+ title,
15
+ children,
16
+ }: Props) {
17
+ return (
18
+ <Modal
19
+ transparent
20
+ visible={ visible }
21
+ animationType="fade"
22
+ onRequestClose={ onClose }
23
+ >
24
+ <View style={ styles.overlay }>
25
+ <View style={ styles.container }>
26
+
27
+ { /*{title && <Text style={styles.title}>{title}</Text>}*/ }
28
+
29
+ { /*{children}*/ }
30
+
31
+ <View style={ { justifyContent:'center',alignSelf:'center',alignItems:'center' } }>
32
+ <Image
33
+ source={ require('../assets/images/game-over.gif') }
34
+ style={ { width: 200, height: 200, marginTop: 20 } }
35
+ resizeMode="contain"
36
+ />
37
+ </View>
38
+
39
+ { /*<TouchableOpacity style={styles.button} onPress={onClose}>*/ }
40
+ { /* <Text style={styles.btnText}>Close</Text>*/ }
41
+ { /*</TouchableOpacity>*/ }
42
+
43
+ </View>
44
+ </View>
45
+ </Modal>
46
+ );
47
+ }
48
+
49
+ const styles = StyleSheet.create({
50
+ overlay: {
51
+ flex: 1,
52
+ backgroundColor: 'rgba(0,0,0,0.5)',
53
+ justifyContent: 'center',
54
+ alignItems: 'center',
55
+ zIndex: 999
56
+ },
57
+ container: {
58
+ // width: '85%',
59
+ backgroundColor: 'transparent',
60
+ // borderRadius: 12,
61
+ padding: 0,
62
+ },
63
+ title: {
64
+ fontSize: 18,
65
+ fontWeight: '700',
66
+ marginBottom: 10,
67
+ },
68
+ button: {
69
+ alignSelf: 'flex-end',
70
+ marginTop: 15,
71
+ },
72
+ btnText: {
73
+ fontSize: 16,
74
+ color: '#2563eb',
75
+ },
76
+ });
@@ -0,0 +1,95 @@
1
+ import React from 'react';
2
+ import { Modal, View, TouchableOpacity, StyleSheet, Image } from 'react-native';
3
+ import FloatingButton from '../components/reusables/FloatingButton';
4
+
5
+ type Props = {
6
+ visible: boolean;
7
+ onClose: () => void;
8
+ title?: string;
9
+ children?: React.ReactNode;
10
+ };
11
+
12
+ export default function PauseModal({
13
+ visible,
14
+ onClose,
15
+ title,
16
+ children,
17
+ }: Props) {
18
+ return (
19
+ <Modal
20
+ transparent
21
+ visible={ visible }
22
+ animationType="fade"
23
+ onRequestClose={ onClose }
24
+ >
25
+ <View style={ styles.overlay }>
26
+ <View style={ styles.container }>
27
+
28
+ { /*{title && <Text style={styles.title}>{title}</Text>}*/ }
29
+
30
+ { /*{children}*/ }
31
+
32
+ <View style={ { justifyContent: 'center', alignSelf: 'center', alignItems: 'center' } }>
33
+ <FloatingButton preset="left">
34
+ <Image
35
+ source={ require('../assets/images/pause-clock.png') }
36
+ style={ { width: 150, height: 150, marginTop: 20 } }
37
+ resizeMode="contain"
38
+ />
39
+ </FloatingButton>
40
+ </View>
41
+
42
+ { /*<TouchableOpacity style={styles.button} onPress={onClose}>*/ }
43
+ { /* <Text style={styles.btnText}>Close</Text>*/ }
44
+ { /*</TouchableOpacity>*/ }
45
+
46
+ </View>
47
+ <FloatingButton preset="left">
48
+ <TouchableOpacity style={ styles.button } onPress={ onClose }>
49
+ { /*<Text>Continue</Text>*/ }
50
+ <Image
51
+ source={ require('../assets/images/start-button.png') }
52
+ style={ { width: 130, height: 90 } }
53
+ resizeMode="cover"
54
+ />
55
+ </TouchableOpacity>
56
+ </FloatingButton>
57
+ </View>
58
+ </Modal>
59
+ );
60
+ }
61
+
62
+ const styles = StyleSheet.create({
63
+ overlay: {
64
+ flex: 1,
65
+ backgroundColor: 'rgba(0,0,0,0.9)',
66
+ justifyContent: 'center',
67
+ alignItems: 'center',
68
+ zIndex: 999
69
+ },
70
+ container: {
71
+ // width: '85%',
72
+ // backgroundColor: '#807e7e',
73
+ // borderRadius: 12,
74
+ padding: 0,
75
+ },
76
+ title: {
77
+ fontSize: 18,
78
+ fontWeight: '700',
79
+ marginBottom: 10,
80
+ },
81
+ button: {
82
+ alignSelf: 'center',
83
+ marginTop: 25,
84
+ // borderColor: '#eee',
85
+ // borderWidth: 1,
86
+ // paddingHorizontal: 10,
87
+ // paddingVertical: 2,
88
+ borderRadius: 50,
89
+ // backgroundColor: 'rgba(44,43,43,0.5)'
90
+ },
91
+ btnText: {
92
+ fontSize: 16,
93
+ color: '#2563eb',
94
+ },
95
+ });
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+ import { GestureHandlerRootView } from 'react-native-gesture-handler';
3
+ import { createNativeStackNavigator } from '@react-navigation/native-stack';
4
+ import { LogBox } from 'react-native';
5
+
6
+ import SplashScreen from '../components/games/SplashScreen';
7
+ import GameSelectorScreen from '../components/games/GameSelectorScreen';
8
+ import NumberPuzzle from '../components/games/number-puzzle/GameScreen';
9
+ import SpinAndWin from '../components/games/spin-wheel/SpinAndWin';
10
+ import ReviewWin from '../components/games/review-and-win/GameScreen';
11
+ import GameSplash from '../components/games/GameSplash';
12
+ import FundAccount from '../components/payment/FundAccount';
13
+
14
+ LogBox.ignoreLogs(['SafeAreaView has been deprecated']);
15
+
16
+ export type RootStackParamList = {
17
+ Splash: undefined;
18
+ Payment: undefined;
19
+ GameSelector: undefined;
20
+ GameSplash: {
21
+ icon?: string;
22
+ title?: string;
23
+ backgroundColor?: string;
24
+ backgroundImage?: any;
25
+ navigateTo: 'Game1' | 'Game2' | 'Game3';
26
+ };
27
+ Game1: undefined;
28
+ Game2: undefined;
29
+ Game3: undefined;
30
+ };
31
+
32
+ const Stack = createNativeStackNavigator<RootStackParamList>();
33
+
34
+ export default function GameNavigator() {
35
+ return (
36
+ <GestureHandlerRootView style={{ flex: 1 }}>
37
+ <Stack.Navigator screenOptions={{ headerShown: false }}>
38
+ <Stack.Screen name="Splash" component={SplashScreen} />
39
+ <Stack.Screen name="Payment" component={FundAccount} />
40
+ <Stack.Screen name="GameSelector" component={GameSelectorScreen} />
41
+ <Stack.Screen name="GameSplash" component={GameSplash} />
42
+ <Stack.Screen name="Game1" component={NumberPuzzle} />
43
+ <Stack.Screen name="Game2" component={SpinAndWin} />
44
+ <Stack.Screen name="Game3" component={ReviewWin} />
45
+ </Stack.Navigator>
46
+ </GestureHandlerRootView>
47
+ );
48
+ }