@adminide-stack/clock-tik-mobile 0.0.0-stage → 12.0.37-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-flow/data/pending-insights.jsonl +43 -0
- package/.claude-flow/sessions/session-1794323376548.json +14 -0
- package/CHANGELOG.md +41 -0
- package/jest.config.cjs +22 -0
- package/lib/assets/home/loop-day.jpg +0 -0
- package/lib/assets/home/loop-day.mp4 +0 -0
- package/lib/assets/home/loop-time-back.jpg +0 -0
- package/lib/assets/home/loop-time-back.mp4 +0 -0
- package/lib/assets/home/loop-where.jpg +0 -0
- package/lib/assets/home/loop-where.mp4 +0 -0
- package/lib/assets/home/reel-gym.jpg +0 -0
- package/lib/assets/home/reel-gym.mp4 +0 -0
- package/lib/assets/home/reel-internet.jpg +0 -0
- package/lib/assets/home/reel-internet.mp4 +0 -0
- package/lib/assets/icon.png +0 -0
- package/lib/assets/lottie/.claude-flow/data/pending-insights.jsonl +1 -0
- package/lib/assets/lottie/lucy-mark-calendar.json +1827 -0
- package/lib/assets/lottie/lucy-mark-call.json +1470 -0
- package/lib/assets/lottie/lucy-mark-connect.json +2552 -0
- package/lib/assets/lottie/lucy-mark-details.json +1735 -0
- package/lib/assets/lottie/lucy-mark-email.json +1363 -0
- package/lib/assets/lottie/lucy-mark-message.json +1154 -0
- package/lib/assets/lottie/lucy-mark-search.json +1067 -0
- package/lib/assets/lottie/lucy-mark-think.json +1253 -0
- package/lib/assets/lottie/lucy-mark-write.json +1532 -0
- package/lib/assets/lottie/time-back.json +16458 -0
- package/lib/assets/lottie/where-lucy-works-chat.json +6170 -0
- package/lib/assets/lottie/where-lucy-works-cloud.json +10066 -0
- package/lib/assets/lottie/where-lucy-works-mine-none.json +2478 -0
- package/lib/assets/lottie/where-lucy-works-mine-offline.json +2373 -0
- package/lib/assets/lottie/where-lucy-works-mine-online.json +7881 -0
- package/lib/assets/sounds/hours-back.m4a +0 -0
- package/lib/assets/sounds/meet-lucy.m4a +0 -0
- package/lib/assets/sounds/power-on.m4a +0 -0
- package/lib/assets/sounds/wind-back.m4a +0 -0
- package/lib/assets/sounds/youre-in.m4a +0 -0
- package/lib/chat/agent.js +358 -0
- package/lib/chat/agent.js.map +1 -0
- package/lib/chat/appFront.js +32 -0
- package/lib/chat/appFront.js.map +1 -0
- package/lib/chat/auth.js +370 -0
- package/lib/chat/auth.js.map +1 -0
- package/lib/chat/chores.js +360 -0
- package/lib/chat/chores.js.map +1 -0
- package/lib/chat/connectors.js +45 -0
- package/lib/chat/connectors.js.map +1 -0
- package/lib/chat/jobs.js +223 -0
- package/lib/chat/jobs.js.map +1 -0
- package/lib/chat/lucyMotion.js +6 -0
- package/lib/chat/lucyMotion.js.map +1 -0
- package/lib/chat/protocol.js +111 -0
- package/lib/chat/protocol.js.map +1 -0
- package/lib/chat/results.js +133 -0
- package/lib/chat/results.js.map +1 -0
- package/lib/chat/store.js +81 -0
- package/lib/chat/store.js.map +1 -0
- package/lib/chat/useDictation.js +168 -0
- package/lib/chat/useDictation.js.map +1 -0
- package/lib/chat/useLucyChat.js +451 -0
- package/lib/chat/useLucyChat.js.map +1 -0
- package/lib/chat/useMyComputer.js +32 -0
- package/lib/chat/useMyComputer.js.map +1 -0
- package/lib/chat/whereLucyWorks.js +52 -0
- package/lib/chat/whereLucyWorks.js.map +1 -0
- package/lib/chat/workspace.js +124 -0
- package/lib/chat/workspace.js.map +1 -0
- package/lib/components/AreaShot.js +289 -0
- package/lib/components/AreaShot.js.map +1 -0
- package/lib/components/Backdrops.js +262 -0
- package/lib/components/Backdrops.js.map +1 -0
- package/lib/components/BottomSheet.js +61 -0
- package/lib/components/BottomSheet.js.map +1 -0
- package/lib/components/ChatSheets.js +429 -0
- package/lib/components/ChatSheets.js.map +1 -0
- package/lib/components/ConnectorLogo.js +91 -0
- package/lib/components/ConnectorLogo.js.map +1 -0
- package/lib/components/CustomDrawer.js +534 -0
- package/lib/components/CustomDrawer.js.map +1 -0
- package/lib/components/IdeasPane.js +394 -0
- package/lib/components/IdeasPane.js.map +1 -0
- package/lib/components/ImessageSheet.js +261 -0
- package/lib/components/ImessageSheet.js.map +1 -0
- package/lib/components/KeyboardAvoider.js +29 -0
- package/lib/components/KeyboardAvoider.js.map +1 -0
- package/lib/components/Logo.js +81 -0
- package/lib/components/Logo.js.map +1 -0
- package/lib/components/LucyWorking.js +67 -0
- package/lib/components/LucyWorking.js.map +1 -0
- package/lib/components/Markdown.js +260 -0
- package/lib/components/Markdown.js.map +1 -0
- package/lib/components/Media.js +93 -0
- package/lib/components/Media.js.map +1 -0
- package/lib/components/MessagesAppIcon.js +23 -0
- package/lib/components/MessagesAppIcon.js.map +1 -0
- package/lib/components/MicButton.js +71 -0
- package/lib/components/MicButton.js.map +1 -0
- package/lib/components/ResultCards.js +974 -0
- package/lib/components/ResultCards.js.map +1 -0
- package/lib/components/SignInPrompt.js +148 -0
- package/lib/components/SignInPrompt.js.map +1 -0
- package/lib/components/SignedOut.js +38 -0
- package/lib/components/SignedOut.js.map +1 -0
- package/lib/components/TalkToLucyHero.js +487 -0
- package/lib/components/TalkToLucyHero.js.map +1 -0
- package/lib/components/TalkToLucySheet.js +182 -0
- package/lib/components/TalkToLucySheet.js.map +1 -0
- package/lib/components/WhereLucyWorks.js +277 -0
- package/lib/components/WhereLucyWorks.js.map +1 -0
- package/lib/components/WorkspaceSection.js +271 -0
- package/lib/components/WorkspaceSection.js.map +1 -0
- package/lib/components/YantraMark.js +13 -0
- package/lib/components/YantraMark.js.map +1 -0
- package/lib/components/drawerHeader.js +38 -0
- package/lib/components/drawerHeader.js.map +1 -0
- package/lib/components/lottieInstalled.js +6 -0
- package/lib/components/lottieInstalled.js.map +1 -0
- package/lib/components/ui.js +550 -0
- package/lib/components/ui.js.map +1 -0
- package/lib/components/useSignOut.js +7 -0
- package/lib/components/useSignOut.js.map +1 -0
- package/lib/components/viewport.js +121 -0
- package/lib/components/viewport.js.map +1 -0
- package/lib/components/voiceDial.js +10 -0
- package/lib/components/voiceDial.js.map +1 -0
- package/lib/compute.js +157 -0
- package/lib/compute.js.map +1 -0
- package/lib/config/env-config.js +27 -0
- package/lib/config/env-config.js.map +1 -0
- package/lib/config/routes.js +15 -0
- package/lib/config/routes.js.map +1 -0
- package/lib/content.js +25 -0
- package/lib/content.js.map +1 -0
- package/lib/hooks/keyboardCover.js +39 -0
- package/lib/hooks/keyboardCover.js.map +1 -0
- package/lib/hooks/useKeyboard.js +121 -0
- package/lib/hooks/useKeyboard.js.map +1 -0
- package/lib/hooks/useReducedMotion.js +13 -0
- package/lib/hooks/useReducedMotion.js.map +1 -0
- package/lib/imessage/openMessages.js +25 -0
- package/lib/imessage/openMessages.js.map +1 -0
- package/lib/imessage/platform.js +12 -0
- package/lib/imessage/platform.js.map +1 -0
- package/lib/imessage/textLink.js +262 -0
- package/lib/imessage/textLink.js.map +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -0
- package/lib/live/card.js +28 -0
- package/lib/live/card.js.map +1 -0
- package/lib/live/liveActivity.js +144 -0
- package/lib/live/liveActivity.js.map +1 -0
- package/lib/module.js +3 -0
- package/lib/module.js.map +1 -0
- package/lib/offer/BlackFridayOffer.js +378 -0
- package/lib/offer/BlackFridayOffer.js.map +1 -0
- package/lib/offer/blackFriday.js +78 -0
- package/lib/offer/blackFriday.js.map +1 -0
- package/lib/offer/parts.js +624 -0
- package/lib/offer/parts.js.map +1 -0
- package/lib/offer/state.js +63 -0
- package/lib/offer/state.js.map +1 -0
- package/lib/push/push.js +142 -0
- package/lib/push/push.js.map +1 -0
- package/lib/push/usePushNotifications.js +39 -0
- package/lib/push/usePushNotifications.js.map +1 -0
- package/lib/routes.json +175 -0
- package/lib/screens/Account/index.js +209 -0
- package/lib/screens/Account/index.js.map +1 -0
- package/lib/screens/Chat/index.js +710 -0
- package/lib/screens/Chat/index.js.map +1 -0
- package/lib/screens/Chores/index.js +18 -0
- package/lib/screens/Chores/index.js.map +1 -0
- package/lib/screens/Connectors/index.js +17 -0
- package/lib/screens/Connectors/index.js.map +1 -0
- package/lib/screens/History/index.js +380 -0
- package/lib/screens/History/index.js.map +1 -0
- package/lib/screens/Home/index.js +2715 -0
- package/lib/screens/Home/index.js.map +1 -0
- package/lib/screens/Home/media.js +25 -0
- package/lib/screens/Home/media.js.map +1 -0
- package/lib/screens/Welcome/index.js +1066 -0
- package/lib/screens/Welcome/index.js.map +1 -0
- package/lib/talk/talkToLucy.js +139 -0
- package/lib/talk/talkToLucy.js.map +1 -0
- package/lib/theme/colors.js +29 -0
- package/lib/theme/colors.js.map +1 -0
- package/lib/theme/fonts.js +17 -0
- package/lib/theme/fonts.js.map +1 -0
- package/lib/theme/muse.js +134 -0
- package/lib/theme/muse.js.map +1 -0
- package/lib/utils/links.js +54 -0
- package/lib/utils/links.js.map +1 -0
- package/lib/utils/yantraLinks.js +68 -0
- package/lib/utils/yantraLinks.js.map +1 -0
- package/lib/welcome/flow.js +375 -0
- package/lib/welcome/flow.js.map +1 -0
- package/lib/welcome/haptics.js +125 -0
- package/lib/welcome/haptics.js.map +1 -0
- package/lib/welcome/parts.js +1996 -0
- package/lib/welcome/parts.js.map +1 -0
- package/lib/welcome/powerOn.js +29 -0
- package/lib/welcome/powerOn.js.map +1 -0
- package/lib/welcome/seen.js +41 -0
- package/lib/welcome/seen.js.map +1 -0
- package/lib/welcome/sound.js +110 -0
- package/lib/welcome/sound.js.map +1 -0
- package/package.json +66 -5
- package/rollup.config.mjs +42 -0
- package/src/.claude-flow/data/pending-insights.jsonl +19 -0
- package/src/.claude-flow/sessions/session-1795013028422.json +14 -0
- package/src/__tests__/auth.test.ts +94 -0
- package/src/__tests__/blackFriday.test.ts +75 -0
- package/src/__tests__/cardTokens.test.ts +77 -0
- package/src/__tests__/chores.test.ts +188 -0
- package/src/__tests__/choresList.test.ts +100 -0
- package/src/__tests__/connectLink.test.ts +21 -0
- package/src/__tests__/content.test.ts +54 -0
- package/src/__tests__/dictation.test.ts +186 -0
- package/src/__tests__/envConfig.test.ts +14 -0
- package/src/__tests__/haptics.test.ts +202 -0
- package/src/__tests__/jobs.test.ts +130 -0
- package/src/__tests__/keyboardCover.test.ts +84 -0
- package/src/__tests__/liveCard.test.ts +39 -0
- package/src/__tests__/lockedPhone.test.ts +355 -0
- package/src/__tests__/lucyMotion.test.ts +34 -0
- package/src/__tests__/platform.test.ts +32 -0
- package/src/__tests__/powerOn.test.ts +62 -0
- package/src/__tests__/protocol.test.ts +125 -0
- package/src/__tests__/push.test.ts +111 -0
- package/src/__tests__/results.test.ts +256 -0
- package/src/__tests__/sound.test.ts +248 -0
- package/src/__tests__/talkToLucy.test.ts +205 -0
- package/src/__tests__/textLink.test.ts +91 -0
- package/src/__tests__/voiceDial.test.ts +53 -0
- package/src/__tests__/welcomeFlow.test.ts +157 -0
- package/src/__tests__/whereLucyWorks.test.ts +81 -0
- package/src/__tests__/yantraLinks.test.ts +96 -0
- package/src/assets/home/loop-day.jpg +0 -0
- package/src/assets/home/loop-day.mp4 +0 -0
- package/src/assets/home/loop-time-back.jpg +0 -0
- package/src/assets/home/loop-time-back.mp4 +0 -0
- package/src/assets/home/loop-where.jpg +0 -0
- package/src/assets/home/loop-where.mp4 +0 -0
- package/src/assets/home/reel-gym.jpg +0 -0
- package/src/assets/home/reel-gym.mp4 +0 -0
- package/src/assets/home/reel-internet.jpg +0 -0
- package/src/assets/home/reel-internet.mp4 +0 -0
- package/src/assets/icon.png +0 -0
- package/src/assets/lottie/.claude-flow/data/pending-insights.jsonl +1 -0
- package/src/assets/lottie/lucy-mark-calendar.json +1827 -0
- package/src/assets/lottie/lucy-mark-call.json +1470 -0
- package/src/assets/lottie/lucy-mark-connect.json +2552 -0
- package/src/assets/lottie/lucy-mark-details.json +1735 -0
- package/src/assets/lottie/lucy-mark-email.json +1363 -0
- package/src/assets/lottie/lucy-mark-message.json +1154 -0
- package/src/assets/lottie/lucy-mark-search.json +1067 -0
- package/src/assets/lottie/lucy-mark-think.json +1253 -0
- package/src/assets/lottie/lucy-mark-write.json +1532 -0
- package/src/assets/lottie/time-back.json +16458 -0
- package/src/assets/lottie/where-lucy-works-chat.json +6170 -0
- package/src/assets/lottie/where-lucy-works-cloud.json +10066 -0
- package/src/assets/lottie/where-lucy-works-mine-none.json +2478 -0
- package/src/assets/lottie/where-lucy-works-mine-offline.json +2373 -0
- package/src/assets/lottie/where-lucy-works-mine-online.json +7881 -0
- package/src/assets/sounds/hours-back.m4a +0 -0
- package/src/assets/sounds/meet-lucy.m4a +0 -0
- package/src/assets/sounds/power-on.m4a +0 -0
- package/src/assets/sounds/wind-back.m4a +0 -0
- package/src/assets/sounds/youre-in.m4a +0 -0
- package/src/chat/.claude-flow/data/pending-insights.jsonl +1 -0
- package/src/chat/agent.ts +376 -0
- package/src/chat/appFront.ts +39 -0
- package/src/chat/auth.ts +433 -0
- package/src/chat/chores.ts +394 -0
- package/src/chat/connectors.ts +75 -0
- package/src/chat/jobs.ts +228 -0
- package/src/chat/lucyMotion.ts +33 -0
- package/src/chat/protocol.ts +192 -0
- package/src/chat/results.ts +224 -0
- package/src/chat/store.ts +87 -0
- package/src/chat/useDictation.ts +201 -0
- package/src/chat/useLucyChat.ts +458 -0
- package/src/chat/useMyComputer.ts +41 -0
- package/src/chat/whereLucyWorks.ts +97 -0
- package/src/chat/workspace.ts +127 -0
- package/src/components/.claude-flow/data/pending-insights.jsonl +3 -0
- package/src/components/AreaShot.tsx +239 -0
- package/src/components/Backdrops.tsx +323 -0
- package/src/components/BottomSheet.tsx +96 -0
- package/src/components/ChatSheets.tsx +565 -0
- package/src/components/ConnectorLogo.tsx +116 -0
- package/src/components/CustomDrawer.tsx +526 -0
- package/src/components/IdeasPane.tsx +318 -0
- package/src/components/ImessageSheet.tsx +280 -0
- package/src/components/KeyboardAvoider.tsx +45 -0
- package/src/components/Logo.tsx +97 -0
- package/src/components/LucyWorking.tsx +122 -0
- package/src/components/Markdown.tsx +219 -0
- package/src/components/Media.tsx +173 -0
- package/src/components/MessagesAppIcon.tsx +51 -0
- package/src/components/MicButton.tsx +92 -0
- package/src/components/ResultCards.tsx +1067 -0
- package/src/components/SignInPrompt.tsx +182 -0
- package/src/components/SignedOut.tsx +47 -0
- package/src/components/TalkToLucyHero.tsx +540 -0
- package/src/components/TalkToLucySheet.tsx +208 -0
- package/src/components/VoiceOrb.tsx +364 -0
- package/src/components/WhereLucyWorks.tsx +261 -0
- package/src/components/WorkspaceSection.tsx +307 -0
- package/src/components/YantraMark.tsx +30 -0
- package/src/components/drawerHeader.tsx +46 -0
- package/src/components/kit.tsx +309 -0
- package/src/components/lottieInstalled.ts +7 -0
- package/src/components/ui.tsx +700 -0
- package/src/components/useSignOut.ts +21 -0
- package/src/components/viewport.tsx +166 -0
- package/src/components/voiceDial.ts +45 -0
- package/src/compute.ts +168 -0
- package/src/config/env-config.ts +50 -0
- package/src/config/routes.ts +28 -0
- package/src/content.ts +217 -0
- package/src/hooks/keyboardCover.ts +70 -0
- package/src/hooks/useKeyboard.ts +135 -0
- package/src/hooks/useReducedMotion.ts +19 -0
- package/src/imessage/openMessages.ts +53 -0
- package/src/imessage/platform.ts +32 -0
- package/src/imessage/textLink.ts +307 -0
- package/src/index.ts +24 -0
- package/src/live/card.ts +62 -0
- package/src/live/liveActivity.ts +192 -0
- package/src/module.ts +8 -0
- package/src/offer/BlackFridayOffer.tsx +394 -0
- package/src/offer/blackFriday.ts +109 -0
- package/src/offer/parts.tsx +650 -0
- package/src/offer/state.ts +78 -0
- package/src/push/push.ts +171 -0
- package/src/push/usePushNotifications.ts +47 -0
- package/src/screens/Account/index.tsx +310 -0
- package/src/screens/Chat/.claude-flow/data/pending-insights.jsonl +4 -0
- package/src/screens/Chat/index.tsx +891 -0
- package/src/screens/Chores/index.tsx +35 -0
- package/src/screens/Connectors/index.tsx +35 -0
- package/src/screens/History/index.tsx +346 -0
- package/src/screens/Home/index.tsx +2776 -0
- package/src/screens/Home/media.ts +31 -0
- package/src/screens/Welcome/index.tsx +1182 -0
- package/src/talk/talkToLucy.ts +187 -0
- package/src/theme/colors.ts +38 -0
- package/src/theme/fonts.ts +30 -0
- package/src/theme/muse.ts +86 -0
- package/src/utils/links.ts +84 -0
- package/src/utils/yantraLinks.ts +94 -0
- package/src/welcome/flow.ts +418 -0
- package/src/welcome/haptics.ts +179 -0
- package/src/welcome/parts.tsx +2160 -0
- package/src/welcome/powerOn.ts +84 -0
- package/src/welcome/seen.ts +68 -0
- package/src/welcome/sound.ts +173 -0
- package/tools/lottie/chat.motion +0 -0
- package/tools/lottie/cloud.motion +0 -0
- package/tools/lottie/generate.mjs +1209 -0
- package/tools/lottie/inter-glyphs.json +4416 -0
- package/tools/lottie/lucy-mark-calendar.motion +0 -0
- package/tools/lottie/lucy-mark-call.motion +0 -0
- package/tools/lottie/lucy-mark-connect.motion +0 -0
- package/tools/lottie/lucy-mark-details.motion +0 -0
- package/tools/lottie/lucy-mark-email.motion +0 -0
- package/tools/lottie/lucy-mark-message.motion +0 -0
- package/tools/lottie/lucy-mark-search.motion +0 -0
- package/tools/lottie/lucy-mark-think.motion +0 -0
- package/tools/lottie/lucy-mark-write.motion +0 -0
- package/tools/lottie/mark.json +1 -0
- package/tools/lottie/mine-none.motion +0 -0
- package/tools/lottie/mine-offline.motion +0 -0
- package/tools/lottie/mine-online.motion +0 -0
- package/tools/lottie/time-back.mjs +604 -0
- package/tools/sounds/render.mjs +730 -0
- package/tsconfig.json +17 -0
- package/README.md +0 -3
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The web home's backgrounds (clock-tik-browser pages/Home/homeStyles.tsx), drawn natively with react-native-svg:
|
|
3
|
+
*
|
|
4
|
+
* - `Aurora`: the hero's ambient backdrop (.cbh-amb), four soft warm blobs drifting slowly over a faint dot grid,
|
|
5
|
+
* fading out toward the bottom. Holds still under Reduce Motion.
|
|
6
|
+
* - `SoftFill`: the shaded sections' band (.cbh-soft).
|
|
7
|
+
* - `DarkFill`: the time-back card's dark warm gradient (.cbh-time-card).
|
|
8
|
+
* - `FinalFill`: the final card's peach, pink and yellow glow (.cbh-final-card).
|
|
9
|
+
*
|
|
10
|
+
* Each fills its parent, sits behind the parent's content (render it first), ignores touches and is hidden from
|
|
11
|
+
* screen readers.
|
|
12
|
+
*/
|
|
13
|
+
import React, { useEffect, useId, useRef, useState } from 'react';
|
|
14
|
+
import { Animated, Easing, StyleSheet, View, type LayoutChangeEvent } from 'react-native';
|
|
15
|
+
import Svg, { Circle, Defs, LinearGradient, Mask, Pattern, RadialGradient, Rect, Stop } from 'react-native-svg';
|
|
16
|
+
import { useReducedMotion } from '../hooks/useReducedMotion';
|
|
17
|
+
import { ui } from '../theme/muse';
|
|
18
|
+
|
|
19
|
+
/** Gradient ids must not repeat across Svgs on some platforms, so every fill gets its own. */
|
|
20
|
+
function useSvgId(name: string): string {
|
|
21
|
+
return `${name}${useId().replace(/[^a-zA-Z0-9]/g, '')}`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const hidden = { accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants' } as const;
|
|
25
|
+
|
|
26
|
+
/* ------------------------------------------------------------------------------------------------ aurora */
|
|
27
|
+
|
|
28
|
+
interface Blob {
|
|
29
|
+
color: string;
|
|
30
|
+
opacity: number;
|
|
31
|
+
/** Where it sits, as the web's left/right/top percentages of the backdrop. */
|
|
32
|
+
left?: number;
|
|
33
|
+
right?: number;
|
|
34
|
+
top: number;
|
|
35
|
+
/** Its width: a share of the backdrop's width, never under `min` (the web's max(46%, 360px)). */
|
|
36
|
+
share: number;
|
|
37
|
+
min: number;
|
|
38
|
+
ms: number;
|
|
39
|
+
/** The web's keyframes at 0, ~35, ~70 and 100%: x and y moves as shares of the blob, and its scale. */
|
|
40
|
+
path: [x: number, y: number, scale: number][];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const BLOBS: Blob[] = [
|
|
44
|
+
{
|
|
45
|
+
color: '#FF5A00',
|
|
46
|
+
opacity: 0.2,
|
|
47
|
+
left: -0.06,
|
|
48
|
+
top: 0,
|
|
49
|
+
share: 0.46,
|
|
50
|
+
min: 360,
|
|
51
|
+
ms: 28000,
|
|
52
|
+
path: [
|
|
53
|
+
[0, 0, 1],
|
|
54
|
+
[0.18, 0.12, 1.12],
|
|
55
|
+
[0.06, 0.22, 0.94],
|
|
56
|
+
[0.26, 0.08, 1.05],
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
color: '#FF8FA3',
|
|
61
|
+
opacity: 0.22,
|
|
62
|
+
right: -0.08,
|
|
63
|
+
top: 0.08,
|
|
64
|
+
share: 0.42,
|
|
65
|
+
min: 320,
|
|
66
|
+
ms: 33000,
|
|
67
|
+
path: [
|
|
68
|
+
[0, 0, 1.04],
|
|
69
|
+
[-0.2, 0.16, 0.92],
|
|
70
|
+
[-0.08, 0.26, 1.1],
|
|
71
|
+
[-0.28, 0.06, 1],
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
color: '#FFC45C',
|
|
76
|
+
opacity: 0.3,
|
|
77
|
+
left: 0.28,
|
|
78
|
+
top: -0.16,
|
|
79
|
+
share: 0.44,
|
|
80
|
+
min: 340,
|
|
81
|
+
ms: 37000,
|
|
82
|
+
path: [
|
|
83
|
+
[0, 0, 0.96],
|
|
84
|
+
[0.16, -0.1, 1.1],
|
|
85
|
+
[0.3, 0.08, 1],
|
|
86
|
+
[0.08, 0.14, 1.08],
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
color: '#FFA064',
|
|
91
|
+
opacity: 0.22,
|
|
92
|
+
left: 0.14,
|
|
93
|
+
top: 0.4,
|
|
94
|
+
share: 0.4,
|
|
95
|
+
min: 300,
|
|
96
|
+
ms: 41000,
|
|
97
|
+
path: [
|
|
98
|
+
[0, 0, 1.06],
|
|
99
|
+
[-0.18, 0.1, 0.94],
|
|
100
|
+
[-0.3, -0.06, 1.1],
|
|
101
|
+
[-0.1, -0.14, 1],
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
];
|
|
105
|
+
|
|
106
|
+
const STEPS = [0, 0.35, 0.7, 1];
|
|
107
|
+
|
|
108
|
+
function AuroraBlob({ blob, width, height, still }: { blob: Blob; width: number; height: number; still: boolean }) {
|
|
109
|
+
const id = useSvgId('blob');
|
|
110
|
+
const t = useRef(new Animated.Value(0)).current;
|
|
111
|
+
const w = Math.max(blob.share * width, blob.min);
|
|
112
|
+
const h = w / 1.15;
|
|
113
|
+
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
if (still) {
|
|
116
|
+
t.setValue(0);
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
// The web plays each drift forward then back (alternate), forever.
|
|
120
|
+
const half = { duration: blob.ms, easing: Easing.inOut(Easing.sin), useNativeDriver: true };
|
|
121
|
+
const loop = Animated.loop(
|
|
122
|
+
Animated.sequence([
|
|
123
|
+
Animated.timing(t, { toValue: 1, ...half }),
|
|
124
|
+
Animated.timing(t, { toValue: 0, ...half }),
|
|
125
|
+
]),
|
|
126
|
+
);
|
|
127
|
+
loop.start();
|
|
128
|
+
return () => loop.stop();
|
|
129
|
+
}, [still, blob.ms, t]);
|
|
130
|
+
|
|
131
|
+
const translateX = t.interpolate({ inputRange: STEPS, outputRange: blob.path.map(([x]) => x * w) });
|
|
132
|
+
const translateY = t.interpolate({ inputRange: STEPS, outputRange: blob.path.map(([, y]) => y * h) });
|
|
133
|
+
const scale = t.interpolate({ inputRange: STEPS, outputRange: blob.path.map(([, , k]) => k) });
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<Animated.View
|
|
137
|
+
style={{
|
|
138
|
+
position: 'absolute',
|
|
139
|
+
width: w,
|
|
140
|
+
height: h,
|
|
141
|
+
top: blob.top * height,
|
|
142
|
+
...(blob.left !== undefined ? { left: blob.left * width } : { right: (blob.right ?? 0) * width }),
|
|
143
|
+
transform: [{ translateX }, { translateY }, { scale }],
|
|
144
|
+
}}
|
|
145
|
+
>
|
|
146
|
+
<Svg width="100%" height="100%">
|
|
147
|
+
<Defs>
|
|
148
|
+
{/* radial-gradient(closest-side, colour, transparent) */}
|
|
149
|
+
<RadialGradient id={id} cx="50%" cy="50%" rx="50%" ry="50%">
|
|
150
|
+
<Stop offset="0" stopColor={blob.color} stopOpacity={blob.opacity} />
|
|
151
|
+
<Stop offset="1" stopColor={blob.color} stopOpacity={0} />
|
|
152
|
+
</RadialGradient>
|
|
153
|
+
</Defs>
|
|
154
|
+
<Rect width="100%" height="100%" fill={`url(#${id})`} />
|
|
155
|
+
</Svg>
|
|
156
|
+
</Animated.View>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** The dot grid (.cbh-amb-grid): 24 px apart, brightest in an ellipse around the top third. */
|
|
161
|
+
function DotGrid({ width, height }: { width: number; height: number }) {
|
|
162
|
+
const dots = useSvgId('dots');
|
|
163
|
+
const spot = useSvgId('spot');
|
|
164
|
+
const mask = useSvgId('mask');
|
|
165
|
+
return (
|
|
166
|
+
<Svg style={StyleSheet.absoluteFill} width={width} height={height}>
|
|
167
|
+
<Defs>
|
|
168
|
+
<Pattern id={dots} width={24} height={24} patternUnits="userSpaceOnUse">
|
|
169
|
+
<Circle cx={12} cy={12} r={1.1} fill="rgb(84,52,20)" fillOpacity={0.16} />
|
|
170
|
+
</Pattern>
|
|
171
|
+
<RadialGradient id={spot} cx="50%" cy="34%" rx="58%" ry="50%">
|
|
172
|
+
<Stop offset="0" stopColor="#fff" stopOpacity={1} />
|
|
173
|
+
<Stop offset="0.78" stopColor="#fff" stopOpacity={0} />
|
|
174
|
+
</RadialGradient>
|
|
175
|
+
<Mask id={mask}>
|
|
176
|
+
<Rect width="100%" height="100%" fill={`url(#${spot})`} />
|
|
177
|
+
</Mask>
|
|
178
|
+
</Defs>
|
|
179
|
+
<Rect width="100%" height="100%" fill={`url(#${dots})`} mask={`url(#${mask})`} />
|
|
180
|
+
</Svg>
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* The hero's backdrop. The web masks it from solid at 62% to nothing at the bottom; here the page colour is laid
|
|
186
|
+
* over that last stretch instead, which looks the same on the plain page.
|
|
187
|
+
*/
|
|
188
|
+
export function Aurora() {
|
|
189
|
+
const reduced = useReducedMotion();
|
|
190
|
+
const fade = useSvgId('fade');
|
|
191
|
+
const [size, setSize] = useState<{ width: number; height: number } | null>(null);
|
|
192
|
+
const onLayout = (e: LayoutChangeEvent) => {
|
|
193
|
+
const { width, height } = e.nativeEvent.layout;
|
|
194
|
+
if (!size || size.width !== width || size.height !== height) setSize({ width, height });
|
|
195
|
+
};
|
|
196
|
+
// The blobs are placed in the hero's own box (the inner view) but may spill above it into the bleed, so pulling
|
|
197
|
+
// the page down past the top (iOS's bounce) shows the glow carrying on, not a plain band and a cut-off edge.
|
|
198
|
+
return (
|
|
199
|
+
<View pointerEvents="none" style={[s.bleed, { overflow: 'hidden' }]} {...hidden}>
|
|
200
|
+
<View style={s.inBleed} onLayout={onLayout}>
|
|
201
|
+
{size ? (
|
|
202
|
+
<>
|
|
203
|
+
{BLOBS.map((blob, i) => (
|
|
204
|
+
<AuroraBlob key={i} blob={blob} width={size.width} height={size.height} still={reduced} />
|
|
205
|
+
))}
|
|
206
|
+
<DotGrid width={size.width} height={size.height} />
|
|
207
|
+
<Svg style={StyleSheet.absoluteFill} width={size.width} height={size.height}>
|
|
208
|
+
<Defs>
|
|
209
|
+
<LinearGradient id={fade} x1="0" y1="0" x2="0" y2="1">
|
|
210
|
+
<Stop offset="0.62" stopColor={ui.bg} stopOpacity={0} />
|
|
211
|
+
<Stop offset="1" stopColor={ui.bg} stopOpacity={1} />
|
|
212
|
+
</LinearGradient>
|
|
213
|
+
</Defs>
|
|
214
|
+
<Rect width="100%" height="100%" fill={`url(#${fade})`} />
|
|
215
|
+
</Svg>
|
|
216
|
+
</>
|
|
217
|
+
) : null}
|
|
218
|
+
</View>
|
|
219
|
+
</View>
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/** How far the aurora reaches above the hero: more than any pull-down bounce shows. */
|
|
224
|
+
const BLEED = 600;
|
|
225
|
+
|
|
226
|
+
const s = StyleSheet.create({
|
|
227
|
+
bleed: { position: 'absolute', top: -BLEED, left: 0, right: 0, bottom: 0 },
|
|
228
|
+
inBleed: { position: 'absolute', top: BLEED, left: 0, right: 0, bottom: 0 },
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
/* ------------------------------------------------------------------------------------------------ fills */
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* An Svg exactly the size of its parent. An Svg sized by absoluteFill keeps the size it had when first drawn, so a
|
|
235
|
+
* card that grows as its content arrives showed its gradient cut off part way; this measures the parent and redraws
|
|
236
|
+
* at the new size whenever it changes.
|
|
237
|
+
*/
|
|
238
|
+
function FillSvg({ children }: { children: React.ReactNode }) {
|
|
239
|
+
const [size, setSize] = useState<{ w: number; h: number } | null>(null);
|
|
240
|
+
const onLayout = (e: LayoutChangeEvent) => {
|
|
241
|
+
const { width, height } = e.nativeEvent.layout;
|
|
242
|
+
setSize((was) => (was && was.w === width && was.h === height ? was : { w: width, h: height }));
|
|
243
|
+
};
|
|
244
|
+
return (
|
|
245
|
+
<View pointerEvents="none" style={StyleSheet.absoluteFill} onLayout={onLayout} {...hidden}>
|
|
246
|
+
{size ? (
|
|
247
|
+
<Svg key={`${size.w}x${size.h}`} width={size.w} height={size.h}>
|
|
248
|
+
{children}
|
|
249
|
+
</Svg>
|
|
250
|
+
) : null}
|
|
251
|
+
</View>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** .cbh-soft: linear-gradient(180deg, --cbh-soft, #fff7f1). */
|
|
256
|
+
export function SoftFill() {
|
|
257
|
+
const id = useSvgId('soft');
|
|
258
|
+
return (
|
|
259
|
+
<FillSvg>
|
|
260
|
+
<Defs>
|
|
261
|
+
<LinearGradient id={id} x1="0" y1="0" x2="0" y2="1">
|
|
262
|
+
<Stop offset="0" stopColor={ui.soft} />
|
|
263
|
+
<Stop offset="1" stopColor="#FFF7F1" />
|
|
264
|
+
</LinearGradient>
|
|
265
|
+
</Defs>
|
|
266
|
+
<Rect width="100%" height="100%" fill={`url(#${id})`} />
|
|
267
|
+
</FillSvg>
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** .cbh-time-card: radial-gradient(120% 140% at 100% 0%, #3d2617 0%, #1a1714 58%). */
|
|
272
|
+
export function DarkFill() {
|
|
273
|
+
const id = useSvgId('dark');
|
|
274
|
+
return (
|
|
275
|
+
<FillSvg>
|
|
276
|
+
<Defs>
|
|
277
|
+
<RadialGradient id={id} cx="100%" cy="0%" fx="100%" fy="0%" rx="120%" ry="140%">
|
|
278
|
+
<Stop offset="0" stopColor="#3D2617" />
|
|
279
|
+
<Stop offset="0.58" stopColor="#1A1714" />
|
|
280
|
+
<Stop offset="1" stopColor="#1A1714" />
|
|
281
|
+
</RadialGradient>
|
|
282
|
+
</Defs>
|
|
283
|
+
<Rect width="100%" height="100%" fill={`url(#${id})`} />
|
|
284
|
+
</FillSvg>
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* .cbh-final-card: a white-to-peach base with three glows, peach at the top, pink at the bottom right and yellow at
|
|
290
|
+
* the bottom left.
|
|
291
|
+
*/
|
|
292
|
+
export function FinalFill() {
|
|
293
|
+
const base = useSvgId('base');
|
|
294
|
+
const top = useSvgId('top');
|
|
295
|
+
const right = useSvgId('right');
|
|
296
|
+
const left = useSvgId('left');
|
|
297
|
+
return (
|
|
298
|
+
<FillSvg>
|
|
299
|
+
<Defs>
|
|
300
|
+
<LinearGradient id={base} x1="0" y1="0" x2="0" y2="1">
|
|
301
|
+
<Stop offset="0" stopColor="#FFFFFF" />
|
|
302
|
+
<Stop offset="1" stopColor="#FFF4EC" />
|
|
303
|
+
</LinearGradient>
|
|
304
|
+
<RadialGradient id={top} cx="50%" cy="0%" fx="50%" fy="0%" rx="60%" ry="70%">
|
|
305
|
+
<Stop offset="0" stopColor="#FFB36B" stopOpacity={0.3} />
|
|
306
|
+
<Stop offset="0.7" stopColor="#FFB36B" stopOpacity={0} />
|
|
307
|
+
</RadialGradient>
|
|
308
|
+
<RadialGradient id={right} cx="100%" cy="100%" fx="100%" fy="100%" rx="45%" ry="55%">
|
|
309
|
+
<Stop offset="0" stopColor="#FF8FA3" stopOpacity={0.16} />
|
|
310
|
+
<Stop offset="0.7" stopColor="#FF8FA3" stopOpacity={0} />
|
|
311
|
+
</RadialGradient>
|
|
312
|
+
<RadialGradient id={left} cx="0%" cy="100%" fx="0%" fy="100%" rx="45%" ry="55%">
|
|
313
|
+
<Stop offset="0" stopColor="#FFC45C" stopOpacity={0.16} />
|
|
314
|
+
<Stop offset="0.7" stopColor="#FFC45C" stopOpacity={0} />
|
|
315
|
+
</RadialGradient>
|
|
316
|
+
</Defs>
|
|
317
|
+
<Rect width="100%" height="100%" fill={`url(#${base})`} />
|
|
318
|
+
<Rect width="100%" height="100%" fill={`url(#${left})`} />
|
|
319
|
+
<Rect width="100%" height="100%" fill={`url(#${right})`} />
|
|
320
|
+
<Rect width="100%" height="100%" fill={`url(#${top})`} />
|
|
321
|
+
</FillSvg>
|
|
322
|
+
);
|
|
323
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A sheet that rises from the bottom over a dimmed page, as iOS's own sheets do: the dim fades in place while only the
|
|
3
|
+
* sheet slides. (A Modal with animationType="slide" moves everything inside it, so the dim slid up with the sheet.)
|
|
4
|
+
* Closing plays the same in reverse before the Modal goes away. Under Reduce Motion both simply fade.
|
|
5
|
+
*
|
|
6
|
+
* Tapping the dim or Android's back button calls onClose. `style` is the sheet's own look (background, corners,
|
|
7
|
+
* padding); its content brings its own close button.
|
|
8
|
+
*/
|
|
9
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
10
|
+
import {
|
|
11
|
+
Animated,
|
|
12
|
+
Easing,
|
|
13
|
+
Modal,
|
|
14
|
+
Pressable,
|
|
15
|
+
StyleSheet,
|
|
16
|
+
useWindowDimensions,
|
|
17
|
+
View,
|
|
18
|
+
type StyleProp,
|
|
19
|
+
type ViewStyle,
|
|
20
|
+
} from 'react-native';
|
|
21
|
+
import { useReducedMotion } from '../hooks/useReducedMotion';
|
|
22
|
+
|
|
23
|
+
const OPEN_MS = 300;
|
|
24
|
+
const CLOSE_MS = 220;
|
|
25
|
+
const DIM = 'rgba(28, 22, 18, 0.4)';
|
|
26
|
+
|
|
27
|
+
export function BottomSheet({
|
|
28
|
+
visible,
|
|
29
|
+
onClose,
|
|
30
|
+
style,
|
|
31
|
+
children,
|
|
32
|
+
}: {
|
|
33
|
+
visible: boolean;
|
|
34
|
+
onClose: () => void;
|
|
35
|
+
style?: StyleProp<ViewStyle>;
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
}) {
|
|
38
|
+
const reduced = useReducedMotion();
|
|
39
|
+
const { height } = useWindowDimensions();
|
|
40
|
+
// Stays mounted through the closing animation, then goes.
|
|
41
|
+
const [mounted, setMounted] = useState(visible);
|
|
42
|
+
const progress = useRef(new Animated.Value(0)).current;
|
|
43
|
+
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
if (visible) setMounted(true);
|
|
46
|
+
}, [visible]);
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (!mounted) return undefined;
|
|
50
|
+
const run = Animated.timing(progress, {
|
|
51
|
+
toValue: visible ? 1 : 0,
|
|
52
|
+
duration: visible ? OPEN_MS : CLOSE_MS,
|
|
53
|
+
easing: visible ? Easing.out(Easing.cubic) : Easing.in(Easing.cubic),
|
|
54
|
+
useNativeDriver: true,
|
|
55
|
+
});
|
|
56
|
+
run.start(({ finished }) => {
|
|
57
|
+
if (finished && !visible) setMounted(false);
|
|
58
|
+
});
|
|
59
|
+
return () => run.stop();
|
|
60
|
+
}, [visible, mounted, progress]);
|
|
61
|
+
|
|
62
|
+
const rise = reduced ? 0 : height;
|
|
63
|
+
return (
|
|
64
|
+
<Modal visible={mounted} transparent animationType="none" onRequestClose={onClose} statusBarTranslucent>
|
|
65
|
+
<View style={styles.root}>
|
|
66
|
+
<Animated.View style={[StyleSheet.absoluteFill, styles.dim, { opacity: progress }]}>
|
|
67
|
+
<Pressable
|
|
68
|
+
style={StyleSheet.absoluteFill}
|
|
69
|
+
onPress={onClose}
|
|
70
|
+
accessibilityLabel="Close"
|
|
71
|
+
accessibilityRole="button"
|
|
72
|
+
/>
|
|
73
|
+
</Animated.View>
|
|
74
|
+
<Animated.View
|
|
75
|
+
accessibilityViewIsModal
|
|
76
|
+
style={[
|
|
77
|
+
style,
|
|
78
|
+
{
|
|
79
|
+
opacity: reduced ? progress : 1,
|
|
80
|
+
transform: [
|
|
81
|
+
{ translateY: progress.interpolate({ inputRange: [0, 1], outputRange: [rise, 0] }) },
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
]}
|
|
85
|
+
>
|
|
86
|
+
{children}
|
|
87
|
+
</Animated.View>
|
|
88
|
+
</View>
|
|
89
|
+
</Modal>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const styles = StyleSheet.create({
|
|
94
|
+
root: { flex: 1, justifyContent: 'flex-end' },
|
|
95
|
+
dim: { backgroundColor: DIM },
|
|
96
|
+
});
|