Skip to content

Commit 4cf46f9

Browse files
authored
Merge pull request #9 from blazejkustra/desert
feat: add Desert component
2 parents f3aeffe + bd5038c commit 4cf46f9

File tree

8 files changed

+771
-6
lines changed

8 files changed

+771
-6
lines changed
89.1 KB
Loading

example/src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import LiquidChromeStaticScreen from './screens/LiquidChrome/LiquidChromeStaticS
1515
import SilkStaticScreen from './screens/Silk/SilkStaticScreen';
1616
import CampfireStaticScreen from './screens/Campfire/CampfireStaticScreen';
1717
import CalicoSwirlStaticScreen from './screens/CalicoSwirl/CalicoSwirlStaticScreen';
18+
import DesertStaticScreen from './screens/Desert/DesertStaticScreen';
1819
import type { RootStackParamList } from './types';
1920

2021
const Stack = createNativeStackNavigator<RootStackParamList>();
@@ -73,6 +74,7 @@ export default function App() {
7374
name="CalicoSwirlStatic"
7475
component={CalicoSwirlStaticScreen}
7576
/>
77+
<Stack.Screen name="DesertStatic" component={DesertStaticScreen} />
7678
</Stack.Navigator>
7779
</NavigationContainer>
7880
);
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
import { View, Text, StyleSheet, StatusBar } from 'react-native';
2+
import { Desert } from 'react-native-backgrounds';
3+
import { Header } from '../../components/Header';
4+
5+
export default function DesertStaticScreen() {
6+
return (
7+
<View style={styles.container}>
8+
<StatusBar barStyle="light-content" backgroundColor="#000" />
9+
10+
<Header
11+
title="Desert"
12+
subtitle="Raymarched desert scene with sand dunes and atmosphere"
13+
/>
14+
15+
<View style={styles.desertContainer}>
16+
<Desert
17+
color="#ffffff"
18+
speed={1.0}
19+
sandDetail={1.0}
20+
bumpIntensity={1.0}
21+
mistIntensity={1.0}
22+
style={styles.desert}
23+
/>
24+
</View>
25+
26+
<View style={styles.infoPanel}>
27+
<Text style={styles.infoTitle}>Classic Desert</Text>
28+
<View style={styles.detailsGrid}>
29+
<View style={styles.detailItem}>
30+
<Text style={styles.detailLabel}>Technique:</Text>
31+
<Text style={styles.detailValue}>Raymarching</Text>
32+
</View>
33+
<View style={styles.detailItem}>
34+
<Text style={styles.detailLabel}>Speed:</Text>
35+
<Text style={styles.detailValue}>1.0x</Text>
36+
</View>
37+
<View style={styles.detailItem}>
38+
<Text style={styles.detailLabel}>Sand Detail:</Text>
39+
<Text style={styles.detailValue}>1.0</Text>
40+
</View>
41+
<View style={styles.detailItem}>
42+
<Text style={styles.detailLabel}>Bump:</Text>
43+
<Text style={styles.detailValue}>1.0</Text>
44+
</View>
45+
</View>
46+
</View>
47+
</View>
48+
);
49+
}
50+
51+
const styles = StyleSheet.create({
52+
container: {
53+
flex: 1,
54+
backgroundColor: '#000',
55+
},
56+
desertContainer: {
57+
flex: 1,
58+
margin: 20,
59+
borderRadius: 20,
60+
overflow: 'hidden',
61+
borderWidth: 1,
62+
borderColor: '#252525',
63+
shadowColor: '#000',
64+
shadowOffset: {
65+
width: 0,
66+
height: 4,
67+
},
68+
shadowOpacity: 0.4,
69+
shadowRadius: 12,
70+
elevation: 6,
71+
},
72+
desert: {
73+
flex: 1,
74+
},
75+
infoPanel: {
76+
backgroundColor: '#111',
77+
padding: 24,
78+
borderTopWidth: 1,
79+
borderTopColor: '#252525',
80+
},
81+
infoTitle: {
82+
fontSize: 24,
83+
fontWeight: '800',
84+
color: '#fff',
85+
marginBottom: 12,
86+
letterSpacing: -0.5,
87+
},
88+
infoDescription: {
89+
fontSize: 15,
90+
color: '#999',
91+
lineHeight: 22,
92+
marginBottom: 20,
93+
},
94+
detailsGrid: {
95+
flexDirection: 'row',
96+
flexWrap: 'wrap',
97+
gap: 16,
98+
},
99+
detailItem: {
100+
flex: 1,
101+
minWidth: '40%',
102+
},
103+
detailLabel: {
104+
fontSize: 12,
105+
color: '#666',
106+
marginBottom: 6,
107+
fontWeight: '600',
108+
textTransform: 'uppercase',
109+
letterSpacing: 0.5,
110+
},
111+
detailValue: {
112+
fontSize: 15,
113+
color: '#ddd',
114+
fontWeight: '600',
115+
},
116+
});

example/src/screens/HomeScreen.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ const EXAMPLE_CATEGORIES: ExampleCategory[] = [
5151
color: '#6366f1',
5252
image: require('../../assets/components/calico-swirl.png'),
5353
},
54+
{
55+
id: 'desert',
56+
title: 'Desert',
57+
description: 'Raymarched desert with sand dunes and mist',
58+
screen: 'DesertStatic',
59+
color: '#d4a574',
60+
image: require('../../assets/components/desert.png'),
61+
},
5462
{
5563
id: 'circular-gradient',
5664
title: 'Circular Gradient',
@@ -107,12 +115,6 @@ export default function HomeScreen() {
107115
</TouchableOpacity>
108116
))}
109117
</ScrollView>
110-
111-
<View style={styles.footer}>
112-
<Text style={styles.footerText}>
113-
Tap any example to see it in action
114-
</Text>
115-
</View>
116118
</View>
117119
);
118120
}

example/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export type RootStackParamList = {
1414
SilkStatic: undefined;
1515
CampfireStatic: undefined;
1616
CalicoSwirlStatic: undefined;
17+
DesertStatic: undefined;
1718
};
1819

1920
export type HomeScreenNavigationProp =

0 commit comments

Comments
 (0)