react-native-games 1.1.0 → 1.2.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.
- package/README.md +58 -7
- package/lib/module/games/balloon-blaster/BalloonBlaster.js +1 -167
- package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js +1 -182
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js +1 -318
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js +1 -183
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js +1 -237
- package/lib/module/games/balloon-blaster/components/GameArea.js +1 -156
- package/lib/module/games/balloon-blaster/components/GameBackground.js +1 -476
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js +1 -112
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/index.js +1 -7
- package/lib/module/games/candy-crush/CandyCrush.js +1 -131
- package/lib/module/games/candy-crush/CandyCrush.js.map +1 -1
- package/lib/module/games/candy-crush/CandyCrushConstants.js +1 -125
- package/lib/module/games/candy-crush/CandyCrushConstants.js.map +1 -1
- package/lib/module/games/candy-crush/CandyCrushService.js +1 -370
- package/lib/module/games/candy-crush/CandyCrushStore.js +1 -303
- package/lib/module/games/candy-crush/components/CandyItem.js +1 -191
- package/lib/module/games/candy-crush/components/GameBackground.js +1 -85
- package/lib/module/games/candy-crush/components/GameGrid.js +1 -314
- package/lib/module/games/candy-crush/components/ScoreBoard.js +1 -79
- package/lib/module/games/candy-crush/components/index.js +1 -7
- package/lib/module/games/candy-crush/index.js +1 -6
- package/lib/module/games/colors-sort/ColorsSort.js +1 -143
- package/lib/module/games/colors-sort/ColorsSort.js.map +1 -1
- package/lib/module/games/colors-sort/ColorsSortConstants.js +1 -72
- package/lib/module/games/colors-sort/ColorsSortConstants.js.map +1 -1
- package/lib/module/games/colors-sort/ColorsSortService.js +1 -255
- package/lib/module/games/colors-sort/ColorsSortStore.js +1 -257
- package/lib/module/games/colors-sort/ColorsSortStore.js.map +1 -1
- package/lib/module/games/colors-sort/components/ColorContainer.js +1 -140
- package/lib/module/games/colors-sort/components/GameBackground.js +1 -135
- package/lib/module/games/colors-sort/components/ScoreBoard.js +1 -70
- package/lib/module/games/colors-sort/components/index.js +1 -6
- package/lib/module/games/dino-jump/DinoJump.js +1 -209
- package/lib/module/games/dino-jump/DinoJump.js.map +1 -1
- package/lib/module/games/dino-jump/DinoJumpConstants.js +1 -189
- package/lib/module/games/dino-jump/DinoJumpConstants.js.map +1 -1
- package/lib/module/games/dino-jump/DinoJumpService.js +1 -270
- package/lib/module/games/dino-jump/DinoJumpStore.js +1 -381
- package/lib/module/games/dino-jump/components/DinoSprite.js +1 -418
- package/lib/module/games/dino-jump/components/DinoSprite.js.map +1 -1
- package/lib/module/games/dino-jump/components/GameArea.js +1 -68
- package/lib/module/games/dino-jump/components/GameBackground.js +1 -444
- package/lib/module/games/dino-jump/components/ObstacleSprite.js +1 -306
- package/lib/module/games/dino-jump/components/ScoreBoard.js +1 -105
- package/lib/module/games/dino-jump/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/dino-jump/components/StarSprite.js +1 -45
- package/lib/module/games/dino-jump/components/index.js +1 -9
- package/lib/module/games/flappy-bird/FlappyBird.js +1 -126
- package/lib/module/games/flappy-bird/FlappyBird.js.map +1 -1
- package/lib/module/games/flappy-bird/FlappyBirdConstants.js +1 -90
- package/lib/module/games/flappy-bird/FlappyBirdConstants.js.map +1 -1
- package/lib/module/games/flappy-bird/FlappyBirdStore.js +1 -300
- package/lib/module/games/flappy-bird/components/Bird.js +1 -87
- package/lib/module/games/flappy-bird/components/GameArea.js +1 -87
- package/lib/module/games/flappy-bird/components/GameBackground.js +1 -79
- package/lib/module/games/flappy-bird/components/Pipes.js +1 -172
- package/lib/module/games/flappy-bird/components/ScoreBoard.js +1 -73
- package/lib/module/games/flappy-bird/components/index.js +1 -8
- package/lib/module/games/fruit-merger/FruitMerger.js +1 -120
- package/lib/module/games/fruit-merger/FruitMerger.js.map +1 -1
- package/lib/module/games/fruit-merger/FruitMergerConstants.js +1 -119
- package/lib/module/games/fruit-merger/FruitMergerConstants.js.map +1 -1
- package/lib/module/games/fruit-merger/FruitMergerService.js +1 -13
- package/lib/module/games/fruit-merger/FruitMergerStore.js +1 -315
- package/lib/module/games/fruit-merger/components/FruitItem.js +1 -102
- package/lib/module/games/fruit-merger/components/GameArea.js +1 -103
- package/lib/module/games/fruit-merger/components/GameBackground.js +1 -498
- package/lib/module/games/fruit-merger/components/ScoreBoard.js +1 -58
- package/lib/module/games/fruit-merger/components/index.js +1 -7
- package/lib/module/games/fruit-ninja/FruitNinja.js +1 -134
- package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js +1 -148
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinjaService.js +1 -311
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js +1 -191
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js.map +1 -1
- package/lib/module/games/fruit-ninja/components/FruitComponent.js +1 -99
- package/lib/module/games/fruit-ninja/components/GameArea.js +1 -215
- package/lib/module/games/fruit-ninja/components/GameBackground.js +1 -1267
- package/lib/module/games/fruit-ninja/components/ScoreBoard.js +1 -92
- package/lib/module/games/fruit-ninja/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/fruit-ninja/components/index.js +1 -7
- package/lib/module/games/game-2048/Game2048.js +1 -149
- package/lib/module/games/game-2048/Game2048.js.map +1 -1
- package/lib/module/games/game-2048/Game2048Constants.js +1 -263
- package/lib/module/games/game-2048/Game2048Constants.js.map +1 -1
- package/lib/module/games/game-2048/Game2048Service.js +1 -457
- package/lib/module/games/game-2048/Game2048Store.js +1 -236
- package/lib/module/games/game-2048/components/GameBackground.js +1 -247
- package/lib/module/games/game-2048/components/GameGrid.js +1 -139
- package/lib/module/games/game-2048/components/GameTile.js +1 -72
- package/lib/module/games/game-2048/components/ScoreBoard.js +1 -52
- package/lib/module/games/game-2048/components/index.js +1 -7
- package/lib/module/games/maze-runner/MazeRunner.js +1 -267
- package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
- package/lib/module/games/maze-runner/MazeRunnerConstants.js +1 -100
- package/lib/module/games/maze-runner/MazeRunnerConstants.js.map +1 -1
- package/lib/module/games/maze-runner/MazeRunnerService.js +1 -586
- package/lib/module/games/maze-runner/components/EnhancedBallComponent.js +1 -150
- package/lib/module/games/maze-runner/components/EnhancedGameArea.js +1 -370
- package/lib/module/games/maze-runner/components/GameBackground.js +1 -175
- package/lib/module/games/maze-runner/components/ScoreBoard.js +1 -61
- package/lib/module/games/maze-runner/components/SkiaPipeComponent.js +1 -209
- package/lib/module/games/maze-runner/components/StaticGameBackground.js +1 -169
- package/lib/module/games/maze-runner/components/WallComponent.js +1 -91
- package/lib/module/games/maze-runner/components/index.js +1 -8
- package/lib/module/games/popit-fidget/PopitFidget.js +1 -285
- package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js +1 -113
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidgetService.js +1 -132
- package/lib/module/games/popit-fidget/PopitFidgetStore.js +1 -125
- package/lib/module/games/popit-fidget/components/BubbleComponent.js +1 -198
- package/lib/module/games/popit-fidget/components/FidgetGrid.js +1 -165
- package/lib/module/games/popit-fidget/components/GameBackground.js +1 -177
- package/lib/module/games/popit-fidget/components/ScoreBoard.js +1 -61
- package/lib/module/games/popit-fidget/components/index.js +1 -7
- package/lib/module/games/sliding-numbers/SlidingNumbers.js +1 -159
- package/lib/module/games/sliding-numbers/SlidingNumbers.js.map +1 -1
- package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js +1 -207
- package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js.map +1 -1
- package/lib/module/games/sliding-numbers/SlidingNumbersService.js +1 -248
- package/lib/module/games/sliding-numbers/SlidingNumbersStore.js +1 -274
- package/lib/module/games/sliding-numbers/components/GameBackground.js +1 -259
- package/lib/module/games/sliding-numbers/components/NumbersGrid.js +1 -174
- package/lib/module/games/sliding-numbers/components/NumbersTile.js +1 -116
- package/lib/module/games/sliding-numbers/components/ScoreBoard.js +1 -64
- package/lib/module/games/sliding-numbers/components/index.js +1 -7
- package/lib/module/games/snake/Snake.js +1 -189
- package/lib/module/games/snake/Snake.js.map +1 -1
- package/lib/module/games/snake/SnakeConstants.js +1 -138
- package/lib/module/games/snake/SnakeConstants.js.map +1 -1
- package/lib/module/games/snake/SnakeService.js +1 -148
- package/lib/module/games/snake/SnakeStore.js +1 -182
- package/lib/module/games/snake/components/GameBackground.js +1 -221
- package/lib/module/games/snake/components/GameGrid.js +1 -153
- package/lib/module/games/snake/components/ScoreBoard.js +1 -51
- package/lib/module/games/snake/components/index.js +1 -6
- package/lib/module/games/snake/index.js +1 -6
- package/lib/module/games/space-fighter/SpaceFighter.js +1 -165
- package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -1
- package/lib/module/games/space-fighter/SpaceFighterConstants.js +1 -108
- package/lib/module/games/space-fighter/SpaceFighterConstants.js.map +1 -1
- package/lib/module/games/space-fighter/SpaceFighterService.js +1 -326
- package/lib/module/games/space-fighter/SpaceFighterStore.js +1 -209
- package/lib/module/games/space-fighter/components/AsteroidComponent.js +1 -113
- package/lib/module/games/space-fighter/components/GameArea.js +1 -289
- package/lib/module/games/space-fighter/components/GameBackground.js +1 -239
- package/lib/module/games/space-fighter/components/ScoreBoard.js +1 -136
- package/lib/module/games/space-fighter/components/Spacecraft3D.js +1 -202
- package/lib/module/games/space-fighter/components/SpacecraftPath.js +1 -52
- package/lib/module/games/space-fighter/components/index.js +1 -9
- package/lib/module/games/whack-a-mole/WhackAMole.js +1 -270
- package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -1
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js +1 -115
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js.map +1 -1
- package/lib/module/games/whack-a-mole/WhackAMoleService.js +1 -120
- package/lib/module/games/whack-a-mole/WhackAMoleStore.js +1 -172
- package/lib/module/games/whack-a-mole/components/GameBackground.js +1 -477
- package/lib/module/games/whack-a-mole/components/GameGrid.js +1 -97
- package/lib/module/games/whack-a-mole/components/GameHole.js +1 -196
- package/lib/module/games/whack-a-mole/components/MoleCharacter.js +1 -241
- package/lib/module/games/whack-a-mole/components/ScoreBoard.js +1 -67
- package/lib/module/games/whack-a-mole/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/whack-a-mole/components/index.js +1 -8
- package/lib/module/helpers/AnimationFrame.js +1 -120
- package/lib/module/helpers/AnimationTracker.js +1 -89
- package/lib/module/helpers/ErrorHandler.js +1 -269
- package/lib/module/helpers/GameControlButton.js +1 -219
- package/lib/module/helpers/GameOverModal.js +1 -144
- package/lib/module/helpers/GameOverModal.js.map +1 -1
- package/lib/module/helpers/GameSettingsModal.js +1 -287
- package/lib/module/helpers/ParticleBlast.js +1 -134
- package/lib/module/helpers/ScoreBoardContainer.js +1 -34
- package/lib/module/helpers/index.js +1 -12
- package/lib/module/index.js +1 -22
- package/lib/module/services/GamesConstants.js +1 -178
- package/lib/module/services/GamesService.js +1 -112
- package/lib/module/services/GamesService.js.map +1 -1
- package/lib/module/services/HapticsService.js +1 -77
- package/lib/module/services/SoundsService.js +1 -302
- package/lib/module/services/UtilsService.js +1 -32
- package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/candy-crush/CandyCrushConstants.d.ts +7 -7
- package/lib/typescript/src/games/colors-sort/ColorsSort.d.ts.map +1 -1
- package/lib/typescript/src/games/colors-sort/ColorsSortStore.d.ts.map +1 -1
- package/lib/typescript/src/games/dino-jump/DinoJump.d.ts.map +1 -1
- package/lib/typescript/src/games/dino-jump/components/DinoSprite.d.ts.map +1 -1
- package/lib/typescript/src/games/flappy-bird/FlappyBird.d.ts.map +1 -1
- package/lib/typescript/src/games/flappy-bird/FlappyBirdConstants.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-merger/FruitMerger.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-merger/FruitMergerConstants.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/game-2048/Game2048.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts.map +1 -1
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbers.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts.map +1 -1
- package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts.map +1 -1
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts +1 -1
- package/lib/typescript/src/games/whack-a-mole/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/helpers/GameOverModal.d.ts +3 -0
- package/lib/typescript/src/helpers/GameOverModal.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesConstants.d.ts +7 -7
- package/package.json +2 -2
|
@@ -1,79 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { View, Text, StyleSheet } from 'react-native';
|
|
5
|
-
import { useScore, useTimeRemaining } from "../CandyCrushStore.js";
|
|
6
|
-
import { CANDY_CRUSH_COLORS } from "../CandyCrushConstants.js";
|
|
7
|
-
import { ScoreBoardContainer } from "../../../helpers/index.js";
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
export const ScoreBoard = /*#__PURE__*/React.memo(({
|
|
10
|
-
offset = 0
|
|
11
|
-
}) => {
|
|
12
|
-
const score = useScore();
|
|
13
|
-
const timeRemaining = useTimeRemaining();
|
|
14
|
-
|
|
15
|
-
// Memoized time display calculation
|
|
16
|
-
const timeDisplay = React.useMemo(() => {
|
|
17
|
-
const minutes = Math.floor(timeRemaining / 60);
|
|
18
|
-
const seconds = timeRemaining % 60;
|
|
19
|
-
return `${minutes}:${seconds.toString().padStart(2, '0')}`;
|
|
20
|
-
}, [timeRemaining]);
|
|
21
|
-
|
|
22
|
-
// Memoized color based on time remaining
|
|
23
|
-
const timeColor = React.useMemo(() => {
|
|
24
|
-
if (timeRemaining <= 30) return CANDY_CRUSH_COLORS.TIME_CRITICAL;
|
|
25
|
-
if (timeRemaining <= 60) return CANDY_CRUSH_COLORS.TIME_WARNING;
|
|
26
|
-
return CANDY_CRUSH_COLORS.TIME_GOOD;
|
|
27
|
-
}, [timeRemaining]);
|
|
28
|
-
return /*#__PURE__*/_jsx(ScoreBoardContainer, {
|
|
29
|
-
offset: offset,
|
|
30
|
-
backgroundColor: CANDY_CRUSH_COLORS.SCORE_BACKGROUND,
|
|
31
|
-
borderColor: CANDY_CRUSH_COLORS.GRID_BORDER,
|
|
32
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
33
|
-
style: styles.scoreRow,
|
|
34
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
35
|
-
style: styles.scoreItem,
|
|
36
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
37
|
-
style: styles.label,
|
|
38
|
-
children: "Score"
|
|
39
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
40
|
-
style: styles.value,
|
|
41
|
-
children: score
|
|
42
|
-
})]
|
|
43
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
44
|
-
style: styles.scoreItem,
|
|
45
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
46
|
-
style: styles.label,
|
|
47
|
-
children: "Time"
|
|
48
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
49
|
-
style: [styles.value, {
|
|
50
|
-
color: timeColor
|
|
51
|
-
}],
|
|
52
|
-
children: timeDisplay
|
|
53
|
-
})]
|
|
54
|
-
})]
|
|
55
|
-
})
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
ScoreBoard.displayName = 'ScoreBoard';
|
|
59
|
-
const styles = StyleSheet.create({
|
|
60
|
-
scoreRow: {
|
|
61
|
-
flex: 1,
|
|
62
|
-
flexDirection: 'row',
|
|
63
|
-
justifyContent: 'space-around'
|
|
64
|
-
},
|
|
65
|
-
scoreItem: {
|
|
66
|
-
alignItems: 'center'
|
|
67
|
-
},
|
|
68
|
-
label: {
|
|
69
|
-
fontSize: 18,
|
|
70
|
-
color: 'rgba(255, 255, 255, 0.7)',
|
|
71
|
-
marginBottom: 4
|
|
72
|
-
},
|
|
73
|
-
value: {
|
|
74
|
-
fontSize: 30,
|
|
75
|
-
color: CANDY_CRUSH_COLORS.SCORE_TEXT,
|
|
76
|
-
fontWeight: 'bold'
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
//# sourceMappingURL=ScoreBoard.js.map
|
|
1
|
+
"use strict";import React from 'react';import{View,Text,StyleSheet}from 'react-native';import{useScore,useTimeRemaining}from "../CandyCrushStore.js";import{CANDY_CRUSH_COLORS}from "../CandyCrushConstants.js";import{ScoreBoardContainer}from "../../../helpers/index.js";import{jsx as _jsx,jsxs as _jsxs}from "react/jsx-runtime";export const ScoreBoard = React.memo(({offset = 0})=>{const score = useScore();const timeRemaining = useTimeRemaining();const timeDisplay = React.useMemo(()=>{const minutes = Math.floor(timeRemaining / 60);const seconds = timeRemaining % 60;return `${minutes}:${seconds.toString().padStart(2,'0')}`;},[timeRemaining]);const timeColor = React.useMemo(()=>{if(timeRemaining <= 30)return CANDY_CRUSH_COLORS.TIME_CRITICAL;if(timeRemaining <= 60)return CANDY_CRUSH_COLORS.TIME_WARNING;return CANDY_CRUSH_COLORS.TIME_GOOD;},[timeRemaining]);return _jsx(ScoreBoardContainer,{offset:offset,backgroundColor:CANDY_CRUSH_COLORS.SCORE_BACKGROUND,borderColor:CANDY_CRUSH_COLORS.GRID_BORDER,children:_jsxs(View,{style:styles.scoreRow,children:[_jsxs(View,{style:styles.scoreItem,children:[_jsx(Text,{style:styles.label,children:"Score"}),_jsx(Text,{style:styles.value,children:score})]}),_jsxs(View,{style:styles.scoreItem,children:[_jsx(Text,{style:styles.label,children:"Time"}),_jsx(Text,{style:[styles.value,{color:timeColor}],children:timeDisplay})]})]})});});ScoreBoard.displayName = 'ScoreBoard';const styles = StyleSheet.create({scoreRow:{flex:1,flexDirection:'row',justifyContent:'space-around'},scoreItem:{alignItems:'center'},label:{fontSize:16,color:'rgba(255,255,255,0.7)',marginBottom:4},value:{fontSize:25,color:CANDY_CRUSH_COLORS.SCORE_TEXT,fontWeight:'bold'}});
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
export { GameBackground } from "./GameBackground.js";
|
|
4
|
-
export { GameGrid } from "./GameGrid.js";
|
|
5
|
-
export { ScoreBoard } from "./ScoreBoard.js";
|
|
6
|
-
export { CandyItem } from "./CandyItem.js";
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";export{GameBackground}from "./GameBackground.js";export{GameGrid}from "./GameGrid.js";export{ScoreBoard}from "./ScoreBoard.js";export{CandyItem}from "./CandyItem.js";
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
export { CandyCrush } from "./CandyCrush.js";
|
|
4
|
-
export { useCandyCrushStore } from "./CandyCrushStore.js";
|
|
5
|
-
export * from "./CandyCrushConstants.js";
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";export{CandyCrush}from "./CandyCrush.js";export{useCandyCrushStore}from "./CandyCrushStore.js";export * from "./CandyCrushConstants.js";
|
|
@@ -1,143 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { useEffect, useCallback, useMemo } from 'react';
|
|
4
|
-
import { View, StyleSheet } from 'react-native';
|
|
5
|
-
import { useColorsSortStore, useIsPlaying, useIsGameOver, useTime, useContainers, useSelectedContainerId } from "./ColorsSortStore.js";
|
|
6
|
-
import { ColorContainer, ScoreBoard, GameBackground } from "./components/index.js";
|
|
7
|
-
import { GameControlButton, GameOverModal } from "../../helpers/index.js";
|
|
8
|
-
import { GameSettingsModal } from "../../helpers/index.js";
|
|
9
|
-
import { COLORS_SORT_COLORS } from "./ColorsSortConstants.js";
|
|
10
|
-
import { GAME_IDS, DEFAULT_GAME_SETTINGS } from "../../services/UtilsService.js";
|
|
11
|
-
import { playSound, GAME_SOUNDS } from "../../services/SoundsService.js";
|
|
12
|
-
import { playHaptic, HapticType } from "../../services/HapticsService.js";
|
|
13
|
-
import { formatTime, getGridLayout } from "./ColorsSortService.js";
|
|
14
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
-
export const ColorsSort = /*#__PURE__*/React.memo(({
|
|
16
|
-
settings = DEFAULT_GAME_SETTINGS,
|
|
17
|
-
onSettingsChange
|
|
18
|
-
}) => {
|
|
19
|
-
const isPlaying = useIsPlaying();
|
|
20
|
-
const isGameOver = useIsGameOver();
|
|
21
|
-
const time = useTime();
|
|
22
|
-
const containers = useContainers();
|
|
23
|
-
const selectedContainerId = useSelectedContainerId();
|
|
24
|
-
const initializeGame = useColorsSortStore(state => state.initializeGame);
|
|
25
|
-
const startGame = useColorsSortStore(state => state.startGame);
|
|
26
|
-
const stopGame = useColorsSortStore(state => state.stopGame);
|
|
27
|
-
const resetGame = useColorsSortStore(state => state.resetGame);
|
|
28
|
-
const selectContainer = useColorsSortStore(state => state.selectContainer);
|
|
29
|
-
const difficulty = settings.difficulty;
|
|
30
|
-
const gridStyle = useMemo(() => getGridLayout(difficulty), [difficulty]);
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
initializeGame(difficulty);
|
|
33
|
-
}, [difficulty, initializeGame]);
|
|
34
|
-
const handleStartGame = useCallback(() => {
|
|
35
|
-
initializeGame(difficulty);
|
|
36
|
-
startGame();
|
|
37
|
-
playSound(GAME_SOUNDS.COLORS_SORT.START, settings.enableSounds);
|
|
38
|
-
playHaptic(HapticType.MEDIUM, settings.enableHaptics);
|
|
39
|
-
}, [difficulty, initializeGame, startGame, settings.enableSounds, settings.enableHaptics]);
|
|
40
|
-
const handleStopGame = useCallback(() => {
|
|
41
|
-
stopGame();
|
|
42
|
-
}, [stopGame]);
|
|
43
|
-
const handleResetGame = useCallback(() => {
|
|
44
|
-
resetGame();
|
|
45
|
-
initializeGame(difficulty);
|
|
46
|
-
}, [resetGame, initializeGame, difficulty]);
|
|
47
|
-
const handleContainerPress = useCallback(containerId => {
|
|
48
|
-
if (!isPlaying || isGameOver) return;
|
|
49
|
-
selectContainer(containerId, settings);
|
|
50
|
-
}, [isPlaying, isGameOver, selectContainer, settings]);
|
|
51
|
-
|
|
52
|
-
// Memoize GameControlButton props to prevent re-renders (CRITICAL)
|
|
53
|
-
const gameControlButtonProps = useMemo(() => ({
|
|
54
|
-
isPlaying,
|
|
55
|
-
gameOver: isGameOver,
|
|
56
|
-
onStartGame: handleStartGame,
|
|
57
|
-
onStopGame: handleStopGame,
|
|
58
|
-
startButtonText: "START SORTING",
|
|
59
|
-
stopButtonText: "STOP GAME",
|
|
60
|
-
startButtonSubtext: "Sort colors!",
|
|
61
|
-
startButtonColor: COLORS_SORT_COLORS.BUTTON_PRIMARY,
|
|
62
|
-
startButtonBorderColor: COLORS_SORT_COLORS.BUTTON_SECONDARY
|
|
63
|
-
}), [isPlaying, isGameOver, handleStartGame, handleStopGame]);
|
|
64
|
-
|
|
65
|
-
// Memoize GameOverModal props to prevent re-renders
|
|
66
|
-
const gameOverModalProps = useMemo(() => ({
|
|
67
|
-
isVisible: isGameOver,
|
|
68
|
-
score: time,
|
|
69
|
-
onPlayAgain: handleResetGame,
|
|
70
|
-
buttonText: "Sort Again!",
|
|
71
|
-
primaryColor: "rgba(255, 140, 66, 0.95)",
|
|
72
|
-
borderColor: COLORS_SORT_COLORS.BUTTON_PRIMARY,
|
|
73
|
-
buttonColor: COLORS_SORT_COLORS.BUTTON_PRIMARY,
|
|
74
|
-
buttonBorderColor: COLORS_SORT_COLORS.BUTTON_SECONDARY,
|
|
75
|
-
scoreLabel: "Completion Time",
|
|
76
|
-
scoreFormatter: formatTime
|
|
77
|
-
}), [isGameOver, time, handleResetGame]);
|
|
78
|
-
|
|
79
|
-
// Memoize GameSettingsModal props
|
|
80
|
-
const gameSettingsModalProps = useMemo(() => ({
|
|
81
|
-
gameId: GAME_IDS.COLORS_SORT,
|
|
82
|
-
settings,
|
|
83
|
-
onSettingsChange
|
|
84
|
-
}), [settings, onSettingsChange]);
|
|
85
|
-
|
|
86
|
-
// Get offset from settings
|
|
87
|
-
const offset = settings?.offset ?? 0;
|
|
88
|
-
|
|
89
|
-
// Memoized dynamic styles based on offset
|
|
90
|
-
const dynamicStyles = useMemo(() => ({
|
|
91
|
-
gameArea: {
|
|
92
|
-
...styles.gameArea,
|
|
93
|
-
paddingTop: 100 + offset
|
|
94
|
-
}
|
|
95
|
-
}), [offset]);
|
|
96
|
-
return /*#__PURE__*/_jsx(GameBackground, {
|
|
97
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
98
|
-
style: styles.container,
|
|
99
|
-
children: [/*#__PURE__*/_jsx(ScoreBoard, {
|
|
100
|
-
offset: offset
|
|
101
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
102
|
-
style: dynamicStyles.gameArea,
|
|
103
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
104
|
-
style: [styles.containersGrid, gridStyle],
|
|
105
|
-
children: containers.map(container => /*#__PURE__*/_jsx(ColorContainer, {
|
|
106
|
-
container: container,
|
|
107
|
-
isSelected: selectedContainerId === container.id,
|
|
108
|
-
onPress: () => handleContainerPress(container.id),
|
|
109
|
-
difficulty: difficulty
|
|
110
|
-
}, container.id))
|
|
111
|
-
})
|
|
112
|
-
}), /*#__PURE__*/_jsx(GameControlButton, {
|
|
113
|
-
...gameControlButtonProps
|
|
114
|
-
}), /*#__PURE__*/_jsx(GameOverModal, {
|
|
115
|
-
...gameOverModalProps
|
|
116
|
-
}), /*#__PURE__*/_jsx(GameSettingsModal, {
|
|
117
|
-
...gameSettingsModalProps
|
|
118
|
-
})]
|
|
119
|
-
})
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
const styles = StyleSheet.create({
|
|
123
|
-
container: {
|
|
124
|
-
flex: 1
|
|
125
|
-
},
|
|
126
|
-
gameArea: {
|
|
127
|
-
flex: 1,
|
|
128
|
-
justifyContent: 'center',
|
|
129
|
-
alignItems: 'center',
|
|
130
|
-
paddingTop: 100,
|
|
131
|
-
paddingBottom: 120
|
|
132
|
-
},
|
|
133
|
-
containersGrid: {
|
|
134
|
-
flexDirection: 'row',
|
|
135
|
-
flexWrap: 'wrap',
|
|
136
|
-
justifyContent: 'center',
|
|
137
|
-
alignItems: 'flex-end',
|
|
138
|
-
gap: 15,
|
|
139
|
-
paddingHorizontal: 10
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
ColorsSort.displayName = 'ColorsSort';
|
|
143
|
-
//# sourceMappingURL=ColorsSort.js.map
|
|
1
|
+
"use strict";import React,{useEffect,useCallback,useMemo}from 'react';import{View,StyleSheet}from 'react-native';import{useColorsSortStore,useIsPlaying,useIsGameOver,useTime,useContainers,useSelectedContainerId}from "./ColorsSortStore.js";import{ColorContainer,ScoreBoard,GameBackground}from "./components/index.js";import{GameControlButton,GameOverModal}from "../../helpers/index.js";import{GameSettingsModal}from "../../helpers/index.js";import{COLORS_SORT_COLORS}from "./ColorsSortConstants.js";import{GAME_IDS,DEFAULT_GAME_SETTINGS}from "../../services/UtilsService.js";import{playSound,GAME_SOUNDS}from "../../services/SoundsService.js";import{playHaptic,HapticType}from "../../services/HapticsService.js";import{formatTime,getGridLayout}from "./ColorsSortService.js";import{jsx as _jsx,jsxs as _jsxs}from "react/jsx-runtime";export const ColorsSort = React.memo(({settings = DEFAULT_GAME_SETTINGS,onSettingsChange})=>{const isPlaying = useIsPlaying();const isGameOver = useIsGameOver();const time = useTime();const containers = useContainers();const selectedContainerId = useSelectedContainerId();const initializeGame = useColorsSortStore(state => state.initializeGame);const startGame = useColorsSortStore(state => state.startGame);const stopGame = useColorsSortStore(state => state.stopGame);const resetGame = useColorsSortStore(state => state.resetGame);const selectContainer = useColorsSortStore(state => state.selectContainer);const difficulty = settings.difficulty;const gridStyle = useMemo(()=> getGridLayout(difficulty),[difficulty]);useEffect(()=>{initializeGame(difficulty);},[difficulty,initializeGame]);const handleStartGame = useCallback(()=>{initializeGame(difficulty);startGame();playSound(GAME_SOUNDS.COLORS_SORT.START,settings.enableSounds);playHaptic(HapticType.MEDIUM,settings.enableHaptics);},[difficulty,initializeGame,startGame,settings.enableSounds,settings.enableHaptics]);const handleStopGame = useCallback(()=>{stopGame();},[stopGame]);const handleResetGame = useCallback(()=>{resetGame();initializeGame(difficulty);},[resetGame,initializeGame,difficulty]);const handleContainerPress = useCallback(containerId =>{if(!isPlaying || isGameOver)return;selectContainer(containerId,settings);},[isPlaying,isGameOver,selectContainer,settings]);const gameControlButtonProps = useMemo(()=>({isPlaying,gameOver:isGameOver,onStartGame:handleStartGame,onStopGame:handleStopGame,startButtonText:"START SORTING",stopButtonText:"STOP GAME",startButtonSubtext:"Sort colors!",startButtonColor:COLORS_SORT_COLORS.BUTTON_PRIMARY,startButtonBorderColor:COLORS_SORT_COLORS.BUTTON_SECONDARY}),[isPlaying,isGameOver,handleStartGame,handleStopGame]);const gameOverModalProps = useMemo(()=>({isVisible:isGameOver,score:time,onPlayAgain:handleResetGame,buttonText:"Sort Again!",primaryColor:"rgba(255,107,53,0.5)",borderColor:"rgba(255,107,53,0.5)",buttonColor:"#ffffff",buttonBorderColor:"#ffffff",buttonTextColor:"#FF6B35",scoreLabel:"Completion Time",scoreFormatter:formatTime}),[isGameOver,time,handleResetGame]);const gameSettingsModalProps = useMemo(()=>({gameId:GAME_IDS.COLORS_SORT,settings,onSettingsChange}),[settings,onSettingsChange]);const offset = settings?.offset ?? 0;const dynamicStyles = useMemo(()=>({gameArea:{...styles.gameArea,paddingTop:100 + offset}}),[offset]);return _jsx(GameBackground,{children:_jsxs(View,{style:styles.container,children:[_jsx(ScoreBoard,{offset:offset}),_jsx(View,{style:dynamicStyles.gameArea,children:_jsx(View,{style:[styles.containersGrid,gridStyle],children:containers.map(container => _jsx(ColorContainer,{container:container,isSelected:selectedContainerId === container.id,onPress:()=> handleContainerPress(container.id),difficulty:difficulty},container.id))})}),_jsx(GameControlButton,{...gameControlButtonProps}),_jsx(GameOverModal,{...gameOverModalProps}),_jsx(GameSettingsModal,{...gameSettingsModalProps})]})});});const styles = StyleSheet.create({container:{flex:1},gameArea:{flex:1,justifyContent:'center',alignItems:'center',paddingTop:100,paddingBottom:120},containersGrid:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',alignItems:'flex-end',gap:15,paddingHorizontal:10}});ColorsSort.displayName = 'ColorsSort';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useCallback","useMemo","View","StyleSheet","useColorsSortStore","useIsPlaying","useIsGameOver","useTime","useContainers","useSelectedContainerId","ColorContainer","ScoreBoard","GameBackground","GameControlButton","GameOverModal","GameSettingsModal","COLORS_SORT_COLORS","GAME_IDS","DEFAULT_GAME_SETTINGS","playSound","GAME_SOUNDS","playHaptic","HapticType","formatTime","getGridLayout","jsx","_jsx","jsxs","_jsxs","ColorsSort","memo","settings","onSettingsChange","isPlaying","isGameOver","time","containers","selectedContainerId","initializeGame","state","startGame","stopGame","resetGame","selectContainer","difficulty","gridStyle","handleStartGame","COLORS_SORT","START","enableSounds","MEDIUM","enableHaptics","handleStopGame","handleResetGame","handleContainerPress","containerId","gameControlButtonProps","gameOver","onStartGame","onStopGame","startButtonText","stopButtonText","startButtonSubtext","startButtonColor","BUTTON_PRIMARY","startButtonBorderColor","BUTTON_SECONDARY","gameOverModalProps","isVisible","score","onPlayAgain","buttonText","primaryColor","borderColor","buttonColor","buttonBorderColor","scoreLabel","scoreFormatter","gameSettingsModalProps","gameId","offset","dynamicStyles","gameArea","styles","paddingTop","children","style","container","containersGrid","map","isSelected","id","onPress","create","flex","justifyContent","alignItems","paddingBottom","flexDirection","flexWrap","gap","paddingHorizontal","displayName"],"sourceRoot":"../../../../src","sources":["games/colors-sort/ColorsSort.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC9D,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,kBAAkB,EAAEC,YAAY,EAAEC,aAAa,EAAEC,OAAO,EAAEC,aAAa,EAAEC,sBAAsB,QAAQ,sBAAmB;AACnI,SAASC,cAAc,EAAEC,UAAU,EAAEC,cAAc,QAAQ,uBAAc;AACzE,SAASC,iBAAiB,EAAEC,aAAa,QAAQ,wBAAe;AAChE,SAASC,iBAAiB,QAAQ,wBAAe;AACjD,SAASC,kBAAkB,QAAQ,0BAAuB;AAC1D,SAASC,QAAQ,EAAkBC,qBAAqB,QAAQ,gCAA6B;AAC7F,SAASC,SAAS,EAAEC,WAAW,QAAQ,iCAA8B;AACrE,SAASC,UAAU,EAAEC,UAAU,QAAQ,kCAA+B;AACtE,SAASC,UAAU,EAAEC,aAAa,QAAQ,wBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhE,OAAO,MAAMC,UAA+B,gBAAG/B,KAAK,CAACgC,IAAI,CAAC,CAAC;EACzDC,QAAQ,GAAGb,qBAAqB;EAChCc;AACF,CAAC,KAAK;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ffect","useCallback","useMemo","View","StyleSheet","useColorsSortStore","useIsPlaying","useIsGameOver","useTime","useContainers","useSelectedContainerId","ColorContainer","ScoreBoard","GameBackground","GameControlButton","GameOverModal","GameSettingsModal","COLORS_SORT_COLORS","GAME_IDS","DEFAULT_GAME_SETTINGS","playSound","GAME_SOUNDS","playHaptic","HapticType","formatTime","getGridLayout","jsx","_jsx","jsxs","_jsxs","ColorsSort","memo","settings","onSettingsChange","isPlaying","isGameOver","time","containers","selectedContainerId","initializeGame","state","startGame","stopGame","resetGame","selectContainer","difficulty","gridStyle","handleStartGame","COLORS_SORT","START","enableSounds","MEDIUM","enableHaptics","handleStopGame","handleResetGame","handleContainerPress","containerId","gameControlButtonProps","gameOver","onStartGame","onStopGame","startButtonText","stopButtonText","startButtonSubtext","startButtonColor","BUTTON_PRIMARY","startButtonBorderColor","BUTTON_SECONDARY","gameOverModalProps","isVisible","score","onPlayAgain","buttonText","primaryColor","borderColor","buttonColor","buttonBorderColor","buttonTextColor","scoreLabel","scoreFormatter","gameSettingsModalProps","gameId","offset","dynamicStyles","gameArea","styles","paddingTop","children","style","container","containersGrid","map","isSelected","id","onPress","create","flex","justifyContent","alignItems","paddingBottom","flexDirection","flexWrap","gap","paddingHorizontal","displayName"],"sourceRoot":"../../../../src","sources":["games/colors-sort/ColorsSort.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC9D,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,kBAAkB,EAAEC,YAAY,EAAEC,aAAa,EAAEC,OAAO,EAAEC,aAAa,EAAEC,sBAAsB,QAAQ,sBAAmB;AACnI,SAASC,cAAc,EAAEC,UAAU,EAAEC,cAAc,QAAQ,uBAAc;AACzE,SAASC,iBAAiB,EAAEC,aAAa,QAAQ,wBAAe;AAChE,SAASC,iBAAiB,QAAQ,wBAAe;AACjD,SAASC,kBAAkB,QAAQ,0BAAuB;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U,CAAC0E,WAAW,GAAG,YAAY","ignoreList":[]}
|
|
@@ -1,72 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { Dimensions } from 'react-native';
|
|
4
|
-
const {
|
|
5
|
-
width,
|
|
6
|
-
height
|
|
7
|
-
} = Dimensions.get('window');
|
|
8
|
-
export const COLORS_SORT_COLORS = {
|
|
9
|
-
BACKGROUND: '#FFF5E6',
|
|
10
|
-
// Warm cream/peach background
|
|
11
|
-
PIECE_ORANGE: '#FF6B35',
|
|
12
|
-
PIECE_PINK: '#FF1493',
|
|
13
|
-
PIECE_GREEN: '#32CD32',
|
|
14
|
-
PIECE_RED: '#FF4444',
|
|
15
|
-
PIECE_YELLOW: '#FFD700',
|
|
16
|
-
PIECE_BLUE: '#4169E1',
|
|
17
|
-
PIECE_PURPLE: '#9370DB',
|
|
18
|
-
BASE_SILVER: '#C0C0C0',
|
|
19
|
-
BASE_DARK: '#A8A8A8',
|
|
20
|
-
SCREW_WHITE: '#F5F5F5',
|
|
21
|
-
BUTTON_PRIMARY: '#FF6B35',
|
|
22
|
-
BUTTON_SECONDARY: '#FF8C42',
|
|
23
|
-
SCORE_TEXT: '#FFFFFF',
|
|
24
|
-
SCORE_BACKGROUND: 'rgba(255, 107, 53, 0.4)',
|
|
25
|
-
// Orange theme
|
|
26
|
-
SCORE_BORDER: 'rgba(255, 107, 53, 0.8)',
|
|
27
|
-
// Orange theme
|
|
28
|
-
SELECTED_GLOW: '#FFD700'
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// Game Configuration
|
|
32
|
-
export const COLORS_SORT_GAME_CONFIG = {
|
|
33
|
-
SCREEN_WIDTH: width,
|
|
34
|
-
SCREEN_HEIGHT: height,
|
|
35
|
-
PIECE_SIZE: 50,
|
|
36
|
-
CONTAINER_SIZE: 60,
|
|
37
|
-
CONTAINER_SPACING: 20,
|
|
38
|
-
PIECE_SPACING: 5
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// Game Constants
|
|
42
|
-
export const COLORS_SORT_CONSTANTS = {
|
|
43
|
-
baseScore: 10,
|
|
44
|
-
moveScore: 10,
|
|
45
|
-
perfectBonus: 100
|
|
46
|
-
};
|
|
47
|
-
export const PIECE_COLORS = [COLORS_SORT_COLORS.PIECE_RED, COLORS_SORT_COLORS.PIECE_GREEN, COLORS_SORT_COLORS.PIECE_BLUE, COLORS_SORT_COLORS.PIECE_YELLOW, COLORS_SORT_COLORS.PIECE_PURPLE, COLORS_SORT_COLORS.PIECE_ORANGE, COLORS_SORT_COLORS.PIECE_PINK];
|
|
48
|
-
|
|
49
|
-
// Game Settings Theme
|
|
50
|
-
export const COLORS_SORT_THEME = {
|
|
51
|
-
backgroundColor: '#FFF5E6',
|
|
52
|
-
headerBackgroundColor: '#FF6B35',
|
|
53
|
-
headerTextColor: '#FFFFFF',
|
|
54
|
-
sectionBackgroundColor: '#FFE8CC',
|
|
55
|
-
sectionTitleColor: '#FF6B35',
|
|
56
|
-
buttonSelectedColor: '#FF6B35',
|
|
57
|
-
buttonUnselectedColor: '#FFA366',
|
|
58
|
-
buttonSelectedTextColor: '#FFFFFF',
|
|
59
|
-
buttonUnselectedTextColor: '#FFFFFF',
|
|
60
|
-
switchTrackColorFalse: '#D0D0D0',
|
|
61
|
-
switchTrackColorTrue: '#FF6B35',
|
|
62
|
-
switchThumbColor: '#FFFFFF',
|
|
63
|
-
infoTextColor: '#666666'
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
// Difficulty Descriptions
|
|
67
|
-
export const COLORS_SORT_DIFFICULTY_DESCRIPTIONS = {
|
|
68
|
-
easy: '4 containers, 3 colors, 3 pieces each - Perfect for beginners',
|
|
69
|
-
medium: '5 containers, 4 colors, 3 pieces each - Standard challenge',
|
|
70
|
-
hard: '6 containers, 5 colors, 4 pieces each - Expert level!'
|
|
71
|
-
};
|
|
72
|
-
//# sourceMappingURL=ColorsSortConstants.js.map
|
|
1
|
+
"use strict";import{Dimensions}from 'react-native';const{width,height}= Dimensions.get('window');export const COLORS_SORT_COLORS ={BACKGROUND:'#FFF5E6',PIECE_ORANGE:'#FF6B35',PIECE_PINK:'#FF1493',PIECE_GREEN:'#32CD32',PIECE_RED:'#FF4444',PIECE_YELLOW:'#FFD700',PIECE_BLUE:'#4169E1',PIECE_PURPLE:'#9370DB',BASE_SILVER:'#C0C0C0',BASE_DARK:'#A8A8A8',SCREW_WHITE:'#F5F5F5',BUTTON_PRIMARY:'#FF6B35',BUTTON_SECONDARY:'#FF8C42',SCORE_TEXT:'#FFFFFF',SCORE_BACKGROUND:'rgba(255,107,53,0.4)',SCORE_BORDER:'rgba(255,107,53,0.8)',SELECTED_GLOW:'#FFD700'};export const COLORS_SORT_GAME_CONFIG ={SCREEN_WIDTH:width,SCREEN_HEIGHT:height,PIECE_SIZE:50,CONTAINER_SIZE:60,CONTAINER_SPACING:20,PIECE_SPACING:5};export const COLORS_SORT_CONSTANTS ={baseScore:10,moveScore:10,perfectBonus:100};export const PIECE_COLORS = [COLORS_SORT_COLORS.PIECE_RED,COLORS_SORT_COLORS.PIECE_GREEN,COLORS_SORT_COLORS.PIECE_BLUE,COLORS_SORT_COLORS.PIECE_YELLOW,COLORS_SORT_COLORS.PIECE_PURPLE,COLORS_SORT_COLORS.PIECE_ORANGE,COLORS_SORT_COLORS.PIECE_PINK];export const COLORS_SORT_THEME ={backgroundColor:'rgba(0,0,0,0.7)',headerBackgroundColor:'#FF6B35',headerTextColor:'#ffffff',sectionBackgroundColor:'rgba(255,107,53,0.15)',sectionTitleColor:'#FF6B35',buttonSelectedColor:'#FF6B35',buttonUnselectedColor:'rgba(255,255,255,0.2)',buttonSelectedTextColor:'#ffffff',buttonUnselectedTextColor:'rgba(255,255,255,0.7)',switchTrackColorFalse:'rgba(255,107,53,0.3)',switchTrackColorTrue:'#FF6B35',switchThumbColor:'#ffffff',infoTextColor:'rgba(255,255,255,0.9)'};export const COLORS_SORT_DIFFICULTY_DESCRIPTIONS ={easy:'4 containers,3 colors,3 pieces each - Perfect for beginners',medium:'5 containers,4 colors,3 pieces each - Standard challenge',hard:'6 containers,5 colors,4 pieces each - Expert level!'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Dimensions","width","height","get","COLORS_SORT_COLORS","BACKGROUND","PIECE_ORANGE","PIECE_PINK","PIECE_GREEN","PIECE_RED","PIECE_YELLOW","PIECE_BLUE","PIECE_PURPLE","BASE_SILVER","BASE_DARK","SCREW_WHITE","BUTTON_PRIMARY","BUTTON_SECONDARY","SCORE_TEXT","SCORE_BACKGROUND","SCORE_BORDER","SELECTED_GLOW","COLORS_SORT_GAME_CONFIG","SCREEN_WIDTH","SCREEN_HEIGHT","PIECE_SIZE","CONTAINER_SIZE","CONTAINER_SPACING","PIECE_SPACING","COLORS_SORT_CONSTANTS","baseScore","moveScore","perfectBonus","PIECE_COLORS","COLORS_SORT_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","COLORS_SORT_DIFFICULTY_DESCRIPTIONS","easy","medium","hard"],"sourceRoot":"../../../../src","sources":["games/colors-sort/ColorsSortConstants.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,MAAM;EAAEC,KAAK;EAAEC;AAAO,CAAC,GAAGF,UAAU,CAACG,GAAG,CAAC,QAAQ,CAAC;AAElD,OAAO,MAAMC,kBAAkB,GAAG;EAChCC,UAAU,EAAE,SAAS;EAAE;EACvBC,YAAY,EAAE,SAAS;EACvBC,UAAU,EAAE,SAAS;EACrBC,WAAW,EAAE,SAAS;EACtBC,SAAS,EAAE,SAAS;EACpBC,YAAY,EAAE,SAAS;EACvBC,UAAU,EAAE,SAAS;EACrBC,YAAY,EAAE,SAAS;EACvBC,WAAW,EAAE,SAAS;EACtBC,SAAS,EAAE,SAAS;EACpBC,WAAW,EAAE,SAAS;EACtBC,cAAc,EAAE,SAAS;EACzBC,gBAAgB,EAAE,SAAS;EAC3BC,UAAU,EAAE,SAAS;EACrBC,gBAAgB,EAAE,yBAAyB;EAAE;EAC7CC,YAAY,EAAE,yBAAyB;EAAE;EACzCC,aAAa,EAAE;AACjB,CAAC;;AAED;AACA,OAAO,MAAMC,uBAAuB,GAAG;EACrCC,YAAY,EAAEtB,KAAK;EACnBuB,aAAa,EAAEtB,MAAM;EACrBuB,UAAU,EAAE,EAAE;EACdC,cAAc,EAAE,EAAE;EAClBC,iBAAiB,EAAE,EAAE;EACrBC,aAAa,EAAE;AACjB,CAAC;;AAED;AACA,OAAO,MAAMC,qBAAqB,GAAG;EACnCC,SAAS,EAAE,EAAE;EACbC,SAAS,EAAE,EAAE;EACbC,YAAY,EAAE;AAChB,CAAC;AAED,OAAO,MAAMC,YAAY,GAAG,CAC1B7B,kBAAkB,CAACK,SAAS,EAC5BL,kBAAkB,CAACI,WAAW,EAC9BJ,kBAAkB,CAACO,UAAU,EAC7BP,kBAAkB,CAACM,YAAY,EAC/BN,kBAAkB,CAACQ,YAAY,EAC/BR,kBAAkB,CAACE,YAAY,EAC/BF,kBAAkB,CAACG,UAAU,CAC9B;;AAED;AACA,OAAO,MAAM2B,iBAAiB,GAAG;EAC/BC,eAAe,EAAE,
|
|
1
|
+
{"version":3,"names":["Dimensions","width","height","get","COLORS_SORT_COLORS","BACKGROUND","PIECE_ORANGE","PIECE_PINK","PIECE_GREEN","PIECE_RED","PIECE_YELLOW","PIECE_BLUE","PIECE_PURPLE","BASE_SILVER","BASE_DARK","SCREW_WHITE","BUTTON_PRIMARY","BUTTON_SECONDARY","SCORE_TEXT","SCORE_BACKGROUND","SCORE_BORDER","SELECTED_GLOW","COLORS_SORT_GAME_CONFIG","SCREEN_WIDTH","SCREEN_HEIGHT","PIECE_SIZE","CONTAINER_SIZE","CONTAINER_SPACING","PIECE_SPACING","COLORS_SORT_CONSTANTS","baseScore","moveScore","perfectBonus","PIECE_COLORS","COLORS_SORT_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","COLORS_SORT_DIFFICULTY_DESCRIPTIONS","easy","medium","hard"],"sourceRoot":"../../../../src","sources":["games/colors-sort/ColorsSortConstants.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,MAAM;EAAEC,KAAK;EAAEC;AAAO,CAAC,GAAGF,UAAU,CAACG,GAAG,CAAC,QAAQ,CAAC;AAElD,OAAO,MAAMC,kBAAkB,GAAG;EAChCC,UAAU,EAAE,SAAS;EAAE;EACvBC,YAAY,EAAE,SAAS;EACvBC,UAAU,EAAE,SAAS;EACrBC,WAAW,EAAE,SAAS;EACtBC,SAAS,EAAE,SAAS;EACpBC,YAAY,EAAE,SAAS;EACvBC,UAAU,EAAE,SAAS;EACrBC,YAAY,EAAE,SAAS;EACvBC,WAAW,EAAE,SAAS;EACtBC,SAAS,EAAE,SAAS;EACpBC,WAAW,EAAE,SAAS;EACtBC,cAAc,EAAE,SAAS;EACzBC,gBAAgB,EAAE,SAAS;EAC3BC,UAAU,EAAE,SAAS;EACrBC,gBAAgB,EAAE,yBAAyB;EAAE;EAC7CC,YAAY,EAAE,yBAAyB;EAAE;EACzCC,aAAa,EAAE;AACjB,CAAC;;AAED;AACA,OAAO,MAAMC,uBAAuB,GAAG;EACrCC,YAAY,EAAEtB,KAAK;EACnBuB,aAAa,EAAEtB,MAAM;EACrBuB,UAAU,EAAE,EAAE;EACdC,cAAc,EAAE,EAAE;EAClBC,iBAAiB,EAAE,EAAE;EACrBC,aAAa,EAAE;AACjB,CAAC;;AAED;AACA,OAAO,MAAMC,qBAAqB,GAAG;EACnCC,SAAS,EAAE,EAAE;EACbC,SAAS,EAAE,EAAE;EACbC,YAAY,EAAE;AAChB,CAAC;AAED,OAAO,MAAMC,YAAY,GAAG,CAC1B7B,kBAAkB,CAACK,SAAS,EAC5BL,kBAAkB,CAACI,WAAW,EAC9BJ,kBAAkB,CAACO,UAAU,EAC7BP,kBAAkB,CAACM,YAAY,EAC/BN,kBAAkB,CAACQ,YAAY,EAC/BR,kBAAkB,CAACE,YAAY,EAC/BF,kBAAkB,CAACG,UAAU,CAC9B;;AAED;AACA,OAAO,MAAM2B,iBAAiB,GAAG;EAC/BC,eAAe,EAAE,oBAAoB;EAAE;EACvCC,qBAAqB,EAAE,SAAS;EAAE;EAClCC,eAAe,EAAE,SAAS;EAC1BC,sBAAsB,EAAE,0BAA0B;EAAE;EACpDC,iBAAiB,EAAE,SAAS;EAAE;EAC9BC,mBAAmB,EAAE,SAAS;EAAE;EAChCC,qBAAqB,EAAE,0BAA0B;EACjDC,uBAAuB,EAAE,SAAS;EAClCC,yBAAyB,EAAE,0BAA0B;EAAE;EACvDC,qBAAqB,EAAE,yBAAyB;EAChDC,oBAAoB,EAAE,SAAS;EAAE;EACjCC,gBAAgB,EAAE,SAAS;EAC3BC,aAAa,EAAE,0BAA0B,CAAE;AAC7C,CAAC;;AAED;AACA,OAAO,MAAMC,mCAAmC,GAAG;EACjDC,IAAI,EAAE,+DAA+D;EACrEC,MAAM,EAAE,4DAA4D;EACpEC,IAAI,EAAE;AACR,CAAC","ignoreList":[]}
|
|
@@ -1,255 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* ColorSort Game Service
|
|
5
|
-
* Handles all utility functions, game logic, and background generation
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { Dimensions } from 'react-native';
|
|
9
|
-
const {
|
|
10
|
-
width,
|
|
11
|
-
height
|
|
12
|
-
} = Dimensions.get('window');
|
|
13
|
-
|
|
14
|
-
// ==================== TYPES ====================
|
|
15
|
-
|
|
16
|
-
// ==================== CONSTANTS ====================
|
|
17
|
-
|
|
18
|
-
// Color sort themed vibrant colors
|
|
19
|
-
export const SORT_COLORS = ['#FF6B35',
|
|
20
|
-
// Primary orange
|
|
21
|
-
'#FF4444',
|
|
22
|
-
// Red
|
|
23
|
-
'#FF8C42',
|
|
24
|
-
// Light orange
|
|
25
|
-
'#FFD700',
|
|
26
|
-
// Yellow
|
|
27
|
-
'#32CD32',
|
|
28
|
-
// Green
|
|
29
|
-
'#4169E1',
|
|
30
|
-
// Blue
|
|
31
|
-
'#FF1493',
|
|
32
|
-
// Pink
|
|
33
|
-
'#9370DB',
|
|
34
|
-
// Purple
|
|
35
|
-
'#00BCD4',
|
|
36
|
-
// Cyan
|
|
37
|
-
'#FFA366',
|
|
38
|
-
// Peach
|
|
39
|
-
'#CDDC39',
|
|
40
|
-
// Lime
|
|
41
|
-
'#E91E63' // Magenta
|
|
42
|
-
];
|
|
43
|
-
|
|
44
|
-
// ==================== GAME UTILITIES ====================
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Format time in seconds to MM:SS format
|
|
48
|
-
*/
|
|
49
|
-
export const formatTime = seconds => {
|
|
50
|
-
const mins = Math.floor(seconds / 60);
|
|
51
|
-
const secs = seconds % 60;
|
|
52
|
-
return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Get grid layout style based on difficulty
|
|
57
|
-
*/
|
|
58
|
-
export const getGridLayout = difficulty => {
|
|
59
|
-
switch (difficulty) {
|
|
60
|
-
case 'easy':
|
|
61
|
-
return {
|
|
62
|
-
maxWidth: 400
|
|
63
|
-
};
|
|
64
|
-
// 4 containers in 1 row
|
|
65
|
-
case 'medium':
|
|
66
|
-
return {
|
|
67
|
-
maxWidth: 300
|
|
68
|
-
};
|
|
69
|
-
// 3 in top, 2 in bottom
|
|
70
|
-
case 'hard':
|
|
71
|
-
return {
|
|
72
|
-
maxWidth: 300
|
|
73
|
-
};
|
|
74
|
-
// 3 in top, 3 in bottom
|
|
75
|
-
default:
|
|
76
|
-
return {
|
|
77
|
-
maxWidth: 400
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Get piece height based on difficulty
|
|
84
|
-
*/
|
|
85
|
-
export const getPieceHeight = (difficulty, baseSize) => {
|
|
86
|
-
switch (difficulty) {
|
|
87
|
-
case 'easy':
|
|
88
|
-
return baseSize - 8;
|
|
89
|
-
// 42px
|
|
90
|
-
case 'medium':
|
|
91
|
-
return baseSize - 10;
|
|
92
|
-
// 40px
|
|
93
|
-
case 'hard':
|
|
94
|
-
return baseSize - 18;
|
|
95
|
-
// 32px
|
|
96
|
-
default:
|
|
97
|
-
return baseSize - 10;
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
// ==================== BACKGROUND GENERATION ====================
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Generate floating color blocks for background
|
|
105
|
-
*/
|
|
106
|
-
export const generateFloatingBlocks = () => {
|
|
107
|
-
const elements = [];
|
|
108
|
-
const blockCount = 25;
|
|
109
|
-
for (let i = 0; i < blockCount; i++) {
|
|
110
|
-
const baseX = width / blockCount * i;
|
|
111
|
-
const baseY = height / blockCount * i;
|
|
112
|
-
const x = baseX + Math.sin(i * 0.5) * 50 + Math.random() * 100;
|
|
113
|
-
const y = baseY + Math.cos(i * 0.7) * 60 + Math.random() * 120;
|
|
114
|
-
const blockSize = 20 + Math.random() * 20;
|
|
115
|
-
const colorIndex = i % SORT_COLORS.length;
|
|
116
|
-
const opacity = 0.3 + Math.sin(i) * 0.15;
|
|
117
|
-
const blockX = Math.max(blockSize / 2, Math.min(width - blockSize, x));
|
|
118
|
-
const blockY = Math.max(blockSize / 2, Math.min(height - blockSize, y));
|
|
119
|
-
const color = `${SORT_COLORS[colorIndex]}${Math.floor(opacity * 255).toString(16).padStart(2, '0')}`;
|
|
120
|
-
let type;
|
|
121
|
-
if (i % 4 === 0) type = 'square';else if (i % 4 === 1) type = 'rect';else if (i % 4 === 2) type = 'wide';else type = 'circle';
|
|
122
|
-
elements.push({
|
|
123
|
-
key: `${type}-${i}`,
|
|
124
|
-
type,
|
|
125
|
-
x: blockX,
|
|
126
|
-
y: blockY,
|
|
127
|
-
size: blockSize,
|
|
128
|
-
color
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
return elements;
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Get decorative blocks positioned around the screen
|
|
136
|
-
*/
|
|
137
|
-
export const getDecorativeBlocks = () => [{
|
|
138
|
-
key: 'top-left',
|
|
139
|
-
x: width * 0.08,
|
|
140
|
-
y: height * 0.12,
|
|
141
|
-
size: 50,
|
|
142
|
-
r: 8,
|
|
143
|
-
color: `${SORT_COLORS[0]}50`
|
|
144
|
-
}, {
|
|
145
|
-
key: 'bottom-right',
|
|
146
|
-
x: width * 0.85,
|
|
147
|
-
y: height * 0.82,
|
|
148
|
-
size: 45,
|
|
149
|
-
r: 7,
|
|
150
|
-
color: `${SORT_COLORS[3]}50`
|
|
151
|
-
}, {
|
|
152
|
-
key: 'top-right',
|
|
153
|
-
x: width * 0.82,
|
|
154
|
-
y: height * 0.18,
|
|
155
|
-
size: 40,
|
|
156
|
-
r: 6,
|
|
157
|
-
color: `${SORT_COLORS[4]}50`
|
|
158
|
-
}, {
|
|
159
|
-
key: 'bottom-left',
|
|
160
|
-
x: width * 0.12,
|
|
161
|
-
y: height * 0.75,
|
|
162
|
-
size: 55,
|
|
163
|
-
r: 9,
|
|
164
|
-
color: `${SORT_COLORS[5]}50`
|
|
165
|
-
}, {
|
|
166
|
-
key: 'top-center',
|
|
167
|
-
x: width * 0.47,
|
|
168
|
-
y: height * 0.08,
|
|
169
|
-
size: 35,
|
|
170
|
-
r: 5,
|
|
171
|
-
color: `${SORT_COLORS[7]}50`
|
|
172
|
-
}, {
|
|
173
|
-
key: 'middle-left',
|
|
174
|
-
x: width * 0.15,
|
|
175
|
-
y: height * 0.47,
|
|
176
|
-
size: 42,
|
|
177
|
-
r: 6,
|
|
178
|
-
color: `${SORT_COLORS[6]}50`
|
|
179
|
-
}, {
|
|
180
|
-
key: 'middle-right',
|
|
181
|
-
x: width * 0.75,
|
|
182
|
-
y: height * 0.57,
|
|
183
|
-
size: 38,
|
|
184
|
-
r: 6,
|
|
185
|
-
color: `${SORT_COLORS[8]}50`
|
|
186
|
-
}, {
|
|
187
|
-
key: 'bottom-center',
|
|
188
|
-
x: width * 0.57,
|
|
189
|
-
y: height * 0.87,
|
|
190
|
-
size: 32,
|
|
191
|
-
r: 5,
|
|
192
|
-
color: `${SORT_COLORS[1]}50`
|
|
193
|
-
}];
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Get decorative circles for variety
|
|
197
|
-
*/
|
|
198
|
-
export const getDecorativeCircles = () => [{
|
|
199
|
-
key: 'circle-1',
|
|
200
|
-
cx: width * 0.25,
|
|
201
|
-
cy: height * 0.25,
|
|
202
|
-
r: 18,
|
|
203
|
-
color: `${SORT_COLORS[10]}45`
|
|
204
|
-
}, {
|
|
205
|
-
key: 'circle-2',
|
|
206
|
-
cx: width * 0.65,
|
|
207
|
-
cy: height * 0.35,
|
|
208
|
-
r: 22,
|
|
209
|
-
color: `${SORT_COLORS[11]}45`
|
|
210
|
-
}, {
|
|
211
|
-
key: 'circle-3',
|
|
212
|
-
cx: width * 0.35,
|
|
213
|
-
cy: height * 0.65,
|
|
214
|
-
r: 16,
|
|
215
|
-
color: `${SORT_COLORS[9]}45`
|
|
216
|
-
}];
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Get gradient colors for background layers
|
|
220
|
-
*/
|
|
221
|
-
export const getGradientColors = () => ({
|
|
222
|
-
main: [`${SORT_COLORS[0]}30`,
|
|
223
|
-
// Orange
|
|
224
|
-
`${SORT_COLORS[3]}25`,
|
|
225
|
-
// Yellow
|
|
226
|
-
`${SORT_COLORS[4]}30`,
|
|
227
|
-
// Green
|
|
228
|
-
`${SORT_COLORS[5]}25`,
|
|
229
|
-
// Blue
|
|
230
|
-
`${SORT_COLORS[7]}30` // Purple
|
|
231
|
-
],
|
|
232
|
-
overlay: [`${SORT_COLORS[1]}20`,
|
|
233
|
-
// Red
|
|
234
|
-
'transparent', `${SORT_COLORS[6]}20`,
|
|
235
|
-
// Pink
|
|
236
|
-
'transparent', `${SORT_COLORS[8]}20`,
|
|
237
|
-
// Cyan
|
|
238
|
-
'transparent'],
|
|
239
|
-
diagonal: [`${SORT_COLORS[2]}15`,
|
|
240
|
-
// Light orange
|
|
241
|
-
'transparent', `${SORT_COLORS[10]}15`,
|
|
242
|
-
// Lime
|
|
243
|
-
'transparent', `${SORT_COLORS[9]}15`,
|
|
244
|
-
// Peach
|
|
245
|
-
'transparent']
|
|
246
|
-
});
|
|
247
|
-
|
|
248
|
-
// ==================== SERVICE CLASS ====================
|
|
249
|
-
|
|
250
|
-
export class ColorSortService {
|
|
251
|
-
cleanup() {
|
|
252
|
-
// Cleanup logic if needed
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
//# sourceMappingURL=ColorsSortService.js.map
|
|
1
|
+
"use strict";import{Dimensions}from 'react-native';const{width,height}= Dimensions.get('window');export const SORT_COLORS = ['#FF6B35','#FF4444','#FF8C42','#FFD700','#32CD32','#4169E1','#FF1493','#9370DB','#00BCD4','#FFA366','#CDDC39','#E91E63' ];export const formatTime = seconds =>{const mins = Math.floor(seconds / 60);const secs = seconds % 60;return `${mins.toString().padStart(2,'0')}:${secs.toString().padStart(2,'0')}`;};export const getGridLayout = difficulty =>{switch(difficulty){case 'easy':return{maxWidth:400};case 'medium':return{maxWidth:300};case 'hard':return{maxWidth:300};default:return{maxWidth:400};}};export const getPieceHeight =(difficulty,baseSize)=>{switch(difficulty){case 'easy':return baseSize - 8;case 'medium':return baseSize - 10;case 'hard':return baseSize - 18;default:return baseSize - 10;}};export const generateFloatingBlocks =()=>{const elements = [];const blockCount = 25;for(let i = 0;i < blockCount;i++){const baseX = width / blockCount * i;const baseY = height / blockCount * i;const x = baseX + Math.sin(i * 0.5)* 50 + Math.random()* 100;const y = baseY + Math.cos(i * 0.7)* 60 + Math.random()* 120;const blockSize = 20 + Math.random()* 20;const colorIndex = i % SORT_COLORS.length;const opacity = 0.3 + Math.sin(i)* 0.15;const blockX = Math.max(blockSize / 2,Math.min(width - blockSize,x));const blockY = Math.max(blockSize / 2,Math.min(height - blockSize,y));const color = `${SORT_COLORS[colorIndex]}${Math.floor(opacity * 255).toString(16).padStart(2,'0')}`;let type;if(i % 4 === 0)type = 'square';else if(i % 4 === 1)type = 'rect';else if(i % 4 === 2)type = 'wide';else type = 'circle';elements.push({key:`${type}-${i}`,type,x:blockX,y:blockY,size:blockSize,color});}return elements;};export const getDecorativeBlocks =()=> [{key:'top-left',x:width * 0.08,y:height * 0.12,size:50,r:8,color:`${SORT_COLORS[0]}50`},{key:'bottom-right',x:width * 0.85,y:height * 0.82,size:45,r:7,color:`${SORT_COLORS[3]}50`},{key:'top-right',x:width * 0.82,y:height * 0.18,size:40,r:6,color:`${SORT_COLORS[4]}50`},{key:'bottom-left',x:width * 0.12,y:height * 0.75,size:55,r:9,color:`${SORT_COLORS[5]}50`},{key:'top-center',x:width * 0.47,y:height * 0.08,size:35,r:5,color:`${SORT_COLORS[7]}50`},{key:'middle-left',x:width * 0.15,y:height * 0.47,size:42,r:6,color:`${SORT_COLORS[6]}50`},{key:'middle-right',x:width * 0.75,y:height * 0.57,size:38,r:6,color:`${SORT_COLORS[8]}50`},{key:'bottom-center',x:width * 0.57,y:height * 0.87,size:32,r:5,color:`${SORT_COLORS[1]}50`}];export const getDecorativeCircles =()=> [{key:'circle-1',cx:width * 0.25,cy:height * 0.25,r:18,color:`${SORT_COLORS[10]}45`},{key:'circle-2',cx:width * 0.65,cy:height * 0.35,r:22,color:`${SORT_COLORS[11]}45`},{key:'circle-3',cx:width * 0.35,cy:height * 0.65,r:16,color:`${SORT_COLORS[9]}45`}];export const getGradientColors =()=>({main:[`${SORT_COLORS[0]}30`,`${SORT_COLORS[3]}25`,`${SORT_COLORS[4]}30`,`${SORT_COLORS[5]}25`,`${SORT_COLORS[7]}30` ],overlay:[`${SORT_COLORS[1]}20`,'transparent',`${SORT_COLORS[6]}20`,'transparent',`${SORT_COLORS[8]}20`,'transparent'],diagonal:[`${SORT_COLORS[2]}15`,'transparent',`${SORT_COLORS[10]}15`,'transparent',`${SORT_COLORS[9]}15`,'transparent']});export class ColorSortService{cleanup(){}}
|