feat: React Native(Expo) 앱 추가 — 탭 구조와 오늘 화면
- Expo SDK 57 + expo-router, react-query, Uniwind(Tailwind v4), SecureStore 토큰 - Metro 가 앱의 react(19.2.3)만 쓰게 고정 (루트에는 웹용 react 19.3.0) - 탭 5개·위 막대·시간대 하늘 배경·밤 테마, 오늘 히어로·각 순위·행사/TOP5/계절 띠 - 남은 이전 작업은 TODO.md 앱 마이그레이션 표
This commit is contained in:
1 parent
2ab2271d61
commit
e52f93fdbb
56 files changed
+1211
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import type { TimeKind } from '@nalssigak/shared/lib';
|
||||
import { LinearGradient } from 'expo-linear-gradient';
|
||||
import { StyleSheet, View } from 'react-native';
|
||||
|
||||
import { useSky } from '@/lib/sky';
|
||||
|
||||
const SKY: Record<TimeKind, { colors: readonly [string, string, string]; locations: readonly [number, number, number] }> = {
|
||||
morning: { colors: ['#ffe0c4', '#fff0e2', '#e4f2ff'], locations: [0, 0.38, 1] },
|
||||
day: { colors: ['#cde7ff', '#e9f5ff', '#f7fbff'], locations: [0, 0.45, 1] },
|
||||
sunset: { colors: ['#ffd0b5', '#f9c3cf', '#ddd2f6'], locations: [0, 0.42, 1] },
|
||||
night: { colors: ['#0e1433', '#1b2356', '#2a2e6e'], locations: [0, 0.5, 1] },
|
||||
};
|
||||
|
||||
const STARS = Array.from({ length: 46 }, (_, i) => ({ left: `${(i * 41 + 7) % 100}%`, top: `${(i * 67 + 3) % 96}%`, size: 1 + (i % 3) * 0.8, opacity: 0.4 + ((i * 7) % 6) / 10 }) as const);
|
||||
|
||||
/** 화면 전체 하늘: 시간대별 색, 밤에는 별 */
|
||||
export function SkyBg() {
|
||||
const { kind } = useSky();
|
||||
return (
|
||||
<View style={StyleSheet.absoluteFill} pointerEvents="none">
|
||||
<LinearGradient {...SKY[kind]} style={StyleSheet.absoluteFill} />
|
||||
{kind === 'night' &&
|
||||
STARS.map((s, i) => <View key={i} style={{ position: 'absolute', left: s.left, top: s.top, width: s.size, height: s.size, borderRadius: s.size, backgroundColor: '#fff', opacity: s.opacity }} />)}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user