forked from bluesky-social/social-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add new assets * Add splashiness * Add butter icon, spread it * Cream together eggs, sugar, and vanilla * Hi, I'd like to place and order. Yeah, none pizza with left beef, plz. * test * Refine animation * tweak * tweak * tweak * Tweak * Simplify * Cleanup * Fix android logo --------- Co-authored-by: Ansh Nanda <[email protected]>
- Loading branch information
1 parent
075ffdf
commit 7897dd2
Showing
26 changed files
with
304 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
import React, {useCallback, useEffect} from 'react' | ||
import {View, StyleSheet} from 'react-native' | ||
import * as SplashScreen from 'expo-splash-screen' | ||
import LinearGradient from 'react-native-linear-gradient' | ||
import Animated, { | ||
interpolate, | ||
runOnJS, | ||
useAnimatedStyle, | ||
useSharedValue, | ||
withTiming, | ||
Easing, | ||
} from 'react-native-reanimated' | ||
import MaskedView from '@react-native-masked-view/masked-view' | ||
import {useSafeAreaInsets} from 'react-native-safe-area-context' | ||
import Svg, {Path, SvgProps} from 'react-native-svg' | ||
|
||
export const Logo = React.forwardRef(function LogoImpl(props: SvgProps, ref) { | ||
const width = 1000 | ||
const height = width * (67 / 64) | ||
return ( | ||
<Svg | ||
fill="none" | ||
// @ts-ignore it's fiiiiine | ||
ref={ref} | ||
viewBox="0 0 64 66" | ||
style={{width, height}}> | ||
<Path | ||
fill="#fff" | ||
d="M13.873 3.77C21.21 9.243 29.103 20.342 32 26.3v15.732c0-.335-.13.043-.41.858-1.512 4.414-7.418 21.642-20.923 7.87-7.111-7.252-3.819-14.503 9.125-16.692-7.405 1.252-15.73-.817-18.014-8.93C1.12 22.804 0 8.431 0 6.488 0-3.237 8.579-.18 13.873 3.77ZM50.127 3.77C42.79 9.243 34.897 20.342 32 26.3v15.732c0-.335.13.043.41.858 1.512 4.414 7.418 21.642 20.923 7.87 7.111-7.252 3.819-14.503-9.125-16.692 7.405 1.252 15.73-.817 18.014-8.93C62.88 22.804 64 8.431 64 6.488 64-3.237 55.422-.18 50.127 3.77Z" | ||
/> | ||
</Svg> | ||
) | ||
}) | ||
|
||
type Props = { | ||
isReady: boolean | ||
} | ||
|
||
SplashScreen.preventAutoHideAsync().catch(() => {}) | ||
|
||
const AnimatedLogo = Animated.createAnimatedComponent(Logo) | ||
|
||
export function Splash(props: React.PropsWithChildren<Props>) { | ||
const insets = useSafeAreaInsets() | ||
const intro = useSharedValue(0) | ||
const outroLogo = useSharedValue(0) | ||
const outroApp = useSharedValue(0) | ||
const [isAnimationComplete, setIsAnimationComplete] = React.useState(false) | ||
|
||
const logoAnimations = useAnimatedStyle(() => { | ||
return { | ||
transform: [ | ||
{ | ||
scale: interpolate(intro.value, [0, 1], [0.8, 1], 'clamp'), | ||
}, | ||
{ | ||
scale: interpolate( | ||
outroLogo.value, | ||
[0, 0.06, 0.08, 1], | ||
[1, 0.8, 0.8, 800], | ||
'clamp', | ||
), | ||
}, | ||
], | ||
opacity: interpolate(intro.value, [0, 1], [0, 1], 'clamp'), | ||
} | ||
}) | ||
|
||
const appAnimation = useAnimatedStyle(() => { | ||
return { | ||
transform: [ | ||
{ | ||
scale: interpolate( | ||
outroApp.value, | ||
[0, 0.7, 1], | ||
[1.1, 1.1, 1], | ||
'clamp', | ||
), | ||
}, | ||
], | ||
opacity: interpolate(outroApp.value, [0, 0.7, 1], [0, 0, 1], 'clamp'), | ||
} | ||
}) | ||
|
||
const onFinish = useCallback(() => setIsAnimationComplete(true), []) | ||
|
||
useEffect(() => { | ||
if (props.isReady) { | ||
// hide on mount | ||
SplashScreen.hideAsync().catch(() => {}) | ||
|
||
intro.value = withTiming( | ||
1, | ||
{duration: 200, easing: Easing.out(Easing.cubic)}, | ||
async () => { | ||
outroLogo.value = withTiming( | ||
1, | ||
{duration: 1200, easing: Easing.in(Easing.cubic)}, | ||
() => { | ||
runOnJS(onFinish)() | ||
}, | ||
) | ||
outroApp.value = withTiming( | ||
1, | ||
{duration: 1200, easing: Easing.inOut(Easing.cubic)}, | ||
() => { | ||
runOnJS(onFinish)() | ||
}, | ||
) | ||
}, | ||
) | ||
} | ||
}, [onFinish, intro, outroLogo, outroApp, props.isReady]) | ||
|
||
return ( | ||
<View style={{flex: 1}}> | ||
{!isAnimationComplete && ( | ||
<LinearGradient | ||
colors={['#0A7AFF', '#59B9FF']} | ||
style={[StyleSheet.absoluteFillObject]} | ||
/> | ||
)} | ||
|
||
<MaskedView | ||
style={[StyleSheet.absoluteFillObject]} | ||
maskElement={ | ||
<Animated.View | ||
style={[ | ||
StyleSheet.absoluteFillObject, | ||
{ | ||
// Transparent background because mask is based off alpha channel. | ||
backgroundColor: 'transparent', | ||
flex: 1, | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
transform: [{translateY: -(insets.top / 2)}, {scale: 0.1}], // scale from 1000px to 100px | ||
}, | ||
]}> | ||
<AnimatedLogo style={[logoAnimations]} /> | ||
</Animated.View> | ||
}> | ||
{!isAnimationComplete && ( | ||
<View | ||
style={[StyleSheet.absoluteFillObject, {backgroundColor: 'white'}]} | ||
/> | ||
)} | ||
|
||
<Animated.View style={[{flex: 1}, appAnimation]}> | ||
{props.children} | ||
</Animated.View> | ||
</MaskedView> | ||
</View> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import {ImageRequireSource} from 'react-native' | ||
|
||
export const DEF_AVATAR: ImageRequireSource = require('../../assets/default-avatar.jpg') | ||
export const TABS_EXPLAINER: ImageRequireSource = require('../../assets/tabs-explainer.jpg') | ||
export const CLOUD_SPLASH: ImageRequireSource = require('../../assets/cloud-splash.png') | ||
export const DEF_AVATAR: ImageRequireSource = require('../../assets/default-avatar.png') | ||
export const CLOUD_SPLASH: ImageRequireSource = require('../../assets/splash.png') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
import {ImageRequireSource} from 'react-native' | ||
|
||
// @ts-ignore we need to pretend -prf | ||
export const DEF_AVATAR: ImageRequireSource = {uri: '/img/default-avatar.jpg'} | ||
export const DEF_AVATAR: ImageRequireSource = {uri: '/img/default-avatar.png'} | ||
// @ts-ignore we need to pretend -prf | ||
export const TABS_EXPLAINER: ImageRequireSource = { | ||
uri: '/img/tabs-explainer.jpg', | ||
} | ||
// @ts-ignore we need to pretend -prf | ||
export const CLOUD_SPLASH: ImageRequireSource = {uri: '/img/cloud-splash.png'} | ||
export const CLOUD_SPLASH: ImageRequireSource = {uri: '/img/splash.png'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.