@@ -18,6 +18,7 @@ export default {
1818 props: {
1919 // canvasWidth: { type: String, default: '100vw' },
2020 hoverInterpolation: { type: Number , default: .98 },
21+ pause: { type: Boolean , default: false },
2122 clickInterpolation: { type: Number , default: .98 },
2223 scrollInterpolation: { type: Number , default: .98 },
2324 shaderParkCode: {type: [Function , String ], default: ' sphere(.5);' },
@@ -90,6 +91,9 @@ export default {
9091 },
9192 mouseDown1 () {
9293 this .state .click = 1.0 ;
94+ },
95+ playToggle () {
96+ this .pause = ! this .pause ;
9397 }
9498 },
9599 mounted () {
@@ -146,13 +150,18 @@ export default {
146150 this .$emit (' beginRender' );
147151 this .animationId = requestAnimationFrame ( render );
148152 if (' time' in this .sculptureParams ) {
149- this .sculptureParams .time += 0.01 ;
153+ if (! this .pause ) {
154+ this .sculptureParams .time += 0.01 ;
155+ }
150156 } else {
151157 this .sculptureParams .time = 0 ;
152158 }
153- this .sculptureParams .click = this .sculptureParams .click * this .clickInterpolation + this .state .click * (1.0 - this .clickInterpolation );
154- this .sculptureParams .hover = this .sculptureParams .hover * this .hoverInterpolation + this .state .hover * (1.0 - this .hoverInterpolation );
155- this .sculptureParams .scroll = this .sculptureParams .scroll * this .scrollInterpolation + window .pageYOffset / window .innerHeight * (1.0 - this .scrollInterpolation );
159+
160+ this .sculptureParams .click = this .sculptureParams .click * this .clickInterpolation + this .state .click * (1.0 - this .clickInterpolation );
161+ this .sculptureParams .hover = this .sculptureParams .hover * this .hoverInterpolation + this .state .hover * (1.0 - this .hoverInterpolation );
162+ if (! this .pause ) {
163+ this .sculptureParams .scroll = this .sculptureParams .scroll * this .scrollInterpolation + window .pageYOffset / window .innerHeight * (1.0 - this .scrollInterpolation );
164+ }
156165
157166 // this.state.currClick = this.state.currClick*.98 + this.state.click*.02;
158167
0 commit comments