@@ -1940,23 +1940,78 @@ function ClipSegmentConfig(props: {
1940
1940
</ div >
1941
1941
< Field name = "Speed" icon = { < IconLucideFastForward class = "size-4" /> } >
1942
1942
< div class = "flex flex-col gap-2" >
1943
- < Slider
1944
- value = { [ props . segment . timescale ] }
1945
- onChange = { ( v ) =>
1946
- setProject (
1947
- "timeline" ,
1948
- "segments" ,
1949
- props . segmentIndex ,
1950
- "timescale" ,
1951
- v [ 0 ]
1952
- )
1953
- }
1954
- minValue = { 0.25 }
1955
- maxValue = { 4 }
1956
- step = { 0.25 }
1957
- formatTooltip = { ( v ) => `${ v } x` }
1958
- />
1943
+ < div class = "flex gap-2 items-center" >
1944
+ < Slider
1945
+ value = { [ props . segment . timescale ] }
1946
+ onChange = { ( v ) =>
1947
+ setProject (
1948
+ "timeline" ,
1949
+ "segments" ,
1950
+ props . segmentIndex ,
1951
+ "timescale" ,
1952
+ v [ 0 ]
1953
+ )
1954
+ }
1955
+ minValue = { 0.1 }
1956
+ maxValue = { 10 }
1957
+ step = { 0.01 }
1958
+ formatTooltip = { ( v ) => `${ v . toFixed ( 2 ) } x` }
1959
+ class = "flex-1"
1960
+ />
1961
+ < div class = "flex items-center gap-1" >
1962
+ < TextInput
1963
+ type = "number"
1964
+ value = { props . segment . timescale . toFixed ( 2 ) }
1965
+ onInput = { ( e ) => {
1966
+ const value = parseFloat ( e . currentTarget . value ) ;
1967
+ if ( ! isNaN ( value ) && value > 0 && value <= 10 ) {
1968
+ setProject (
1969
+ "timeline" ,
1970
+ "segments" ,
1971
+ props . segmentIndex ,
1972
+ "timescale" ,
1973
+ value
1974
+ ) ;
1975
+ }
1976
+ } }
1977
+ onBlur = { ( e ) => {
1978
+ const value = parseFloat ( e . currentTarget . value ) ;
1979
+ if ( isNaN ( value ) || value <= 0 ) {
1980
+ e . currentTarget . value = props . segment . timescale . toFixed ( 2 ) ;
1981
+ } else if ( value > 10 ) {
1982
+ setProject (
1983
+ "timeline" ,
1984
+ "segments" ,
1985
+ props . segmentIndex ,
1986
+ "timescale" ,
1987
+ 10
1988
+ ) ;
1989
+ e . currentTarget . value = "10.00" ;
1990
+ }
1991
+ } }
1992
+ class = "w-16 px-2 py-1 text-xs text-center border rounded-md bg-gray-2 text-gray-12"
1993
+ min = "0.01"
1994
+ max = "10"
1995
+ step = "0.01"
1996
+ />
1997
+ < span class = "text-xs text-gray-11" > x</ span >
1998
+ </ div >
1999
+ </ div >
1959
2000
< div class = "flex gap-2 text-xs" >
2001
+ < button
2002
+ onClick = { ( ) =>
2003
+ setProject (
2004
+ "timeline" ,
2005
+ "segments" ,
2006
+ props . segmentIndex ,
2007
+ "timescale" ,
2008
+ 0.25
2009
+ )
2010
+ }
2011
+ class = "px-2 py-1 rounded-md bg-gray-3 hover:bg-gray-4 transition-colors"
2012
+ >
2013
+ 0.25x
2014
+ </ button >
1960
2015
< button
1961
2016
onClick = { ( ) =>
1962
2017
setProject (
@@ -1992,12 +2047,12 @@ function ClipSegmentConfig(props: {
1992
2047
"segments" ,
1993
2048
props . segmentIndex ,
1994
2049
"timescale" ,
1995
- 1.5
2050
+ 2
1996
2051
)
1997
2052
}
1998
2053
class = "px-2 py-1 rounded-md bg-gray-3 hover:bg-gray-4 transition-colors"
1999
2054
>
2000
- 1.5x
2055
+ 2x
2001
2056
</ button >
2002
2057
< button
2003
2058
onClick = { ( ) =>
@@ -2006,12 +2061,12 @@ function ClipSegmentConfig(props: {
2006
2061
"segments" ,
2007
2062
props . segmentIndex ,
2008
2063
"timescale" ,
2009
- 2
2064
+ 4
2010
2065
)
2011
2066
}
2012
2067
class = "px-2 py-1 rounded-md bg-gray-3 hover:bg-gray-4 transition-colors"
2013
2068
>
2014
- 2x
2069
+ 4x
2015
2070
</ button >
2016
2071
</ div >
2017
2072
</ div >
0 commit comments