Skip to content

Commit 21d83a7

Browse files
Add example app branding and large screen layout (#15)
* feat(web): use CSS linear() for spring animations Replace the hardcoded cubic-bezier spring approximation with a real spring physics simulation that generates CSS linear() easing points. This matches native iOS/Android spring behavior much more closely. - Add damped spring simulator (120Hz, downsampled to 60fps output) - Cache generated linear() strings by spring params - Lazy feature detection with cubic-bezier fallback - Duration now derived from simulation settling time (uses stiffness) * chore: release 0.4.0 * feat(example): add branding assets and improve large screen layout Add app icon, adaptive icon, favicon, and splash screen with the ease branding (S-curve with floating leaves). Configure app.json with all asset references. Add MaxWidthContainer to cap content at 600px on wide screens/web, and a custom index.html with dark background to prevent white flash on web load. * chore: remove unnecessary *.png gitignore rule * fix(example): remove splash screen, enlarge adaptive icon foreground Drop the custom splash image — modern Expo handles splash via the app icon automatically. Increase the adaptive icon foreground from 55% to 75% of the canvas so it fills the Android safe zone properly. * fix(example): set splash background color to match app theme * fix(example): enlarge leaves and improve spacing in icon assets * fix(example): update iOS build script to match renamed app The app was renamed from EaseExample to Ease but the build:ios script still referenced the old workspace and scheme names, breaking CI.
1 parent 008ff53 commit 21d83a7

10 files changed

Lines changed: 87 additions & 19 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,3 @@ android/generated
8585
# React Native Nitro Modules
8686
nitrogen/
8787
.playwright-cli/
88-
*.png

example/app.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{
2-
"name": "EaseExample",
3-
"displayName": "EaseExample",
2+
"name": "Ease",
3+
"displayName": "Ease",
44
"expo": {
5-
"name": "EaseExample",
5+
"name": "Ease",
66
"slug": "ease-example",
77
"scheme": "ease-example",
88
"version": "1.0.0",
9+
"icon": "./assets/icon.png",
10+
"splash": {
11+
"backgroundColor": "#1a1a2e"
12+
},
913
"plugins": [
1014
[
1115
"expo-router",
@@ -16,15 +20,20 @@
1620
],
1721
"web": {
1822
"bundler": "metro",
19-
"output": "single"
23+
"output": "single",
24+
"favicon": "./assets/favicon.png"
2025
},
2126
"platforms": [
2227
"ios",
2328
"android",
2429
"web"
2530
],
2631
"android": {
27-
"package": "com.janic.easeexample"
32+
"package": "com.janic.easeexample",
33+
"adaptiveIcon": {
34+
"foregroundImage": "./assets/adaptive-icon.png",
35+
"backgroundColor": "#1a1a2e"
36+
}
2837
},
2938
"ios": {
3039
"bundleIdentifier": "com.janic.easeexample"

example/app/_layout.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
import { Stack } from 'expo-router';
22

3+
import { MaxWidthContainer } from '../src/components/MaxWidthContainer';
4+
35
export default function RootLayout() {
46
return (
5-
<Stack
6-
screenOptions={{
7-
headerStyle: { backgroundColor: '#1a1a2e' },
8-
headerTintColor: '#fff',
9-
headerTitleStyle: { fontWeight: '700' },
10-
headerBackButtonDisplayMode: 'minimal',
11-
contentStyle: { backgroundColor: '#1a1a2e' },
12-
}}
13-
>
14-
<Stack.Screen name="index" options={{ headerShown: false }} />
15-
</Stack>
7+
<MaxWidthContainer>
8+
<Stack
9+
screenOptions={{
10+
headerStyle: { backgroundColor: '#1a1a2e' },
11+
headerTintColor: '#fff',
12+
headerTitleStyle: { fontWeight: '700' },
13+
headerBackButtonDisplayMode: 'minimal',
14+
contentStyle: { backgroundColor: '#1a1a2e' },
15+
}}
16+
>
17+
<Stack.Screen name="index" options={{ headerShown: false }} />
18+
</Stack>
19+
</MaxWidthContainer>
1620
);
1721
}

example/assets/adaptive-icon.png

35.7 KB
Loading

example/assets/favicon.png

1.57 KB
Loading

example/assets/icon.png

76 KB
Loading

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"web": "expo start --web",
1111
"prebuild": "expo prebuild",
1212
"build:android": "expo prebuild --platform android --clean && cd android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
13-
"build:ios": "expo prebuild --platform ios --clean && xcodebuild -workspace ios/EaseExample.xcworkspace -scheme EaseExample -configuration Debug -sdk iphonesimulator -arch x86_64 build"
13+
"build:ios": "expo prebuild --platform ios --clean && xcodebuild -workspace ios/Ease.xcworkspace -scheme Ease -configuration Debug -sdk iphonesimulator -arch x86_64 build"
1414
},
1515
"dependencies": {
1616
"@expo/metro-runtime": "~55.0.6",

example/public/index.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
6+
<meta
7+
name="viewport"
8+
content="width=device-width, initial-scale=1, shrink-to-fit=no"
9+
/>
10+
<meta name="theme-color" content="#1a1a2e" />
11+
<title>Ease</title>
12+
<style id="expo-reset">
13+
html,
14+
body {
15+
height: 100%;
16+
}
17+
body {
18+
overflow: hidden;
19+
background-color: #1a1a2e;
20+
}
21+
#root {
22+
display: flex;
23+
height: 100%;
24+
flex: 1;
25+
}
26+
</style>
27+
</head>
28+
<body>
29+
<noscript>You need to enable JavaScript to run this app.</noscript>
30+
<div id="root"></div>
31+
</body>
32+
</html>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from 'react';
2+
import { View, StyleSheet } from 'react-native';
3+
4+
const MAX_WIDTH = 600;
5+
6+
export function MaxWidthContainer({ children }: { children: React.ReactNode }) {
7+
return (
8+
<View style={styles.container}>
9+
<View style={styles.inner}>{children}</View>
10+
</View>
11+
);
12+
}
13+
14+
const styles = StyleSheet.create({
15+
container: {
16+
flex: 1,
17+
alignItems: 'center',
18+
},
19+
inner: {
20+
flex: 1,
21+
width: '100%',
22+
maxWidth: MAX_WIDTH,
23+
},
24+
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-ease",
3-
"version": "0.3.0",
3+
"version": "0.4.0",
44
"description": "Lightweight declarative animations powered by platform APIs",
55
"main": "./lib/module/index.js",
66
"types": "./lib/typescript/src/index.d.ts",

0 commit comments

Comments
 (0)