Skip to content

Commit

Permalink
core(lib): add reanimated lib and made few animation as poc (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
arenault-pass authored Apr 1, 2024
1 parent f206613 commit 4701386
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .maestro/launchGame.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
appId: com.axe.l.r.drinkup
---
- launchApp
- tapOn: # Open the server in
- tapOn: # Open the server in dev build if possible
point: "50%,26%"
- tapOn: "LANCER LA PARTIE"

Expand Down
5 changes: 4 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo",],
plugins: ["nativewind/babel"],
plugins: [
"nativewind/babel",
"react-native-reanimated/plugin"
],
};
};
4 changes: 2 additions & 2 deletions eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"distribution": "internal"
},
"preview": {
"android": {
"buildType": "apk"
"ios": {
"simulator": true
}
},
"production": {}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"react-native": "0.72.10",
"react-native-heroicons": "^4.0.0",
"react-native-progress": "^5.0.1",
"react-native-reanimated": "~3.3.0",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "~3.22.0",
"react-native-svg": "13.9.0",
Expand Down
5 changes: 3 additions & 2 deletions screens/Gamescreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
TouchableOpacity,
ImageBackground,
} from "react-native";
import Animated, { LightSpeedInRight } from "react-native-reanimated";
import React, { useEffect, useState } from "react";
import { ActivityIndicator } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
Expand Down Expand Up @@ -127,7 +128,7 @@ export default function Gamescreen() {
const currentPlayer =
players[currentQuestionIndex % players.length];
return (
<View className="items-center">
<Animated.View className="items-center" key={currentQuestionIndex} entering={LightSpeedInRight} >
<View className="bg-white rounded-2xl px-2">
<Text className="text-cyan-700 font-semibold text-center text-xs">
Thème : {item.Theme}
Expand All @@ -139,7 +140,7 @@ export default function Gamescreen() {
<Text className="text-white font-semibold text-center text-sm">
{item.Questions}
</Text>
</View>
</Animated.View>
);
})()
) : (
Expand Down
3 changes: 3 additions & 0 deletions screens/Homescreen.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { View, Text, TouchableOpacity, ImageBackground } from "react-native";
import Animated, { FadeInDown } from "react-native-reanimated";
import React from "react";
import { SafeAreaView } from "react-native-safe-area-context";
import { StatusBar } from "expo-status-bar";
Expand Down Expand Up @@ -39,6 +40,7 @@ export default function HomeScreen() {
</View>
{/* Button */}
<View className="flex justify-center items-center ">
<Animated.View entering={FadeInDown}>
<TouchableOpacity
onPress={goToLobby}
className=" bg-white w-50 px-4 py-4 border-solid rounded-lg mt-4 justify-center align-items-center"
Expand All @@ -47,6 +49,7 @@ export default function HomeScreen() {
LANCER LA PARTIE
</Text>
</TouchableOpacity>
</Animated.View>
</View>
</SafeAreaView>
</View>
Expand Down
9 changes: 5 additions & 4 deletions screens/Lobbyscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
FlatList,
ImageBackground,
} from "react-native";
import Animated, { SlideInUp, SlideInDown } from "react-native-reanimated";
import React, { useEffect, useState } from "react";
import { StatusBar } from "expo-status-bar";
import { TouchableOpacity } from "react-native";
Expand Down Expand Up @@ -116,16 +117,16 @@ export default function Lobbyscreen() {
data={players}
keyExtractor={(item) => item.id.toString()}
renderItem={({ item }) => (
<View className=" bg-white justify-center items-center p-4 rounded-lg my-2">
<Animated.View className=" bg-white justify-center items-center p-4 rounded-lg my-2" entering={SlideInUp} >
<Text className=" text-cyan-900 font-semibold">
{item.name}
</Text>
</View>
</Animated.View>
)}
/>
</View>
{/* Button */}
<View className="flex-1 justify-center items-center ">
<Animated.View className="flex-1 justify-center items-center " entering={SlideInDown}>
<TouchableOpacity
disabled={!hasMinPlayer}
onPress={startGame}
Expand All @@ -135,7 +136,7 @@ export default function Lobbyscreen() {
ON EST PRET !
</Text>
</TouchableOpacity>
</View>
</Animated.View>
</SafeAreaView>
</View>
);
Expand Down
90 changes: 90 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,21 @@
"@babel/helper-split-export-declaration" "^7.22.6"
semver "^6.3.1"

"@babel/helper-create-class-features-plugin@^7.24.1":
version "7.24.1"
resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.1.tgz#db58bf57137b623b916e24874ab7188d93d7f68f"
integrity sha512-1yJa9dX9g//V6fDebXoEfEsxkZHk3Hcbm+zLhyu6qVgYFLvmTALTeV+jNU9e5RnYtioBrGEOdoI2joMSNQ/+aA==
dependencies:
"@babel/helper-annotate-as-pure" "^7.22.5"
"@babel/helper-environment-visitor" "^7.22.20"
"@babel/helper-function-name" "^7.23.0"
"@babel/helper-member-expression-to-functions" "^7.23.0"
"@babel/helper-optimise-call-expression" "^7.22.5"
"@babel/helper-replace-supers" "^7.24.1"
"@babel/helper-skip-transparent-expression-wrappers" "^7.22.5"
"@babel/helper-split-export-declaration" "^7.22.6"
semver "^6.3.1"

"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.22.15", "@babel/helper-create-regexp-features-plugin@^7.22.5":
version "7.22.15"
resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz"
Expand Down Expand Up @@ -200,6 +215,11 @@
resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz"
integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==

"@babel/helper-plugin-utils@^7.24.0":
version "7.24.0"
resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz#945681931a52f15ce879fd5b86ce2dae6d3d7f2a"
integrity sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==

"@babel/helper-remap-async-to-generator@^7.18.9", "@babel/helper-remap-async-to-generator@^7.22.20":
version "7.22.20"
resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz"
Expand All @@ -218,6 +238,15 @@
"@babel/helper-member-expression-to-functions" "^7.22.15"
"@babel/helper-optimise-call-expression" "^7.22.5"

"@babel/helper-replace-supers@^7.24.1":
version "7.24.1"
resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.24.1.tgz#7085bd19d4a0b7ed8f405c1ed73ccb70f323abc1"
integrity sha512-QCR1UqC9BzG5vZl8BMicmZ28RuUBnHhAMddD8yHFHDRH9lLTZ9uUPehX8ctVPT8l0TKblJidqcgUUKGVrePleQ==
dependencies:
"@babel/helper-environment-visitor" "^7.22.20"
"@babel/helper-member-expression-to-functions" "^7.23.0"
"@babel/helper-optimise-call-expression" "^7.22.5"

"@babel/helper-simple-access@^7.22.5":
version "7.22.5"
resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz"
Expand Down Expand Up @@ -493,6 +522,13 @@
dependencies:
"@babel/helper-plugin-utils" "^7.22.5"

"@babel/plugin-syntax-jsx@^7.24.1":
version "7.24.1"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.1.tgz#3f6ca04b8c841811dbc3c5c5f837934e0d626c10"
integrity sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==
dependencies:
"@babel/helper-plugin-utils" "^7.24.0"

"@babel/plugin-syntax-logical-assignment-operators@^7.10.4":
version "7.10.4"
resolved "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz"
Expand Down Expand Up @@ -556,6 +592,13 @@
dependencies:
"@babel/helper-plugin-utils" "^7.22.5"

"@babel/plugin-syntax-typescript@^7.24.1":
version "7.24.1"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.1.tgz#b3bcc51f396d15f3591683f90239de143c076844"
integrity sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw==
dependencies:
"@babel/helper-plugin-utils" "^7.24.0"

"@babel/plugin-syntax-unicode-sets-regex@^7.18.6":
version "7.18.6"
resolved "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz"
Expand Down Expand Up @@ -762,6 +805,15 @@
"@babel/helper-plugin-utils" "^7.22.5"
"@babel/helper-simple-access" "^7.22.5"

"@babel/plugin-transform-modules-commonjs@^7.24.1":
version "7.24.1"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.1.tgz#e71ba1d0d69e049a22bf90b3867e263823d3f1b9"
integrity sha512-szog8fFTUxBfw0b98gEWPaEqF42ZUD/T3bkynW/wtgx2p/XCP55WEsb+VosKceRSd6njipdZvNogqdtI4Q0chw==
dependencies:
"@babel/helper-module-transforms" "^7.23.3"
"@babel/helper-plugin-utils" "^7.24.0"
"@babel/helper-simple-access" "^7.22.5"

"@babel/plugin-transform-modules-systemjs@^7.23.3":
version "7.23.3"
resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.3.tgz"
Expand Down Expand Up @@ -811,6 +863,13 @@
"@babel/helper-plugin-utils" "^7.22.5"
"@babel/plugin-syntax-numeric-separator" "^7.10.4"

"@babel/plugin-transform-object-assign@^7.16.7":
version "7.24.1"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.24.1.tgz#46a70169e56970aafd13a6ae677d5b497fc227e7"
integrity sha512-I1kctor9iKtupb7jv7FyjApHCuKLBKCblVAeHVK9PB6FW7GI0ac6RtobC3MwwJy8CZ1JxuhQmnbrsqI5G8hAIg==
dependencies:
"@babel/helper-plugin-utils" "^7.24.0"

"@babel/plugin-transform-object-rest-spread@^7.23.4":
version "7.23.4"
resolved "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.23.4.tgz"
Expand Down Expand Up @@ -984,6 +1043,16 @@
"@babel/helper-plugin-utils" "^7.22.5"
"@babel/plugin-syntax-typescript" "^7.23.3"

"@babel/plugin-transform-typescript@^7.24.1":
version "7.24.1"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.24.1.tgz#5c05e28bb76c7dfe7d6c5bed9951324fd2d3ab07"
integrity sha512-liYSESjX2fZ7JyBFkYG78nfvHlMKE6IpNdTVnxmlYUR+j5ZLsitFbaAE+eJSK2zPPkNWNw4mXL51rQ8WrvdK0w==
dependencies:
"@babel/helper-annotate-as-pure" "^7.22.5"
"@babel/helper-create-class-features-plugin" "^7.24.1"
"@babel/helper-plugin-utils" "^7.24.0"
"@babel/plugin-syntax-typescript" "^7.24.1"

"@babel/plugin-transform-unicode-escapes@^7.23.3":
version "7.23.3"
resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.23.3.tgz"
Expand Down Expand Up @@ -1130,6 +1199,17 @@
"@babel/plugin-transform-modules-commonjs" "^7.23.3"
"@babel/plugin-transform-typescript" "^7.23.3"

"@babel/preset-typescript@^7.16.7":
version "7.24.1"
resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.24.1.tgz#89bdf13a3149a17b3b2a2c9c62547f06db8845ec"
integrity sha512-1DBaMmRDpuYQBPWD8Pf/WEwCrtgRHxsZnP4mIy9G/X+hFfbI47Q2G4t1Paakld84+qsk2fSsUPMKg71jkoOOaQ==
dependencies:
"@babel/helper-plugin-utils" "^7.24.0"
"@babel/helper-validator-option" "^7.23.5"
"@babel/plugin-syntax-jsx" "^7.24.1"
"@babel/plugin-transform-modules-commonjs" "^7.24.1"
"@babel/plugin-transform-typescript" "^7.24.1"

"@babel/register@^7.13.16":
version "7.23.7"
resolved "https://registry.npmjs.org/@babel/register/-/register-7.23.7.tgz"
Expand Down Expand Up @@ -7834,6 +7914,16 @@ react-native-progress@^5.0.1:
dependencies:
prop-types "^15.7.2"

react-native-reanimated@~3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-3.3.0.tgz#80f9d58e28fddf62fe4c1bc792337b8ab57936ab"
integrity sha512-LzfpPZ1qXBGy5BcUHqw3pBC0qSd22qXS3t8hWSbozXNrBkzMhhOrcILE/nEg/PHpNNp1xvGOW8NwpAMF006roQ==
dependencies:
"@babel/plugin-transform-object-assign" "^7.16.7"
"@babel/preset-typescript" "^7.16.7"
convert-source-map "^2.0.0"
invariant "^2.2.4"

[email protected]:
version "4.6.3"
resolved "https://registry.yarnpkg.com/react-native-safe-area-context/-/react-native-safe-area-context-4.6.3.tgz#f06cfea05b1c4b018aa9758667a109f619c62b55"
Expand Down

0 comments on commit 4701386

Please sign in to comment.