@@ -19,7 +19,6 @@ import "./Navbar.css";
1919
2020const OPEN_MS = 900 ;
2121const CLOSE_MS = 680 ;
22- const DRAG_THRESHOLD_PX = 26 ;
2322const TOPIC_MORPH_TIME_MS = 820 ;
2423const TOPIC_SLIDE_TIME_MS = 560 ;
2524const MORPH_BLUR_BASE = 5 ;
@@ -126,7 +125,6 @@ function Navbar() {
126125 const initialRouteStatus = resolvePathStatus ( initialPathname ) . status ;
127126 const [ topicTransitionMode ] = useState ( resolveTopicTransitionMode ) ;
128127 const [ screenPhase , setScreenPhase ] = useState ( "closed" ) ;
129- const [ isRopeGrabbed , setIsRopeGrabbed ] = useState ( false ) ;
130128 const [ selectedSection , setSelectedSection ] = useState ( PROJECTOR_SECTIONS [ 0 ] ) ;
131129 const [ hoveredSection , setHoveredSection ] = useState ( null ) ;
132130 const [ displayedSection , setDisplayedSection ] = useState ( PROJECTOR_SECTIONS [ 0 ] ) ;
@@ -164,7 +162,6 @@ function Navbar() {
164162 const fromTextNodesRef = useRef ( [ ] ) ;
165163 const toTextNodesRef = useRef ( [ ] ) ;
166164 const screenPhaseRef = useRef ( "closed" ) ;
167- const ropeDragRef = useRef ( { active : false , pointerId : null , startY : 0 , acted : false } ) ;
168165 const subtopicReturnListenersRef = useRef ( new WeakMap ( ) ) ;
169166
170167 const parseCssNumber = ( value , fallback = 0 ) => {
@@ -687,30 +684,6 @@ function Navbar() {
687684 openProjectorScreen ( ) ;
688685 } ;
689686
690- const startRopeDrag = ( event ) => {
691- if ( event . button !== 0 ) return ;
692- event . currentTarget . setPointerCapture ( event . pointerId ) ;
693- ropeDragRef . current = { active : true , pointerId : event . pointerId , startY : event . clientY , acted : false } ;
694- setIsRopeGrabbed ( true ) ;
695- } ;
696-
697- const moveRopeDrag = ( event ) => {
698- const d = ropeDragRef . current ;
699- if ( ! d . active || d . pointerId !== event . pointerId ) return ;
700- const deltaY = event . clientY - d . startY ;
701- if ( deltaY >= DRAG_THRESHOLD_PX && ! isOpenLikeNow ( ) ) { d . acted = true ; d . startY = event . clientY ; openProjectorScreen ( ) ; return ; }
702- if ( deltaY <= - DRAG_THRESHOLD_PX && isOpenLikeNow ( ) ) { d . acted = true ; d . startY = event . clientY ; closeProjectorScreen ( ) ; }
703- } ;
704-
705- const endRopeDrag = ( event , allowTapToggle ) => {
706- const d = ropeDragRef . current ;
707- if ( ! d . active || d . pointerId !== event . pointerId ) return ;
708- if ( event . currentTarget . hasPointerCapture ( event . pointerId ) ) event . currentTarget . releasePointerCapture ( event . pointerId ) ;
709- ropeDragRef . current = { active : false , pointerId : null , startY : 0 , acted : false } ;
710- setIsRopeGrabbed ( false ) ;
711- if ( allowTapToggle && ! d . acted && Math . abs ( event . clientY - d . startY ) < DRAG_THRESHOLD_PX ) toggleProjectorScreen ( ) ;
712- } ;
713-
714687 const isSlideMorph = isMorphingTopics && topicTransitionMode === "slide" ;
715688 const isGooeyMorph = isMorphingTopics && topicTransitionMode === "gooey" ;
716689 const topicStageStyle = {
@@ -852,13 +825,9 @@ function Navbar() {
852825 </ div >
853826
854827 < button
855- className = { ` projector-rope${ isRopeGrabbed ? " is-grabbed" : "" } ` }
828+ className = " projector-rope"
856829 type = "button"
857- onPointerDown = { startRopeDrag }
858- onPointerMove = { moveRopeDrag }
859- onPointerUp = { ( e ) => endRopeDrag ( e , true ) }
860- onPointerCancel = { ( e ) => endRopeDrag ( e , false ) }
861- onKeyDown = { ( e ) => { if ( e . key === "Enter" || e . key === " " ) { e . preventDefault ( ) ; toggleProjectorScreen ( ) ; } } }
830+ onClick = { toggleProjectorScreen }
862831 aria-pressed = { isOpenLike }
863832 aria-label = { isOpenLike ? "Roll up projector screen" : "Pull down projector screen" }
864833 >
0 commit comments