@adminide-stack/clock-tik-mobile 0.0.0-stage → 12.0.37-alpha.0
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 +31 -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 +42 -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 +21 -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 +2711 -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 +179 -0
- package/src/__tests__/choresList.test.ts +100 -0
- package/src/__tests__/content.test.ts +54 -0
- package/src/__tests__/dictation.test.ts +186 -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 +65 -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 +37 -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 +2773 -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,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Talk to Lucy, from Account's "Lucy on your Action Button" row, as designed on the Clockbook mobile canvas
|
|
3
|
+
* (VoiceShortcut.dc.html): a Muse-style sheet rising from the bottom. There is nothing to install, because the control
|
|
4
|
+
* comes with Clockbook (portable-devices/mobile/targets/lucy-live/TalkToLucyControl.swift). So the sheet says where to
|
|
5
|
+
* pick it, and Try it now does what it will do: Home, at the top, with the big mic listening. An iPhone without an
|
|
6
|
+
* Action Button is told about Control Center instead (talk/talkToLucy.ts talkPlace).
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { Pressable, ScrollView, StyleSheet, Text, useWindowDimensions, View } from 'react-native';
|
|
10
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
11
|
+
import Svg, { Circle, Line, Rect } from 'react-native-svg';
|
|
12
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
13
|
+
import { BottomSheet } from './BottomSheet';
|
|
14
|
+
import { TalkToLucyHero } from './TalkToLucyHero';
|
|
15
|
+
import { Button } from './ui';
|
|
16
|
+
import { PAD, type, ui } from '../theme/muse';
|
|
17
|
+
import type { TalkCopy, TalkPlace, TalkStep } from '../talk/talkToLucy';
|
|
18
|
+
|
|
19
|
+
const SIDE = PAD + 4;
|
|
20
|
+
|
|
21
|
+
/** Account's row icon, in GroupRow's tile: an iPhone with its Action Button lit, or controls with Lucy's one lit. */
|
|
22
|
+
export function TalkGlyph({ place }: { place: TalkPlace }) {
|
|
23
|
+
return (
|
|
24
|
+
<View style={styles.glyph}>
|
|
25
|
+
<Svg width={18} height={18} viewBox="0 0 24 24">
|
|
26
|
+
{place === 'action-button' ? (
|
|
27
|
+
<>
|
|
28
|
+
<Rect
|
|
29
|
+
x={8}
|
|
30
|
+
y={2.5}
|
|
31
|
+
width={11}
|
|
32
|
+
height={19}
|
|
33
|
+
rx={3}
|
|
34
|
+
fill="none"
|
|
35
|
+
stroke={ui.accentText}
|
|
36
|
+
strokeWidth={1.9}
|
|
37
|
+
/>
|
|
38
|
+
<Line
|
|
39
|
+
x1={4.6}
|
|
40
|
+
y1={6.2}
|
|
41
|
+
x2={4.6}
|
|
42
|
+
y2={10}
|
|
43
|
+
stroke={ui.accent}
|
|
44
|
+
strokeWidth={2.6}
|
|
45
|
+
strokeLinecap="round"
|
|
46
|
+
/>
|
|
47
|
+
</>
|
|
48
|
+
) : (
|
|
49
|
+
<>
|
|
50
|
+
<Circle cx={7.5} cy={7.5} r={3.3} fill="none" stroke={ui.accentText} strokeWidth={1.9} />
|
|
51
|
+
<Circle cx={16.5} cy={7.5} r={3.3} fill="none" stroke={ui.accentText} strokeWidth={1.9} />
|
|
52
|
+
<Circle cx={7.5} cy={16.5} r={3.3} fill="none" stroke={ui.accentText} strokeWidth={1.9} />
|
|
53
|
+
<Circle cx={16.5} cy={16.5} r={3.3} fill={ui.accent} stroke={ui.accent} strokeWidth={1.9} />
|
|
54
|
+
</>
|
|
55
|
+
)}
|
|
56
|
+
</Svg>
|
|
57
|
+
</View>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function Step({ step, n }: { step: TalkStep; n: number }) {
|
|
62
|
+
const said = [step.body, step.path?.join(', then ')].filter(Boolean).join(' ');
|
|
63
|
+
return (
|
|
64
|
+
<View style={styles.step} accessible accessibilityLabel={`Step ${n}: ${step.title}. ${said}`}>
|
|
65
|
+
<View style={styles.stepN}>
|
|
66
|
+
<Text style={styles.stepNText}>{n}</Text>
|
|
67
|
+
</View>
|
|
68
|
+
<View style={styles.stepMain}>
|
|
69
|
+
<Text style={styles.stepTitle}>{step.title}</Text>
|
|
70
|
+
{step.body ? <Text style={styles.stepBody}>{step.body}</Text> : null}
|
|
71
|
+
{step.path ? (
|
|
72
|
+
<View style={styles.path}>
|
|
73
|
+
{step.path.map((part, i, all) => (
|
|
74
|
+
<React.Fragment key={part}>
|
|
75
|
+
<View style={styles.chip}>
|
|
76
|
+
<Text style={styles.chipText}>{part}</Text>
|
|
77
|
+
</View>
|
|
78
|
+
{i < all.length - 1 ? (
|
|
79
|
+
<Ionicons name="chevron-forward" size={13} color={ui.faint} />
|
|
80
|
+
) : null}
|
|
81
|
+
</React.Fragment>
|
|
82
|
+
))}
|
|
83
|
+
</View>
|
|
84
|
+
) : null}
|
|
85
|
+
</View>
|
|
86
|
+
</View>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function TalkToLucySheet({
|
|
91
|
+
visible,
|
|
92
|
+
place,
|
|
93
|
+
copy,
|
|
94
|
+
onClose,
|
|
95
|
+
onTryNow,
|
|
96
|
+
}: {
|
|
97
|
+
visible: boolean;
|
|
98
|
+
place: TalkPlace;
|
|
99
|
+
/** The words for this iPhone (talk/talkToLucy.ts talkCopy). */
|
|
100
|
+
copy: TalkCopy;
|
|
101
|
+
onClose: () => void;
|
|
102
|
+
/** Try it now: Home, at the top, with the big mic listening, as the control will open it. */
|
|
103
|
+
onTryNow: () => void;
|
|
104
|
+
}) {
|
|
105
|
+
const insets = useSafeAreaInsets();
|
|
106
|
+
const { height } = useWindowDimensions();
|
|
107
|
+
return (
|
|
108
|
+
// As tall as it needs, up to the screen: on an iPhone SE the steps scroll under the picture.
|
|
109
|
+
<BottomSheet visible={visible} onClose={onClose} style={[styles.card, { maxHeight: height - insets.top - 12 }]}>
|
|
110
|
+
<View style={styles.grabber} />
|
|
111
|
+
<ScrollView
|
|
112
|
+
style={styles.scroll}
|
|
113
|
+
contentContainerStyle={[styles.content, { paddingBottom: Math.max(insets.bottom, 14) + 8 }]}
|
|
114
|
+
bounces={false}
|
|
115
|
+
showsVerticalScrollIndicator={false}
|
|
116
|
+
>
|
|
117
|
+
<View style={styles.bleed}>
|
|
118
|
+
<TalkToLucyHero place={place} cue={copy.cue} />
|
|
119
|
+
</View>
|
|
120
|
+
<Text accessibilityRole="header" style={[type.title, styles.center, styles.title]}>
|
|
121
|
+
{copy.title}
|
|
122
|
+
</Text>
|
|
123
|
+
<Text style={[type.callout, styles.center, styles.lede]}>{copy.lede}</Text>
|
|
124
|
+
<View style={styles.steps}>
|
|
125
|
+
{copy.steps.map((step, i) => (
|
|
126
|
+
<Step key={step.title} step={step} n={i + 1} />
|
|
127
|
+
))}
|
|
128
|
+
</View>
|
|
129
|
+
<View accessibilityHint="Opens Home with the mic listening, as the control will">
|
|
130
|
+
<Button label="Try it now" icon="mic" onPress={onTryNow} style={styles.try} />
|
|
131
|
+
</View>
|
|
132
|
+
<Text style={[type.footnote, styles.center, styles.foot]}>{copy.foot}</Text>
|
|
133
|
+
</ScrollView>
|
|
134
|
+
<Pressable
|
|
135
|
+
onPress={onClose}
|
|
136
|
+
hitSlop={10}
|
|
137
|
+
accessibilityRole="button"
|
|
138
|
+
accessibilityLabel="Close"
|
|
139
|
+
style={styles.close}
|
|
140
|
+
>
|
|
141
|
+
<Ionicons name="close" size={18} color={ui.ink2} />
|
|
142
|
+
</Pressable>
|
|
143
|
+
</BottomSheet>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const styles = StyleSheet.create({
|
|
148
|
+
glyph: {
|
|
149
|
+
width: 30,
|
|
150
|
+
height: 30,
|
|
151
|
+
borderRadius: 8,
|
|
152
|
+
backgroundColor: ui.accentSoft,
|
|
153
|
+
alignItems: 'center',
|
|
154
|
+
justifyContent: 'center',
|
|
155
|
+
marginRight: 12,
|
|
156
|
+
},
|
|
157
|
+
card: {
|
|
158
|
+
backgroundColor: ui.surface,
|
|
159
|
+
borderTopLeftRadius: 24,
|
|
160
|
+
borderTopRightRadius: 24,
|
|
161
|
+
paddingTop: 10,
|
|
162
|
+
},
|
|
163
|
+
grabber: { alignSelf: 'center', width: 36, height: 5, borderRadius: 3, backgroundColor: ui.fill, marginBottom: 14 },
|
|
164
|
+
close: {
|
|
165
|
+
position: 'absolute',
|
|
166
|
+
top: 16,
|
|
167
|
+
right: 16,
|
|
168
|
+
width: 30,
|
|
169
|
+
height: 30,
|
|
170
|
+
borderRadius: 15,
|
|
171
|
+
backgroundColor: ui.fill,
|
|
172
|
+
alignItems: 'center',
|
|
173
|
+
justifyContent: 'center',
|
|
174
|
+
},
|
|
175
|
+
scroll: { flexGrow: 0, flexShrink: 1 },
|
|
176
|
+
content: { paddingHorizontal: SIDE },
|
|
177
|
+
bleed: { marginHorizontal: -SIDE },
|
|
178
|
+
center: { textAlign: 'center' },
|
|
179
|
+
title: { marginTop: 8 },
|
|
180
|
+
lede: { marginTop: 6, color: ui.muted },
|
|
181
|
+
steps: { marginTop: 18, gap: 14 },
|
|
182
|
+
step: { flexDirection: 'row', alignItems: 'flex-start', gap: 12 },
|
|
183
|
+
stepN: {
|
|
184
|
+
width: 24,
|
|
185
|
+
height: 24,
|
|
186
|
+
borderRadius: 12,
|
|
187
|
+
marginTop: -1,
|
|
188
|
+
backgroundColor: ui.accentSoft,
|
|
189
|
+
alignItems: 'center',
|
|
190
|
+
justifyContent: 'center',
|
|
191
|
+
},
|
|
192
|
+
stepNText: { fontSize: 12, fontWeight: '700', color: ui.accentText, fontVariant: ['tabular-nums'] },
|
|
193
|
+
stepMain: { flex: 1, gap: 2 },
|
|
194
|
+
stepTitle: { fontSize: 15, lineHeight: 20, fontWeight: '600', color: ui.ink },
|
|
195
|
+
stepBody: { fontSize: 13.5, lineHeight: 19, color: ui.muted },
|
|
196
|
+
path: { flexDirection: 'row', flexWrap: 'wrap', alignItems: 'center', gap: 4, marginTop: 5 },
|
|
197
|
+
chip: {
|
|
198
|
+
paddingVertical: 3,
|
|
199
|
+
paddingHorizontal: 8,
|
|
200
|
+
borderRadius: 8,
|
|
201
|
+
backgroundColor: ui.surface,
|
|
202
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
203
|
+
borderColor: 'rgba(26,23,20,0.2)',
|
|
204
|
+
},
|
|
205
|
+
chipText: { fontSize: 12.5, lineHeight: 17, fontWeight: '600', color: ui.ink2 },
|
|
206
|
+
try: { marginTop: 22 },
|
|
207
|
+
foot: { marginTop: 14 },
|
|
208
|
+
});
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Home's big mic as a Clockbook clock: an ember orb to tap, inside a dial of sixty ticks. While it waits, the dial's
|
|
3
|
+
* second hand keeps the phone's own seconds and a halo breathes; while Lucy listens, a light runs round the dial, rings
|
|
4
|
+
* leave the orb and the halo swells with the voice (`level`, from useDictation's onLevel). Under Reduce Motion nothing
|
|
5
|
+
* travels: listening just lights the dial. The chat's small mic is components/MicButton.tsx.
|
|
6
|
+
*/
|
|
7
|
+
import React, { useEffect, useId, useMemo, useRef } from 'react';
|
|
8
|
+
import { Animated, Easing, Platform, Pressable, StyleSheet, View, type ViewStyle } from 'react-native';
|
|
9
|
+
import Svg, { Circle, Defs, Ellipse, RadialGradient, Stop } from 'react-native-svg';
|
|
10
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
11
|
+
import { useReducedMotion } from '../hooks/useReducedMotion';
|
|
12
|
+
import { click, release } from '../welcome/haptics';
|
|
13
|
+
import { dialTicks, tailRange } from './voiceDial';
|
|
14
|
+
|
|
15
|
+
const BOX = 184;
|
|
16
|
+
const ORB = 98;
|
|
17
|
+
const HALO = Math.round(BOX * 1.45);
|
|
18
|
+
const TICKS = dialTicks();
|
|
19
|
+
const LAP_MS = 1500;
|
|
20
|
+
const RING_MS = 1900;
|
|
21
|
+
|
|
22
|
+
export function VoiceOrb({
|
|
23
|
+
listening,
|
|
24
|
+
onPress,
|
|
25
|
+
level,
|
|
26
|
+
}: {
|
|
27
|
+
listening: boolean;
|
|
28
|
+
onPress: () => void;
|
|
29
|
+
/** How loud the voice is, 0 to 1 (Animated on the native driver). */
|
|
30
|
+
level: Animated.Value;
|
|
31
|
+
}) {
|
|
32
|
+
const reduced = useReducedMotion();
|
|
33
|
+
const uid = useId().replace(/[^A-Za-z0-9]/g, '');
|
|
34
|
+
const face = `voiceFace${uid}`;
|
|
35
|
+
const spec = `voiceSpec${uid}`;
|
|
36
|
+
const glow = `voiceGlow${uid}`;
|
|
37
|
+
|
|
38
|
+
const on = useRef(new Animated.Value(listening ? 1 : 0)).current;
|
|
39
|
+
const press = useRef(new Animated.Value(0)).current;
|
|
40
|
+
const breathe = useRef(new Animated.Value(0.5)).current;
|
|
41
|
+
const lap = useRef(new Animated.Value(0)).current;
|
|
42
|
+
const ringA = useRef(new Animated.Value(0)).current;
|
|
43
|
+
const ringB = useRef(new Animated.Value(0)).current;
|
|
44
|
+
const second = useRef(new Animated.Value(new Date().getSeconds())).current;
|
|
45
|
+
|
|
46
|
+
// Waiting and listening cross-fade.
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (reduced) {
|
|
49
|
+
on.setValue(listening ? 1 : 0);
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
const fade = Animated.timing(on, {
|
|
53
|
+
toValue: listening ? 1 : 0,
|
|
54
|
+
duration: 380,
|
|
55
|
+
easing: Easing.out(Easing.cubic),
|
|
56
|
+
useNativeDriver: true,
|
|
57
|
+
});
|
|
58
|
+
fade.start();
|
|
59
|
+
return () => fade.stop();
|
|
60
|
+
}, [listening, on, reduced]);
|
|
61
|
+
|
|
62
|
+
// The halo breathes.
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (reduced) return undefined;
|
|
65
|
+
const loop = Animated.loop(
|
|
66
|
+
Animated.sequence([
|
|
67
|
+
Animated.timing(breathe, {
|
|
68
|
+
toValue: 1,
|
|
69
|
+
duration: 2600,
|
|
70
|
+
easing: Easing.inOut(Easing.sin),
|
|
71
|
+
useNativeDriver: true,
|
|
72
|
+
}),
|
|
73
|
+
Animated.timing(breathe, {
|
|
74
|
+
toValue: 0,
|
|
75
|
+
duration: 2600,
|
|
76
|
+
easing: Easing.inOut(Easing.sin),
|
|
77
|
+
useNativeDriver: true,
|
|
78
|
+
}),
|
|
79
|
+
]),
|
|
80
|
+
);
|
|
81
|
+
loop.start();
|
|
82
|
+
return () => loop.stop();
|
|
83
|
+
}, [breathe, reduced]);
|
|
84
|
+
|
|
85
|
+
// The second hand keeps the phone's seconds, a tick at a time. It only ever counts up, so twelve never runs back.
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
if (reduced || listening) return undefined;
|
|
88
|
+
const base = Math.floor(Date.now() / 1000);
|
|
89
|
+
const from = base % 60;
|
|
90
|
+
second.setValue(from);
|
|
91
|
+
let every: ReturnType<typeof setInterval> | undefined;
|
|
92
|
+
const step = () =>
|
|
93
|
+
Animated.timing(second, {
|
|
94
|
+
toValue: from + Math.floor(Date.now() / 1000) - base,
|
|
95
|
+
duration: 260,
|
|
96
|
+
easing: Easing.out(Easing.back(2.2)),
|
|
97
|
+
useNativeDriver: true,
|
|
98
|
+
}).start();
|
|
99
|
+
const first = setTimeout(
|
|
100
|
+
() => {
|
|
101
|
+
step();
|
|
102
|
+
every = setInterval(step, 1000);
|
|
103
|
+
},
|
|
104
|
+
1000 - (Date.now() % 1000),
|
|
105
|
+
);
|
|
106
|
+
return () => {
|
|
107
|
+
clearTimeout(first);
|
|
108
|
+
if (every) clearInterval(every);
|
|
109
|
+
};
|
|
110
|
+
}, [listening, reduced, second]);
|
|
111
|
+
|
|
112
|
+
// Listening: the light laps the dial and rings leave the orb.
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
if (!listening || reduced) {
|
|
115
|
+
lap.setValue(0);
|
|
116
|
+
ringA.setValue(0);
|
|
117
|
+
ringB.setValue(0);
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
const ring = (v: Animated.Value) =>
|
|
121
|
+
Animated.loop(
|
|
122
|
+
Animated.timing(v, {
|
|
123
|
+
toValue: 1,
|
|
124
|
+
duration: RING_MS,
|
|
125
|
+
easing: Easing.out(Easing.quad),
|
|
126
|
+
useNativeDriver: true,
|
|
127
|
+
}),
|
|
128
|
+
);
|
|
129
|
+
const runs = [
|
|
130
|
+
Animated.loop(
|
|
131
|
+
Animated.timing(lap, { toValue: 1, duration: LAP_MS, easing: Easing.linear, useNativeDriver: true }),
|
|
132
|
+
),
|
|
133
|
+
ring(ringA),
|
|
134
|
+
Animated.sequence([Animated.delay(RING_MS / 2), ring(ringB)]),
|
|
135
|
+
];
|
|
136
|
+
runs.forEach((r) => r.start());
|
|
137
|
+
return () => runs.forEach((r) => r.stop());
|
|
138
|
+
}, [lap, listening, reduced, ringA, ringB]);
|
|
139
|
+
|
|
140
|
+
const pressTo = (to: number) =>
|
|
141
|
+
Animated.spring(press, { toValue: to, useNativeDriver: true, speed: 40, bounciness: to ? 0 : 9 }).start();
|
|
142
|
+
|
|
143
|
+
// Drawn once: the dial, its second hand and the running light only change through their Animated values.
|
|
144
|
+
const dial = useMemo(() => {
|
|
145
|
+
const lit = TICKS.map((t) => (reduced ? 0.85 : lap.interpolate(tailRange(t.i))));
|
|
146
|
+
return (
|
|
147
|
+
<>
|
|
148
|
+
<Animated.View
|
|
149
|
+
pointerEvents="none"
|
|
150
|
+
style={[
|
|
151
|
+
StyleSheet.absoluteFill,
|
|
152
|
+
{ opacity: on.interpolate({ inputRange: [0, 1], outputRange: [1, 0.35] }) },
|
|
153
|
+
]}
|
|
154
|
+
>
|
|
155
|
+
{TICKS.map((t) => (
|
|
156
|
+
<View key={t.i} style={[s.slot, { transform: [{ rotate: `${t.deg}deg` }] }]}>
|
|
157
|
+
<View style={t.major ? s.tickMajor : s.tick} />
|
|
158
|
+
</View>
|
|
159
|
+
))}
|
|
160
|
+
</Animated.View>
|
|
161
|
+
<Animated.View
|
|
162
|
+
pointerEvents="none"
|
|
163
|
+
style={[
|
|
164
|
+
StyleSheet.absoluteFill,
|
|
165
|
+
{
|
|
166
|
+
opacity: on.interpolate({ inputRange: [0, 1], outputRange: [1, 0] }),
|
|
167
|
+
transform: [
|
|
168
|
+
{
|
|
169
|
+
rotate: second.interpolate({
|
|
170
|
+
inputRange: [0, 60],
|
|
171
|
+
outputRange: ['0deg', '360deg'],
|
|
172
|
+
}),
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
]}
|
|
177
|
+
>
|
|
178
|
+
<View style={s.slot}>
|
|
179
|
+
<View style={s.hand} />
|
|
180
|
+
</View>
|
|
181
|
+
</Animated.View>
|
|
182
|
+
<Animated.View pointerEvents="none" style={[StyleSheet.absoluteFill, { opacity: on }]}>
|
|
183
|
+
{TICKS.map((t, k) => (
|
|
184
|
+
<View key={t.i} style={[s.slot, { transform: [{ rotate: `${t.deg}deg` }] }]}>
|
|
185
|
+
<Animated.View style={[t.major ? s.litMajor : s.lit, { opacity: lit[k] }]} />
|
|
186
|
+
</View>
|
|
187
|
+
))}
|
|
188
|
+
</Animated.View>
|
|
189
|
+
</>
|
|
190
|
+
);
|
|
191
|
+
}, [lap, on, reduced, second]);
|
|
192
|
+
|
|
193
|
+
const haloScale = useMemo(
|
|
194
|
+
() =>
|
|
195
|
+
Animated.add(
|
|
196
|
+
breathe.interpolate({ inputRange: [0, 1], outputRange: [0.94, 1.03] }),
|
|
197
|
+
Animated.add(
|
|
198
|
+
on.interpolate({ inputRange: [0, 1], outputRange: [0, 0.06] }),
|
|
199
|
+
Animated.multiply(level, 0.24),
|
|
200
|
+
),
|
|
201
|
+
),
|
|
202
|
+
[breathe, level, on],
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
return (
|
|
206
|
+
<View style={s.box}>
|
|
207
|
+
<Animated.View
|
|
208
|
+
pointerEvents="none"
|
|
209
|
+
style={[
|
|
210
|
+
s.halo,
|
|
211
|
+
{
|
|
212
|
+
opacity: on.interpolate({ inputRange: [0, 1], outputRange: [0.85, 1] }),
|
|
213
|
+
transform: [{ scale: haloScale }],
|
|
214
|
+
},
|
|
215
|
+
]}
|
|
216
|
+
>
|
|
217
|
+
<Svg width={HALO} height={HALO}>
|
|
218
|
+
<Defs>
|
|
219
|
+
<RadialGradient id={glow} cx="50%" cy="50%" r="50%">
|
|
220
|
+
<Stop offset="0" stopColor="#FF6A14" stopOpacity={0.3} />
|
|
221
|
+
<Stop offset="0.42" stopColor="#FF8A3D" stopOpacity={0.13} />
|
|
222
|
+
<Stop offset="1" stopColor="#FF8A3D" stopOpacity={0} />
|
|
223
|
+
</RadialGradient>
|
|
224
|
+
</Defs>
|
|
225
|
+
<Circle cx={HALO / 2} cy={HALO / 2} r={HALO / 2} fill={`url(#${glow})`} />
|
|
226
|
+
</Svg>
|
|
227
|
+
</Animated.View>
|
|
228
|
+
{[ringA, ringB].map((r, k) => (
|
|
229
|
+
<Animated.View
|
|
230
|
+
key={k}
|
|
231
|
+
pointerEvents="none"
|
|
232
|
+
style={[
|
|
233
|
+
s.ring,
|
|
234
|
+
{
|
|
235
|
+
opacity: Animated.multiply(
|
|
236
|
+
on,
|
|
237
|
+
r.interpolate({ inputRange: [0, 1], outputRange: [0.55, 0] }),
|
|
238
|
+
),
|
|
239
|
+
transform: [{ scale: r.interpolate({ inputRange: [0, 1], outputRange: [1, 1.8] }) }],
|
|
240
|
+
},
|
|
241
|
+
]}
|
|
242
|
+
/>
|
|
243
|
+
))}
|
|
244
|
+
{dial}
|
|
245
|
+
<Animated.View
|
|
246
|
+
style={[
|
|
247
|
+
s.orbLift,
|
|
248
|
+
{ transform: [{ scale: press.interpolate({ inputRange: [0, 1], outputRange: [1, 0.92] }) }] },
|
|
249
|
+
]}
|
|
250
|
+
>
|
|
251
|
+
<Pressable
|
|
252
|
+
onPress={() => {
|
|
253
|
+
// On with a crisp click, off with a soft one: the mic is a switch.
|
|
254
|
+
(listening ? release : click)();
|
|
255
|
+
onPress();
|
|
256
|
+
}}
|
|
257
|
+
onPressIn={() => pressTo(1)}
|
|
258
|
+
onPressOut={() => pressTo(0)}
|
|
259
|
+
hitSlop={14}
|
|
260
|
+
accessibilityRole="button"
|
|
261
|
+
accessibilityLabel={listening ? 'Stop listening' : 'Speak to Lucy'}
|
|
262
|
+
accessibilityHint={listening ? undefined : 'Your words go into the box below'}
|
|
263
|
+
accessibilityState={{ selected: listening }}
|
|
264
|
+
style={s.orb}
|
|
265
|
+
>
|
|
266
|
+
<Svg width={ORB} height={ORB} style={StyleSheet.absoluteFill}>
|
|
267
|
+
<Defs>
|
|
268
|
+
<RadialGradient id={face} cx="36%" cy="30%" r="80%">
|
|
269
|
+
<Stop offset="0" stopColor="#FFC08F" />
|
|
270
|
+
<Stop offset="0.38" stopColor="#FF7A2C" />
|
|
271
|
+
<Stop offset="0.72" stopColor="#FF5A00" />
|
|
272
|
+
<Stop offset="1" stopColor="#D64700" />
|
|
273
|
+
</RadialGradient>
|
|
274
|
+
<RadialGradient id={spec} cx="50%" cy="50%" r="50%">
|
|
275
|
+
<Stop offset="0" stopColor="#FFFFFF" stopOpacity={0.7} />
|
|
276
|
+
<Stop offset="1" stopColor="#FFFFFF" stopOpacity={0} />
|
|
277
|
+
</RadialGradient>
|
|
278
|
+
</Defs>
|
|
279
|
+
<Circle cx={ORB / 2} cy={ORB / 2} r={ORB / 2} fill={`url(#${face})`} />
|
|
280
|
+
<Ellipse
|
|
281
|
+
cx={ORB * 0.37}
|
|
282
|
+
cy={ORB * 0.27}
|
|
283
|
+
rx={ORB * 0.25}
|
|
284
|
+
ry={ORB * 0.14}
|
|
285
|
+
fill={`url(#${spec})`}
|
|
286
|
+
transform={`rotate(-28 ${ORB * 0.37} ${ORB * 0.27})`}
|
|
287
|
+
/>
|
|
288
|
+
<Circle
|
|
289
|
+
cx={ORB / 2}
|
|
290
|
+
cy={ORB / 2}
|
|
291
|
+
r={ORB / 2 - 0.75}
|
|
292
|
+
fill="none"
|
|
293
|
+
stroke="#FFFFFF"
|
|
294
|
+
strokeOpacity={0.32}
|
|
295
|
+
strokeWidth={1.5}
|
|
296
|
+
/>
|
|
297
|
+
</Svg>
|
|
298
|
+
{listening ? (
|
|
299
|
+
<View style={s.stop} />
|
|
300
|
+
) : (
|
|
301
|
+
<Ionicons name="mic" size={38} color="#FFFAF5" style={s.glyph} />
|
|
302
|
+
)}
|
|
303
|
+
</Pressable>
|
|
304
|
+
</Animated.View>
|
|
305
|
+
</View>
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const glowShadow = (radius: number, opacity: number): ViewStyle =>
|
|
310
|
+
Platform.select<ViewStyle>({
|
|
311
|
+
ios: {
|
|
312
|
+
shadowColor: '#FF5A00',
|
|
313
|
+
shadowOpacity: opacity,
|
|
314
|
+
shadowRadius: radius,
|
|
315
|
+
shadowOffset: { width: 0, height: 0 },
|
|
316
|
+
},
|
|
317
|
+
default: {},
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
const s = StyleSheet.create({
|
|
321
|
+
box: { width: BOX, height: BOX, alignItems: 'center', justifyContent: 'center' },
|
|
322
|
+
halo: { position: 'absolute', left: (BOX - HALO) / 2, top: (BOX - HALO) / 2, width: HALO, height: HALO },
|
|
323
|
+
ring: {
|
|
324
|
+
position: 'absolute',
|
|
325
|
+
width: ORB,
|
|
326
|
+
height: ORB,
|
|
327
|
+
borderRadius: ORB / 2,
|
|
328
|
+
borderWidth: 2,
|
|
329
|
+
borderColor: '#FF6A14',
|
|
330
|
+
},
|
|
331
|
+
// Spelled out: StyleSheet.absoluteFillObject is gone from newer React Native and spreads to nothing there.
|
|
332
|
+
slot: { position: 'absolute', top: 0, right: 0, bottom: 0, left: 0, alignItems: 'center' },
|
|
333
|
+
tick: { marginTop: 7, width: 2, height: 7, borderRadius: 1, backgroundColor: 'rgba(26,23,20,0.14)' },
|
|
334
|
+
tickMajor: { marginTop: 5, width: 2.5, height: 11, borderRadius: 1.25, backgroundColor: 'rgba(26,23,20,0.3)' },
|
|
335
|
+
hand: { marginTop: 3, width: 3, height: 14, borderRadius: 1.5, backgroundColor: '#FF5A00', ...glowShadow(6, 0.75) },
|
|
336
|
+
lit: { marginTop: 7, width: 2, height: 7, borderRadius: 1, backgroundColor: '#FF6A14' },
|
|
337
|
+
litMajor: { marginTop: 5, width: 2.5, height: 11, borderRadius: 1.25, backgroundColor: '#FF5A00' },
|
|
338
|
+
// A solid face under the drawing, so the glow beneath follows the circle (and Android's elevation has a shape).
|
|
339
|
+
orbLift: {
|
|
340
|
+
width: ORB,
|
|
341
|
+
height: ORB,
|
|
342
|
+
borderRadius: ORB / 2,
|
|
343
|
+
backgroundColor: '#FF5A00',
|
|
344
|
+
...Platform.select<ViewStyle>({
|
|
345
|
+
ios: {
|
|
346
|
+
shadowColor: '#FF5A00',
|
|
347
|
+
shadowOpacity: 0.45,
|
|
348
|
+
shadowRadius: 18,
|
|
349
|
+
shadowOffset: { width: 0, height: 12 },
|
|
350
|
+
},
|
|
351
|
+
default: { elevation: 8 },
|
|
352
|
+
}),
|
|
353
|
+
},
|
|
354
|
+
orb: {
|
|
355
|
+
width: ORB,
|
|
356
|
+
height: ORB,
|
|
357
|
+
borderRadius: ORB / 2,
|
|
358
|
+
alignItems: 'center',
|
|
359
|
+
justifyContent: 'center',
|
|
360
|
+
overflow: 'hidden',
|
|
361
|
+
},
|
|
362
|
+
glyph: { textShadowColor: 'rgba(120,30,0,0.35)', textShadowRadius: 4, textShadowOffset: { width: 0, height: 1 } },
|
|
363
|
+
stop: { width: 28, height: 28, borderRadius: 8, backgroundColor: '#FFFAF5' },
|
|
364
|
+
});
|