Skip to content

Commit d0377fb

Browse files
committed
Initial commit
0 parents  commit d0377fb

23 files changed

Lines changed: 12969 additions & 0 deletions

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
lib/

.eslintrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"root": true,
3+
"extends": "tienphaw"
4+
}

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# macOS
2+
.DS_Store
3+
4+
# Node
5+
node_modules/
6+
npm-debug.log
7+
yarn-debug.log
8+
yarn-error.log
9+
10+
# Expo
11+
.expo/
12+
13+
# Build
14+
dist/
15+
lib/

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname $0)/_/husky.sh"
3+
4+
yarn lint

.prettierrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"singleQuote": true,
3+
"tabWidth": 2,
4+
"trailingComma": "es5",
5+
"useTabs": false,
6+
"semi": false,
7+
"quoteProps": "consistent"
8+
}

example/.expo-shared/assets.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true,
3+
"40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true
4+
}

example/.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
node_modules/
2+
.expo/*
3+
npm-debug.*
4+
*.jks
5+
*.p8
6+
*.p12
7+
*.key
8+
*.mobileprovision
9+
*.orig.*
10+
web-build/
11+
12+
# macOS
13+
.DS_Store

example/App.tsx

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import { StatusBar } from 'expo-status-bar'
2+
import React from 'react'
3+
import { StyleSheet, View } from 'react-native'
4+
import { LinearGradient } from 'expo-linear-gradient'
5+
import easeGradient from 'react-native-easing-gradient'
6+
import { Text } from 'react-native'
7+
8+
const BACKGROUND_COLOR = '#18181B'
9+
10+
const { colors, locations } = easeGradient({
11+
colorStops: {
12+
0: {
13+
color: 'transparent',
14+
},
15+
1: {
16+
color: BACKGROUND_COLOR,
17+
},
18+
},
19+
})
20+
21+
export default function App() {
22+
return (
23+
<View style={styles.container}>
24+
<StatusBar style="auto" />
25+
<View style={styles.header} />
26+
<View style={styles.overlayContainer}>
27+
<View style={styles.fill}>
28+
<LinearGradient
29+
colors={['transparent', BACKGROUND_COLOR]}
30+
locations={[0, 1]}
31+
style={styles.fill}
32+
/>
33+
<View style={styles.description}>
34+
<Text style={styles.descriptionText}>Before (linear)</Text>
35+
</View>
36+
</View>
37+
<View style={styles.fill}>
38+
<LinearGradient
39+
colors={colors}
40+
locations={locations}
41+
style={styles.fill}
42+
/>
43+
<View style={styles.description}>
44+
<Text style={styles.descriptionText}>After (ease-in-out)</Text>
45+
</View>
46+
</View>
47+
</View>
48+
</View>
49+
)
50+
}
51+
52+
const HEADER_HEIGHT = 300
53+
54+
const styles = StyleSheet.create({
55+
container: {
56+
flex: 1,
57+
backgroundColor: BACKGROUND_COLOR,
58+
},
59+
header: {
60+
height: HEADER_HEIGHT,
61+
backgroundColor: '#6366F1',
62+
},
63+
overlayContainer: {
64+
position: 'absolute',
65+
top: 0,
66+
left: 0,
67+
right: 0,
68+
flexDirection: 'row',
69+
height: HEADER_HEIGHT / 2,
70+
marginTop: HEADER_HEIGHT / 2,
71+
},
72+
fill: {
73+
flex: 1,
74+
},
75+
description: {
76+
position: 'absolute',
77+
left: 0,
78+
right: 0,
79+
bottom: 0,
80+
alignItems: 'center',
81+
},
82+
descriptionText: {
83+
color: '#E0E7FF',
84+
},
85+
})

example/app.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"expo": {
3+
"name": "example",
4+
"slug": "example",
5+
"version": "1.0.0",
6+
"orientation": "portrait",
7+
"icon": "./assets/icon.png",
8+
"splash": {
9+
"image": "./assets/splash.png",
10+
"resizeMode": "contain",
11+
"backgroundColor": "#ffffff"
12+
},
13+
"updates": {
14+
"fallbackToCacheTimeout": 0
15+
},
16+
"assetBundlePatterns": [
17+
"**/*"
18+
],
19+
"ios": {
20+
"supportsTablet": true
21+
},
22+
"android": {
23+
"adaptiveIcon": {
24+
"foregroundImage": "./assets/adaptive-icon.png",
25+
"backgroundColor": "#FFFFFF"
26+
}
27+
},
28+
"web": {
29+
"favicon": "./assets/favicon.png"
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)