src/js/animations/ViewTransition-surroundingNodes.js
// hides toolbar by pushing it away off the top of the screen
hides toolbar by pushing it away off the top of the screen
hides toolbar by pushing it away off the top of the screen
pushAwayElementsAbove() {
		this.aboveMain = this.aboveNodes.pop()
		if (!this.aboveMain) return
		let top = this.originBbox.top - this.baseViewBbox.top
		let distFromToolbar = top - this.aboveMain.offsetHeight
		let radians = mapRange(distFromToolbar * 2, 0, this.newViewBbox.height, 0, Math.PI / 2)
		let delay = 0.1 + (Math.sin(radians) * 0.45)
		let transform = ['translate3d(0, 0%, 0)', 'translate3d(0, -100%, 0)']
		this.schedule(this.aboveMain, {transform}, delay, 1)
	}
pushAwayElementsAbove ( ) { this . aboveMain = this . aboveNodes . pop ( ) if ( ! this . aboveMain ) return let top = this . originBbox . top - this . baseViewBbox . top let distFromToolbar = top - this . aboveMain . offsetHeight let radians = mapRange ( distFromToolbar * 2 , 0 , this . newViewBbox . height , 0 , Math . PI / 2 ) let delay = 0.1 + ( Math . sin ( radians ) * 0.45 ) let transform = [ 'translate3d(0, 0%, 0)' , 'translate3d(0, -100%, 0)' ] this . schedule ( this . aboveMain , { transform } , delay , 1 ) }
hides toolbar by pushing it away off the top of the screen
hides toolbar by pushing it away off the top of the screen
// TODO: crude. proof of concept //if (!isElevated(this.aboveMain)) return // MD spec wants to delay the animation until edges of toolbar and animated element are touching // to make it look like the animated element pushes toolbar away. // This is an ugly calculation that somewhat does the job (I'm not a mathematician. send halp pls). // NOTE: It'd be nice to use the actual bezier curve used to animate the element. // Distance between bottom edge of toolbar and origin's top edge.