-
Notifications
You must be signed in to change notification settings - Fork 1
/
Layout.js
210 lines (204 loc) · 5.21 KB
/
Layout.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
import React, {useState, useEffect, useId} from 'react';
import {
View,
Text,
StyleSheet,
ImageBackground,
TouchableOpacity,
ScrollView,
FlatList,
SafeAreaView,
Platform,
Image,
} from 'react-native';
import Svg, {Circle, Path, Line, G} from 'react-native-svg';
import LinearGradient from 'react-native-linear-gradient';
import {ReactNativeZoomableView} from '@openspacelabs/react-native-zoomable-view';
import {Dimensions} from 'react-native';
import Carousel from 'react-native-reanimated-carousel';
const Layout = ({navigation}) => {
const windowWidth = Dimensions.get('window').width;
const windowHeight = Dimensions.get('window').height;
const images = [
{
id: 1,
url: require('./assets/layoutPics/Level1.png'),
},
{
id: 2,
url: require('./assets/layoutPics/Level2.png'),
},
{
id: 3,
url: require('./assets/layoutPics/Level3.png'),
},
{
id: 4,
url: require('./assets/layoutPics/Level4.png'),
},
{
id: 5,
url: require('./assets/layoutPics/Level5.png'),
},
{
id: 6,
url: require('./assets/layoutPics/Atrium.png'),
},
{
id: 7,
url: require('./assets/layoutPics/MakerLab.png'),
},
{
id: 8,
url: require('./assets/layoutPics/AdmtStudio.png'),
},
{
id: 9,
url: require('./assets/layoutPics/LO1.png'),
},
{
id: 10,
url: require('./assets/layoutPics/LO2.png'),
},
];
const carouselItems = images.map(image => ({
id: image.id,
image: image.url,
}));
return (
<View style={styles.container}>
<ImageBackground
source={require('./assets/background.png')}
style={styles.imageBackground}
resizeMode="cover">
<SafeAreaView style={{flex: 1}}>
<View style={{marginTop: '5%'}} />
<View>
<View style={styles.topSidebar}>
<Text allowFontScaling={false} style={styles.header}>
Layout
</Text>
<TouchableOpacity
style={styles.hamburgerIconPress}
onPress={() => navigation.openDrawer()}>
<Svg
width="48"
height="52"
viewBox="0 0 48 52"
fill="none"
style={{marginTop: 11}}>
<LinearGradient
colors={['#D9D9D9', 'transparent']}
style={{borderRadius: 24}}></LinearGradient>
<Line x1="12" y1="16.5" x2="36" y2="16.5" stroke="#EBEBEF" />
<Line x1="12" y1="24.5" x2="36" y2="24.5" stroke="#EBEBEF" />
<Line x1="12" y1="32.5" x2="36" y2="32.5" stroke="#EBEBEF" />
</Svg>
</TouchableOpacity>
</View>
</View>
<View style={{flex: 1, marginTop: '20%'}}>
<Text allowFontScaling={false} style={styles.basicText}>
Swipe to view the layouts!
</Text>
<Carousel
loop
width={windowWidth}
style={{bottom: '40%'}}
autoPlay={false}
data={carouselItems}
scrollAnimationDuration={1000}
onSnapToItem={index => console.log('current index:', index)}
renderItem={({item}) => (
<View
style={{
flex: 1,
justifyContent: 'center',
}}>
<Image
source={item.image}
style={{width: '100%', height: '100%'}}
resizeMode="contain"
/>
</View>
)}
/>
</View>
</SafeAreaView>
</ImageBackground>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
topSidebar: {
flexDirection: 'row',
justifyContent: 'space-between',
width: '90%',
marginLeft: '5%',
},
header: {
color: '#EBEBEF',
textAlign: 'center',
fontFamily: 'Lato',
fontSize: 50,
fontWeight: 'normal',
},
discover: {
color: 'rgba(235, 235, 239, 0.60)',
opacity: 0.7,
marginLeft: '5%',
marginTop: '7%',
fontSize: 16,
},
imageBackground: {
width: '100%',
height: '100%',
},
generalText: {
color: 'rgba(235, 235, 239, 0.70)',
fontFamily: 'Lato',
fontSize: 16,
fontWeight: '400',
lineHeight: 19,
},
seperator: {
marginTop: '9%',
flexDirection: 'row',
display: 'inline-flex',
justifyContent: 'flex-end',
alignItems: 'center',
gap: 8,
},
basicText: {
color: '#EBEBEF',
fontFamily: 'Lato',
fontSize: 25,
fontStyle: 'normal',
fontWeight: '400',
marginBottom: '3%',
marginLeft: '5.7%',
},
eventsContainer: {
flexDirection: 'column',
},
eventsBox: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
gap: 19,
},
eventsDetailsBox: {
width: '69.3%',
height: 64,
borderRadius: 20,
borderWidth: 1,
borderColor: 'rgba(235, 235, 239, 0.20)',
backgroundColor: 'rgba(235, 235, 239, 0.20)',
},
});
export default Layout;