@@ -64,6 +64,39 @@ const PositionCursor = styled("div")({
6464 }
6565} )
6666
67+ const KeyframeMarker = styled ( "div" ) ( {
68+ position : "absolute" ,
69+ bottom : 8 ,
70+ cursor : "pointer" ,
71+ opacity : 0.75 ,
72+ fontSize : 10 ,
73+ fontWeight : "bold" ,
74+ color : "#fff" ,
75+ display : "grid" ,
76+ placeItems : "center" ,
77+ width : 16 ,
78+ marginLeft : 0 ,
79+ borderTopLeftRadius : 2 ,
80+ borderTopRightRadius : 2 ,
81+ height : 12 ,
82+ marginLeft : - 8 ,
83+ backgroundColor : colors . red [ 500 ] ,
84+ userSelect : "none" ,
85+ fontVariantNumeric : "tabular-nums" ,
86+
87+ "&::before" : {
88+ position : "absolute" ,
89+ bottom : - 8 ,
90+ left : 0 ,
91+ content : '""' ,
92+ width : 0 ,
93+ height : 0 ,
94+ borderTop : `8px solid ${ colors . red [ 500 ] } ` ,
95+ borderLeft : "8px solid transparent" ,
96+ borderRight : "8px solid transparent"
97+ }
98+ } )
99+
67100const min = 60000
68101const displayIntervalPairs = [
69102 [ 50 , 250 ] ,
@@ -98,6 +131,10 @@ export default ({
98131 const [ ref , bounds ] = useMeasure ( )
99132 const [ instantCurrentTime , changeInstantCurrentTime ] = useState ( currentTime )
100133 const [ draggingTime , changeDraggingTime ] = useRafState ( false )
134+ const keyframeTimes = Object . keys ( keyframes || { } )
135+ . map ( t => parseInt ( t ) )
136+ . filter ( t => ! isNaN ( t ) )
137+ . sort ( ( a , b ) => a - b )
101138
102139 useEffect ( ( ) => {
103140 if ( currentTime !== instantCurrentTime ) {
@@ -159,6 +196,13 @@ export default ({
159196 } }
160197 />
161198 ) ) }
199+ { keyframeTimes . map ( kt => (
200+ < KeyframeMarker
201+ onClick = { ( ) => onChangeCurrentTime ( kt ) }
202+ key = { kt }
203+ style = { { left : ( kt / duration ) * bounds . width } }
204+ />
205+ ) ) }
162206 < PositionCursor
163207 onMouseDown = { e => changeDraggingTime ( true ) }
164208 style = { {
0 commit comments