panelui-native 0.82.0 → 0.84.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/lib/module/components/bottom-sheet/index.js +111 -16
- package/lib/module/components/bottom-sheet/index.js.map +1 -1
- package/lib/module/components/circular-text/circular-text-geometry.js +63 -0
- package/lib/module/components/circular-text/circular-text-geometry.js.map +1 -0
- package/lib/module/components/circular-text/index.js +146 -0
- package/lib/module/components/circular-text/index.js.map +1 -0
- package/lib/module/components/image-generation/dot-field.js +66 -9
- package/lib/module/components/image-generation/dot-field.js.map +1 -1
- package/lib/module/components/image-generation/index.js +65 -23
- package/lib/module/components/image-generation/index.js.map +1 -1
- package/lib/module/components/marquee/index.js +12 -5
- package/lib/module/components/marquee/index.js.map +1 -1
- package/lib/module/components/panelside/index.js +15 -417
- package/lib/module/components/panelside/index.js.map +1 -1
- package/lib/module/components/popover/index.js +119 -7
- package/lib/module/components/popover/index.js.map +1 -1
- package/lib/module/icons/index.js +24 -4
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/index.js +52 -0
- package/lib/module/native/index.js.map +1 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts +17 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/src/components/circular-text/circular-text-geometry.d.ts +39 -0
- package/lib/typescript/src/components/circular-text/circular-text-geometry.d.ts.map +1 -0
- package/lib/typescript/src/components/circular-text/index.d.ts +69 -0
- package/lib/typescript/src/components/circular-text/index.d.ts.map +1 -0
- package/lib/typescript/src/components/image-generation/dot-field.d.ts +36 -1
- package/lib/typescript/src/components/image-generation/dot-field.d.ts.map +1 -1
- package/lib/typescript/src/components/image-generation/index.d.ts +16 -8
- package/lib/typescript/src/components/image-generation/index.d.ts.map +1 -1
- package/lib/typescript/src/components/marquee/index.d.ts.map +1 -1
- package/lib/typescript/src/components/panelside/index.d.ts +10 -202
- package/lib/typescript/src/components/panelside/index.d.ts.map +1 -1
- package/lib/typescript/src/components/popover/index.d.ts +25 -1
- package/lib/typescript/src/components/popover/index.d.ts.map +1 -1
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/index.d.ts +66 -0
- package/lib/typescript/src/native/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/bottom-sheet/index.tsx +139 -16
- package/src/components/circular-text/circular-text-geometry.ts +80 -0
- package/src/components/circular-text/index.tsx +217 -0
- package/src/components/image-generation/dot-field.ts +65 -9
- package/src/components/image-generation/index.tsx +67 -18
- package/src/components/marquee/index.tsx +12 -5
- package/src/components/panelside/index.tsx +16 -604
- package/src/components/popover/index.tsx +146 -4
- package/src/icons/index.tsx +23 -2
- package/src/index.ts +1 -6
- package/src/native/index.ts +100 -0
|
@@ -7,7 +7,7 @@ import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
|
7
7
|
import Animated, { Extrapolation, FadeIn, cancelAnimation, interpolate, SlideInDown, runOnJS, useAnimatedScrollHandler, useAnimatedStyle, useReducedMotion, useSharedValue, withSpring, withTiming } from 'react-native-reanimated';
|
|
8
8
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
9
9
|
import { tv } from 'tailwind-variants';
|
|
10
|
-
import { getNativeUI } from "../../native/index.js";
|
|
10
|
+
import { getComposeModifiers, getNativeUI, getSwiftUIModifiers } from "../../native/index.js";
|
|
11
11
|
import { XIcon } from "../../icons/index.js";
|
|
12
12
|
import { ModalPortal } from "../../primitives/portal.js";
|
|
13
13
|
import { Scrim } from "../../primitives/scrim.js";
|
|
@@ -106,6 +106,22 @@ const DETENT_FRACTION = {
|
|
|
106
106
|
full: 0.9
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
+
/**
|
|
110
|
+
* How long to treat a dismissal *we* asked for as still in flight.
|
|
111
|
+
*
|
|
112
|
+
* A timer, because there is nothing to wait on. The platform reports a
|
|
113
|
+
* dismissal the reader performed — that report is the binding writing its new
|
|
114
|
+
* value back — but not one we asked for, where the binding already holds the
|
|
115
|
+
* value it would have written and the change is suppressed at the source. So
|
|
116
|
+
* the only sheet whose departure can be observed is the one we did not ask to
|
|
117
|
+
* leave.
|
|
118
|
+
*
|
|
119
|
+
* Comfortably past the system's own sheet transition, since the cost of being
|
|
120
|
+
* late is a present held a little longer than it needed to be, and the cost of
|
|
121
|
+
* being early is the platform dropping it and no sheet at all.
|
|
122
|
+
*/
|
|
123
|
+
const NATIVE_DISMISS_MS = 400;
|
|
124
|
+
|
|
109
125
|
/**
|
|
110
126
|
* The height the content should at least fill for a given set of detents.
|
|
111
127
|
*
|
|
@@ -136,6 +152,27 @@ export function bottomSheetDetentHeight(snapPoints, screenHeight) {
|
|
|
136
152
|
return undefined;
|
|
137
153
|
}
|
|
138
154
|
|
|
155
|
+
/**
|
|
156
|
+
* The modifier that paints a native sheet's own surface, for whichever toolkit
|
|
157
|
+
* is drawing it — or nothing, where neither is reachable.
|
|
158
|
+
*
|
|
159
|
+
* A sheet's surface is not the background of anything hosted in it. The
|
|
160
|
+
* grabber's strip at the top and the safe-area inset at the bottom are the
|
|
161
|
+
* sheet's own chrome, and a colour put behind the content stops short of both
|
|
162
|
+
* of them — so the sheet arrives two-tone, and shifts as it moves between
|
|
163
|
+
* detents. These two reach the surface itself.
|
|
164
|
+
*
|
|
165
|
+
* The toolkits do not share a vocabulary, so the question is asked of each in
|
|
166
|
+
* its own terms rather than one answer being sent to both.
|
|
167
|
+
*/
|
|
168
|
+
function nativeSheetSurface(color) {
|
|
169
|
+
const swiftUI = getSwiftUIModifiers();
|
|
170
|
+
if (swiftUI) return [swiftUI.presentationBackground(color)];
|
|
171
|
+
const compose = getComposeModifiers();
|
|
172
|
+
if (compose) return [compose.background(color)];
|
|
173
|
+
return undefined;
|
|
174
|
+
}
|
|
175
|
+
|
|
139
176
|
/**
|
|
140
177
|
* Set by the root so Content knows the platform is drawing the sheet, and with
|
|
141
178
|
* which detents. Null means the styled sheet renders.
|
|
@@ -160,7 +197,8 @@ function BottomSheetRoot({
|
|
|
160
197
|
onOpenChange,
|
|
161
198
|
defaultOpen = false,
|
|
162
199
|
native,
|
|
163
|
-
snapPoints
|
|
200
|
+
snapPoints,
|
|
201
|
+
nativeBackground
|
|
164
202
|
}) {
|
|
165
203
|
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
166
204
|
const isControlled = open !== undefined;
|
|
@@ -176,8 +214,9 @@ function BottomSheetRoot({
|
|
|
176
214
|
const nativeUI = native ? getNativeUI() : null;
|
|
177
215
|
const nativeSheet = useMemo(() => nativeUI ? {
|
|
178
216
|
nativeUI,
|
|
179
|
-
snapPoints
|
|
180
|
-
|
|
217
|
+
snapPoints,
|
|
218
|
+
background: nativeBackground
|
|
219
|
+
} : null, [nativeBackground, nativeUI, snapPoints]);
|
|
181
220
|
return /*#__PURE__*/_jsx(BottomSheetContext.Provider, {
|
|
182
221
|
value: context,
|
|
183
222
|
children: /*#__PURE__*/_jsx(NativeSheetContext.Provider, {
|
|
@@ -234,6 +273,10 @@ function BottomSheetContent({
|
|
|
234
273
|
const insets = useSafeAreaInsets();
|
|
235
274
|
const translateY = useSharedValue(0);
|
|
236
275
|
const closeTint = useCSSVariable('--color-muted-foreground');
|
|
276
|
+
// Read unconditionally, used only by the native branch: the platform draws
|
|
277
|
+
// that sheet's container, so a token can only reach it as a colour handed
|
|
278
|
+
// over, never as a class.
|
|
279
|
+
const popoverSurface = useCSSVariable('--color-popover');
|
|
237
280
|
|
|
238
281
|
/*
|
|
239
282
|
* The scrolling body's gesture, if there is one. It is built here rather
|
|
@@ -307,35 +350,77 @@ function BottomSheetContent({
|
|
|
307
350
|
* sees a sheet that "took a moment" or never came at all.
|
|
308
351
|
*
|
|
309
352
|
* `isPresented` is therefore driven from here rather than straight from
|
|
310
|
-
* `open
|
|
311
|
-
*
|
|
312
|
-
*
|
|
353
|
+
* `open`: a present that arrives during a dismissal is held, and let through
|
|
354
|
+
* once that dismissal is over.
|
|
355
|
+
*
|
|
356
|
+
* Knowing when it is over is the hard half, because it depends on who asked.
|
|
357
|
+
* A dismissal the reader performed is reported — that report is the platform
|
|
358
|
+
* writing the new value back to us. One we asked for is not: the value is
|
|
359
|
+
* already what the platform would have written, so the change is suppressed
|
|
360
|
+
* at the source and no report is ever sent. A queue that waits for one
|
|
361
|
+
* regardless waits for ever, and every present after the first is held —
|
|
362
|
+
* which is a sheet that opens once and then never again, whether the flag was
|
|
363
|
+
* raised by the reader's swipe or by a Close button inside the sheet.
|
|
364
|
+
*
|
|
365
|
+
* So the two are ended by their own means: the reader's by the report, ours
|
|
366
|
+
* by {@link NATIVE_DISMISS_MS} — and by the report as well, if one turns up,
|
|
367
|
+
* since arriving early is only ever an improvement.
|
|
313
368
|
*/
|
|
314
369
|
const [nativePresented, setNativePresented] = useState(open);
|
|
370
|
+
const nativeOnScreen = useRef(open);
|
|
315
371
|
const nativeDismissing = useRef(false);
|
|
372
|
+
const nativeDismissTimer = useRef(null);
|
|
316
373
|
const openRef = useRef(open);
|
|
317
374
|
openRef.current = open;
|
|
375
|
+
|
|
376
|
+
/** The dismissal is over: let a held present through, if one is waiting. */
|
|
377
|
+
const endNativeDismissal = useCallback(() => {
|
|
378
|
+
if (nativeDismissTimer.current !== null) {
|
|
379
|
+
clearTimeout(nativeDismissTimer.current);
|
|
380
|
+
nativeDismissTimer.current = null;
|
|
381
|
+
}
|
|
382
|
+
if (!nativeDismissing.current) return;
|
|
383
|
+
nativeDismissing.current = false;
|
|
384
|
+
if (openRef.current) {
|
|
385
|
+
nativeOnScreen.current = true;
|
|
386
|
+
setNativePresented(true);
|
|
387
|
+
}
|
|
388
|
+
}, []);
|
|
318
389
|
useEffect(() => {
|
|
319
390
|
if (!nativeSheet) return;
|
|
320
391
|
if (open) {
|
|
321
392
|
if (nativeDismissing.current) return;
|
|
393
|
+
nativeOnScreen.current = true;
|
|
322
394
|
setNativePresented(true);
|
|
323
395
|
return;
|
|
324
396
|
}
|
|
325
|
-
|
|
397
|
+
|
|
398
|
+
// Only a sheet the platform still has on screen can be in the middle of
|
|
399
|
+
// leaving. One the reader already swiped away has reported itself gone.
|
|
400
|
+
if (nativeOnScreen.current) {
|
|
401
|
+
nativeOnScreen.current = false;
|
|
402
|
+
nativeDismissing.current = true;
|
|
403
|
+
if (nativeDismissTimer.current !== null) clearTimeout(nativeDismissTimer.current);
|
|
404
|
+
nativeDismissTimer.current = setTimeout(endNativeDismissal, NATIVE_DISMISS_MS);
|
|
405
|
+
}
|
|
326
406
|
setNativePresented(false);
|
|
327
|
-
}, [
|
|
407
|
+
}, [endNativeDismissal, nativeSheet, open]);
|
|
408
|
+
useEffect(() => () => {
|
|
409
|
+
if (nativeDismissTimer.current !== null) clearTimeout(nativeDismissTimer.current);
|
|
410
|
+
}, []);
|
|
328
411
|
const onNativeDismiss = useCallback(() => {
|
|
329
|
-
//
|
|
330
|
-
//
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
412
|
+
// The platform reporting that its sheet has gone. Whatever asked for it,
|
|
413
|
+
// there is nothing on screen now.
|
|
414
|
+
nativeOnScreen.current = false;
|
|
415
|
+
|
|
416
|
+
// Ours, or the reader's? A dismissal we asked for hands the queue back
|
|
417
|
+
// ahead of its window; one the reader performed is a close to report.
|
|
418
|
+
if (nativeDismissing.current) {
|
|
419
|
+
endNativeDismissal();
|
|
335
420
|
return;
|
|
336
421
|
}
|
|
337
422
|
if (dismissible) close();
|
|
338
|
-
}, [close, dismissible]);
|
|
423
|
+
}, [close, dismissible, endNativeDismissal]);
|
|
339
424
|
const pan = useMemo(() => Gesture.Pan()
|
|
340
425
|
/*
|
|
341
426
|
* A drag has to travel before it takes the touch. This detector wraps
|
|
@@ -426,6 +511,15 @@ function BottomSheetContent({
|
|
|
426
511
|
* height, so a native sheet keeps the system's snapping.
|
|
427
512
|
*/
|
|
428
513
|
const snapPoints = nativeSheet.snapPoints ?? (size === 'auto' ? undefined : [size]);
|
|
514
|
+
/*
|
|
515
|
+
* `true` means the theme's surface, and a string means itself. A token
|
|
516
|
+
* that did not resolve is dropped rather than passed on — an unresolved
|
|
517
|
+
* colour reaching the platform is a sheet painted some default, which is
|
|
518
|
+
* further from the material than leaving the material alone.
|
|
519
|
+
*/
|
|
520
|
+
const requested = nativeSheet.background;
|
|
521
|
+
const surface = requested === true ? typeof popoverSurface === 'string' ? popoverSurface : undefined : typeof requested === 'string' ? requested : undefined;
|
|
522
|
+
const modifiers = surface ? nativeSheetSurface(surface) : undefined;
|
|
429
523
|
// The platform owns presentation, so this stays mounted and toggles
|
|
430
524
|
// isPresented rather than unmounting on close.
|
|
431
525
|
//
|
|
@@ -442,6 +536,7 @@ function BottomSheetContent({
|
|
|
442
536
|
isPresented: nativePresented,
|
|
443
537
|
onDismiss: onNativeDismiss,
|
|
444
538
|
snapPoints: snapPoints,
|
|
539
|
+
modifiers: modifiers,
|
|
445
540
|
children: /*#__PURE__*/_jsx(RNHostView, {
|
|
446
541
|
matchContents: true,
|
|
447
542
|
children: /*#__PURE__*/_jsx(BottomSheetContext.Provider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["cloneElement","createContext","isValidElement","useCallback","useContext","useEffect","useMemo","useRef","useState","Pressable","StyleSheet","useWindowDimensions","View","useCSSVariable","Gesture","GestureDetector","Animated","Extrapolation","FadeIn","cancelAnimation","interpolate","SlideInDown","runOnJS","useAnimatedScrollHandler","useAnimatedStyle","useReducedMotion","useSharedValue","withSpring","withTiming","useSafeAreaInsets","tv","getNativeUI","XIcon","ModalPortal","Scrim","Text","textChildren","useBackHandler","cn","impactKnock","jsx","_jsx","jsxs","_jsxs","SPRING","duration","dampingRatio","EXIT_SPRING","overshootClamping","DISMISS_DISTANCE","DISMISS_VELOCITY","ENTERING","springify","project","velocity","decelerationRate","sheetVariants","base","variants","detached","false","true","defaultVariants","BottomSheetContext","useBottomSheet","component","context","Error","DETENT_FRACTION","half","full","bottomSheetDetentHeight","snapPoints","screenHeight","length","undefined","first","fraction","height","NativeSheetContext","SheetSurfaceContext","BottomSheetRoot","children","open","onOpenChange","defaultOpen","native","internalOpen","setInternalOpen","isControlled","resolvedOpen","setOpen","next","nativeUI","nativeSheet","Provider","value","BottomSheetTrigger","onPress","args","props","SIZE_FRACTION","BottomSheetContent","className","dismissible","showClose","showGrabber","blur","size","width","screenWidth","reducedMotion","insets","translateY","closeTint","scrollGesture","Native","scrollOffset","hasScrollable","close","presented","setPresented","land","finished","nativePresented","setNativePresented","nativeDismissing","openRef","current","onNativeDismiss","wasOurs","pan","Pan","activeOffsetY","simultaneousWithExternalGesture","onChange","event","changeY","onEnd","projected","velocityY","sheetStyle","transform","backdropStyle","opacity","CLAMP","sizedHeight","Math","min","top","surface","Host","BottomSheet","NativeBottomSheet","RNHostView","matchContents","ignoreSafeArea","style","position","isPresented","onDismiss","minHeight","paddingBottom","max","bottom","absoluteFill","accessibilityLabel","gesture","entering","accessibilityViewIsModal","accessibilityRole","hitSlop","color","BottomSheetHeader","title","description","text","weight","muted","displayName","BottomSheetBody","onScroll","handler","contentOffset","y","body","ScrollView","scrollEventThrottle","showsVerticalScrollIndicator","BottomSheetFooter","Object","assign","Trigger","Content","Header","Body","Footer"],"sourceRoot":"../../../../src","sources":["components/bottom-sheet/index.tsx"],"mappings":";;AAAA,SACEA,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QAIH,OAAO;AACd,SACEC,SAAS,EACTC,UAAU,EACVC,mBAAmB,EACnBC,IAAI,QAEC,cAAc;AACrB,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,OAAO,EAAEC,eAAe,QAAQ,8BAA8B;AACvE,OAAOC,QAAQ,IACbC,aAAa,EACbC,MAAM,EACNC,eAAe,EACfC,WAAW,EACXC,WAAW,EACXC,O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Ae;IAACwJ,OAAO,EAAEjB,OAAO,CAACnC,aAAc;IAAAjC,QAAA,EAAEuG;EAAI,CAAkB,CAAC;AAClF;AACAL,eAAe,CAACD,WAAW,GAAG,kBAAkB;AAOhD;AACA;AACA;AACA;AACA;AACA,SAASU,iBAAiBA,CAAC;EACzBtF,SAAS;EACTrB,QAAQ;EACR,GAAGkB;AACmB,CAAC,EAAE;EACzB,oBACE3D,IAAA,CAAC7B,IAAI;IACH2F,SAAS,EAAEjE,EAAE,CAAC,mCAAmC,EAAEiE,SAAS,CAAE;IAAA,GAC1DH,KAAK;IAAAlB,QAAA,EAER9C,YAAY,CAAC8C,QAAQ;EAAC,CACnB,CAAC;AAEX;AACA2G,iBAAiB,CAACV,WAAW,GAAG,oBAAoB;AAEpD,OAAO,MAAM3B,WAAW,GAAGsC,MAAM,CAACC,MAAM,CAAC9G,eAAe,EAAE;EACxD+G,OAAO,EAAE/F,kBAAkB;EAC3BgG,OAAO,EAAE3F,kBAAkB;EAC3B4F,MAAM,EAAErB,iBAAiB;EACzBsB,IAAI,EAAEf,eAAe;EACrBgB,MAAM,EAAEP;AACV,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["cloneElement","createContext","isValidElement","useCallback","useContext","useEffect","useMemo","useRef","useState","Pressable","StyleSheet","useWindowDimensions","View","useCSSVariable","Gesture","GestureDetector","Animated","Extrapolation","FadeIn","cancelAnimation","interpolate","SlideInDown","runOnJS","useAnimatedScrollHandler","useAnimatedStyle","useReducedMotion","useSharedValue","withSpring","withTiming","useSafeAreaInsets","tv","getComposeModifiers","getNativeUI","getSwiftUIModifiers","XIcon","ModalPortal","Scrim","Text","textChildren","useBackHandler","cn","impactKnock","jsx","_jsx","jsxs","_jsxs","SPRING","duration","dampingRatio","EXIT_SPRING","overshootClamping","DISMISS_DISTANCE","DISMISS_VELOCITY","ENTERING","springify","project","velocity","decelerationRate","sheetVariants","base","variants","detached","false","true","defaultVariants","BottomSheetContext","useBottomSheet","component","context","Error","DETENT_FRACTION","half","full","NATIVE_DISMISS_MS","bottomSheetDetentHeight","snapPoints","screenHeight","length","undefined","first","fraction","height","nativeSheetSurface","color","swiftUI","presentationBackground","compose","background","NativeSheetContext","SheetSurfaceContext","BottomSheetRoot","children","open","onOpenChange","defaultOpen","native","nativeBackground","internalOpen","setInternalOpen","isControlled","resolvedOpen","setOpen","next","nativeUI","nativeSheet","Provider","value","BottomSheetTrigger","onPress","args","props","SIZE_FRACTION","BottomSheetContent","className","dismissible","showClose","showGrabber","blur","size","width","screenWidth","reducedMotion","insets","translateY","closeTint","popoverSurface","scrollGesture","Native","scrollOffset","hasScrollable","close","presented","setPresented","land","finished","nativePresented","setNativePresented","nativeOnScreen","nativeDismissing","nativeDismissTimer","openRef","current","endNativeDismissal","clearTimeout","setTimeout","onNativeDismiss","pan","Pan","activeOffsetY","simultaneousWithExternalGesture","onChange","event","changeY","onEnd","projected","velocityY","sheetStyle","transform","backdropStyle","opacity","CLAMP","sizedHeight","Math","min","top","surface","Host","BottomSheet","NativeBottomSheet","RNHostView","requested","modifiers","matchContents","ignoreSafeArea","style","position","isPresented","onDismiss","minHeight","paddingBottom","max","bottom","absoluteFill","accessibilityLabel","gesture","entering","accessibilityViewIsModal","accessibilityRole","hitSlop","BottomSheetHeader","title","description","text","weight","muted","displayName","BottomSheetBody","onScroll","handler","contentOffset","y","body","ScrollView","scrollEventThrottle","showsVerticalScrollIndicator","BottomSheetFooter","Object","assign","Trigger","Content","Header","Body","Footer"],"sourceRoot":"../../../../src","sources":["components/bottom-sheet/index.tsx"],"mappings":";;AAAA,SACEA,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QAIH,OAAO;AACd,SACEC,SAAS,EACTC,UAAU,EACVC,mBAAmB,EACnBC,IAAI,QAEC,cAAc;AACrB,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,OAAO,EAAEC,eA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C1DH,KAAK;IAAAnB,QAAA,EAERrD,YAAY,CAACqD,QAAQ;EAAC,CACnB,CAAC;AAEX;AACAkH,iBAAiB,CAACV,WAAW,GAAG,oBAAoB;AAEpD,OAAO,MAAM5B,WAAW,GAAGuC,MAAM,CAACC,MAAM,CAACrH,eAAe,EAAE;EACxDsH,OAAO,EAAErG,kBAAkB;EAC3BsG,OAAO,EAAEjG,kBAAkB;EAC3BkG,MAAM,EAAErB,iBAAiB;EACzBsB,IAAI,EAAEf,eAAe;EACrBgB,MAAM,EAAEP;AACV,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Where each character sits on the ring, kept out of the component so it can
|
|
5
|
+
* be tested without rendering one.
|
|
6
|
+
*
|
|
7
|
+
* Every number here reaches a transform, and a transform treats `NaN` and
|
|
8
|
+
* `Infinity` as a frame that never resolves rather than as an error — a ring
|
|
9
|
+
* handed a bad radius should draw nothing, not wedge. So the guards live at
|
|
10
|
+
* the boundary, once, instead of at each use.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/** Points from the centre to the baseline the characters sit on. */
|
|
14
|
+
export const DEFAULT_CIRCULAR_TEXT_RADIUS = 90;
|
|
15
|
+
|
|
16
|
+
/** Milliseconds for one full turn. Slow: it is decoration, not a spinner. */
|
|
17
|
+
export const DEFAULT_CIRCULAR_TEXT_DURATION = 20000;
|
|
18
|
+
|
|
19
|
+
/** Degrees of the circle the text is spread across. The whole way round. */
|
|
20
|
+
export const DEFAULT_CIRCULAR_TEXT_SPREAD = 360;
|
|
21
|
+
export function normalizeRadius(value) {
|
|
22
|
+
if (!Number.isFinite(value)) return DEFAULT_CIRCULAR_TEXT_RADIUS;
|
|
23
|
+
return Math.max(value, 0);
|
|
24
|
+
}
|
|
25
|
+
export function normalizeDuration(value) {
|
|
26
|
+
if (!Number.isFinite(value)) return DEFAULT_CIRCULAR_TEXT_DURATION;
|
|
27
|
+
return Math.max(value, 0);
|
|
28
|
+
}
|
|
29
|
+
export function normalizeSpread(value) {
|
|
30
|
+
if (!Number.isFinite(value)) return DEFAULT_CIRCULAR_TEXT_SPREAD;
|
|
31
|
+
// Clamped rather than wrapped: past a full turn the characters would overlap
|
|
32
|
+
// the ones already there, and a spread of -40 is a spread of 40 the other
|
|
33
|
+
// way round, which `reverse` is the prop for.
|
|
34
|
+
return Math.min(Math.abs(value), 360);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* One entry per character, evenly spaced around the arc.
|
|
38
|
+
*
|
|
39
|
+
* The step is measured between characters rather than across them, and which
|
|
40
|
+
* of the two you divide by is the whole difference between a closed ring and
|
|
41
|
+
* one with a visible seam. A full turn has no last gap — the end of the string
|
|
42
|
+
* is adjacent to its start — so `n` characters make `n` gaps and the step is
|
|
43
|
+
* `spread / n`. Anything less than a full turn has one gap fewer than it has
|
|
44
|
+
* characters, so the step is `spread / (n - 1)` and the text reaches both ends
|
|
45
|
+
* of the arc it was given instead of stopping short of the second one.
|
|
46
|
+
*/
|
|
47
|
+
export function circularTextGlyphs(text, spread, startAngle) {
|
|
48
|
+
const characters = Array.from(text);
|
|
49
|
+
if (characters.length === 0) return [];
|
|
50
|
+
const arc = normalizeSpread(spread);
|
|
51
|
+
const from = Number.isFinite(startAngle) ? startAngle : 0;
|
|
52
|
+
const closed = arc >= 360;
|
|
53
|
+
|
|
54
|
+
// One character cannot be spread across anything, and dividing by the zero
|
|
55
|
+
// gaps it has would put it nowhere.
|
|
56
|
+
const step = characters.length === 1 ? 0 : arc / (closed ? characters.length : characters.length - 1);
|
|
57
|
+
return characters.map((character, index) => ({
|
|
58
|
+
character,
|
|
59
|
+
index,
|
|
60
|
+
angle: from + step * index
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=circular-text-geometry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DEFAULT_CIRCULAR_TEXT_RADIUS","DEFAULT_CIRCULAR_TEXT_DURATION","DEFAULT_CIRCULAR_TEXT_SPREAD","normalizeRadius","value","Number","isFinite","Math","max","normalizeDuration","normalizeSpread","min","abs","circularTextGlyphs","text","spread","startAngle","characters","Array","from","length","arc","closed","step","map","character","index","angle"],"sourceRoot":"../../../../src","sources":["components/circular-text/circular-text-geometry.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,MAAMA,4BAA4B,GAAG,EAAE;;AAE9C;AACA,OAAO,MAAMC,8BAA8B,GAAG,KAAK;;AAEnD;AACA,OAAO,MAAMC,4BAA4B,GAAG,GAAG;AAE/C,OAAO,SAASC,eAAeA,CAACC,KAAa,EAAU;EACrD,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACF,KAAK,CAAC,EAAE,OAAOJ,4BAA4B;EAChE,OAAOO,IAAI,CAACC,GAAG,CAACJ,KAAK,EAAE,CAAC,CAAC;AAC3B;AAEA,OAAO,SAASK,iBAAiBA,CAACL,KAAa,EAAU;EACvD,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACF,KAAK,CAAC,EAAE,OAAOH,8BAA8B;EAClE,OAAOM,IAAI,CAACC,GAAG,CAACJ,KAAK,EAAE,CAAC,CAAC;AAC3B;AAEA,OAAO,SAASM,eAAeA,CAACN,KAAa,EAAU;EACrD,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACF,KAAK,CAAC,EAAE,OAAOF,4BAA4B;EAChE;EACA;EACA;EACA,OAAOK,IAAI,CAACI,GAAG,CAACJ,IAAI,CAACK,GAAG,CAACR,KAAK,CAAC,EAAE,GAAG,CAAC;AACvC;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASS,kBAAkBA,CAChCC,IAAY,EACZC,MAAc,EACdC,UAAkB,EACG;EACrB,MAAMC,UAAU,GAAGC,KAAK,CAACC,IAAI,CAACL,IAAI,CAAC;EACnC,IAAIG,UAAU,CAACG,MAAM,KAAK,CAAC,EAAE,OAAO,EAAE;EAEtC,MAAMC,GAAG,GAAGX,eAAe,CAACK,MAAM,CAAC;EACnC,MAAMI,IAAI,GAAGd,MAAM,CAACC,QAAQ,CAACU,UAAU,CAAC,GAAGA,UAAU,GAAG,CAAC;EACzD,MAAMM,MAAM,GAAGD,GAAG,IAAI,GAAG;;EAEzB;EACA;EACA,MAAME,IAAI,GACRN,UAAU,CAACG,MAAM,KAAK,CAAC,GAAG,CAAC,GAAGC,GAAG,IAAIC,MAAM,GAAGL,UAAU,CAACG,MAAM,GAAGH,UAAU,CAACG,MAAM,GAAG,CAAC,CAAC;EAE1F,OAAOH,UAAU,CAACO,GAAG,CAAC,CAACC,SAAS,EAAEC,KAAK,MAAM;IAC3CD,SAAS;IACTC,KAAK;IACLC,KAAK,EAAER,IAAI,GAAGI,IAAI,GAAGG;EACvB,CAAC,CAAC,CAAC;AACL","ignoreList":[]}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useMemo } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import Animated, { Easing, cancelAnimation, useAnimatedStyle, useReducedMotion, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
|
|
6
|
+
import { tv } from 'tailwind-variants';
|
|
7
|
+
import { Text } from "../../primitives/text.js";
|
|
8
|
+
import { cn } from "../../utils/cn.js";
|
|
9
|
+
import { DEFAULT_CIRCULAR_TEXT_DURATION, DEFAULT_CIRCULAR_TEXT_RADIUS, DEFAULT_CIRCULAR_TEXT_SPREAD, circularTextGlyphs, normalizeDuration, normalizeRadius, normalizeSpread } from "./circular-text-geometry.js";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
const circularTextVariants = tv({
|
|
12
|
+
base: 'items-center justify-center'
|
|
13
|
+
});
|
|
14
|
+
const glyphVariants = tv({
|
|
15
|
+
/*
|
|
16
|
+
* Every character gets a box the size of the ring, laid over the same point,
|
|
17
|
+
* with the character at the top edge of it. Rotating the box about its own
|
|
18
|
+
* centre — which is the ring's centre — is what swings the character round
|
|
19
|
+
* the circle, and it means no per-character arithmetic reaches the transform
|
|
20
|
+
* beyond the one angle.
|
|
21
|
+
*
|
|
22
|
+
* The box's size is set inline rather than by a utility, and that is not
|
|
23
|
+
* decoration: a box that states its own width and height cannot end up with
|
|
24
|
+
* a different one, and one glyph sitting at twice the radius of the rest is
|
|
25
|
+
* exactly what a box of the wrong size looks like.
|
|
26
|
+
*/
|
|
27
|
+
base: 'items-center justify-start'
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The glyph size the ring is drawn at unless the caller says otherwise.
|
|
32
|
+
*
|
|
33
|
+
* A step up from the body default. Text bent round a circle is read a letter
|
|
34
|
+
* at a time rather than as a word, and at body size the letters are small
|
|
35
|
+
* enough that the ring reads as a texture instead of as a phrase.
|
|
36
|
+
*/
|
|
37
|
+
const GLYPH_TEXT = 'text-lg';
|
|
38
|
+
/**
|
|
39
|
+
* Text set around a circle, turning.
|
|
40
|
+
*
|
|
41
|
+
* For a badge, a seal, a mark around a logo: decoration whose job is to be a
|
|
42
|
+
* shape first and a sentence second. The characters are placed one at a time
|
|
43
|
+
* and each is turned to sit square on the curve, so the ring closes and the
|
|
44
|
+
* text at the bottom is upside down — which is what makes it read as a
|
|
45
|
+
* circle rather than as a sentence bent into one.
|
|
46
|
+
*
|
|
47
|
+
* The centre is left empty and nothing is laid out inside it. Put a logo
|
|
48
|
+
* there by stacking the two, rather than by passing it as a child.
|
|
49
|
+
*
|
|
50
|
+
* The turn runs entirely on the UI thread, and under the platform's
|
|
51
|
+
* reduce-motion setting the ring is drawn once and held still. Not a slower
|
|
52
|
+
* turn — none. The shape carries the whole meaning; the rotation is the part
|
|
53
|
+
* that setting exists to remove.
|
|
54
|
+
*/
|
|
55
|
+
export function CircularText({
|
|
56
|
+
children,
|
|
57
|
+
radius = DEFAULT_CIRCULAR_TEXT_RADIUS,
|
|
58
|
+
spinDuration = DEFAULT_CIRCULAR_TEXT_DURATION,
|
|
59
|
+
reverse = false,
|
|
60
|
+
paused = false,
|
|
61
|
+
spread = DEFAULT_CIRCULAR_TEXT_SPREAD,
|
|
62
|
+
startAngle = 0,
|
|
63
|
+
className,
|
|
64
|
+
textClassName,
|
|
65
|
+
style,
|
|
66
|
+
...props
|
|
67
|
+
}) {
|
|
68
|
+
const reducedMotion = useReducedMotion();
|
|
69
|
+
const rotation = useSharedValue(0);
|
|
70
|
+
const size = normalizeRadius(radius) * 2;
|
|
71
|
+
const duration = normalizeDuration(spinDuration);
|
|
72
|
+
const arc = normalizeSpread(spread);
|
|
73
|
+
const glyphs = useMemo(() => circularTextGlyphs(children, arc, startAngle), [children, arc, startAngle]);
|
|
74
|
+
|
|
75
|
+
// A duration of zero is a timing that never advances, so it is a held ring
|
|
76
|
+
// rather than an infinitely fast one.
|
|
77
|
+
const turning = !paused && !reducedMotion && duration > 0 && glyphs.length > 0;
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
if (!turning) {
|
|
80
|
+
// Leaves the value where it reached. Zeroing here would send a ring
|
|
81
|
+
// paused mid-word back to the top, and the pause would read as a reset.
|
|
82
|
+
cancelAnimation(rotation);
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/*
|
|
87
|
+
* From wherever it already is, one turn, forever.
|
|
88
|
+
*
|
|
89
|
+
* The repeat restarts each cycle at the value it began on, and the state
|
|
90
|
+
* at `from + 360` is the state at `from`, so the seam between cycles is
|
|
91
|
+
* arithmetic rather than something to see. Taking the remainder first
|
|
92
|
+
* keeps the number from growing without bound over a long session.
|
|
93
|
+
*/
|
|
94
|
+
const from = rotation.value % 360;
|
|
95
|
+
const to = reverse ? from - 360 : from + 360;
|
|
96
|
+
rotation.value = from;
|
|
97
|
+
rotation.value = withRepeat(withTiming(to, {
|
|
98
|
+
duration,
|
|
99
|
+
easing: Easing.linear
|
|
100
|
+
}), -1, false);
|
|
101
|
+
return () => cancelAnimation(rotation);
|
|
102
|
+
}, [rotation, turning, duration, reverse]);
|
|
103
|
+
const ringStyle = useAnimatedStyle(() => ({
|
|
104
|
+
transform: [{
|
|
105
|
+
rotate: `${rotation.value}deg`
|
|
106
|
+
}]
|
|
107
|
+
}));
|
|
108
|
+
return /*#__PURE__*/_jsx(View, {
|
|
109
|
+
accessible: true,
|
|
110
|
+
accessibilityRole: "text",
|
|
111
|
+
accessibilityLabel: children,
|
|
112
|
+
className: cn(circularTextVariants(), className),
|
|
113
|
+
style: [{
|
|
114
|
+
width: size,
|
|
115
|
+
height: size
|
|
116
|
+
}, style],
|
|
117
|
+
...props,
|
|
118
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
119
|
+
accessibilityElementsHidden: true,
|
|
120
|
+
importantForAccessibility: "no-hide-descendants",
|
|
121
|
+
style: [{
|
|
122
|
+
width: size,
|
|
123
|
+
height: size
|
|
124
|
+
}, ringStyle],
|
|
125
|
+
children: glyphs.map(glyph => /*#__PURE__*/_jsx(View, {
|
|
126
|
+
className: glyphVariants(),
|
|
127
|
+
style: {
|
|
128
|
+
position: 'absolute',
|
|
129
|
+
left: 0,
|
|
130
|
+
top: 0,
|
|
131
|
+
width: size,
|
|
132
|
+
height: size,
|
|
133
|
+
transform: [{
|
|
134
|
+
rotate: `${glyph.angle}deg`
|
|
135
|
+
}]
|
|
136
|
+
},
|
|
137
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
138
|
+
className: cn(GLYPH_TEXT, textClassName),
|
|
139
|
+
children: glyph.character
|
|
140
|
+
})
|
|
141
|
+
}, `${glyph.character}-${glyph.index}`))
|
|
142
|
+
})
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
CircularText.displayName = 'CircularText';
|
|
146
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useMemo","View","Animated","Easing","cancelAnimation","useAnimatedStyle","useReducedMotion","useSharedValue","withRepeat","withTiming","tv","Text","cn","DEFAULT_CIRCULAR_TEXT_DURATION","DEFAULT_CIRCULAR_TEXT_RADIUS","DEFAULT_CIRCULAR_TEXT_SPREAD","circularTextGlyphs","normalizeDuration","normalizeRadius","normalizeSpread","jsx","_jsx","circularTextVariants","base","glyphVariants","GLYPH_TEXT","CircularText","children","radius","spinDuration","reverse","paused","spread","startAngle","className","textClassName","style","props","reducedMotion","rotation","size","duration","arc","glyphs","turning","length","undefined","from","value","to","easing","linear","ringStyle","transform","rotate","accessible","accessibilityRole","accessibilityLabel","width","height","accessibilityElementsHidden","importantForAccessibility","map","glyph","position","left","top","angle","character","index","displayName"],"sourceRoot":"../../../../src","sources":["components/circular-text/index.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAC1C,SAASC,IAAI,QAAwB,cAAc;AACnD,OAAOC,QAAQ,IACbC,MAAM,EACNC,eAAe,EACfC,gBAAgB,EAChBC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,EACVC,UAAU,QACL,yBAAyB;AAChC,SAASC,EAAE,QAAQ,mBAAmB;AACtC,SAASC,IAAI,QAAQ,0BAAuB;AAC5C,SAASC,EAAE,QAAQ,mBAAgB;AACnC,SACEC,8BAA8B,EAC9BC,4BAA4B,EAC5BC,4BAA4B,EAC5BC,kBAAkB,EAClBC,iBAAiB,EACjBC,eAAe,EACfC,eAAe,QACV,6BAA0B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElC,MAAMC,oBAAoB,GAAGZ,EAAE,CAAC;EAC9Ba,IAAI,EAAE;AACR,CAAC,CAAC;AAEF,MAAMC,aAAa,GAAGd,EAAE,CAAC;EACvB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEa,IAAI,EAAE;AACR,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,UAAU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C;UACPC,GAAG,EAAE,CAAC;UACNR,KAAK,EAAElB,IAAI;UACXmB,MAAM,EAAEnB,IAAI;UACZa,SAAS,EAAE,CAAC;YAAEC,MAAM,EAAE,GAAGS,KAAK,CAACI,KAAK;UAAM,CAAC;QAC7C,CAAE;QAAAxC,QAAA,eAEFN,IAAA,CAACV,IAAI;UAACuB,SAAS,EAAEtB,EAAE,CAACa,UAAU,EAAEU,aAAa,CAAE;UAAAR,QAAA,EAAEoC,KAAK,CAACK;QAAS,CAAO;MAAC,GAXnE,GAAGL,KAAK,CAACK,SAAS,IAAIL,KAAK,CAACM,KAAK,EAYlC,CACP;IAAC,CACW;EAAC,CACZ,CAAC;AAEX;AAEA3C,YAAY,CAAC4C,WAAW,GAAG,cAAc","ignoreList":[]}
|
|
@@ -27,6 +27,15 @@ export const DOT_LIT_RADIUS = 1.9;
|
|
|
27
27
|
/** How visible the resting grid is, under everything. */
|
|
28
28
|
export const DOT_REST_OPACITY = 0.16;
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* How visible the lit dots are, together.
|
|
32
|
+
*
|
|
33
|
+
* "Together" is the operative word: they are drawn as two layers fading into
|
|
34
|
+
* one another, and this is what the pair composites to, not what either one
|
|
35
|
+
* carries. {@link crossfadeAlphas} is what holds that true.
|
|
36
|
+
*/
|
|
37
|
+
export const LIT_OPACITY = 0.9;
|
|
38
|
+
|
|
30
39
|
/** How many still frames one loop is drawn as. */
|
|
31
40
|
export const FRAMES = 24;
|
|
32
41
|
|
|
@@ -117,11 +126,20 @@ export function influenceAt(distance, radius) {
|
|
|
117
126
|
/**
|
|
118
127
|
* Where the light is at a phase of the loop, and how wide it reaches.
|
|
119
128
|
*
|
|
120
|
-
* `drift` wanders around the middle
|
|
121
|
-
*
|
|
122
|
-
* amplitudes because a light that reaches the corners
|
|
123
|
-
*
|
|
124
|
-
*
|
|
129
|
+
* `drift` wanders around the middle on a figure-eight: one horizontal pass to
|
|
130
|
+
* two vertical, so the path arrives back where it started and the loop has no
|
|
131
|
+
* seam in it. The amplitudes are small because a light that reaches the corners
|
|
132
|
+
* stops reading as one source.
|
|
133
|
+
*
|
|
134
|
+
* The two frequencies used not to divide into each other, on the reasoning that
|
|
135
|
+
* a path which never closes is one the eye cannot learn. It closes anyway —
|
|
136
|
+
* every animation here restarts at the end of its period — so all that bought
|
|
137
|
+
* was a jump of four normal steps, once a pass. A figure-eight is not a shape
|
|
138
|
+
* anybody follows over four seconds of soft light on a dot grid.
|
|
139
|
+
*
|
|
140
|
+
* `pulse` is a ring leaving the centre, and has expanded past the last dot
|
|
141
|
+
* before it restarts, so it fades out rather than snapping back. `scan` crosses
|
|
142
|
+
* as a band, which is the same maths with the light infinitely tall.
|
|
125
143
|
*/
|
|
126
144
|
function lightAt(animation, phase, width, height) {
|
|
127
145
|
const short = Math.min(width, height);
|
|
@@ -153,7 +171,7 @@ function lightAt(animation, phase, width, height) {
|
|
|
153
171
|
}
|
|
154
172
|
return {
|
|
155
173
|
x: width / 2 + Math.sin(turn) * width * 0.26,
|
|
156
|
-
y: height / 2 + Math.cos(turn *
|
|
174
|
+
y: height / 2 + Math.cos(turn * 2) * height * 0.22,
|
|
157
175
|
radius: short * 0.42,
|
|
158
176
|
ring: 0
|
|
159
177
|
};
|
|
@@ -165,12 +183,17 @@ function lightAt(animation, phase, width, height) {
|
|
|
165
183
|
* Only the dots the light actually reaches are in it — the rest are already
|
|
166
184
|
* drawn by the resting grid underneath, so this is a fraction of the field
|
|
167
185
|
* rather than all of it.
|
|
186
|
+
*
|
|
187
|
+
* `points` is the same grid {@link anchors} would build, passed in by a caller
|
|
188
|
+
* that is about to ask for every frame of a loop. Building it here instead cost
|
|
189
|
+
* a fresh array of several hundred pairs per frame, to arrive at the identical
|
|
190
|
+
* grid twenty-four times over.
|
|
168
191
|
*/
|
|
169
|
-
export function litPath(width, height, phase, animation = 'drift') {
|
|
192
|
+
export function litPath(width, height, phase, animation = 'drift', points) {
|
|
170
193
|
if (width <= 0 || height <= 0) return '';
|
|
171
194
|
const light = lightAt(animation, phase, width, height);
|
|
172
195
|
let path = '';
|
|
173
|
-
for (const [x, y] of anchors(width, height)) {
|
|
196
|
+
for (const [x, y] of points ?? anchors(width, height)) {
|
|
174
197
|
const deltaX = x - light.x;
|
|
175
198
|
const deltaY = Number.isNaN(light.y) ? 0 : y - light.y;
|
|
176
199
|
const distance = Math.abs(Math.sqrt(deltaX * deltaX + deltaY * deltaY) - light.ring);
|
|
@@ -188,9 +211,10 @@ export function litPath(width, height, phase, animation = 'drift') {
|
|
|
188
211
|
* reduced-motion field shows, so there is no separate code path for holding it.
|
|
189
212
|
*/
|
|
190
213
|
export function litFrames(width, height, animation = 'drift') {
|
|
214
|
+
const points = width > 0 && height > 0 ? anchors(width, height) : [];
|
|
191
215
|
return Array.from({
|
|
192
216
|
length: FRAMES
|
|
193
|
-
}, (_unused, index) => litPath(width, height, index / FRAMES, animation));
|
|
217
|
+
}, (_unused, index) => litPath(width, height, index / FRAMES, animation, points));
|
|
194
218
|
}
|
|
195
219
|
|
|
196
220
|
/** One pass of the loop, in milliseconds, per animation. */
|
|
@@ -207,4 +231,37 @@ export function frameAt(time, animation) {
|
|
|
207
231
|
const phase = time % PERIOD[animation] / PERIOD[animation];
|
|
208
232
|
return Math.min(FRAMES - 1, Math.floor(phase * FRAMES));
|
|
209
233
|
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Where a moment falls in the loop, as a frame index with its fraction kept.
|
|
237
|
+
*
|
|
238
|
+
* {@link frameAt} rounds this down, and rounding it down is what made the field
|
|
239
|
+
* a flipbook: twenty-four pictures spread over the period, which on the slowest
|
|
240
|
+
* animation is a new one every 175ms however fast the screen refreshes. The
|
|
241
|
+
* fraction is what the two layers cross-fade on, so the light moves at the rate
|
|
242
|
+
* the display can draw rather than the rate the frames were built at.
|
|
243
|
+
*/
|
|
244
|
+
export function framePhase(time, animation) {
|
|
245
|
+
'worklet';
|
|
246
|
+
|
|
247
|
+
return time % PERIOD[animation] / PERIOD[animation] * FRAMES;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* What the outgoing and incoming layers are worth, a fraction `t` of the way
|
|
252
|
+
* from one frame to the next.
|
|
253
|
+
*
|
|
254
|
+
* Not `[1 - t, t]`. The layers are drawn over one another, so a dot lit in both
|
|
255
|
+
* of them composites to `1 - (1-a)(1-b)`, and two half-strength copies of it
|
|
256
|
+
* come to 0.70 rather than 0.90 — the field dips a fifth in the middle of every
|
|
257
|
+
* step, which six steps a second turns into a flicker. So only the outgoing
|
|
258
|
+
* layer ramps, and the incoming one is solved for: whatever leaves the pair at
|
|
259
|
+
* {@link LIT_OPACITY} the whole way across.
|
|
260
|
+
*/
|
|
261
|
+
export function crossfadeAlphas(t) {
|
|
262
|
+
'worklet';
|
|
263
|
+
|
|
264
|
+
const out = LIT_OPACITY * (1 - t);
|
|
265
|
+
return [out, 1 - (1 - LIT_OPACITY) / (1 - out)];
|
|
266
|
+
}
|
|
210
267
|
//# sourceMappingURL=dot-field.js.map
|