-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
94 lines (89 loc) · 2.49 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{/*StAuth10244:
I Alexander Hernandez, 000896328 certify that this material is my original work. No other person's work has been used without due acknowledgement. I have not made my work available to anyone else.*/}
import React, { useState } from 'react';
import { StyleSheet, View, Text, TouchableOpacity, ImageBackground, Image } from 'react-native';
import TreasureMapComponent from './components/TreasureMapComponent';
export default function App() {
const [mapActive, setMapActive] = useState(false);
const handleActivateMap = () => {
setMapActive(true);
};
const handleDeactivateMap = () => {
setMapActive(false);
};
return (
<View style={styles.container}>
<ImageBackground
source={require('./assets/gradient-background.jpeg')}
style={styles.bgImage}
>
{mapActive ? (
<TreasureMapComponent onDeactivateMap={handleDeactivateMap} />
) : (
<View style={styles.glassmorphicContainer}>
<Image
source={require('/assets/mystery-quest-title.png')}
style={styles.imageTitle}
resizeMode="contain"
/>
<TouchableOpacity style={styles.button} onPress={handleActivateMap}>
<ImageBackground source={require('./assets/map.png')} style={styles.scanButton}/>
<Text style={styles.buttonText}>View Map</Text>
</TouchableOpacity>
</View>
)}
</ImageBackground>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
bgImage: {
flex: 1,
width: '100%',
justifyContent: 'center',
},
glassmorphicContainer: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
width: '100%',
backgroundColor: 'rgba(255, 255, 255, 0.1)',
borderRadius: 15,
padding: 20,
borderWidth: 1,
borderColor: 'rgba(255, 255, 255, 0.2)',
shadowColor: 'rgba(0, 0, 0, 0.2)',
shadowOffset: { width: 0, height: 4 },
shadowRadius: 10,
shadowOpacity: 1,
},
imageTitle: {
width: '100%',
maxWidth: 300,
marginBottom: 20,
},
button: {
backgroundColor: 'inherit',
padding: 15,
borderRadius: 8,
alignSelf: 'center',
},
scanButton: {
width: 80,
height: 80,
justifyContent: 'center',
alignItems: 'center',
alignSelf: 'center',
},
buttonText: {
color: '#720e9e',
fontSize: 30,
fontWeight: 'bold',
alignSelf: 'center',
},
});