It's pretty naive - should honestly look into actually simulating race progress per cars and simulate track-side detectors instead, but this is easy and simple.
Added a new event state to track sorted GridSpots.
Small adjustments to the layout of the TimingTower prototype controls.
Got a good result as the chyrons will not swap positions while open. But will swap if closed and opened a moment later. So, it all works the way I want it to.
Adjusted the method that placement is determined. It didn't make much sense to define Placement in state, so I've moved it to the central theme object instead.
I also took the time to support +10 laps and minutes with a special xScale setting for the TimingTowerRows.
The issue is, say our scale is 50%. A PositionFlag on the TimingBoard is normally 32x32px in size. That means that the size of the actual PositionFlag while scaled is 16x16.
The WipeTransition component takes the effective size of its child element using the useMeasure() hook. So it sees the size is 16x16, thus, when the wipe is set to visible its clip dimensions on the opposite and adjacent points of the triangle are 16px away from origin.
But because we're scaled at 50% that clip path effectively becomes 8px. The clip path is doubly scaled. As a result I'm seeing white squares in the corner of the PositionFlag component.
I think I might be able to solve this by using simple division to express the values of the clip path in percentages. Or I'll find a way to avoid the double scaling issue.
Didn't have to do anything to position the element, which made me pretty happy. I assumed I'd have to do some annoying amount of finagling to get it to position correctly in the frame. It just worked. Lucky me.
I flipped the way the wipe effect works. Originally there was the complicated problem of revealing a flag instantly and then wiping it away, requiring some delicate work with mounting and unmounting components. Instead it now works by always having a colored PositionFlag component in place and temporarily disappearing the normal PositionFlag (that is on top of it) using a transition-free opacity switch that lets the WipeTransition work reliably. This makes for fewer states and conditional renders.
Added textColor and bgColor props to the PositionFlag component for flexibility.
Now we can define separate opening and closing transition settings as well as common (both ways) transition props.
This is all pretty cool.
Timing for open/close animations and transitions are looking better and more mature.
Discovered a limitation with WipeTransition and added a new optional prop for manual dimension definition.
Going to attempt using a mask image next instead as the animation fades the name in, not using a direct clip.
Refactored outlineClipPath() to support outlines that have been offset to be inside.
Added animation duration configuration to the TimingBoard workspace.
New reducers for event slice that allow increasing of car distances, awarding fastest laps, and changing the statuses of cars.
Updating more types to enums, which are just better in most cases as far as I can tell.